The Daily Click ::. Forums ::. Klik Coding Help ::. lacewing neutral objects
 

Post Reply  Post Oekaki 
 

Posted By Message

vetmora120



Registered
  07/01/2010
Points
  273
13th May, 2012 at 13/05/2012 11:53:47 -

Hi all,

I'm making a game that involves Lacewing. I have everything set up but the thing I'm unsure of is how to do objects that move by themselves that need to be synced between clients.

What is the best way to do this? With peers it's simple because they have names and you can use them to indentify which object to change/update. But I'm unsure of how to identify between these objects I'm describing with the lacewing object.

Anyone able to quide me in the right direction?

Thanks in advance

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
13th May, 2012 at 13/05/2012 15:13:15 -

The must be only one true copy of any object on only one machine, with it's co-ordinates and other values stored on either that machine or a server, while all the other identical instances of this object on the other user's computer are simply updated from the source.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
14th May, 2012 at 14/05/2012 03:29:47 -

I'm kind of a noob when it comes to online games, but how about this..?

Divide your map up into zones. Allocate a different channel for each zone. The first player to enter a zone becomes the "master" of that zone - the "neutral" objects inside it are created and handled on their computer, and they send out data about the objects to all the other players in the same zone (other peers on the same channel).
When they leave the zone, control shifts to one of the remaining players - or if there are no other players in the same zone, the objects simply cease to exist until the next player enters the zone.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
14th May, 2012 at 14/05/2012 05:19:41 -

Nice.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
14th May, 2012 at 14/05/2012 08:23:32 -

Clever idea Sketchy. I like it because it would be a good way of handing large stages in multiplayer games. Now to get down to the nitty gritty and sort out a system to track the objects' data. I have a feeling this might be a bit ambitious, but hey, I like a challenge .

Thanks for the help guys.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
16th May, 2012 at 16/05/2012 07:04:40 -

This is what I have so far. Not even sure I'm on the right track here.

I'm unsure how to get Lacewing to receive the text and identify which object_clone to set the received to as I'm sending the ID with the X and Y and creating them before I send the data. The code is below (some expressions may be slightly mis-worded as I'm at work at the moment and can't quite remember exactly).

You are the channel master
+ On user clicks left button with Mouse
- Create “object”
- Set ID to Global Value A
- Set X(“object”) to XMouse
- Set Y(“Object”) to YMouse
- Add 1 to Global Value A


Always
- Send number NObject(“object”) to channel on subchannel 0

On number message sent to channel on subchannel 0
+ NCount(“object_clone”) < Received$(Lacewing Client)
- Create “object_clone”

On number message sent to channel on subchannel 0
+ NCount(“object_clone”) > Received$(Lacewing Client)
- Pick one “object_clone” at random
- Destroy “object_clone”


Always
- Start ForEach “loop” for “object”

On ForEach “loop” for “object”
+ ID(“Object”) = ForEach “loop” iteration value
- Send text Str$(ID(“object”)+”/”+Str$(X(“object”)+”/”+ Str$(Y(“object”) to channel on subchannel 1

...?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click