Monday, October 1, 2007

Game Lobby


I wish I had more time to develop. I was very busy with other things during the past months.
Well finally I managed to distill some time for Dragon Siege out of my life.

The main feature I added is a game lobby.
In the background you will see a local game already running, while the players are in the lobby.
Each player PC runs a local "demo game" in the background while waiting for all the players to join the lobby and the server to start the network game.

I created a local loop back implementation of the networking layer in order to run a "demo game" on each PC. The networking layer was already abstracted so this was quite easy.

I also had to do some refactoring. Initially the entity representing a connected player in the game was the same as the entity representing the Faction (in game group of units usually allocated a particular color). I split these entities in order to make the game state independent of the players connected.

Thus
  • a game can run without any players connected,
  • multiple players can be assigned to a Faction,
  • players disconnecting does not affect the game state.
I plan to implement unexplored features as well: A player that did not join the lobby before the game started may join a game in progress as an observer, or with permission of a current player may gain control of game entities.

It was a nice exercise writing TextboxControl and ButtonControl classes and handling events in the container Form in a similar fashion as working with Windows forms.

Dragon Siege is on the verge of multi-player testing.