The Daily Click ::. Forums ::. Klik Coding Help ::. Online positions of player
 

Post Reply  Post Oekaki 
 

Posted By Message

Robbert



Registered
  19/06/2003
Points
  420
17th October, 2005 at 14:58:36 -

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.

 
Hey mates, I'm Iglo yeah =P!

Robbert



Registered
  19/06/2003
Points
  420
19th October, 2005 at 05:24:24 -

Anyone ?

 
Hey mates, I'm Iglo yeah =P!

Robbert



Registered
  19/06/2003
Points
  420
21st October, 2005 at 04:16:13 -

Well the problem with that is that the player has to send a message whenever the player moves by 1 pixel. And that is a lot!!!

Thanks, but I don't think your solution is a good one. It will be laggy as hell I'm afraid

 
Hey mates, I'm Iglo yeah =P!

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
21st October, 2005 at 10:01:40 -

What's wrong with your ', Phizzy?

Image Edited by the Author.

 
Old member (~2004-2007).

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
21st October, 2005 at 16:08:37 -

I developed a system called NeQ (Noventa e Quatro, 'Ninety Four') to help with sending data.

It works on the same principles as Binary, Decimal, Hexadecimal, etc. It stores a value between 0 and 8,836 in just two ascii characters.

Something like 255, for example, is #d. 1,000 would be +]

The idea is to be able to send lots of number data in less characters. So we could do this:

Direction = 16
X pos = 1024
Y pos = 468

So we send: 1+u%}

If we had sent it as normal text, we'd have to send '16 1024 468'. NeQ is, in this case, 45% of the size.

 
191 / 9999 * 7 + 191 * 7

Robbert



Registered
  19/06/2003
Points
  420
22nd October, 2005 at 12:06:20 -

yeah that's great I guess

 
Hey mates, I'm Iglo yeah =P!

Robbert



Registered
  19/06/2003
Points
  420
22nd October, 2005 at 16:08:28 -

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

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
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.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Robbert



Registered
  19/06/2003
Points
  420
23rd October, 2005 at 06:50:29 -

"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."

Yeah thanks I will try.

 
Hey mates, I'm Iglo yeah =P!
   

Post Reply



 



Advertisement

Worth A Click