So I am finishing up my first project in blender (it’ll be put in finished games probably by the end of the week or next week) and my partner and I are starting to brainstorm our next game. We wanted it to be randomly generated and we saw piichan’s level generator and thought “wow, this would be a really useful tool!”, but we quickly ran into problems. The AI we had planned out would use a navigation mesh, something that needs to be done in advance as far as I know, and on top of that piichan’s generator doesn’t work in the latest version of Blender. So then I started thinking about what I’ve coined in my head as modular generation, I’m sure there’s probably a real term for it, but I don’t know what it is. Basically you have several different rooms already planned out and the generator puts them all together in a random order. I know this is possible, but Im not sure how to go about it. Any advice, or even better does someone already have an example of this in the BGE?
When it comes to the AI at least, there are some resources that show how to do a node-based pathfinding system as an alternative (nodes can at least be created during the generation).
There’s also some resources on random generation, but it depends on whether you want the game engine to have a sort of grid or walker system to lay down random modules or you want to do it during the general modeling phase (which the latter would also allow navmeshes).
Lego ? Here is one screwy example but it needs proper real time lighting and shadows , which is not happening in the bge.
LevelGenerator 001.blend (98.1 KB)
This one is bugged too. At some point the distance between objects is not the same anymore.
LevelGenerator 002.blend (105 KB)
Modular generation is a topic I’ve been playing with for at least a year in the BGE. I have many examples, some being generated by a single object, some being generated by a preplaced grid of empties (which I find to be the better option).
I’d use the empties method, and have nodes align themselves to certain points once the modules are added in.
Here is another version but with lots of problems.
LevelGenerator 005.blend (152 KB)
Hmm, I like Michelle’s idea. Having a bunch of nodes that the modules could be placed on makes sense, and would allow for fairly easy implementation. I’m also thinking of grouping the different pre-made rooms into categories of how intense/interesting they are so I can place them in a manner where the game would feel paced. Like have a 1 rated room, then a 3, then a 5, then a 4, then another 1, then a boss, something like that. The nodes would lend themselves to that sort of system. Thanks for the input guys!
I am using modular building components in my game,
Due to instancing and ram, duplicated sections are “cheaper” then unique sections,
having “wall section B” “window section A” you could in theory generate a real building…