Updated project setup, finishing up timeline data structures.

Updates

Mechanics

Redo

Added redo, so now we have the following user-controllable functions:

  • undo
  • redo
  • rewind
  • unwind

It works similar to unwind, where under the hood it uses a “virtual” stack that doesn’t truncate until a push, and can “unpop”.

Paused/Playing Areas

There will be active areas that affect objects immediately once inside. These areas are permanent with no limits on how much they can be used, in contrast with the consumable players/pausers.

Code

Internal Class Structure

This is subject to change, but for now this is what I have for time travel related features:

  • VirtualStack
  • ActionTimeline
    • actions (VirtualStack of ActionList’s)
    • timeline (VirtualStack of indices to actions)
  • ActionList
    • Ordered results of a recursive getEffects method
  • “Action” objects
    • getEffects
    • mutates
    • redo
    • undo

Project Setup

Now using parcel for bundling and jest for unit tests. Parcel supports bundling pixi.js and lodash, and supports modern JS features out of the box. Unit tests are great to have for these new internal libraries, and jest has nice output and no required configuration as well.

Next Steps

Finish the low-level data structures and libraries for time travel mechanics, then actually integrate them into the game. Would also be good to have a higher level road map planned out with deadlines.