Hello everyone! Welcome back – I do hope you’re all enjoying these regular updates :). I certainly am. To begin with here’s the latest update on progress, where BLUE denotes something finished and GREEN denotes something currently being worked on:

ITEM INTERACTIONS

  • You can drop items
  • You can pick items up
  • You can use items (whatever that means for the item in question)
  • You can destroy items (very rarely an item might have something hidden inside it…!)
  • You can show items (e.g. to someone else)

RELIGIONS

  • Generate the images for all 25+ archetypes of religious relics, and place them in religious buildings
  • Update and transform things like religious beliefs, things religions dislike, information about religious histories, holy books, etc
  • Enable the player to join and leave a religion
  • Far more complex interactions with priests etc
  • Develop proper model for “membership” in religions, nations, cults, etc

TREASURE MAPS

  • Treasure maps spawn in shops just like non-treasure maps do
  • Zoomed-out treasure maps correctly show relevant locations
  • Zoomed-in treasure maps correctly show relevant locations (far more complex)
  • High-value items are, indeed, under the ground where a map points!
  • These will become, for now, the game’s primary objective (rather than, as they will be later, one aspect of many)

MORE OPTMIZATIONS / BUG FIXING / POLISHING

  • I currently count 48 known bugs / issues – I want this down to 0
  • Further speed up map generation
  • Further speed up turn-by-turn rendering
  • Try to speed up world generation as well?

As ever, if you enjoy these posts, please do think about sharing them around the internet, or on forums, or tweeting it out, or to fellow gamers who might be interested – it takes a heck of a lot of effort to write these things up and I really do appreciate it a ton. And please do leave a comment if you feel inclined!

Procedurally generated religious relics

We begin again by returning to our generated religious relics. Three more have joined the pantheon this week in the “tile”, “goblet” and “eldritch shape” archetypes. The last of these can only be found in a Lovecraftian-styled generated religion, while the other two can apply to any religion within the normal religion archetype. The tiles on the left have around 160,000 permutations; the goblets in the middle have the middle have around 13,000 permutations; while the weird shapes have the fewest permutations at a mere 75, although that’s still far more than will ever be needed in a single generated world. One of the interest things I have learned about image generation is that often the generators that yield outcomes which look the most different can have the fewest permutations, while generators with outcomes that are closer to each other likely have fewer permutations. This is not a strict rule but one which does seem to manifest very often.

As for naming conventions, the tile relics generate with names like “[Name]’s Blessed Tile” or “[Name]’s Treasured Slate”; the goblets generate with names like “The Bronze Goblet of [Name]” or “The Golden Chalice of [Name]”; and the shapes have named like “The Wretched Octahedron of the Abyss” or “The Writhing Cube of Darkness”. Can’t wait to see these in the game in a few months once all the graphics are done and it’s time for implementation! Here, also, is a little behind-the-scenes look at the various stages required to procedurally generate the goblets:

Shovels and pickaxes

I’ve now properly distinguished what makes shovels distinct from pickaxes (though I’ll be starting you off in the game with one of each, at least for now) – shovels are for digging through anything which is not solid ground, and pickaxes are for digging through solid ground. I had originally intended to make pickaxes items for digging through walls, but after a lot of consideration I decided that at least in this regard I don’t think this is a game for allowing you to do that, because it could have major impacts on things like the schedules and pathing of NPCs, either changing how they behave in ways I don’t want, or actually blocking off paths by making too high a difference in the height between different terrain tiles (this is also why the shovel adds a “hole” feature to a tile, rather than actually reducing the ‘z’ level of that tile). This is now therefore reflected in the item descriptions – pickaxes allow you to dig down through things like stone, wooden flooring, marble flooring, dried lava, ice, and so on, while shovels are for everything else (all kinds of soil, sand, snow, and the like). The game now has appropriate checks for the type of terrain you’re trying to attack, appropriate messages, etc etc:

I also thought of a nice little bit of extra detail I could add in for sometimes giving the player another small bit of information about where something important might be buried. In the rough area where treasure is found, therefore, holes might now generate in the local area, suggesting that other treasure hunters have been here and have unsuccessfully sought out whatever’s buried in that area. I first thought about making these appear in a 3×3 grid of map tiles (map tiles, not human-scale tiles) around a treasure but then it would make it very easy to pin down the correct map tile, so instead the game selects a map tile containing treasure, and then picks a few map tile around it at various distances to spawn existing holes in, but nothing more than that. That’s enough that if the player is on that tile for some other reason they’ll know there’s treasure somewhere in this area, but they can’t use the locations of holes to pin it down to a specific map tile. As such, map tiles around treasure will now contain a number of random holes that someone else has dug into the ground. I realise it’s going to be very rare that anyone sees these, but I think it’s a nice little bit of extra world detail.

Items you don’t own

In recent blog entries I described the implementation of picking up and dropping items. This works really nicely now, but another thing to consider is picking up items which don’t belong to you. This will require me to implement things like laws and crime detection and enforcement and the like, which will logically come in the same release as combat, so for now a handful of items are simply marked with a “cannot pickup” flag, with a special message that comes up and tells you it doesn’t belong to you so you can’t acquire it. This currently only applies to the holy books in churches and cathedrals and the like, and also ingots in banks. Later on you will be able to pick up any item you can get to with appropriate problematic CONSEQUENCES, but for 0.11 therefore these items are simply un-pick-up-able, and the game makes clear why:

Crown Generation

The game can now procedurally generate crowns! Like relics these are very rare items, with only one appearing per feudal / nomadic civilization and then a handful of crowns from ancient civilizations scattered around the map (such as, for instance, in the treasure locations we talked about last time…?). I’ve had an absolute blast creating these and they’re going to give some really nice distinctiveness to monarchs and other rulers when the player (rarely) encounters them, and should make for very exciting high-value items to attempt to get one’s hands on, or once one has been acquired, to attempt to find somewhere safe to sell them. During the process of working on the generator I settled on essentially all crowns being made out of gold or silver or (rarely) bronze, and then I added three other one-off crown materials (iron, wood, and some kind of strange red stone?). Throughout the generation process I actually took screenshots of all the various steps to show how this kind of procedural graphic comes together, so here’s the full demonstration of the various steps the crown generator went to before reaching its final state:

For 0.11 it is possible that royal / leader NPCs will appear, but more likely is that for now I’m going to make these items the rewards in the chests found at the end of treasure maps, and then as soon as these NPCs make their way into the game, they will get the crowns that they so richly deserve. Aren’t they nice though? Crowns from the player’s perspective will be handled in the same manner as helmets, i.e. as things which you can wear on your head – although of course doing so in certain locations might lead to some striking and strong responses from the people you pass by. You can also of course show the crown to people, destroy it to see whether there is anything hidden inside it (though I’d think twice about destroying such a valuable object!), throw it, dump it on the ground, and so on. Here’s one in-game:

And here’s another one, but…

…huh…

…that’s a weird crown.

Super weird.

I’d probably not think too much about it.

Castle exteriors and castle courtyards

Castles are “districts” within cities but aside from the actual castle itself, and its defensive walls and moats and so forth, these districts have historically been extremely empty. I’ve filled up as much of them as I can with the walls and the moats and a drawbridge and all this sort of stuff, but ultimately the district system – which works well both in gameplay terms and data-storage terms for the rest of the cities – does, sadly, struggle a little bit here with just generating a bunch of empty terrain. To make these castle exteriors a bit more interesting and a bit more organic I decided to start some basic homes spawning around the castle, as if the city is sufficiently densely packed that the need for living space has brought settlements up to the edges of the castle walls themselves. So, here’s an example of a part of the old castle exterior, which would have a number of defensive walls (and you can see the moat of course) but not much in the way of other stuff

…and here is an updated version, where we see lots of houses in this outer area. I think this really makes the castle in each city feel far less isolated and akin to its own strange, unique little thing, and instead a part of the city which the rest of the city has since organically grown around, with houses brushing up against the moat and the defensive walls of a given castle:

Although this is very minor I think it’s a nice little improvement, and adds a lot more life to a part of the city that generally didn’t really have much going on outside until now.

At the same time I also turned my attention back to the courtyards inside castles. These were looking pretty dull, honestly, with just a little bit of terrain and nothing else really growing there. As such I felt that these should really be made much denser with stuff and hence a little bit more interesting to walk around and spend time in – and also, of course, valid for treasure maps to point you in their direction – so I made some changes by implementing a database of castle-courtyard patterns for each of the main five aesthetic shape choices a civilization can have (square, octagon, diamond, circle, cross). Here, therefore, is a pre-change courtyard.

…and here are a few post-change courtyards (in this case for the diamond shape though I’ve put in a half-dozen variations for each shape), which I think we can all agree are far more pleasant and interesting and filled instead with water, trees, and statues:

This is (of course) a minor addition again, but it’s just another filling out of the world, plugging the gaps left in previous releases, etc. As for the interiors there are five possibilities for each shape, and no more than five feudal nations can use each shape, so each inner courtyard will also be unique.

Additional world generation screen

The current world generation process has a number of different and interesting procedurally-generated graphics for the user to enjoy while the process is going on, but the last of these – the generated bookcase screen for the “Generating Knowledge” section – stays up far longer than any of the others, and sometimes longer than two of them combined. Although on one level this is fine since it’s telling the player that the game is heavily about knowledge and exploration and discovery, I decided it would be nice to break this up a little and to further emphasize to the (new) player what they should be doing and how they should be thinking. As such I have added a new screen, “Generating Secrets”, which again accomplishes the goal of clearly telling a new player what they might want to be thinking about, and comes with a lovely new generated loading image as well. I realise it’s just a loading screen, but I have to say, I think this is really, really nice, and very evocative of mysterious symbols and their unknown meanings…

New buildings

There are now four new structures to be found in the world!

Icehouse

Icehouses now appear in 100% of desert fortresses, 100% of towns in the desert, 100% of lower-class housing districts in the desert, and 25% of towns in savannah regions and 25% of lower-class housing districts in savannah regions. They are a structure which takes the basic shape that the nation they appear in likes (i.e. squares, circles, octagons, diamonds, crosses) and can be freely entered, and inside you’ll find stacks of ice and ice cubes for keeping a supply of ice and cold water going to the people living in that area. These are just a small addition but I had fun creating the ice cube image generator, and they give a nice additional something to the specifically desert / desert-adjacent regions of the game.

Granary

Granaries appear in 100% of towns and 50% of lower-class housing districts. They look like icehouses except with an extended entrance attached to the shape preference of the nation they spawn in. Whereas inside icehouses one does of course find ice, inside granaries one will find large mounds of grain. Again these are just giving a little bit more detail to the game world and adding some more variety and believability to the places one walks around, but again – as with all of these buildings – might be included in a future clue of some sort which the player finds useful.

Almshouse

Almshouses appear in 50% of lower-class housing districts in all cities. I was thinking about having them tethered to particularly policies but on further consideration I elected against this on the basis that historically even massively powerful global imperialist powers can sometimes have almshouses or their cultural equivalent, while otherwise pacifistic and largely benevolent nations can entirely overlook institutions of this sort. As such, all nations will have some almshouses in their lower-class housing districts, and these contain beds and supplies for the poorest of the poor in these areas.

(The poor and destitute who actually occupy these beds will come later, as that needs new AI code and has been *a while* since I did any AI work…)

Well

Wells appear in 100% of lower-class housing districts and 100% of towns. Again, these are just a little extra detail, a little extra believability, another potential piece for clue generation (“To the east of the well…”), and another thing to add more variety and difference to the generated areas in the game world. I also had a lot of fun generating the images of these, and I have to say I think they’re rather charming.

All of these structures (well, aside from the Well) have of course new general messages that can appear in the message box when you’re inside them, and function correctly for bookmarks, and registering in the player’s list of sighted things, and fast travel, and everything else. I’m really happy with the extra variation and detail and sense of density that these bring to their locations in the game world!

Bugs and miscellany

  • Resolved an issue with trying to enter certain districts in polar regions would, under certain circumstances, result in the game crashing due to it being unable to spawn appropriate plants and being unable to figure out what plants it should spawn, instead, in places where plants absolutely must be spawned.
  • Resolved a somewhat related issue with deserts never generating plants except around a treasure map – which rather gave the game away! – and so now all desert tiles, no matter what, have a few plants in them.
  • Fixed a bug where the “Monarchy” leadership type was sometimes just being used a default in certain aspects of world generation instead of properly using the effects that the other leadership types should be causing. Whoops!
  • Updated some parts of the encyclopedia to properly note the names of civilizations – especially if it’s a long name – and to not flow over the edges of the window if trying to print the civilization name.
  • Removed “Families” from the encyclopedia as these, at present, really do nothing and have no real function, and some of the artwork is a little bit outdated compared to the more recent stuff. I’m sure they’ll find their way back in later, though.
  • Changed “Settlement” to “Encampment” to describe hunter-gatherer, er, encampments, because “settlement” feels like a very generic term.
  • Fixed a super rare bug with an obscure aspect of world generation that I think maybe 1/300 times would lead to the game being unable to connect a road (solely because of a typo in the code) and hence getting stuck in an infinite loop.
  • Fixed a problem with the game rarely trying to generate religious relics for a hunter-gatherer religion that doesn’t have explicit religious relics, and hence crashing.
  • Dealt with an issue with the export menu that cause the menu to appear strangely under certain circumstances, and to not properly update itself once the player was done with it.
  • Resolved an issue with the entering or exiting city menu appearing when you’re travelling through a city gate on foot – this no longer happens and you just transition properly into the next area as you should.

What next?

Come on back in a few weeks for the next 0.11 update :).

6 Comments

  • That loading screen looks incredible. Also loving the the behind-the-scenes stuff on the proc-gen. The courtyards, et al, add a lot of flavour and lived-in detail to the world. Big fan.

    For the consequences of picking up something – do you intend it to be universal, or based on the local societal system? Will nomads really care when things are picked up compared to an empire? Probably yes, but for different reasons. And then there might be how you personally feel about something; like the burial site of your bereaved spouse.

    The more I think about it, it seems turtles all the way down!

    • Thank you Shane! Glad you like it all :). It will NOT be universal, and yes, definitely based on the culture. In the next release I’ll be working on the various sorts of punishments for the various sorts of justice policies – ordeal, gladiatorial, etc – and implementing all of those. And I’ll definitely need a more complex and detailed system for determining ownership, but for now it’s pretty easy to just add a no-pick-up flag to a couple of items and then go from there…

  • Wow, this is a huge update. So much new and interesting stuff. I like the look of the new relics (particularly the bizarre Eldritch ones) and the crowns. It’s interesting to see the behind-the-scenes look of how they are actually generated, so thanks for that. And yes I hope we do see some rare instances of bizarre-but-vaguely-plausible items such as the Gore Crown appearing in the game. It’s those sorts of things that make for a memorable gaming experience!

    By the way, have you considered eventually compiling all of these URR development posts into a book? I think a lot of aspiring designers might be interested in reading it.

    • Thanks crowbar! Really glad you like them (though I’ve realised now that the way I presented the steps is slightly unclear; each one is showing the outcomes of ten different versions of the generator as I developed the generator, rather than ten steps in a generator to produce an outcome). And oh yes, everything has to stick to the realm of physical possibility, but beyond that I’m keen to push the boundaries of possibilities. Re: a book, I absolutely love that idea. I actually really do want to try to get just a little bit more URR / PCG stuff into my academic / writing life, so it’s certainly not impossible. I’d have to go back and find the database of the earlier entries on the old site, but that shouldn’t be *too* difficult…

  • Your observation that more permutations can lead to less diversity is really interesting. I think it can be explained by considering two extreme examples:

    In one case, you have a procedurally generated item with only a single parameter, “appearance”. Not very interesting from a proc gen perspective, and you’d need a lot of different images to draw from to make it not repeat itself. But with no other restrictions, that appearance could be literally anything. A cat, a house, a tin can etc. There’s no limit to how much it varies.

    On the other hand, if you had a proc gen item with 100 different parameters, it would be much more limited, because whatever you generate has to have those 100 properties, even if the implementation of each property is randomised. For example, “how many points the crown has” limits your crowns to those which have points. Even if “0” points is an option, it still affects the possible crown shapes, as they all have to support the possibility of having points.

    I suspect you already do this to an extent, but one solution to this is to have conditional permutations. e.g select a crown body, if that crown body supports points, then select the point type and quantity, if the point type has a gem slot, then pick a gem, etc. That way you end up with a branching tree of possibilities, with loosely coupled parameters which may or may not even exist on the final output, rather than a single layer of interdependent parameters that restrain each other.

    • Thanks so much for this comment Jeremy! Sorry it took me so long to reply to it. I think you have essentially nailed it there! The more properties something has, the more that each variation has to actually have those properties. This isn’t the case in every image generator I develop, as plenty have what we might think of as “nested” properties where certain variations unlock the possibilities of certain sub-variations, but ultimately I think you have the right of it!

Leave a Reply

Your email address will not be published. Required fields are marked *