You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need a way to simulate in-game time passing that can be paused, serialized, deserialized, etc. Maybe u64 milliseconds since the start of the save file? I don't need to be particularly precise about this, and I don't need to handle any of the weird edge cases that come with real-world time. Mostly I need to make sure it's readable by everyone across the whole game while still being easily adjusted, but that's easy enough with AtomicU64. (We'll see if my embedded dreams make that problematic.)
The text was updated successfully, but these errors were encountered:
I'm wondering now if it might be easier to file this under a more general "centrally updated global state" thing, with the various "game time" things (realtime or round-based) being premade chunks offered (maybe integrated?) by the engine. There's other global state I'll want to be able to pass around so it makes sense to build that in together, and let the game decide what's there.
Add Game::state() -> State to get the current state (owned value)
Every so often, the Game is polled for the current state
Arc<State> is passed around to the various threads
Threads pass the respective &State to agents in the normal functions
State is expected (guaranteed?) to be updated every round (do I want to formalize rounds?)
Should have absolutely no issues with lifetimes, and also be possible to make nostd-friendly
Not sure how Cell should be involved, if at all. Maybe in some behind-the-scenes machinery, i.e. using an Arc<Cell<State>> or something instead of a channel to pass the new states around?
I need a way to simulate in-game time passing that can be paused, serialized, deserialized, etc. Maybe
u64
milliseconds since the start of the save file? I don't need to be particularly precise about this, and I don't need to handle any of the weird edge cases that come with real-world time. Mostly I need to make sure it's readable by everyone across the whole game while still being easily adjusted, but that's easy enough withAtomicU64
. (We'll see if my embedded dreams make that problematic.)The text was updated successfully, but these errors were encountered: