Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

feat(engine): rewrite player_info & npc_info packets#986

Merged
Pazaz merged 9 commits into2004Scape:mainfrom
ultraviolet-jordan:feat/renderers
Nov 9, 2024
Merged

feat(engine): rewrite player_info & npc_info packets#986
Pazaz merged 9 commits into2004Scape:mainfrom
ultraviolet-jordan:feat/renderers

Conversation

@ultraviolet-jordan
Copy link
Copy Markdown
Contributor

  • Caches player & npc update blocks. They are cached arrays. Appearances stay cached forever until a player is removed from the world.
  • Is able to know the sizes of update blocks before writing the packets.
  • Exact move is still written on demand because of the observer problem.
  • Renames mask to masks.
  • Removes this.alreadyFacedEntity property.
  • Keeps all of the effective results as before.
  • Removes the static masks from Player/Npc and creates a new InfoProt class.
  • Removes a bunch of lookups to World.getPlayer or World.getNpc

My testing shows about a 40-60ms gain in performance on the high end.

Applying masks to 2000 players in a single tick.

2000 dense/sparse players idling.

Logging in is slightly faster because of the caching.

Idle (Sparse)

Before

image

After

image

2000 Updates (Dense)

Before

image

After

image


Dense is faster to loop than sparse because our getNearbyPlayers function works faster with a smaller "view distance".

@Pazaz Pazaz merged commit 49736ee into 2004Scape:main Nov 9, 2024
Pazaz added a commit that referenced this pull request Nov 11, 2024
## Content Changes

### Features

* #973
* #985

### Fixes

* #966
* #969
* #971
* #981
* Smithing daggers level-up typo
* Item spawns update

## Engine Changes

### Features

* #972
* #979
* #986

### Fixes

* #975
* #977
* #978 - movement bug
* #983
* #987
* Don't send UNSET_MAP_FLAG when standing still
* Soundscape song crash
* Authentic Loc category config code
* Authentic Obj tradeable config code
* InvType safety in player save
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants