Rishabh Posted June 16, 2017 Report Share Posted June 16, 2017 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 Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted June 16, 2017 Report Share Posted June 16, 2017 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. 3 Quote Link to comment Share on other sites More sharing options...
Rishabh Posted June 16, 2017 Author Report Share Posted June 16, 2017 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 Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted June 16, 2017 Report Share Posted June 16, 2017 2 hours ago, Rishabh said: 1) Point me to the part of the code where each player performs simulations for other players on the network CNetClientTurnManager::OnSimulationMessage 2 hours ago, Rishabh said: 2) Point me to the part of the code where the 'sync' validation is done. CNetServerTurnManager::NotifyFinishedClientUpdate 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted June 17, 2017 Report Share Posted June 17, 2017 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? 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted June 19, 2017 Report Share Posted June 19, 2017 Yeah, uh, hi. Why do you want to know this information? You guys are too friendly to a potential hacker. 3 Quote Link to comment Share on other sites More sharing options...
fcxSanya Posted June 19, 2017 Report Share Posted June 19, 2017 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. 4 Quote Link to comment Share on other sites More sharing options...
Rishabh Posted June 19, 2017 Author Report Share Posted June 19, 2017 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). Quote Link to comment Share on other sites More sharing options...
Imarok Posted June 19, 2017 Report Share Posted June 19, 2017 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. Quote Link to comment Share on other sites More sharing options...
wraitii Posted June 19, 2017 Report Share Posted June 19, 2017 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. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.