Push or Pull Input Data In the Game Logic?
Posted
by
Qua
on Game Development
See other posts from Game Development
or by Qua
Published on 2011-03-11T14:11:16Z
Indexed on
2011/03/11
16:19 UTC
Read the original article
Hit count: 362
In the process of preparing my game for networking I'm adding a layer of seperation between the physical input (mouse/keyboard) and the actual game "engine"/logic. All input that has any relation to the game logic is wrapped inside action objects such as BuildBuildingAction
.
I was thinking of having an action processing layer that would determine what to do with the input. This layer could then be set up to either just pass the actions locally to the game engine or send it via sockets to the network server depending on whether the game was single- or multiplayer.
In network games it would make sense that the player's actions should be sent to the server, but should the game logic be pulling (polling?) the data through some sort of interface or should the action processing layer be adding the actions to an input queue in the game logic code?
© Game Development or respective owner