| View previous topic :: View next topic |
| Author |
Message |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sat Jan 17, 2009 5:41 am Post subject: [HELP] Some way to send movement packets better? |
|
|
Is there a way to send movement packets better? Right now I send a movement packet every 130 milliseconds for a player and 160 milliseconds for a monster. This causes extreme lag on even a VPS (Virtual Private Server). I spawned about 20 chickens, and bam, you can't even see anything move anymore. Is there a better way to send movement packets? Like maybe sending a larger packet then parsing it on the client?
By the way, what was sent was like this:
x = int
y = int
frame = byte
stance = byte
directon = byte
That adds up to.. 11 bytes.
Thanks.
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Jan 17, 2009 8:47 am Post subject: |
|
|
- Instead of sending a separate 11 byte packet for every monster/player, group them into a bigger packet. (like 1 packet with an array of info for every monster)
- You could also consider only sending the information if it changed. So only send a packet if a monster moved or changed stance of whatever.
|
|
| Back to top |
|
 |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sat Jan 17, 2009 8:55 am Post subject: |
|
|
hmm, so you mean send a 110 byte message every 1.6 seconds? I'm wondering how to synch it if I did it that way. Also, I cannot calculate movement/collisions on the server side.
or are you talking about, like
byte - number of monsters
then for each monster
objectid - int
x - int
y - int
frame - byte
stance - byte
direction - byte
So, if I had like 20 monsters in a map it would send 221 bytes? In 1 bigger packet?
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Jan 17, 2009 10:05 am Post subject: |
|
|
| Jvlaple wrote: | hmm, so you mean send a 110 byte message every 1.6 seconds? I'm wondering how to synch it if I did it that way. Also, I cannot calculate movement/collisions on the server side.
| I don't mean a 110 byte message every 1.6 seconds. What you did (what you told in first post) was sending like 20 packets every 160 milliseconds. That will lag indeed. Instead you should send 1 big packet (with every monster's info in it) every 160 milliseconds.
| Jvlaple wrote: |
or are you talking about, like
byte - number of monsters
then for each monster
objectid - int
x - int
y - int
frame - byte
stance - byte
direction - byte
So, if I had like 20 monsters in a map it would send 221 bytes? In 1 bigger packet? |
Yes that's exactly what I meant.
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Sat Jan 17, 2009 10:50 am Post subject: |
|
|
This is for MS right?
If it is, you will have to edit the client to read all of the data from one packet...
Maplestory gets the packet, reads the first 11 bytes, and then throws the packet away again (im pretty sure...), so if you make a packet on 121 bytes or something, MS will read the first 11 bytes, and then delete the rest...
The only method to avoid lagg, is to make a higher delay
20 chickens you say?, what about a better server then?
|
|
| Back to top |
|
 |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sat Jan 17, 2009 5:27 pm Post subject: |
|
|
no, its not MS,its my own mmo
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Jan 17, 2009 6:18 pm Post subject: |
|
|
| Quote: | | [PacketID] [MobID] [MiscellaneousInfo] [dwStructCount] [[X] [Y] [Frame] [Stance] [Direction]]*... |
Personally, I wouldn't put all of the mob movement information into one packet. Movement is clientsided or serversided?
_________________
|
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sat Jan 17, 2009 6:23 pm Post subject: |
|
|
20 monsters should only be 1.5kB/s...There shouldn't be any problems with that.
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Jan 17, 2009 6:27 pm Post subject: |
|
|
| Yea what if someone was being stupid and spawned alot? That would exceed the 1kb packet size range right?
|
|
| Back to top |
|
 |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sat Jan 17, 2009 7:55 pm Post subject: |
|
|
| sponge wrote: | | Quote: | | [PacketID] [MobID] [MiscellaneousInfo] [dwStructCount] [[X] [Y] [Frame] [Stance] [Direction]]*... |
Personally, I wouldn't put all of the mob movement information into one packet. Movement is clientsided or serversided? |
Movement is clientsided, but I register autoban points if it moves too much.
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
sphere90 Grandmaster Cheater
Reputation: 0
Joined: 24 Jun 2006 Posts: 912
|
Posted: Sat Jan 17, 2009 11:07 pm Post subject: |
|
|
| Jvlaple wrote: | | sponge wrote: | | Quote: | | [PacketID] [MobID] [MiscellaneousInfo] [dwStructCount] [[X] [Y] [Frame] [Stance] [Direction]]*... |
Personally, I wouldn't put all of the mob movement information into one packet. Movement is clientsided or serversided? |
Movement is clientsided, but I register autoban points if it moves too much. |
Sounds like you are doing it server sided. Try to do it in the client so the server would not be burdened by the creation of movement packet for each and every monster in your server. For example, create the movement packet in the client and send to the server, the server just parse the packet. This is how Maple works. Therefore, the workload is distributed across all clients and your server will be able to scale if more monsters are required.
_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life. |
|
| Back to top |
|
 |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sun Jan 18, 2009 12:32 am Post subject: |
|
|
its already client sided. every update, the new position is sent to the server then the server validates it. And how does maple work?
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
sphere90 Grandmaster Cheater
Reputation: 0
Joined: 24 Jun 2006 Posts: 912
|
Posted: Sun Jan 18, 2009 1:00 am Post subject: |
|
|
| Jvlaple wrote: | | And how does maple work? |
every update, the new position is sent to the server then the server validates it.
_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life. |
|
| Back to top |
|
 |
Jvlaple Grandmaster Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 768
|
Posted: Sun Jan 18, 2009 5:57 am Post subject: |
|
|
You sure? Odin seems to read a whole bunch of moves at once.
_________________
| jadeling wrote: | | how do i save my npc? |
| samerj13 wrote: | | What the fuck is visual basic? |
|
|
| Back to top |
|
 |
sphere90 Grandmaster Cheater
Reputation: 0
Joined: 24 Jun 2006 Posts: 912
|
Posted: Sun Jan 18, 2009 8:47 am Post subject: |
|
|
| Jvlaple wrote: | | You sure? Odin seems to read a whole bunch of moves at once. |
One simple motion like jumping is broken down into several smaller movement fragments which gets sent to the server in one packet.
_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life. |
|
| Back to top |
|
 |
|