Skip to content

World Processing Cycle

Pazaz edited this page Nov 20, 2023 · 39 revisions

Each section is listed in order.

Some unknowns...

  • run energy recovery processing details: where does it live in player processing
  • longqueue processing details: where to execute accelerated scripts/discard scripts
  • how they cancel logout e.g. a trigger called "logout" that runs when the player requests to logout
  • how they cancel movement e.g. a trigger called "movecheck" that runs pre-movement

World processing

  • world queue
  • NPC spawn scripts
  • NPC hunt

Client input

  • 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)

NPC processing

  • if not busy:
    • resume suspended script
    • stat regen
    • timer
    • queue
    • movement
    • modes

note: npc stat regen is done at the engine level here, not like player stat regen
note: null mode will set to default mode (config) this tick, which will run starting next tick

Controller processing

  • timer
  • queue

note: controllers do not exist in these early years. Included for completeness.

Player processing

  • resume suspended script
  • close interface if strong queued
  • primary queue: normal, strong (late 2004+), soft (osrs?)
    • running strong clears weak queue
    • do not run if busy (delayed || modal)
  • weak queue
  • timers
  • soft timers
  • engine queue
    • levelup trigger, queued after gaining a level
    • area trigger, not in 2004
  • loc/obj interactions
  • movement (the pathfinding request)
  • player/npc interactions
  • close interface if attempting to logout

note: player stat regen is a soft timer
note: player run energy recovery 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

Player logout

  • remove player if they have nothing in their queue

Loc/obj despawn/respawn

Client output

  • map update (load new zones)
  • player info
  • npc info
  • zone updates
  • inv changes
  • stat changes
  • flush packets
Clone this wiki locally