Published: October 18, 2024
1
3
15

My LD game is not well designed and has a lot of issues, but it seems that people like it (https://x.com/Nazariglez/statu... In the next months, I'm gonna try to convert this into a "Real Game™". I'll use this thread to share it. #ldjam #ld56 #gamedev #rustlang

It starts here: Hello World! I'll be using no engine, only #rustlang with wgpu. #gamedev

Image in tweet by Nazarí González

Testing shipyard ECS, it seems great, but these false positives in RustRover are driving me crazy! It works fine with neovim + rust-analyzer. I usually prefer neovim for coding, but IntelliJ tools are better for refactoring and debugging (IMHO). All red, is valid rust.

Image in tweet by Nazarí González

By 'I prefer nvim for coding' I mean the actual act of writing code and navigating. It feels great on nvim, like you're flowing and fully focused on the code, barely touching the mouse. But with larger codebases, I prefer intellij for managing, refactoring, and moving code around

Ok, just to make it clear, this is my go-to process: hobby project? I enjoy using nvim. Job or serious project? IntelliJ IDEs have been my go-to for the last decade. That’s why this false positive bothers me so much, I want to use it for this.#rustrover #jetbrains #rustlang

@rustrover @jetbrains please take a look at this if you can: https://x.com/Nazariglez/statu... You can see the code here: https://github.com/Nazariglez/... The first issue is that the tuple implements the trait, and the second is that the for_each params are "&mut Vec2", not "Vec2". #rustlang

Anyway let's go back to #gamedev. I have spent the morning improving how the pixelart is rendered, this include a way to tell the app that it's pixelart so offscreen texture is using nearest filter, also font rendering, some fonts are nearest some linear, some emojis, 1 draw call

Image in tweet by Nazarí González

This is made with two textures and two samplers, the shader will select the right combination. WebGPU works fine but WebGL2 no, not sure if an issue on Naga or it's about wgl itself, but you cannot use two different sampler with one texture. So WebGL fallback to one sampler. -

In that case the sampler is selected based on if the app/game is set as pixelart or not. This is not idea if you're mixing diferent types of fonts, but it works for most of games where or it's all pixel art or no. Another approach can be made using two drawcalls, which is fine

But it's not the solution I implemented. Maybe one day I'll revisit it if needed, but for now, it works for me this way. With a bit of luck, WebGPU will be supported everywhere soon, and I won't need to make this change.

In my game, there’s some "pack" behavior with predators, prey, etc., so it seems like a flocking algorithm could be a good fit. I’m experimenting with it for the first time, and while the rules are "simple" the results I’m getting aren't quite right yet... although it’s fun!

I like where this is heading! I still need to keep iterating on it, and eventually, I’ll need to see how I can apply it to my game. It could be a disaster, or it could fit perfectly. I guess I’ll figure it out pretty soon. #gamedev

I like this video more, less noise. #gamedev #rustlang

Spatial Hashing + ECS + Parallel Iteration: Awesome! I love it, it's great... and totally overkill for my game haha #gamedev #rustlang

The video looks terrible on Twitter. Also, I think I broke something because they can avoid collisions, but they’re not flocking like they should. Ugh

Fixed it! Even with the debug UI enabled, it's mesmerizing to watch. #gamedev

Twitter’s video compression is awful. Small, low-alpha lines don’t even show up. This pic gives a better idea of what it looks like in real time:

Image in tweet by Nazarí González

Bounding to a zone, following the mouse, predator/prey behavior, and noise avoidance all happening at once. Not the best way to see each behavior tbh. Anyway, now it’s time to fit this into a game...

WIP: Trying to get the game’s behavior right, forming packs, avoiding others, etc. With a few tweaks, it’s working well, but I’ll need to make more changes, also eventually I will need to "break" the flocking system based on actions. #gamedev

Added an energy system. Boids now slow down as they get tired and rest when they're out of energy. #gamedev #indiedev #rustlang

I was missing a post-process/filter system to easily improve visuals, so I started working on it, and I'm pretty happy with the results.

And it's used like this:

Image in tweet by Nazarí González

I guess video compression might mess with this, but I love this postfx! It’s simple, yet it really enhances the visuals of games going for that "old-school" vibe. Not that it was easy to make for me, I'm no graphics programmer and this took me quite a few hours... #gamedev

Yeah, it doesn’t look great on Twitter. It’s mainly a mix of scanlines, horizontal offset, chromatic aberration, and vignette. #rustlang #gamedev

Life's been busy, so progress has been slower this week: more postfx tweaks, working on the main menu, refining the tween system, and adding boid behavior to the game... small steps, but still moving forward #gamedev #indiedev

btw, I'm mainly using nvim for the project right now. RustRover has some issues with Shipyard (ECS) and a few macros I use, but rust-analyzer on nvim works great, so there we go... Still using RustRover for the "engine" and other projects though

Along these lines, I’m not using Alacritty anymore, it’s great but the copy&paste behavior drives me crazy. Also when working with Zellij and nvim you have to lock Zellij sometimes to avoid conflicts (or rebind keys). So I came back to good old iTerm2, no complaints for now

Image in tweet by Nazarí González

I wish Shipyard ECS had more ergonomic features. It's a great library with lots of amazing functionality, but having things like commands, bundles, "change" event, or the ability to query while excluding a component without "borrowing" it would make life so much easier.

I might bite the bullet and switch to bevy_ecs. I need to take a closer look to see if it’s a good fit, it seems a bit heavy. That said, I’m not doing it right now. The things I’m "complaining" about aren’t dealbreakers, just inconveniences I have to work around.

Share this thread

Read on Twitter

View original thread

Navigate thread

1/31