Character location when zoning
Moderators: Community Managers, Developers
Character location when zoning
I am having some problems with a really trivial detail.
When a character zones between chunks, they are set with an IsZoning() flag until they are established in the next chunk. If you watch the character's location, after the flag has been removed they will still show a location from the previous zone (but the correct chunk now), and then at times an additional location that is different, but still in the previous zone, and then eventually they will show their coordinates in the new zone.
The reason this matters:
When a character with a pet zones, the pet will notice that their owner is no longer in the same chunk through their movement AI. They will then be removed from the previous chunk and added to the new chunk. They also need to be placed in the same location as the character. This means that right now, even after the character has completed their shift into the next chunk, for several cycles the location is invalid; it is from the last chunk, so the pet might be sent all the way across the zone to the other border.
The only solutions are to wait some specified period of time before moving the pet to the new location (to make sure it is correct), or to warp the pet if it is particularly far away from the owner. The second option is not really ideal and more of a workaround, and the first is a little messy, as in 'how long do we wait?'. If anyone understands the zoning mechanics a little better and can find out why after the character has zoned it takes a second or two to start showing the correct character location, I'd be glad to know, and perhaps we can fix it.
When a character zones between chunks, they are set with an IsZoning() flag until they are established in the next chunk. If you watch the character's location, after the flag has been removed they will still show a location from the previous zone (but the correct chunk now), and then at times an additional location that is different, but still in the previous zone, and then eventually they will show their coordinates in the new zone.
The reason this matters:
When a character with a pet zones, the pet will notice that their owner is no longer in the same chunk through their movement AI. They will then be removed from the previous chunk and added to the new chunk. They also need to be placed in the same location as the character. This means that right now, even after the character has completed their shift into the next chunk, for several cycles the location is invalid; it is from the last chunk, so the pet might be sent all the way across the zone to the other border.
The only solutions are to wait some specified period of time before moving the pet to the new location (to make sure it is correct), or to warp the pet if it is particularly far away from the owner. The second option is not really ideal and more of a workaround, and the first is a little messy, as in 'how long do we wait?'. If anyone understands the zoning mechanics a little better and can find out why after the character has zoned it takes a second or two to start showing the correct character location, I'd be glad to know, and perhaps we can fix it.
Re: Character location when zoning
Unlike with rifting when changing chunks via zone line we don't have a way of knowing exactly where the player ends up as far as I know. The client tells the server where the player is and those location updates are probably just on a slight delay when changing chunks. That said you can roughly guess where the player will be.
If you're in chunk -13, -9 for example and you move to -12, -9 you've changed to a different chunk on the X axis. If you flip the sign of the player's X location before they chunked you'll be pretty close. Same concept applies for changing to a different chunk on the Y axis.
If you're in chunk -13, -9 for example and you move to -12, -9 you've changed to a different chunk on the X axis. If you flip the sign of the player's X location before they chunked you'll be pretty close. Same concept applies for changing to a different chunk on the Y axis.
Re: Character location when zoning
I thought about that and hoped I wouldn't have to get that clever. I may just need to do something like that. Right now I'm having some trouble testing this out because I thought I was randomly crashing to desktop (but not the server) from my pet code, but it turns out that happens if I keep rifting pretty quickly even without having a pet.
Re: Character location when zoning
Positioning when crossing chunk lines was a common issue in Live. When watching the dot of group members when they cross the border, you'd often see them snap halfway across the chunk before snapping back to their actual location. This was especially a problem if you were on a flying mount. The game would often dismount you if the new chunk had a no-fly zone, as I think it believed you were in there for a frame and kicked you off the mount. Anyone heading to PotA dealt with it so often it was a surprise when you weren't knocked off.
Re: Character location when zoning
Yes, I'm definitely not trying to replicate Live's behavior on chunking...it was usually a mess.
Re: Character location when zoning
I'll add the formula in for chunking because it is really pretty simple. Now I just have to figure out how to tell if the character was chunking naturally or rifted, from the pet's point of view. It's obvious if it is between non-adjacent chunks, but otherwise I'll have to dig in a little for the rest.