Develop and Implement Redux for global state management
Let's have a discussion about the possible implementations for global state management in the game engine.
First off why do we need global state?
Consider a stage with multiple actor objects in it. Suppose one of your actors manages a scoreboard, and another needs to manipulate the number of points on the scoreboard.
Both actors would need a reference to the scoreboard object(assuming the scoreboard itself is an actor). How could you pass a reference to these actors at init time? They would have to expect a value in the constructor.
This would be easily done for a 1-level property(prop) drill, but for nth-levels, this would be an extremely inefficient and annoying task.
It would be easier to have a global state object, that actors could subscribe to. When the state is manipulated, the actors would exhibit the changes.
Proposal
Lucklily, redux is an excellent library to manage global state. The only question is how to best implement redux patterns for game engines(which is not done prevalently)
Develop and Implement Redux for global state management
Let's have a discussion about the possible implementations for global state management in the game engine.
First off why do we need global state?
Consider a stage with multiple actor objects in it. Suppose one of your actors manages a scoreboard, and another needs to manipulate the number of points on the scoreboard.
Both actors would need a reference to the scoreboard object(assuming the scoreboard itself is an actor). How could you pass a reference to these actors at init time? They would have to expect a value in the constructor.
This would be easily done for a 1-level property(prop) drill, but for nth-levels, this would be an extremely inefficient and annoying task.
It would be easier to have a global state object, that actors could subscribe to. When the state is manipulated, the actors would exhibit the changes.
Proposal
Lucklily, redux is an excellent library to manage global state. The only question is how to best implement redux patterns for game engines(which is not done prevalently)