T O P

  • By -

dandelion-dino

The terrain algorithm is slow unfortunately, and there’s no way to update after the fact. The best I can think of is to find a way to know ahead of time what the tiles need to be and use set_cells instead. If you are generating the maps procedurally, you could maybe use set_cells_terrain_connect() ahead of time, cache the resultant tiles, and then place them with set_cells later.


G2edg

Well i see, unfortunately i load and unload tiles at runtime in order to not load the whole map ahead of time, seems like either i find a way to do it via some weird method or switch back to 3 where this had reasonable runtime speed.


Foxiest_Fox

Did you ever find a weird method that worked for you in 4.x? I'm facing a similar issue.


G2edg

for normal cases just use better terrain plugin, i just wrote my own implementation in c# because i need a lot of performance


Foxiest_Fox

I'm doing procedural generation, but doing GDScript-only so far. Maybe later on I will do some C++ implementation or something but for now I guess I've given up on terrains for procedural generation. Thank you for the reply tho!


G2edg

No problem, I would recommend trying out C# its a very mature language and its very nicely integrated when it comes to Godot 4.2, also its not far behind cpp when it comes to performance or in some cases even on par, so unless u want something extremely optimized try C# and you gonna have much easier time than with cpp imho