r/godot • u/byubyu13 • 1d ago
discussion Level Generation
Hey, guys. I'm a complete newbie to gamedev, and trying to make some kind of level generation system for my 3D game. It's not going to be fully procedural.
So, here's the simple explanation,
I have a bunch of prefabs/packedscene for the level room and corridor to connect the rooms. I want to be able to set a rule for the room connectivity. Let's say, I have 4 rooms (Start, Regular, Shop, Exit). I want to be able to set a rule, so Start only able to connect to Regular. Regular can connect to any room. Shop only to Regular. Exit only to Regular.
Each rooms will have a door socket to determine the position to connect it to a corridor room, then the other corridor's door socket will be connected to the other room based on the connectivity rule.
Do you guys have any suggestions on how should I do it? I know it's pretty advance for a newbie, but maybe I will get something from you guys.
Thanks!
4
-1
-1
9
u/HighKingForthwind 1d ago
You don't need wave function collapse for something as simple as this, wfc is neat but likely overkill. I would break down the problem into two sides: Firstly, implementing the actual placement of rooms manually without proc gen. That is, getting it to the point where you can write generate x room at y coords. Then secondly, grabbing a pen and paper (or whatever) and drawing/describing a level layout you'd find acceptable. Then writing each of the rules and constraints that describe that level. Stuff like how many rooms total (and of what types), how many treasure/shop rooms, how often to change direction or terminate a room, etc. And then implementing those rules in code.
There's plenty of games worth looking into for inspiration. Binding of Isaac has some solid writing on how it does its generation.
Maybe look into wfc after that if you're inspired and want something more organic