[gameprogrammer] Re: Mulitplayer/Network support extendability
- From: Charlie Lobo <charlie.lobo@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Fri, 14 Oct 2005 19:17:11 -0500
Well, you would have to forsee it, but then if you abstract it enough, in
theory, you should be able to handle any situation that pops up.
Let us have three main type of objects the game expects:
The board (with all the pieces)
Players
A diplomat object that knows where all players and the board is and it
handles all communication between objects.
If they are well programmed objects they should be independant. Also we
handle the whole game from the diplomat object since it knows where
everything is.
When a player does something, then the diplomat sends the message to the
board so that the action is done. The players also recieve the state of the
board so that they can see and act upon that.
The board handles it's rules independantly. Varying here is quite hard,
because it is limited to what the player object can expect. It could also
have some illegality checking (making sure rules aren't broken) to prevent
cheating.
The diplomat only has pointers to the player objects and the board if it is
a local game. If it is a networked game the the diplomat object also handles
networking.
The player object just sends simple actions (save move piece such to pos
(x,y), why it did this doesn't really matter). The cause behind the action
is handled by the player, wherethas it's because of the input of an actual
person on a computer, or the decision of an AI.
So you never had to "recode" you just keep coding more and more, if you
want a new functionality, you wouldn't have to recode most of the game. OOP
ftw!
- References:
- [gameprogrammer] Mulitplayer/Network support extendability
- From: Gautam Narain
- [gameprogrammer] Re: Mulitplayer/Network support extendability
- From: Alan Wolfe
Other related posts:
- » [gameprogrammer] Mulitplayer/Network support extendability
- » [gameprogrammer] Re: Mulitplayer/Network support extendability
- » [gameprogrammer] Re: Mulitplayer/Network support extendability
- » [gameprogrammer] Re: Mulitplayer/Network support extendability
- » [gameprogrammer] Re: Mulitplayer/Network support extendability
- [gameprogrammer] Mulitplayer/Network support extendability
- From: Gautam Narain
- [gameprogrammer] Re: Mulitplayer/Network support extendability
- From: Alan Wolfe