1

I am programming a MMO Tower Defense game (Client Server architecture). Because of cheating protection, the server needs to have the logic. But I have real design problem. When lets say 10 People fight deathmatch against each other, every tower shoot needs to be calcuted and send over to the players. When many towers are build. (Like 10 Players * 10 Tower = 100 Tower ) the traffic is very high. (One player causes many messages per second) How can I solve this problem?

Server is written in Java ( Smartfox 2x) Client is written in C# ( Unity 3d)

Thanks in advance.

Mileseven
  • 21
  • 4
  • How do you currently do the communinication between server and clients? What languages are you using? – PeeHaa Jan 20 '14 at 01:06
  • I am using unity3d(c#, client) and smartfox(java, server) – Mileseven Jan 20 '14 at 01:07
  • There is a game called Demigod. When it was releases it took several months to patch it up to playable state, where the most problems were in the networking area. This happened because while they did a lot of testing when magnitudes more players started using it all sort of things went awry. I wish you the best of luck, I *know* you are going to have so much fun! – Andrew Savinykh Jan 20 '14 at 01:14
  • Have lots of bandwidth on your server and/or optimize what you send and/or have clients *also* have the logic and simply send player actions. – Bernhard Barker Jan 20 '14 at 01:48

2 Answers2

0

Because of cheating protection, the server needs to have the logic.

This is a false assumption. The server needs to have sufficient logic to run game logic and make sure that all players' actions make sense, but it does not need to send back the results. The clients can all run that same logic in parallel and figure out the results on their own.

  • Thanks for the answer, but what about the delay beetween the server and clients? Like, Server thinks all units are dead, but Client does not. Also the other clients should know when units are hitted. How can I solve this particualr problem? – Mileseven Jan 20 '14 at 01:20
  • With appropriate synchronization between the client-side and server-side simulations, that shouldn't happen. –  Jan 20 '14 at 01:35
  • Thanks thats all I need to know :) – Mileseven Jan 20 '14 at 15:01
0

Use strong simplified Units and combat rules on the server. Just program your damage algorithm by affecting continuous damage over time if someone is stepping into the "Damage area" around the tower.

U can use tow dimensional battlefields on the server where all units and towers and damage areas are just circles or oints and circles. U can also use several rings of damage with damage per second is lower in the outter circles and higher at the inner circles around the defense tower.

U can use queues for managing single target damage / multi target damage and area damage. Just the first in the queue is affecting by the damage area if single shot, just the first, second and third is affected by multi shot etc.

If a tower shoot a bullet every 5 seconds and does 40 damage per bullet u just calculate on the server by affecting a damage of 8 per second for every target standing in the "Damage area" or "damage circle".

On the client u can all the things like flying bullets and hitting and splish and splash and fireworks and so on.

But on the server do all the stuff by entering damage areas and then get damage per second. (sorry for bad english)