How the client "despawn" a player/mob?

02/09/2014 17:41 Reivein#1
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 Ultimation#2
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 Spirited#3
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 Reivein#4
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 Spirited#5
Quote:
Originally Posted by Reivein View Post
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:
[Only registered and activated users can see links. Click Here To Register...]
02/10/2014 02:49 Reivein#6
Quote:
Originally Posted by Spirited Fang View Post
Well, here's what I understand about the system:
[Only registered and activated users can see links. Click Here To Register...]
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 Spirited#7
Quote:
Originally Posted by Reivein View Post
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 Reivein#8
Quote:
Originally Posted by Spirited Fang View Post
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 Spirited#9
Quote:
Originally Posted by Reivein View Post
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 Reivein#10
Quote:
Originally Posted by Spirited Fang View Post
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 Ultimation#11
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 SteveRambo#12
Quote:
Originally Posted by Ultimation View Post
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.