Central game loop and data model - handling actions and observing their results
The main loop of the game will receive action requests from clients and from simulated agents, queue them, and execute them in order. The execution may change the state of other objects in the game world, if they are observed they will send update messages to their observers.
To be solved:
- Who handles action requests?
The avatar object presumably, but it could forward to wielded tools or used consoles.
- Do all game state changes require an action to happen?
Probably not, things like physics should be updated by some kind of modules that can loop through game objects and update their state.
- How do state changes get communicated to players and AI (and triggerable objects?)
Players have some area/environment around them that they can observe. Significant state changes there should be sent to them as change messages to objects they observe (they'll need to replicate part of the game world objects, at least their appearance)
- What kind of additions should we allow on the fly?
New game object types, new game object properties, etc? What kind of usage scenarios are there for changes?
- How to implement this in Scala?
In Java I ended up with a custom game object system that allowed arbitrary properties and registering listeners to them, it would be nice if it could be solved in shorter and more elegant way in Scala. Also, maybe more of the game object functionality and types could be implemented at compile time, leaving mostly parametrization and combination to configuration files, editors, and in-game editing.
Blueprint information
- Status:
- Started
- Approver:
- Hans Häggström
- Priority:
- Essential
- Drafter:
- Hans Häggström
- Direction:
- Approved
- Assignee:
- Hans Häggström
- Definition:
- Discussion
- Series goal:
- None
- Implementation:
- Started
- Milestone target:
- skycastle-0.0.4
- Started by
- Hans Häggström
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
We are looking at using Darkstar as the server back end, so it would take care of many of these tasks and simplify the rest.