The Truth (Our Machinery Data Model)
Created on 2023-02-08T08:38:24-06:00
Data model for the Our Machinery engine.
- Refer to object by a reference number / object ID
- Create a meta-model of the object
- Generate code to interact with objects of particular types
- Generate code to serialize objects of particular types
- Get free undo/redo support by swapping pointers around
- Copy data out, change it, then do atomic pointer swaps to update references
- Use Compare and Swap operations to check if committing an object succeeded
Explicit read, write, and commit verbs exist to facilitate pulling objects out or writing them to new data to be committed to the system.
Heirarchial storage
Root -> super blocks -> blocks.
Allows fixed size arrays to be used to back object IDs but allocated in banks when needed. Heirarchy can be adjusted based on profiling to what the game needs.
Write-locks used when allocating a new ID to issue an object to.
Threading
Give each thread its own superblock to work with. This stops threads from having write contention over object IDs for the most part.