I am making a soccer game these months and basicly the coolest thing about it has to be the multi-player mode. But before I'll be able to finish that, there is a problem.
I use 8-direction movement for the soccer player that you're controlling. If you go in a new direction, pc 1 will send the direction value to pc 2 via the internet
When the direction value message reaches pc 2, it will set the direction of the player object (which has a ball-movement to it) and will always start movement until the "stop-command" reaches pc 2.
The stop-command is in this game just : Send text "stop" to pc2. (i work with mooclick).
I hope it is clear so far...
the problem is that the player looks to move fluently, but reacts sometimes a little late on the commands, especially the stop command. So if the player is stopped on pc1, it will sometimes walk a little further on pc2. So the position are different from the one that controls the player and the one that sees that player as the opponent. This is also sometimes the case with directions, that are sent too late (but not as often as the stop-message)
The movement of the ball and the player are set equal btw so it is not that that causes the difference in x,y.
I hope you have an answer to this, because in a soccer game, there is a soccer ball. when you hit the ball on your own screen, it must not look on the other screen that you walk around it and still the ball is hit. That would be spooky.
So you are saying that if you send "s" it will go faster than "stop"?
Because I am still sending "stop" to the other pc to let the game know that the player has to stop.
Hey mates, I'm Iglo yeah =P!
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
23rd October, 2005 at 00:41:43 -
It will go faster, but not by all that much. Unless you have heaps of data then it will go slower. LegendKprDos's ideas should work. My only other suggestion is that you try blasting the text instead of sending it.
"ok well how bout you keep your old ball movement (or like phizzy said custom) and add like a condition when the player on pc1 is stopped only once when condition loops--send its coordinates and make the player on pc2 go to those coordinates to make its position accurate.
this way it only sends the coordinates when its stopped and only once."