Forum General turn based game implementation

Any issues or discussions relating to Flash development are welcome here.

turn based game implementation

Postby ben » May 12th, 2010, 12:17 pm

Hi again,
for my tower defence multiplayer game I nedd some tips and advice for the technical implentation and security part:
-for the multiplayer part I want to calculate each round on the client site and then compare the results on the server. Is this going to work? Because every client runs on a different mashine and maybe the round calculation is slightly different...
-for the security party I want all importent variables to be on the server but maybe this is a bit oversized if the game call the server every second(or so) to change the players money?
Thanks in advance,
Ben
ben
 
Posts: 10
Joined: April 13th, 2010, 10:11 am

Re: turn based game implementation

Postby Oliver » May 13th, 2010, 11:45 am

Hi Ben,

I don't think your questions can be answered correctly without knowing a lot more detail, so i'll try with some high-level advice instead.

-for the multiplayer part I want to calculate each round on the client site and then compare the results on the server. Is this going to work? Because every client runs on a different mashine and maybe the round calculation is slightly different...


In general, the best way to make multiplayer games is to "run the game on the server" (ie, the simulation), and use the clients as external displays that only need to be told (via messages) about changes they should display. Of course, it gets a lot more complicated, and there are a bunch of loop holes that can be taken.

Without knowing more about the gameplay of your game, it's hard to tell what the best way to implement your game is. I think that an old nonoba game, Starland Multiplayer TD, runs the game on the client and only uses the server as a message-router between the two players.

This can work because the gameplay in Starland is almost just a singleplayer game, where the two players just see each others state. The server is just relaying state between clients.

We have a good tutorial on the various issues and solutions involved in multiplayer games here:
http://playerio.com/documentation/tutor ... -tutorial/

-for the security party I want all importent variables to be on the server but maybe this is a bit oversized if the game call the server every second(or so) to change the players money?


As i said, running the game/simulation, on the server is usually the best approach.

Also remember that the servers are very fast, and they're running code in .NET which is also very fast, so i don't think you'll need to worry much about performance. You're not likely to run into performance issues, especially when just sending a few messages every second.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: turn based game implementation

Postby ben » May 14th, 2010, 12:14 pm

Hi Oliver,
thanks for taking time! The game I'm working on is nearly a standard multiplayer td game witch runs in multiplayer mode. A special features is that you can build the units which runs to the enemy. So the game have two stats. In de first state the player can build towers and recruit units. If both player have finished this state the second state simulates the battle and the player can't do anything since the battle state is over.

I think that an old nonoba game, Starland Multiplayer TD, runs the game on the client and only uses the server as a message-router between the two players.


I want basically to do the same. What is the disadvantage of this? I guess security could be a reason but on the other hand this implementation cost not much traffic and server power.

As i said, running the game/simulation, on the server is usually the best approach.

Yes, this is the best way to secure a game. But maybe the game is also secure if important variables are only on the server (in my case: live & money)?
I'm new to the whole C# language so I want to minimised the work on the server side.

Cheers,
Ben
ben
 
Posts: 10
Joined: April 13th, 2010, 10:11 am

Re: turn based game implementation

Postby Oliver » May 17th, 2010, 10:30 am

Hi Ben,

My advice would be to make something simple that works to get going. Use whatever method works best for you, running most of the game on the client sounds like the best solution for you.

Then you can always make a more advanced solution later :-)

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: turn based game implementation

Postby ben » May 25th, 2010, 9:52 am

Thanks for your advice Oliver.
ben
 
Posts: 10
Joined: April 13th, 2010, 10:11 am


Return to General



cron