The Daily Click ::. Forums ::. Klik Coding Help ::. Lacewing performance
 

Post Reply  Post Oekaki 
 

Posted By Message

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
30th May, 2013 at 30/05/2013 05:35:26 -

First off, please know that I know little to nothing about making games work online, so talk to me like I'm retarded .

I recall reading in the past that sending too much data from one client to another can cause major lag. I am reading a Lacewing tutorial in which the creator "streams" the player locations through the network. His event is as follows:

Always:
+ Add Short (X Position)
+ Add Short (Y Position)
+ Add Byte (Animation Number)
+ Add Byte (Direction)
+Blast binary to channel on subchannel 0.

I remember "back in the day" people used to send a lot of information in a delimited string, and parse that string on the receiving end in order to prevent lag.

Should I ignore this tutorial and look for one that does things properly, or is Lacewing different from the older methods of creating online games? Does this work because Lacewing is converting the data into binary data (very small I assume?) rather than just using raw data/strings?

Also, is this correct:

In the above code, X Position would take up "blocks" 0 and 1, Y position would take up "blocks" 2 and 3, Animation number would take up "block" 4, and Direction would take up "block" 5? So to reference X Position I would look for Short 0, Y position Short 2, Animation Number Byte 4, and Animation Direction Byte 5?


Any help is greatly appreciated. Are there any good guides out there that explain all of the functions of Lacewing?





 
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!
30th May, 2013 at 30/05/2013 15:34:32 -

Lacewing is different. Now that we're able to send streams there is no longer a need for delimited strings.
Strings take more bandwidth since every character is a byte, and not to mention all the header data that has to be sent.

Now with streams the data is no longer separated by delimiters and instead is separated by the length in bytes of the datatype. Less data to send = faster

So yes, you're absolutely correct.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
31st May, 2013 at 31/05/2013 16:06:36 -

Thanks a bunch.

With that said, how would one go about streaming enemy/npc locations from a host to a peer? Does every enemy need an ID?

Also . . how in the world does the add byte/short/int work? If I have 2 lines of code like this:

Condition:
+ Add Short (X Position of Self)
+ Add Short (Y Position of Self)
+Blast Binary on Subchannel 0

Condition:
+ Add Short (HP of Self)
+ Add Short (MP of Self)
+ Blast Binary on Subchannel 0

Will this create 4 shorts that need to be referenced 0,2,4,6 OR will it create 2 instances of shorts that need to be referenced 0,2 0,2.

How do I differentiate between the two? Do they need to be sent on different subchannels?



 
n/a
   

Post Reply



 



Advertisement

Worth A Click