2023-05-21: Yes, we're back. No, you can't login yet

Ghost All Bricks

Uploaded by Queuenard

The add-on board icon. Server Mods
The add-on file name icon. Server_GhostAllBricks.zip
The add-on upload date icon. Oct 9th 2017, 3:35 PM
The add-on download count icon. 1,097

Description

This addon makes a server push ghost updates on all of its bricks so that a client ghosts every brick upon spawning.

  • Some credit goes to Crown for the some BottomPrint code and the original idea used on Jailbreak

Even with the disadvantages, this is probably pretty helpful for builds scattered across large areas.

Pros:

  • Never teleport into a new area and have to ghost bricks
  • Allow everyone to save the entire map without having to worry about bricks that are too far away and not ghosted
  • With the companion DLL, eliminate the lag from large builds caused by player objects doing brick searches

Cons:

  • Clients can get laggy from the quantity of bricks being ghosted
  • Loading new bricks and clearing all bricks are very slow. Example: 1.5 minutes to load 204k bricks, 4 minutes to clear them

New in 0.0.1:

  • Counting deleted bricks while ghosting has been removed as the SimSet class moves objects on the end to the positions formerly occupied by the deleted objects
  • Now supports a DLL companion, "GhostBuddy", which can completely disable normal brick ghosting and implement iterating through the master brick list in C++. Brick ghosting (scope query) happens every 5 seconds for every player, so large builds may otherwise suffer when large amounts of players are in the vicinity of a large amount of bricks.

The DLL companion is available here: https://notabug.org/Queuenard/GhostBuddy

You can use this client-sided script to check your ghosted brick count: $cbc = 0; for(%i = 0; %i < (%g = serverConnection).getCount(); %i++) {if(%g.getObject(%i).getType() & $TypeMasks::FxBrickAlwaysObjectType) $cbc++;} echo("Client detected "@ $cbc @" bricks");

Memory measurements, specifically addressing the impacts of large builds:

To store a copy of a brick inside a SimSet will require about 12 bytes for a Notify structure associated with the brick object itself. A Notify in the opposite direction is also created. As for the SimSet object list, 4 bytes for the memory address are used. Both Notify structures are also registered in the notifyChunker list, which contains all Notify structures in the engine.

With 2 Notify structures, 1 reference to each of those 2 Notify structures, and one reference to the address of the brick in the SimSet containing all bricks, it will take approximately 36 bytes to store a single brick in the SimSet. This closely matches measurements I've taken of large builds.

For a build with a million bricks, that would mean an extra 36MB of memory used.

Internally, a Notify structure, the structure used to keep track of information regarding when an object needs to tell another object about events, such as object deletion, is used with each brick to keep track of references to the brick from other objects. It's how SimSets and SimGroups are told when a member object is being deleted, so the object can be deleted from the set. If the SimSet itself is deleted, it also needs to delete all the Notify requests it placed onto its children objects.

Comments (0)