Passing data between engine layers
Posted
by
spaceOwl
on Game Development
See other posts from Game Development
or by spaceOwl
Published on 2013-08-07T07:26:53Z
Indexed on
2013/11/06
16:16 UTC
Read the original article
Hit count: 255
I am building a software system (game engine with networking support ) that is made up of (roughly) these layers:
- Game Layer
- Messaging Layer
- Networking Layer
Game related data is passed to the messaging layer (this could be anything that is game specific), where they are to be converted to network specific messages (which are then serialized to byte arrays).
I'm looking for a way to be able to convert "game" data into "network" data, such that no strong coupling between these layers will exist.
As it looks now, the Messaging layer sits between both layers (game and network) and "knows" both of them (it contains Converter objects that know how to translate between data objects of both layers back and forth).
I am not sure this is the best solution.
Is there a good design for passing objects between layers? I'd like to learn more about the different options.
© Game Development or respective owner