This week was a grind. Every time I fixed a bug in the history generator, a new bug appeared on the next run. When I found the source of a bug, I made quick and direct fixes without regard to code quality or architecture, resulting in some ugly branching and repetition. I had my reasons for using this approach. I’ve struggled to fully devise the conceptual and architectural solutions for history generation. Producing working code for various history generation examples allowed me to identify patterns that I could apply to the architecture. I have code rework to do now, but that’s better than being stalled out in abstract design.
It wasn’t until yesterday that I got a clean history generation test run. The current test run generates 20 events randomly selected from 10 different event types. Most of the event types are generic – add a new section, add a new actor, add a new faction, etc. There are a couple of event types to test triggers – a faction leader dies, the faction leader’s son becomes leader of the faction. There’s also one event type that advances the history era. This event type ages world state entities according to the time difference between the current and next era. The current implementation of the aging event type is very simple; if the amount of time that has elapsed exceeds the lifespan of the entity, the entity dies. I will expand the implementation in the near future to do more interesting things such as decomposition.
Despite the limited number and generic nature of the current event types, interesting events are being produced: a giant rat is appointed leader of a faction of dark elves, the giant rat’s daughter is a gelatinous cube, the son of a wizard is a thief, troglodytes and knights settle in the same cavern section. I want to maximize the possibility space, but avoid generating histories that are highly random and implausible. This can be accomplished through constraints in the event type definition. For example, only an actor type associated with a faction can become the leader of that faction.
The impact of history generation on overall game progress remains a big concern. I don’t know how long this detour will take. It’s a far greater effort than I envisioned it being, and there is far more work to do. I planned on winding down the effort by the end of March. While I have succeeded in developing a functioning framework, there is so much more content to create, and undoubtedly as new content is created more bugs and functionality holes will be exposed. Next week, I’ll continue working on history generation exclusively to close out March. My plans for April aren’t solidified yet, but a key goal will be expanding the variety of history event types.