Sven
banner
embersarc.bsky.social
Sven
@embersarc.bsky.social
hobby gamedev working on a spaceflight simulation game
And here we are! The ring world is now fully integrated in the game. There are still a bunch of rough edges to take care of but it already feels great to sit on the surface and watch the stars slowly rotate behind it.
October 30, 2025 at 2:19 PM
Many tweaks later, this is starting to take shape!

I increased the radius, added self-shadowing, rim walls and a mesh for the outside.

#bevy #gamedev
October 23, 2025 at 5:19 PM
But I just got the high-detail model to work! The changes to the terrain, ocean and cloud systems luckily didn't end up being too invasive.
October 18, 2025 at 8:51 PM
And here's the initial low detail model! This is good as a first step to figure out how to generate and render a cylindrical world. The atmosphere is still missing, so that will be next.
October 17, 2025 at 2:36 PM
Alright let's build a megastructure!

I've been reading Consider Phlebas by Iain M. Banks and can't resist adding a ring world to the game.

Starting a thread for this one 🧵

(image by @alexjaybrady.bsky.social for inspiration)

#gamedev #bevy
October 17, 2025 at 2:36 PM
With an improvised workaround we're back to a decent frame rate!
October 13, 2025 at 10:32 AM
Through trial and error I found that running the early sweep before the specialization function actually fixes the issue.

But that doesn't make sense. The early sweep only removes cache entries and doesn't add any. So something else must be going on there.
October 12, 2025 at 11:43 AM
Why are those material instances not present?

There are three systems that modify them. The extract and the two sweep functions. The extract function is the only one that can add the instances. The sweep functions only remove them.

The ordering appears correct.
October 12, 2025 at 11:40 AM
Now there *is* code to remove the cache entries when a mesh is despawned. In my case however, the loop early-exits most of the time at the first `contains_key` check and so doesn't get to remove the entry in the next step.
October 12, 2025 at 10:11 AM
Printing out the number of cache entries shows that they grow indefinitely with each spawned terrain chunk. Despawning chunks however does not seem to remove their cache entry.
October 12, 2025 at 9:32 AM
Luckily bevy is open source, so we can just take a look. Those functions have one thing in common: They all access the `SpecializedMaterialPipelineCache`.
October 12, 2025 at 9:25 AM
Inspecting a frame in the profiler we find those three function calls taking about 50ms. How do they spend all that time?
October 12, 2025 at 9:21 AM
I realized that the frame rate of my game was going down the more I played.

Let's debug!
October 12, 2025 at 9:15 AM
The egui -> Bevy UI rewrite is complete!

Quite happy that it was possible to reproduce the look and feel from before and even improve on it a bit :)

#bevy #gamedev
September 29, 2025 at 5:07 PM
Currently porting the GUI from egui to #bevy UI and quite happy with it so far! The only thing I'm missing is the ability to render arbitrary meshes as part of the UI.

Image nodes are super useful. I'm using one to show the navball which is a 3D scene rendered to a texture.

#gamedev
September 23, 2025 at 4:04 PM
I switched to the Avian physics engine! Its excellent documentation made this a pretty simple process.

The physics now run at a fixed rate, independent of the frame rate. This helps a lot with determinism and things keep their velocity, even if the rendering isn't fast enough.

#bevy #gamedev
September 21, 2025 at 9:07 PM
I added a hover mode to the spacecraft controller! It tries to keep the craft level at a fixed altitude so that the player can precisely maneuver across the ground.

Oh and also it's now possible to load in any 3D scene with colliders, like this makeshift landing pad.

#gamedev #bevy
September 13, 2025 at 5:15 PM
Finally got around to adding oceans to the planets!

It's just an additional opaque mesh on top of each terrain chunk. But changing the water's surface color depending on its depth is so simple yet so effective at faking actual translucency.

#bevy #gamedev
September 4, 2025 at 5:10 PM
Apologies for the lack of updates, I was chilling at the top of the highest mountain in the solar system

#gamedev #bevy
August 24, 2025 at 2:24 PM
One reason I enjoy shader programming is that at least bugs are entertaining
August 7, 2025 at 7:57 PM
Currently writing a controller to enable some cool takeoff and landing modes. The idea is that the controller should make such maneuvers relatively easy and intuitive as long as the ship's construction makes them physically possible.

#gamedev
August 4, 2025 at 9:33 PM
Experimenting with some close-up terrain detail textures. I like how putting some green rocks on the closest moon to the gas giant ties the scene together :)

#bevy #gamedev
August 3, 2025 at 11:36 AM
Working on a new aesthetic for the spacecraft model. The technology in the game should be more of the "far future" kind. This will do for now.

#gamedev
August 2, 2025 at 8:09 PM
The solution: Just fall back to the color and normal from the texture I generate for the map view. More detail without having to increase the polygon count!

#bevy #gamedev
July 31, 2025 at 7:15 PM
I finally got to merge the new terrain system! Really happy with how it turned out. Now it's just a matter of writing a fancy position -> (elevation, color) function for every planet and moon. Here are some impressions of the icy moon.
July 28, 2025 at 8:26 PM