Sven
banner
embersarc.bsky.social
Sven
@embersarc.bsky.social
hobby gamedev working on a spaceflight simulation game
It currently has a bit of gravity, mainly so that my orbital physics code does not break down.

Rendezvous is slightly different because it requires matching velocity with the ground, which in most cases means speeding up instead of slowing down.
November 7, 2025 at 10:48 AM
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
Thanks! It completely relies on the centrifugal force. Luckily I already have those implemented as they are also important with spherical planets. I'm curious about the emergent flight dynamics as well and it will likely take some trial and error to make this intuitive for players.
October 30, 2025 at 2:10 PM
can't wait to land on it and go 🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂🙃🙂
October 25, 2025 at 12:41 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
Haha yes sorry about that. Sure! Sounds like it could be useful
October 22, 2025 at 3:34 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
Okay maybe I don't feel like adding the atmosphere just yet.

In theory it's "just" a matter of curving it the other way, but that is easier said than done.
October 18, 2025 at 8:46 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
This is very much a "not because it is easy" kind of project. But I'm sure it will be well worth it.

All the building blocks are already there, but it will still be a lot of work as I never anticipated having to support non-spherical celestial bodies, but here we are.
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
back at it now and boy do things look broken beyond belief
October 12, 2025 at 10:10 PM
With that fixed, EntitySpecializationTicks is another map that just keeps filling up. The reason might be related. Time for a break for now though.
October 12, 2025 at 2:40 PM
Ah I had this backwards. Them being removed means that the `contains_key` check can return false and the cleanup later can actually happen!
October 12, 2025 at 1:40 PM
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
For orbital motion I have a separate physics engine that models trajectories with patched conics. So it boils down to a bunch of two-body problems that can be solved with the Kepler equation :)
September 30, 2025 at 6:04 AM