I started looking at the remaining time this week, and drew up a schedule to follow. I then proceeded to immediately miss all of the excessively aggressive deadlines. The goal for this week was to wrap up generation- not necessarily the pretty stuff, but to complete it sufficiently to begin pursuing the rest of the new map stuff. It’s incredibly difficult to extract much of any topics of interest from this week. But in the order than they happened:
Fixing the previous bugs
You might recall this bug from last week, zones not getting their wall edges when part of their generation chain hit an error and got undone. Turns out the problem is that the remaining zones weren’t getting passed to the wall generator on account of the error, and they didn’t get undone from the error either. A simple fix of actually undoing failed generator chains.
Adding new generator constraints
The area generator for a single town basically needs to deal with two constraints: Don’t generate more than X zones, and don’t create a single zone chain longer than Y zones from town. I ended up handling these constraints by having the various generators take in the maximums relative to the current zone, and estimating how much their generator would take up- continually lowering the parameters until they’re either within the limits, or letting the master generator know that this is impossible. It also required adding the calculation of distance from town- not complex, but yet another pre-requisite to add to the work load.
Generating multiple towns
Required some heavy repurposing of the generator to basically iterate over 3 generators 3 times: Create town border, create town, create town area. Had to jump through some hoops to get it to let each town subzone know which town it belongs to to calculate distance, passing a different element to each zone generator, etc. This also revealed how completely inadequate the existing generator was at dealing with impossible generators when this many zones are present (generation could take several minutes). Optimization was quite simple since I hadn’t put any effort into it prior, mostly just making it recognize impossibilities much faster instead of having it hit its head against the wall. This phase also revealed a glitch in the zone shape generator which wasn’t validating that a new tile was actually adjacent to the existing zone.
You can see the fruits of the labor here:
Looks a bit like a random, garbled mess at the moment. But there IS logic behind it, and it’ll start to make a lot more sense with proper locations, roadways, and variation to show off the underlying layout logic.
Next week I hope to finish out generation by placing locations, roadways, and allowing for dungeon lock generation (Essentially, dungeons “claim” their own portion of zones, and their sub-zones shouldn’t connect to other zones without placing another dungeon or some other form of lock). From there I’ll move straight into implementing the new node based movement system.