of     1   

cjcool12345
#216980256Saturday, May 20, 2017 9:45 PM GMT

1. Background ============= I'm working on a game which loads smooth terrain around the player, and occasionally generates an island in the distance. I load this terrain in chunks to avoid the Region3 size limit, reduce the amount of writing necessary, and to provide an easy to use interface to expand the game. 2. The Problem ============== The problem is, an island takes a considerable amount of time to generate. This delay means that any new requests to load voxels is delayed until that island finishes generating. From what I've been able to inspect, I can not resolve this in my own code. The island can not be loaded at another point in time (the delay is unavoidable), and the data I supply to load the voxels has already been generated at this point. As a Roblox developer, it is currently impossible to prioritize chunks closest to the player. 3. Solutions ============ There are 3 possible solutions I can think of for this problem. 3.1. Provide a Loaded event --------------------------- An event could be provided that fires when voxels finish loading. With this solution, I would have to loop through a queue of voxel data (in the order I want them to load), and use the Loaded event to wait for the voxels to finish loading before continuing to the next chunk. 3.2. Provide a priority to WriteVoxels -------------------------------------- The WriteVoxels method could be modified to take an integer (higher priorities first) that specifies it's priority. Internally, this priority could be used to determine what chunk of voxels to load first. The new WriteVoxels signature could look like this (had to remove less-then, greater-then signs to post this forum): void WriteVoxels ( Region3 region, float resolution, array array array Material materials, array array array float occupancy, int priority = 1 ) By adding the new parameter last with a default of 1, this solution will be completely backwards compatible. 3.3. Prioritize closest chunks ----------------------------- Internally, collections of voxels closest to a player could be generated first. 4. Upsides and Downsides ======================== I personally think solution 2 offers the most benefit, and the least downsides. Solution 1 would require a different approach to loading voxels (requiring the largest amount of changes to existing games). Solution 2 would require significantly less effort (on my end), although the priority of a chunk could not be modified once a request to write it is made. Solution 3 would require no changes to the game, but might have unintended behavior with games that strategically target which voxels to write first. 5. Thank You ============ Thank you for reading this. Roblox is a community, so please reply if you have any of your own ideas, solutions, etc. I want this game I'm creating to have as much value to it's players as possible, your support helps to make that possible!
DaMagicScoot
#216983051Saturday, May 20, 2017 10:28 PM GMT

This sub-forum is for Suggestions and Ideas for ROBLOX, not scripting problems. Please repost here: https://forum.roblox.com/Forum/ShowForum.aspx?ForumID=33 Watch: https://www.youtube.com/watch?v=voqYX8_VjvQ
Pumaface011
#216983092Saturday, May 20, 2017 10:29 PM GMT

^ what he said
cjcool12345
#216987913Saturday, May 20, 2017 11:48 PM GMT

I did post suggestions (I just happened to state the problem first). And although my suggestion is related to scripting, it's not a problem with my own code.
AdhesiveDiamond
#216988087Saturday, May 20, 2017 11:50 PM GMT

no support cuz u got a stupid helmit on
ethanlaj
#218093544Saturday, June 03, 2017 10:05 PM GMT

no support cuz u got a stupid helmit on [2]

    of     1