The Daily Click ::. Forums ::. Klik Coding Help ::. Paint Object with OINC Object
 

Post Reply  Post Oekaki 
 

Posted By Message

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
21st September, 2009 at 20:23:53 -

I'm making a side pictionary game. So pretty much I want the drawer to draw a picture using the paint object, and OINC will draw it on all the other player's computers. Here's my code:


+String of Drawer=OINC Name
+Mouse is in the paper
+User held down left mouse button
-Send text message [String(Xmouse)+"/"+String(Ymouse)] to channel 6 on OINC

+Message received on channel 6
+String of Drawer<>OINC Name
-Set source string to OINC recieved message (STRING PARSER)
-Set position of brush (PAINT)to X=First(String Parser), Y=Last (Sting Parser)
-Draw Point


Problem is, the brush seems to not be in the same position as the original drawer. Also, it doesn't draw "smooth" like the original drawer. It draws in "bursts" if you know what I mean. How can I fix this?

 
n/a

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
22nd September, 2009 at 00:13:15 -

anyone? . . .

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
22nd September, 2009 at 00:36:47 -

You're sending too many messages too fast. Try sending less messages in a short amount of time and instead interpolate between values on the client machines.

Sorry but something like this isn't very cut and dry. It all depends on the type of game and how important some factors are over others.

The Clients will never be perfectly synchronized. You'll always have lag, and sending too many messages could make it even more laggy.

Edited by UrbanMonk

 
n/a

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
22nd September, 2009 at 01:12:16 -

What you could try to do is set up some kind of system that will purposely make the images show up about 2 or 3 seconds slower on other computers. Then whenever you start drawing the picture, start a timer and have it constantly adding up. Include that number in with the messages being sent, and have all the other clients have a similar counter and store all received messages until the timer hits the appropriate number and then fires the appropriate paint response.

This will help compensate for some lag by creating a buffer between when the messages are all received and when the picture is created, and it doesn't give anyone a significant advantage because everyone will have the same amount of lag time. This also allows the picture to be drawn out almost exactly as smoothly as it was drawn by the original creator.

 
http://www.facebook.com/truediamondgame

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
1st October, 2009 at 00:13:50 -

anyone have an example?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click