-
Notifications
You must be signed in to change notification settings - Fork 47
World Processing Cycle
Each section is listed in order.
- world queue
- NPC spawn scripts
- NPC hunt
- read packets
- calculate pathfinding request (if not using clientside pathfinding)
note: pathfinding calculates once at the end to save processing time! do not do it for every move packet
note: if using clientside pathfinding, the server still has to validate the input (like every other packet should)
- if not busy:
- resume suspended script
- stat regen
- timer
- queue
- movement
- theory:
movecheck
trigger, to conditionally cancel movement (bind effects)
- theory:
- modes
- null, none, wander, patrol, playerescape, playerfollow, playerface, playerfaceclose, op/ap interactions
note: npc stat regen is done at the engine level here, not like player stat regen
note: null mode will set to default mode this tick, which will run starting next tick
- timer
- queue
note: controllers do not exist in these early years. Included for completeness.
- resume suspended script
- close interface if strong queued
- primary queue
- weak queue
- timers
- soft timers
- engine queue
- levelup trigger (queued after gaining a level)
- area trigger (not in 2004)
- (maybe run energy restore?)
- loc/obj interactions
- movement (the pathfinding request)
- theory: run
movecheck
trigger, to conditionally cancel movement (bind effects) - theory/custom: run
move
trigger, to execute a script when entering a new tile (area system does not exist in 2004)
- theory: run
- player/npc interactions
- close interface if attempting to logout
note: player stat regen is a soft timer
note: player run energy is at the engine level (not controlled in runescript)
note: weak queues were introduced september 2004, and strong came separately after that
note: while movecheck is just a theory, we are able to override freezes with other effects which proves there can only be 1 registered trigger
note: this isn't observable to test, so may be swapped with the section below (loc/obj despawn/respawn)
- map update (load new zones)
- player info
- npc info
- zone updates
- stat changes
- flush packets