bryanedds / Nu

Repository hosting the open-source Nu Game Engine and related projects.
MIT License
1.05k stars 151 forks source link

Added world keyed value events and have the engine itself never use them. #818

Closed bryanedds closed 1 month ago

bryanedds commented 1 month ago

For global game config values in Nu, I don't think it actually ends up making sense to store those values in GameDispatcher models. This is because the GameDispatcher and its models should generally be defined after the game's other simulants yet it's the other simulants that will need to access them. So actually using the world's keyed value API might be the recommended way to do this for users. However, to make that properly declarative on the user side, we should be adding events for keyed value transformations. But to make that efficient, we should make the internal world functionality use a different keyed value store (for example, World.handleSubscribeAndUnsubscribeEvent currently uses the keyed value store API).

bryanedds commented 1 month ago

Done. However, we kept the change sub count in the kvs.