<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multiplayer Game Design: Server-Side Models and Distributed Models</title>
	<atom:link href="http://www.andyjdesign.com/game-programming/multiplayer-game-design-server-side-models-and-distributed-models/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andyjdesign.com/game-programming/multiplayer-game-design-server-side-models-and-distributed-models/</link>
	<description>Game Development and Design</description>
	<lastBuildDate>Mon, 12 Jul 2010 14:37:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Gery Teague</title>
		<link>http://www.andyjdesign.com/game-programming/multiplayer-game-design-server-side-models-and-distributed-models/comment-page-1/#comment-133</link>
		<dc:creator>Gery Teague</dc:creator>
		<pubDate>Thu, 03 Sep 2009 07:06:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.andyjdesign.com/?p=109#comment-133</guid>
		<description>That was fantastic. I&#039;m going to be rereading this post and implementing these methodologies as best I can. What I had been picturing was something simple, like a two car race game, like.... the light bikes from TRON.

Okay, so you have player 1 and player 2 on their own home computers and the server. I was imagining that the server stores the state of the world, so let&#039;s say that the server changes the map every day, so when player 1 logs on to play he sees whatever the map is for that day, and so would player 2.

Also, the server stores where player 1 and 2 parked their light bikes from the last time they played.

So, when player 1 opens up the program/webpage at home, he sees the world that the server is showing that day and where his bike was last parked. When player 2 opens up the program/webpage at home, he sees the world that the server is showing that day and where his bike was last parked, and both players now see each other&#039;s bikes.

The way I see this playing out in code:
1) Player 1 opens up the program at home.
   - A LocalGameModel is created that stores pointers to a LocalPlayerModel, a RemotePlayerModel, and a ViewPortModel.
   - A LocalGameController is created that will begin the game loop.
   - A LocalGameView is created that shows the looks of the GUI.
   - A LocalGamePortView is created that shows what&#039;s happening in the game, and is added to the LocalGameView
   - A LocalPlayerView is created that shows the light bike. This is added to the LocalGamePortView
   - A RemotePlayerView is created that shows the light bike of the remote player. This is added to the LocalGamePortView.

   - A LocalPlayerController is created that receives key presses from the local player and updates the LocalPlayerModel.

2) The Game loop begins and the LocalGamePortView is updating dependant upon the LocalGamePortModel and this cascades down through it&#039;s child views.

3) Player 1 presses the up button and the LocalPlayerModel is updated by a given amount so that the bike&#039;s model is moved up.

4) This updated data is sent to the Server&#039;s Model, which then announces an update.

5) Player 1&#039;s View is updated because it hears the update and player 1&#039;s bike is moved up.

6) Player 2&#039;s View is updated because it hears the updand and player 1&#039;s bike is moved up.

Now, problems I see. 
1) Models are usually Singletons, so  I begin seeing a problem if there would be more than 1 RemotePlayerModel as now they would overwrite each other.

2) Again with the Models as Singletons. In this scenario the server is holding pointers to the Models of both players, since players would be of the same type, they would cancel each other out.

3) There is of course the issue of keeping everything in perfect sync, which I will need re-reading of your post as well as further research into best methods.

I&#039;m sure there are plenty more issues, I&#039;m just trying to get my head wrapped around how this would work out.

Thanks again for the GREAT write-up!

Gery</description>
		<content:encoded><![CDATA[<p>That was fantastic. I&#8217;m going to be rereading this post and implementing these methodologies as best I can. What I had been picturing was something simple, like a two car race game, like&#8230;. the light bikes from TRON.</p>
<p>Okay, so you have player 1 and player 2 on their own home computers and the server. I was imagining that the server stores the state of the world, so let&#8217;s say that the server changes the map every day, so when player 1 logs on to play he sees whatever the map is for that day, and so would player 2.</p>
<p>Also, the server stores where player 1 and 2 parked their light bikes from the last time they played.</p>
<p>So, when player 1 opens up the program/webpage at home, he sees the world that the server is showing that day and where his bike was last parked. When player 2 opens up the program/webpage at home, he sees the world that the server is showing that day and where his bike was last parked, and both players now see each other&#8217;s bikes.</p>
<p>The way I see this playing out in code:<br />
1) Player 1 opens up the program at home.<br />
   &#8211; A LocalGameModel is created that stores pointers to a LocalPlayerModel, a RemotePlayerModel, and a ViewPortModel.<br />
   &#8211; A LocalGameController is created that will begin the game loop.<br />
   &#8211; A LocalGameView is created that shows the looks of the GUI.<br />
   &#8211; A LocalGamePortView is created that shows what&#8217;s happening in the game, and is added to the LocalGameView<br />
   &#8211; A LocalPlayerView is created that shows the light bike. This is added to the LocalGamePortView<br />
   &#8211; A RemotePlayerView is created that shows the light bike of the remote player. This is added to the LocalGamePortView.</p>
<p>   &#8211; A LocalPlayerController is created that receives key presses from the local player and updates the LocalPlayerModel.</p>
<p>2) The Game loop begins and the LocalGamePortView is updating dependant upon the LocalGamePortModel and this cascades down through it&#8217;s child views.</p>
<p>3) Player 1 presses the up button and the LocalPlayerModel is updated by a given amount so that the bike&#8217;s model is moved up.</p>
<p>4) This updated data is sent to the Server&#8217;s Model, which then announces an update.</p>
<p>5) Player 1&#8242;s View is updated because it hears the update and player 1&#8242;s bike is moved up.</p>
<p>6) Player 2&#8242;s View is updated because it hears the updand and player 1&#8242;s bike is moved up.</p>
<p>Now, problems I see.<br />
1) Models are usually Singletons, so  I begin seeing a problem if there would be more than 1 RemotePlayerModel as now they would overwrite each other.</p>
<p>2) Again with the Models as Singletons. In this scenario the server is holding pointers to the Models of both players, since players would be of the same type, they would cancel each other out.</p>
<p>3) There is of course the issue of keeping everything in perfect sync, which I will need re-reading of your post as well as further research into best methods.</p>
<p>I&#8217;m sure there are plenty more issues, I&#8217;m just trying to get my head wrapped around how this would work out.</p>
<p>Thanks again for the GREAT write-up!</p>
<p>Gery</p>
]]></content:encoded>
	</item>
</channel>
</rss>
