TheDudeFromCI / Bones3

Bones³ is a Voxel Editor for Unity. Supports both in-game and in-editor building.
MIT License
58 stars 12 forks source link

BlockWorld Dedicated Thread #10

Closed TheDudeFromCI closed 4 years ago

TheDudeFromCI commented 4 years ago

There are massive performance gains to be had by moving the block world handling to a dedicated thread, per world. A "pseudo-server" set-up. The main thread can then poll this secondary thread for events involving the block world, such as getting or setting blocks. Scripts that analyze chunks can run on this background thread as well to avoid hanging the main thread when doing many calculations.

The BlockList object is also a useful tool here as this can also be moved to the secondary thread to make adding or removing block types easier without worrying about concurrent modifications. When new block types are added or removed, these batches can be sent as a single request to the block world thread to load and modify all chunks according to these changes.

TheDudeFromCI commented 4 years ago

This feature has been implemented.