-
Notifications
You must be signed in to change notification settings - Fork 53
Zone Protocol
Static means "in the map data at startup"
Dynamic means "changed at runtime"
-
PARTIAL_ENCLOSED
is used to send this tick's changes. A new shared buffer must be created each tick there are changes. -
FULL_FOLLOWS
clears the zone of changes and is sent while loading. Static map changes that happened in the past are sent here while loading. - Public
OBJ
events are sent individually withPARTIAL_FOLLOWS
while loading.FULL_FOLLOWS
is still sent, right before this. - Private
OBJ
events are not enclosed and get sent individually withPARTIAL_FOLLOWS
. - Public changes (
OBJ
/LOC
) and transient events (projanim, locmerge) are sent withPARTIAL_ENCLOSED
. - Private items do not combine with public items, new stacks are always created. Attempting to pick up one will take the public item first.
- Teleporting to another floor (i.e. taking stairs) will clear zones and send FULL_FOLLOWS for the current level.
- Tracks 3x3 area of zones around the player. With 48 as the center zone start, 24 is -3*8, 72 is +3*8.
OSRS: logging into an area does not show items that were previously dropped by players.
Under each UPDATE_ZONE line is the build area-relative coordinate.
Zone base: build area x, build area z, level
Loading 3206, 3224, 2
. This is right by lumbridge bank booths. There are normal log spawns nearby
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 24, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 32, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 40, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 48, 2
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 24, 48, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 24, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 32, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 40, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 48, 2
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 48, 48, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 48, 48, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 72, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 24, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 32, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 40, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 48, 2
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 48, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 48, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 72, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 24, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 32, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 40, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 48, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 72, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 24, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 32, 2
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 72, 32, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 40, 2
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 72, 40, 2
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 48, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 56, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 64, 2
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 72, 2
Logging in after someone has lit 2 normal logs (same location)
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Packet received: LOC_ADD_CHANGE
Packet received: LOC_ADD_CHANGE
Loading 3217, 3276, 0
. This is in between both lumbridge farms
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 48, 0
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 24, 48, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 24, 72, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 32, 72, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 40, 72, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 48, 72, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 64, 0
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 64, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 64, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 56, 72, 0
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 72, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 72, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 56, 72, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 64, 72, 0
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Zone base: 64, 72, 0
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 24, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 32, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 40, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 48, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 56, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 64, 0
Packet received: UPDATE_ZONE_FULL_FOLLOWS
Zone base: 72, 72, 0
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_ADD_CHANGE
Normally
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_DEL
Partial zone update: LOC_ADD_CHANGE
In between two zones
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_DEL
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_ADD_CHANGE
Normally
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_DEL
Partial zone update: LOC_ADD_CHANGE
In between two zones
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_ADD_CHANGE
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_DEL
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_DEL
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_COUNT
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: OBJ_DEL
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: OBJ_DEL
Partial zone update: LOC_ADD_CHANGE
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_DEL
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_ADD_CHANGE
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_DEL
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: OBJ_DEL
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: MAP_PROJANIM
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_ADD
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: MAP_PROJANIM
Packet received: UPDATE_ZONE_PARTIAL_FOLLOWS
Packet received: OBJ_COUNT
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_MERGE
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: SOUND_AREA
Operating the spinning wheel in lumbridge castle
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: LOC_ANIM
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: MAP_PROJANIM
Partial zone update: MAP_ANIM
Partial zone update: SOUND_AREA
...
Packet received: UPDATE_ZONE_PARTIAL_ENCLOSED
Partial zone update: OBJ_DEL
The way I see it, it should really just be... and this is some kotlin pseudocode, but that's irrelevant:
class Zone {
private val enclosedEvents: List<ZoneEvent>
private val followsEvents: List<ZoneEvent>
fun addEvent(event: ZoneEvent) {
// determine the collection based on the event
// e.g. map anim would go in enclosed, but obj add prob in follows
collection.add(event)
}
}
interface ZoneEvent : OutgoingPacket
class LocAddEvent(packet_properties) : ZoneEvent // packet impl etc
Zone would furthermore have another collection to actually store information of every loc that exists. Don't mix the visual representation of packets w/ the underlying data. Whenever you add a new loc to the collection, you also add a locadd event to the zone events. Same with deletion, etc.
(The below is regarding syncing old changes done to zones in the past, e.g. a tree that spawned 30 seconds ago) This other collection needs to contain information of two types - the original loc(or lack of) and the currently-visible loc, so that you can determine/on-demand build a list of old events that happened in the past by comparing the original loc and the currently visible loc, e.g:
- If original loc exists, and current loc != original, LocAdd(currently_visible_loc)
- If original loc does not exist, and current loc exists, LocAdd(currently_visible_loc)
- If original loc exists, and current loc does not exist, LocDel(original_loc)
- Otherwise, do nothing - only if both are the same (either both nulls, or both equal in value)
So whenever you actually spawn a loc, you'd be doing something like....
class Zone {
// other shit above
fun addLoc(loc: Loc) {
val existing = locCollection.add(loc)
if (existing == loc) return // no need to change anything if equal
events += LocAdd(loc)
if (existing != null) {
removeClipping(existing)
}
addClipping(loc)
}
}
... etc