Monday, 18 December 2017

Level generation

Time to start putting all these bits together, the prefab editor is coming along nicely and we need to start thinking about how those prefabs join together to procedurally generate levels.

The levels have a 'widget' that is placed at the join points for each prefab, this gives hints to the generator where to join the next prefab on, then its a simple bounds check and rotation to connect bits of the level together.

Oh yeah, probably need to stop/limit the amount of prefabs to join at some point, otherwise we just keep going in one direction until we hit the max prefabs limit. Ooops

After adding a branch limit, might as well 'cap' off the end of a branch if there is room.

Finally, the editor now supports setting the bounding box for the prefab by hand, so that we can tighten the bounds to the join points, otherwise bits of the model like the rocks under a platform could make it hard to join a section onto anything else.

Still some possible bugs lurking around but its now building some fairly interesting levels, next we need to build a lot more prefabs =D