One of the aspects I have enjoyed immensively in pyherc is level generation. It’s no surprise then that I wanted to try a slightly different approach that I’m describing here. It’s not fully finished, but should be sufficiently ready for a blog posting
roguelike
Bit of Background
When I originally started pyherc, I had very vague idea about the setting and the backstory. Over the time I modified them a bit and tried to narrow things down. This blog post will be about how the world stands currently.
Society generation, again
I was working on society generation, where the system would generate whole socities (villages to be specific), inhabited with people. These people could be part of various factions or secret socities and have their own agendas. Moreover, some of them might have powerful artifacts or other special items, that would have history attached to them.
Tinkering with society generation
I have been tinkering with building societies for my game. Basic idea behind the whole thing is that I have two tier system: one level generates blueprints and another level turns those blueprints to actual objects in game world. For scrolls (see first and second post) it already works.
Codifying some facts about pulling things
I was travelling and wasn’t able to hack code as much as I would liked to (and on top of that, I wanted to play some computer games too). But I did manage to push next feature forward just a little bit and write some BDD specifications for it. It’s a bit odd to write BDD specs for a single person project, but I view doing that as a good training and a nice favour to my future self.
Who can pull and what?
So, Water Guardians (among other creatures) are powerful beings that can grab and pull unsuspecting adventurers if they stray too close to water. They aren’t the only creature that can pull others, but they’re exceptionally strong at that and can pull being equal to their own size (and since they’re large creatures, there are very few things that can resist that).
Generating scrolls – redux
In previous post I indulged myself with some wishful coding and outlined some ideas how to procedurally generate scrolls that have name and description and that can be regenerated again and again based on id number. For a change, I actually went and implemented system like that and will detail some points about that in this post.
Generating scrolls
Earlier I blogged about procedural lore generation. That in itself is very large and complex topic and I wouldn’t want to tackle that in one go. One major part of the system would be generating all kinds of artefacts, of which some could even apppear in the game. This is quite large part too and will require significant changes (I have very few item types implemented currently).
But, I can already get started on fleshing out my ideas and implement a tiny, fairly insignificant portion of the system and see how well it will work and what kind of new ideas I’ll unearth. For this I chose cosmetic (at least for now) scrolls that player can find laying around everywhere in the game. I won’t be touching that much how the scroll generating will actually be implemented as a part of item system. Instead, I’ll assume that there’s some sensible way of system to call the code (although, I do have some hazy ideas already) and trigger creation of a scroll.
Legend generator
I love reading little snippets of background story in RPGs. These snippets can be in form of discussions with NPCs (or between NPCs), little notes, scrolls or even pages of books. But I generally don’t like reading long paragraphs that keep going and going. Information needs to be in tiny, bite-sized chuncks and it shouldn’t be mandatory to read all of them to proceed in game. I really liked for example how Dragon Age: Origins did this. There are tons and tons of stuff to discover, it’s delivered in varied means and it’s interesting.
AI, goals and subgoals
Building an AI (for a game or for some other purpose) which can look ahead, subdivide its goal to smaller goals and plan actions required for completing each of them doesn’t sound too hard. Just use some mechanism to break big goal into smaller steps, maybe starting from the very last on and then working backwards towards current situation and stuff those goals into a stack. AI can then take the topmost item from the stack and start working towards solving it. If it’s not achievable, just figure out what’s needed to be done first, return original item on top of the stack and start working on the new one. If situation changes drastically, say a huge fire breathing monster appears, return the current item on top of the stack and figure out what needs to be done in the short term in order to be able to return back to that task.