So for various reasons, I want to keep my game logic completely separate from how the world is rendered.
In practice, that means that I have a struct World that completely describes the current state, and all external possible state transformations are described by member functions.
Everything is completely discrete, so I don't have to worry about continuous actions, changes over time, or simulations that need updates every tick, etc.
What would be the proper way to now set up the rendering etc on top of this in Bevy? I see basically two possibilities:
- The world exists just for itself as Entity in the ECS that somehow renders everything in it.
- The world somehow has one entity in the ECS for each of its elements, so they all get rendered by Bevy individually. Upon changes of the world, it somehow needs to update/delete/create these components to reflect the current state correctly.
Both seem not very great/best practice to me. The first one basically sidesteps the whole ECS by putting everything in one entity that does everything internally. The second one kind of duplicates state, once in the world, once in the ECS.
Do I overlook a better option to do this? Is there a good example I can look at of some project that already does something similar in a best practice way? Or is Bevy maybe just not the right tool for this kind of game? In that case, what would be better fit for this?