Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Tutorial

Reading BaseNetworkable entity dictionary without hitching or FPS drops

ptr_arithmetic
C++ Wizard
MEMBER
прадстаўнік: 162
Дата далучэння: May 2018
Паведамленні: 73
Дзякуй: 42
1 месяцаў таму · Jul 2, 2026 10:32 AM
#1

In Rust, BaseNetworkable.clientEntities contains thousands of world objects (trees, ores, barrels, animals, players).

If you iterate all 15,000 entities every frame, your external overlay will drop to 20 FPS.

Multi-Threaded Entity Caching Solution:

  1. Spawn a dedicated background worker thread that iterates clientEntities once every 200ms.
  2. Filter and store active players (BasePlayer) and relevant loot in an atomic thread-safe double buffer.
  3. The main render thread only reads the small cached array of ~30 nearby players at 144Hz.

Zero frame hitching, render overlay runs at solid 240 FPS!

unity_il2cpp_dan
IL2CPP Reverser
MEMBER
прадстаўнік: 46
Дата далучэння: Jun 2020
Паведамленні: 4
Дзякуй: 15
1 месяцаў таму · Jul 2, 2026 12:33 PM
#2

Double buffering entity lists with std::atomic<bool> flip flag is the best architectural pattern for external game overlays.

imgui_artisan
UI Designer
MEMBER
прадстаўнік: 202
Дата далучэння: Apr 2019
Паведамленні: 54
Дзякуй: 28
1 месяцаў таму · Jul 3, 2026 7:48 AM
#3

Implemented this and CPU usage dropped from 28% down to 1.2%.