![]() ![]() The client will still need a VoxelViewer, which will allow the terrain to detect when it can unload voxel data (the server does not send that information).That means if a client receives an edited block in the meantime, the generating block won't overwrite it. If you use asynchronous generation, note that blocks written with try_set_block_data will cancel blocks that are loading. If you want the client to generate the block locally, you could use the generator to make one with generate_block_async(). When a box of edited voxels is received from the server, you may use a VoxelTool and the paste function to replace the edited voxels.When a block is received from the server, store it inside VoxelTerrain by using the try_set_block_data function. Add a script handling network messages.Voxels will only load based on what the server sends. Configure VoxelTerrain with a mesher and maybe a generator, and turn off automatic_loading_enabled.You can get a list of network peer IDs by calling get_viewer_network_peer_ids_in_area(origin, size). Voxels inside may have to be sent to all players close enough. This function will be called each time voxels are edited within a bounding box. In your VoxelTerrain script, implement func _on_area_edited(origin, size).On VoxelTerrain, enable area_edit_notification_enabled. ![]() This will make the terrain load blocks around it and notify when blocks need to be sent to the peer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |