|
You last visited: Today at 18:54
Advertisement
How the client "despawn" a player/mob?
Discussion on How the client "despawn" a player/mob? within the CO2 Programming forum part of the Conquer Online 2 category.
02/09/2014, 17:41
|
#1
|
elite*gold: 0
Join Date: Sep 2012
Posts: 9
Received Thanks: 1
|
How the client "despawn" a player/mob?
Hi! 
I'm making a small bot to improve my programming skills and I have a little question. I hope you can help me with this
How the client knows when a mob/player is out of his range and "desappear" from the memory? I made a simple structure to save the mobs/players that the user found (I made that with the Spawn and Walk packets), but it keeps outdated every time that a mob/player goes out of the range of my client 
Thx for help! ^^
|
|
|
02/09/2014, 23:50
|
#2
|
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
|
easy, hook the case structure for packet type 10010 and find the remove entity packet.
Or if you have there locations, and your location just check if range between 2 coordinates > 21 then remove i guess.
Pretty simple either way
|
|
|
02/10/2014, 00:16
|
#3
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Perhaps I'm wrong, but I thought the removal distance was anything greater than 18 in the x or y direction. That's what I've experienced, at least - players are removed from the client at 19 and greater without any server packets telling the client to remove the entities.
|
|
|
02/10/2014, 02:32
|
#4
|
elite*gold: 0
Join Date: Sep 2012
Posts: 9
Received Thanks: 1
|
Exactly. I reach the same conclusion that Spirited Fang after like 4h trying to understand how the client does it. I haven't found any packet that made the despawn funcion. Finally, I did it calculating distance between my coords and the mobs/players coords (over 18 is out of range, true?).
Thx for the answers ^^
|
|
|
02/10/2014, 02:40
|
#5
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Reivein
Exactly. I reach the same conclusion that Spirited Fang after like 4h trying to understand how the client does it. I haven't found any packet that made the despawn funcion. Finally, I did it calculating distance between my coords and the mobs/players coords (over 18 is out of range, true?).
Thx for the answers ^^
|
Well, here's what I understand about the system:
|
|
|
02/10/2014, 02:49
|
#6
|
elite*gold: 0
Join Date: Sep 2012
Posts: 9
Received Thanks: 1
|
Quote:
Originally Posted by Spirited Fang
Well, here's what I understand about the system:

|
I read it, and it's the same conclusion that I reach. But what I didn't understand is the part that you talk about the teleport/disconnect. In this cases, the server will send me a packet with the entity remove?
Now I need to know what happens when I kill a mob... It's time to investigate! ^^
|
|
|
02/10/2014, 02:59
|
#7
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Reivein
I read it, and it's the same conclusion that I reach. But what I didn't understand is the part that you talk about the teleport/disconnect. In this cases, the server will send me a packet with the entity remove?
Now I need to know what happens when I kill a mob... It's time to investigate! ^^
|
Right. The entity is removed from the screen using that packet.
|
|
|
02/10/2014, 03:06
|
#8
|
elite*gold: 0
Join Date: Sep 2012
Posts: 9
Received Thanks: 1
|
Quote:
Originally Posted by Spirited Fang
Right. The entity is removed from the screen using that packet.
|
This packet that you say will be a General Data packet, true?
Thx for the info! ^^
|
|
|
02/10/2014, 03:07
|
#9
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
|
Quote:
Originally Posted by Reivein
This packet that you say will be a General Data packet, true?
Thx for the info! ^^
|
Right, with the removal subtype, which might be 135 or something around that.
|
|
|
02/10/2014, 03:16
|
#10
|
elite*gold: 0
Join Date: Sep 2012
Posts: 9
Received Thanks: 1
|
Quote:
Originally Posted by Spirited Fang
Right, with the removal subtype, which might be 135 or something around that.
|
Thank you so much! When I make something useful I'll show you! ^^
|
|
|
02/10/2014, 19:14
|
#11
|
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
|
i always thought the spawn in distance was 18 and the removal distances was 21.
Reason being, is if a player is 19 coordinates away then jumps, you still receive the packet. the client then updates the offset and removes the player.
|
|
|
02/10/2014, 20:00
|
#12
|
elite*gold: 0
Join Date: Sep 2013
Posts: 197
Received Thanks: 141
|
Quote:
Originally Posted by Ultimation
i always thought the spawn in distance was 18 and the removal distances was 21.
Reason being, is if a player is 19 coordinates away then jumps, you still receive the packet. the client then updates the offset and removes the player.
|
Anything more than 18 cells away gets removed, and you only receive jump packets of players that are in the 18 cell range.
At least if you're using the correct (TQ's) distance formula.
|
|
|
All times are GMT +1. The time now is 18:54.
|
|