Telarin
So I've been having some issues the last few days with the FPS character dropping through terrain after walking around for a while. I haven't really tinkered with the FPS controller, other than to add some code to track stamina loss when running and climbing steep terrain, other than that, it is the out-of-the-box unity FPSController. I am not sure what could be causing the issue, and cannot really pinpoint any changes that I made recently that might be connected. Are there any things that you can suggest I look for?
0 0
Telarin
After a little experimentation, I have noticed a few things. This is much more common on my clunky computer than on my good computer. However, if I move a little, wait until I can see the close LODs change, then move some more, and repeat, I never fall through. My working theory is that under some circumstances, VF is simply not generating collision meshes fast enough, and I am able to walk off of the mesh.

Are collision meshes generated for all LODs, or just the closest LODs? Is it possible that there are seams between the LOD2 and LOD3 collision messages that I am falling through if the LOD3 meshes are not replaced with LOD2 fast enough as I move from cell to cell? I assume from what I can see when dropping into the game, that VF generates meshes in a simple grid traversal. Would it be possible to change this so that closer LODs have a higher priority? Maybe have multiple priority mesh generation queues, and take care of the closest ones first before processing the further LODs?
0 0
ncpaddler
And therein lies our greatest challenge.

The colliders not updating quick enough seems to be the first gamebreaking sign that you get in all these voxel solutions when FPS gets low. Even before you get laggy, the colliders may fail. I've got full source versions of uTerrains, TerrainEngine, and Voxeland and they all have the same problem. Even 7 days to die allows you to fall through at times. I think that's why most voxel games severely limit your running speed while on surface. Empyrion does an amazing job with this even though I have fell through once or twice and jammed my SV through the colliders and into enemy bases a couple times. They must have an extremely optimized system throughout and this is probably one reason they don't go with larger planets yet in that game.

Voxelfarm is amazing in that it provides extreme terrain view distances that load up almost instantly and still keeps the colliders updated at a manageable rate. I've often wandered if we could limit the number of times the VF terrain tiles, if it would help any with optimization. For the worlds I'm working on now, I really only need 3 tiles. But I suspect that this has already been considered and the advantage would be minimal.

I do know that in voxelfarm.cs you can adjust:

public const int MAX_COLLISION_LOD = LOD_0+3;

to set how far out from player the colliders update. I usually go with LOD_0+4

I think a larger world scale might help too by making the size of each collider larger.

Other than that, as far as I know this is the main reason to optimize everything.

I always hope to get more info regarding this as I have probably fell through all kinds of terrains a million times or more in the last year... lol
0 0
voxelfarmtorres
There is no reason why you should fall through the terrain.

If colliders are not generated for all LODs, the real issue is your character may be outrunning the world generation. For any dynamic content, this is always a possibility.

The first thing to check is that you are running an optimized build of the Voxel Farm DLL. Have you recompiled the DLL at any point?
0 0
Telarin
I have recompiled it to expose a "GetHeight()" method to the plugin, however, the problem occasionally occurred before that. Since this problem mostly occurs on a lower performance machine, outrunning the generation of the collision meshes is exactly what I believe is happening. Because of that, I'm thinking this won't be any easy thing to solve. What order does VF generate collision meshes? Is it a simply row/column traversal, as terrain seems to be, or something more optimized to do the nearest first? If it is the former, I'm thinking using a spiral algorithm to make sure that the closest collision meshes are always regenerated first might be enough to solve the problem in most situations. You would still have to potentially worry about other objects falling through terrain at further distances, but at least you should be able to keep the character on top of the terrain the majority of the time, even on slower machines.
0 0
Telarin
Is the generation of terrain and collision meshes multi-threaded? If so, how many threads does the Unity Plugin implement for this out-of-the-box? Is it possible to increase the number of threads available for this process?
0 0
voxelfarmtorres
Voxel Farm is optimized for multithreading: procedural generation, streaming of voxel data, contouring and mesh simplification occurs simultaneously for different scene chunks. There are some serial aspects, however, that are imposed by the host game engine. In the case of Unity, baking collision meshes and uploading mesh data must happen in the main thread, so no matter how many threads you want to engage, Unity's processing may be the bottleneck and more threading may not make a difference.

If your issue occurs with your clunky PC, increasing the number of threads is not likely to help. Most likely this PC has fewer cores. I need to double check this with the engineers tomorrow, but my understanding is by default, Voxel Farm will engage four threads.

Your scene configuration and voxel size will have the greatest impact on this. By default, Voxel Farm uses rather small voxels (typically 64 times less volume than games currently featuring voxel terrain). Have you selected a voxel size already? We may be able to provide some pointers there. Also, your game mechanics may allow you to start the scene at a higher LOD, and increase resolution only for voxel content that requires the extra resolution.

We would like to know more about your project. If you write us to support at voxelfarm.com, we can arrange a one-on-one with our devs. Depending on schedule, we may even get you in a call with Miguel (our CEO and Founder). Miguel likes understanding what types of projects are using Voxel Farm and he will make sure you are getting the best throughput while achieving your artistic goals.
0 0
BRStevens
I'm always falling through the world - even with just a simple test project in UE4. I can usually walk for a few feet, but then I just drop through. Is there a simple fix for this?
0 0
voxelfarmtorres
When this happens the first thing to check is whether you are setting new focus positions to the clipmapview:

https://www.voxelfarm.com/doc.html?controlling-scene-focus-2

Is this step included in your simple tests?
0 0
BRStevens
Worked through this one - thank you! It did have to do with scene focus but also some tinkering with detail distance as well. Even with focus moving with the actor the scene wasn't generating the collision mesh fast enough. It's going well no with some minor adjustments. Thanks for the help!
0 0