0 votes

I'm trying to develop a house procedural generator, after trying to use meshes and CSG nodes, the easiest way I come up to do this was to use a GridMap with the house "chunks" and place they together in the GridMap, it's a lot more limited but as I don't have a lot of procedural generation experience, I think I'm gonna stick with the simpler way.

The thing is, I don't want just "metric" variation, I also want to use multiple textures, and it would be really annoying to create multiple meshes with the same shapes but with different textures, so, what's the best way to do this? Should I even use GridMap for this?

Godot version 3.3.2
in Engine by (61 points)
edited by

1 Answer

+1 vote

There is a more practical way of creating your MeshLibrary, through code! I describe how to do it as part of this answer.

Starting out in procedural generation with cubes seems like a reasonable choice, and GridMap is definitely capable of doing what you want. You can even generate new MeshLibrary items on the fly in a running project, if you do not need previews for those.

In terms of algorithm, you could generate a few touching room-rectangles, place floor, ceiling and walls, then punch doors. Each room can have different cell_items for it's walls and floor. You can add furniture as cell_items too (any shape and size should work if you make you MeshLibrary using a script).

Houses are often arranged as one big rectangle with smaller ones inside it, but other shapes tend to look better (semi random arrangement). With procedural generation, an important step is visualizing what you want, so since making a prototype isn't too hard, try making a few by hand first.

by (2,446 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.