Making editable maze terrain


I want to improve my simulator ‘arena’ which so far consists of a box floor and box walls. I need a real time editable terrain generator. To keep it simple I split my arena into a 10x10 grid and when I click with my mouse on a specific place which belongs to a square on the grid I need a block to popup there so I can just click edit the whole maze (right click removes the block and leaves just floor there).

Is there an easy way of doing this using height maps? I did some digging around and found nothing suitable. I see there is a way of generating a rawheightmap from an image which means that I would have to generate a new grid image everytime I click and then load the height map in from there. The issue is that I need to be able to do this when there are units on the arena and I’m worried that they will fall through when the arena is being rebuilt.

So far the best plan I have is to build everything on the fly using planes and planecollisionshapes. Is that a viable solution?

You’re mixing a few things here like collision and actual visible terrain. Just keep and modify the heightmap of the terrain and the collision shape (if you use physics) - its a simple array of floats for the height values. The rest can be done with simple ray casting (see beginner tutorials).

The thing is that from what I saw in the tutorial, using float arrays like that makes the map interpolate from value to value which is not what I want (I need straight edge walls) but I’ll try it and see what I get. Thanks for the answer.