Closed Anyeos closed 2 years ago
Try decreasing your view distance. What is it set to and how much RAM do you have? Are you using the 64-bit version and a 64-bit kernel?
Sounds like a duplicate of https://github.com/Zylann/godot_voxel/issues/97
Thank you for the support and maybe you are right it can be a memory problem but not with my computer but the project settings itself. I have 16 GB of RAM and 4 GB of VRAM there are no slowdown at all only a crash. All my system is a 64 bit and as you can look I am using a 3.2.1-custom build of Godot just pulled yesterday.
Ubuntu 19.10 64 bits with default kernel.
But I want a very far view distance because I am interested on developing a procedural FPS game with large terrains and view distance. I will use FOG to hide that but I need a far credible view distance.
I just look that on the final example that uses a shader to achieve a better terrain simulation. I am just expecting something like that too as a final result. So I think it is achievable.
Well I don't find such an option to limit memory for my project except some about the mesh buffers and video. I don't think a voxel can fill the video memory so easy. Specially when I check it is using only 30% of VRAM and the pipeline is used at 3% only. There are a lot of margin power to handle that.
All that is using is a lot of threads and full 8 cores CPU but there are still a lot of System Memory because it is using 2GB.
I will investigate what is happening with the pool. Maybe it is a problem with threads that are trying to use the same memory space than another thread.
Sounds like a duplicate of #97
Yes, it appears to be related. There are some problem with the actual code that is reproducible so fast on my computer. I have 8 cores maybe if there are more cores it is more suceptible to crash. It is a must to solve that code because actually is of no use.
I discovered that Godot have hardcoded the memory pool allocation as (1 << 16) that is 65536. I changed it to (1 << 18) and now it is working as expected.
Of course I need to change it to the export templates too. I cannot export the game for now but I will try to solve that in a future.
Cool, what file is that in? I've noticed my Godot executable crashing with this error when it only has allocated ~3GB, even though I have plenty more.
On the file core/pool_vector.h there are the declaration:
static void setup(uint32_t p_max_allocs = (1 << 16));
Or if you want you can modify it on core/register_core_types.cpp:
MemoryPool::setup();
You can specify the ammount there just by someting like:
MemoryPool::setup(1 << 20);
This is quite curious because the biggest memory buffers allocated by this plugin (i.e voxels) are not using Godot's containers. However I suppose this is caused by mesh data because these are a Godot thing (I didn't know they stayed in memory, if there is an option to turn that off it would be cool). PoolVectors were removed in Godot's master branch, so that sort of error should no longer occur in the future.
Going to close this because PoolVector limitation is no longer present in Godot 4, and in Godot 3 it needs tweaking and shouldnt actually crash. Though if it still crashes in Godot 3 that can be fixed if it happens within the module.
Adding a VoxelTerrain with VoxcelGeneratorNoise Sdf with an OpenSimplexNoise with default configurations, next pasing some seconds crash the entire program (except of course the Godot Editor).
I will do furter investigation but for now I only have time to post this issue and include some log: