Jump to content

Server Side Modification


Rishabh
 Share

Recommended Posts

Hey all,

I was just trying to understand how the server side validation works for this game. I tried changing the mod in one game making building costs zero and player this game with a vanilla version. On creating any changed unit, I got a message that the game is out of sync and stopped. I have the following questions:

1) Since the game is following a p2p model, shouldn't this not happen?

2) How can I allow games with different mods to be played while maintaining sync?

Ps. I have tried enabling cheat mode on the server, it did not make any difference.

 

Thanks.
Rishabh

Screenshot from 2017-06-15 16-48-08.png

Link to comment
Share on other sites

Hi and welcome to the forums!

0 A.D. uses the same 'synchronized simulations' network model as Age of Empires (and probably some/many other RTS games), you can read about it here: http://www.gamasutra.com/view/feature/131503/1500_archers_on_a_288_network_.php , the second paragraph puts it in a nutshell:

Quote

Simultaneous Simulations

Rather than passing the status of each unit in the game, the expectation was to run the exact same simulation on each machine, passing each an identical set of commands that were issued by the users at the same time. The PCs would basically synchronize their game watches in best war-movie tradition, allow players to issue commands, and then execute in exactly the same way at the same time and have identical games.

So:

43 minutes ago, Rishabh said:

1) Since the game is following a p2p model, shouldn't this not happen?

Each game client validates the simulation state checksum, since any deviation is guaranteed to lead to issues.

43 minutes ago, Rishabh said:

2) How can I allow games with different mods to be played while maintaining sync?

If they affect simulation -- you cannot by design.

  • Like 3
Link to comment
Share on other sites

Hey,

Thank you for your reply. Got what I needed. If this is the case, could you help me with the following?

1) Point me to the part of the code where each player performs simulations for other players on the network

2) Point me to the part of the code where the 'sync' validation is done.

Thank you,

Rishabh

Link to comment
Share on other sites

On 6/16/2017 at 11:34 AM, Rishabh said:

1) Since the game is following a p2p model, shouldn't this not happen?

0 A.D. is played on multiplayer too and it wouldn't be quite fair if one player modified his templates so that his units become really strong, would it?

  • Like 2
Link to comment
Share on other sites

8 hours ago, wowgetoffyourcellphone said:

You guys are too friendly to a potential hacker.

Security through obscurity isn't very efficient for an open-source project in any case. I found the methods I linked by searching a not-very-familiar-to-me part of the codebase for 10-15 minutes. If someone would be able to find a flaw after such a small time / effort investment, then it may have sense to improve the validation, and raising awareness about potential issues helps.

  • Like 4
Link to comment
Share on other sites

Just to clarify, I am not trying to hack the game or anything. I'm trying to understand exactly how the networking protocol works as I'm working on a project on multiplayer online game security. In fact, could any of you help me with this:

In the current version of the game, is it possible to cheat in multiplayer mode? If so, how? (This has to be done in a way so that synchronisation is not lost).

Link to comment
Share on other sites

It works l ike this in the game:

Every client sends his commands to the server, then the server broadcasts all commands to the clients. They all execute those commands on their local simulation.

Now and then everyone compares a hash of the simstate with the hash of everyone else's hash. If they don't match, you get an Out of Sync error.

So to hack the thing: find some command that does things to everyones simulation, that are not intended.

Link to comment
Share on other sites

If you're developing a complete-information game, then using our architecture makes it logically/mathematically impossible to cheat and be undetected.

0 A.D. is not, and it is possible to cheat slightly, by getting more information than the game wants you to have, because of that.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...