3 ms·
Explicit state machine is better than an implicit one. And every program is one of these. 4 KLOC for big chunk of game logic is rather frugal. The main proble
by AstralStorm 7y ago
Explicit state machine is better than an implicit one. And every program is one of these.
4 KLOC for big chunk of game logic is rather frugal.
The main problems that are plain is not enough names (for states, flags and triggers) and not having split off text to some central repository. (Making translation easier.)
Orthodox version of the state machine would have code execute while you're changing states rather than in any given state.
The big switch statement is a good design with mediocre implementation. (Compare with Sierra's AGI LOGIC code: https://wiki.scummvm.org/index.php?title=AGI/Specifications/Logic#Sample https://wiki.scummvm.org/index.php?title=AGI/Specifications/... )