4 ms·
The elm lang style architecture is very condusive to games. Collision and global state related AI planning not with standing. Though I feel like if you take th
by endergen 10y ago
The elm lang style architecture is very condusive to games. Collision and global state related AI planning not with standing.
Though I feel like if you take the idea of a single app data structure, and you make your code deterministic with a clean event loop boundary then you basically get a lot of the redux benefits.
Even hot code reloading would be fine, you just need to make sure to wait till the end of each loop before doing anything.
- SomeCallMeTim 10y ago> Collision and global state related AI planning not with standing. You're excluding about 50-80% of the actual game logic here you realize? Don't forget optimizations like memory locality [1] for time sensitive components like particle systems, direct messaging between various game elements, physics processing (which often needs to iterate on world state), and any other kinds of interaction where something (like a door) needs to know whether the player that's trying to unlock it has a certain item in their inventory (like a particular key). Or maybe the door only unlocks after a switch in another room has been thrown. Both are trivial in an OO design; a bit ugly in the functional approaches that come to mind. Possible; of course. But why put yourself to the extra effort? Functional is great for UIs; you could probably code the HUD and game menu in Elm. I still think functional languages aren't ideal for predominantly imperative problems. [1] https://en.wikipedia.org/wiki/Data-oriented_design https://en.wikipedia.org/wiki/Data-oriented_design