Engine V2 - tobymao/18xx GitHub Wiki
Note: currently only available locally
For development/implementation details and future plans, see Issue #12193.
"Engine V2" is a refactoring of how the game engine deals with identifying the active entities ("Whose turn is it?"), what the current step is in the game flow (stock round turn, track step of operating round, etc) and which Step objects should process the game actions. With improved efficiencies, we hope to see better performance, which should be most noticeable late in games on actions dealing with complicated track graphs (#10331), or when undoing actions (undoing causes all actions in the game to be re-processed by the web browser in order to reset to an earlier game state).
While Engine V2 is under development, it can only be activated for a game by selecting the "Use Engine V2" checkbox on game creation, and it is only available for select titles.
If you opt to use Engine V2 in a game, please be prepared to report bugs. For this reason, it is not recommended to use for any kind of tournament games, or if players prefer only the most stable experience. We appreciate your help in testing improvements for the site!
Current* Changes
*once the initial few PRs are merged (current status: not yet created)
- actions have a new
stepfield- when an action is executed for the first time, its
stepwill be populated with the name of theStepobject that processed the action - when that action is executed in the future (e.g., when the game is opened in a web browser and all its actions are processed), the
stepfield is used to find the rightStepobject to process the action, skipping the computation that checks all possible steps until one is found
- when an action is executed for the first time, its
eagermode is Engine V2's equivalent ofstrict- when a game is loaded (opened in browser, or the initial load by the server when a new action is submitted),
eageris false; it is lazily assumed actions up to this point don't need validation - when a new action is submitted, it is processed with
eager: true
- when a game is loaded (opened in browser, or the initial load by the server when a new action is submitted),