Wikifang:Telefang 1 Translation Patch/State Machine

From Wikifang, a definitive guide to Telefang, Dino Device and Bugsite
Revision as of 10:25, 22 July 2017 by Kmeisthax (talk | contribs) (Created page with "Telefang's primary game loop is structured as a state machine. Each iteration of the game loop executes a handful of predefined tasks, and then indexes a jump table to load ot...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Telefang's primary game loop is structured as a state machine. Each iteration of the game loop executes a handful of predefined tasks, and then indexes a jump table to load other screens' code. This indexing can be recursive, with individual states running their own predefined tasks before jumping into sub-states. This is known to recurse to at least fourth-order state machines.

State machines are indexed through four primary SystemState variables, and two secondary state variables. The secondary state variables are used in certain states for various reasons - usually to prevent overwriting the state of another screen. (Why they didn't set up a proper state stack for this sort of thing is beyond me...)