openage
openage copied to clipboard
Decoupling of subsystems
Set up the GameState
as a dump data store.
The core loop consists of:
- simulation
- input events
- presentation (renderer, sound, gui)
- network
They all work on the GameState
(read/write).
The GameState
may carry some information for the subsystem (e.g. Unit objects have some member struct from another subsystem or have a forward-declarated pointer etc), but all the subsystem methods should stay in the subsystems.
@Vtec234 and I were talking about this in IRC, so I'd continue the discussion in here how we split up the networking, simulation, renderer, input etc. Related: #287 #286
I added a general architecture draft here: https://github.com/SFTtech/openage/blob/master/doc/architecture.md so please update it with more ideas.
This was implemented in https://github.com/SFTtech/openage/pull/1497 and documented in https://github.com/SFTtech/openage/pull/1525