Does anyone whats CCell:: structures and what do they do?

xarel

Member
Joined
Feb 9, 2024
Messages
5
0042A3B0 - CCell::EnterDoor
0042A410 - CCell::LeaveDoor
0042A420 - CCell::SendCellInfoEnter
0042AA90 - CCell::SendCellInfoLeave
0042ACA0 - CCell::SendAll
0042ADA0 - CCell::SendRange
0042AF40 - CCell::pSendAll<

I have no information about these address structures, what exactly do they do?
 
I'll answer this thread for public information, even though I know you've already gotten the answer (as we discussed in private messages). These cells are part of an optimization technique called spatial partitioning. I'm not exactly sure about how big a Cell is right now, but imagine that a map is virtually divided up into many even sized cells (for simplicity sake lets just call them 64x64, where the map size is 1024x1024). The benefit here is that when the server needs to iterate over many entities (such as players and mobs), it doesn't need to search for every entity in the map all the time.

Consider a player using a spell. Rather than looping through every player to figure out how far away they are from the spell in order to send relevant packets or combat effects, the server will instead only search the players within neighboring cells. This drastically reduces the amount of checks needed to be done by the server. It is similarly used for checking aggression, where a mob is looking for nearby players to attack. It obviously doesn't care about checking for cells on the other side of the map, so it can start by checking its own cell first to find a player.

You can read more about spatial partitioning here, but that's the gist of it. https://en.wikipedia.org/wiki/Space_partitioning
 
Back
Top