I have been working on Game that consists of 10 Game Objects that have to be sync by the server values. The server decides that which game object will win and then sends command to my side(Client side) but I am not able to match the server values to mine then what can I do to sort out this problem? The track is kind of horse racing track i.e. straight and then circular. Any help would be appreciated :) Thanks in advance

share|improve this question
    
If server send you the values then why are you generating your own to compare? – Hamza HasanJan 19 '16 at 10:34
    
No I don't compare... I just have to take that speeds to randomize my game objects and nothing....But server sends the speed chunks that I assign to game objects and then the winners don't match from both the sides. :( – Shraddha PatelJan 19 '16 at 10:46
    
Then show some relevant code if you can – Hamza HasanJan 19 '16 at 10:47
    
It can't be done there are more than 3 classes that m using :9 – Shraddha PatelJan 19 '16 at 10:50
    
Send, receive and assigning code chunks – Hamza HasanJan 19 '16 at 10:52

I wonder how are you trying to sync it, the "best" way to do this is via socket connection.

Also, you have to identify the important info that you really need to sync, FE, im developing an MRTS, i have to sync the units but the client doesn´t care about movement speed, attack points, etc, so, in essence i only need send to the client which unit he has to draw, who owns this unit and where it has to be drawn, so, a huge object called "Archer" in my serverside application would be sent to the server as an Int8 array like [23,1,1851,2434] (Unit id, owner id, X, Y).

Then, your client only has to draw it.

If you use UDP sockets (fast as hell) and condensed bit data you will be able to do real time sync without any problem.

share|improve this answer
2  
Not voting down your answer, but your answer is irrelevant. OP can't assign properly the value he/she fetch. Without code, it is difficult to point out – Hamza HasanJan 19 '16 at 10:53
    
Thanks sir for the reply...me too just doing that way as u said.. just receive the command and by entry and key values the speeds automatically assign to that objects but then too the objects don't match from both the side. Am I doing anything wrong? or server? – Shraddha PatelJan 19 '16 at 10:55
    
Are you sure you are not making calcs in clientside? also, are your objects clearly identificables so, once a packet arrives, they could be updated? – PRDevingJan 19 '16 at 11:02
    
That's why I asked for code :) – Hamza HasanJan 19 '16 at 11:03
    
Hamza, you are right, there's no info enough, i just pointed out how it "should" be done, just in case OP didn't know how manage real time sync, i never said it's the final solution. As Hamza said, you should post some more info OP, code, chart or flow would be appreciated – PRDevingJan 19 '16 at 11:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.