SFTtech/openage

Standardize control flow between engine subsystems

heinezen opened this issue · 3 comments

We could improve the way individual subsystems in the engine (presenter, renderer, gamestate, networking, ...) talk to each other by using a standardized method for all communications. For this to work, we would need to define how data should be sent, fetched or manipulated during transfer and find a flexible solution that is reusable for all subsystems.

The main benefit of this would be less maintanance (since we don't need to figure out a new solution for every subsystems) and better code readability. It should also improve thread safety as the subsystems usually run in their own threads and communication between them form a critical path. We also want to minimize interdependencies between subsystems as much as possible.

#1492 and #1497 already address parts of this issue by handling communication in dedicated objects and using a one-way control flow.

We can use other implementations as a reference, e.g. https://developer.android.com/kotlin/flow

socketio can be use to comunicate, I know him with python (here) and in python It's pretty easy to use so the part modding would be also easy to create custom network event.

@coco875 This issue is not really about external communication with the Python API and more about the internal C++ subsystems of the engine.

oh ok