Print at May 19, 2026, 10:53:28 PM

Posted by Keet at Mar 31, 2026, 8:36:14 PM
Re: Terrain Generator plug-in
Draw a simple room.
Start TerrainGenerator and set the gridsize to 25.
Elevate a few areas and generate the terrain object.

As long as you don't change the gridsize you can re-open the terrain and change it to generate a new terrain. That's good.
Checking the Home.xml file revealed that the gridsize was stored as 776 where I expected 25.

Now start the TerrainGenerator again with the same room and change the gridsize to 50. You get a lot of weird spikes and the gridsize value in the Home.xml file changed to 338.
Re-testing this I found that if you reset the gridsize back to the 25 I started with, then the terrain is restored to its correct form. But I wanted it regenerated with a gridsize of 50...

So I did some hacking: I manually edited the Home.xml file and set the gridsize to 25. The value that was set in the TerrainGenerator. Opening the project file is no problem. Starting the TerrainGenerator seemed to hang but eventually it came up with the correct terrain. And the gridsize value was again set to 776 smile

What is it with the weird gridsize value in the Home.xml file? I would expect that reopening the room in the TerrainGenerator would do something weird with such a strange value but it had some difficulty with the correct value 25.

Obviously something doesn't work as it is supposed to do. Thoughts:
After you changed the gridsize lock it to that room, don't allow it to be changed again,
or the better option, recalculate the room for the new gridsize. That is some difficult math because it adds or removes a lot of points. Obviously this can give weird results if you switch the gridsize from (for example) 15 to 99 or 88 to 17.
Recalculation might be necessary if rooms with different gridsizes are selected. You would probably need to recalculate all rooms to the largest gridsize of the selected rooms.

The easiest solution is to set a gridsize for the whole project, not for individual rooms, and once a terrain is generated don't allow it to be changed. Any change would require all elevation points to be removed and to start over. A gridsize for the whole project ensures that combined rooms all use the same gridsize. Most users will leave it at 50 anyway.

by-the-way: I didn't use the height-map options. For my current project I must see the home wire frame to create the terrain. But I'm going to give it a try to see how it works over my 25 rooms.

In short: changing the gridsize after the first generation breaks your terrain.
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects