Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 214 215 [216] 217

Author Topic: Ultima Ratio Regum (0.9 released Dec 31 2021!)  (Read 516934 times)

Great Order

  • Bay Watcher
  • [SCREAMS_INTERNALLY]
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3225 on: October 06, 2022, 04:45:48 am »

Huh, I'd forgotten about this game.

Not really my thing I think, but the procedural generation always seemed impressive.
Logged
Quote
I may have wasted all those years
They're not worth their time in tears
I may have spent too long in darkness
In the warmth of my fears

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3226 on: October 06, 2022, 05:06:22 am »

Huh, I'd forgotten about this game.

Not really my thing I think, but the procedural generation always seemed impressive.

Thanks friend! It has actually been back in active development for a few years now, but I still struggle to make development truly *regular* and routine. It's one of my big challenges for the coming years.
Logged

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3227 on: October 06, 2022, 06:50:38 am »

My first plan for 0.10 was procedural book generation. We already had the books generating as items and - if you'll allow me - they're one of the things I was proudest of in the 0.9 release:



This was always intended to be a central part of the game - I want to get the game generating texts that were logical and meaningful and connected closely to the game world, and to get the player reading these as a central part of learning about the world and finding the clues to the core mystery. However, as readers will know to some extent, 2022 has not exactly been the year I was hoping it would in terms of my health, and while things might be picking up now, I often feel like I'm in a perpetual back-and-forth between "unwell" and "getting back to where I was before I got unwell again", with little time to actually build something and build on what I've been doing previously. I'm now back in the "gbtwiwbigua" phase (as we call it) once more, but I don't know what the rest of the year holds. This is important because the generation of the book contents is something I've made some progress on - some incredibly exciting progress, actually - but realistically there is no way I can now finish it before the end of the year. Even if I didn't have a full-time job to consider, and even if I did literally nothing else for 0.10 except the book contents, I still don't think I could get it finished in time. I really don't want to half-arse the book generation as it's something that really excites me, but I also am now determined (as discussed in past blog posts) to keep to one major release a year, no matter what.

So, instead, 0.10 is going to be the "everything I wanted to put in 0.7, 0.8 and 0.9, but didn't have the time to" release! I've been making some good progress easing myself back in, building some new code and some new content, and refamiliarizing myself with everything, so here's what has been added so far in the past couple of months:

New Items

To begin with, we have some new items! These appear in a variety of logical shops and are items that contribute to your navigation of the world and to surviving in the world (see below). The first of these is the compass, which (like everything) can be found in various qualities and various shapes depending on the civilization you buy it from. The compass reduces how much water the player consumes when moving through desert - the logic being that you can more accurately plan your movements instead of stumbling around uncertainly. The quality of the compass - low, medium, high - determines how accurate it is and thus how much water is saved, with the lowest quality saving the player 25% of their water, the medium quality saving 33%, and the highest quality saving 50%.



The second of these is the binoculars, which increase your viewing distance as you move around the world map using the "travel" function. The lowest quality binoculars will give you one extra map tile around the player as you move; the medium-quality binoculars will give you a few more extra map tiles in each direction as you move; and the highest-quality binoculars will give you a few more map tiles in each direction than that. It's hard to describe, but think of a circle where each quality level adds on a couple more tiles at the edge of the circle than the one before it.



Pitons are the equivalent of the compass, but for your use of supplies in mountainous or polar terrain, rather than your use of water in the desert. Pitons can be used to reduce your use of supplies in mountainous and polar terrain by 25%, 33%, or 50%, depending on the quality. Unlike the compasses and the binoculars pitons will very slowly be used up, but at a rate that still makes them a very profitable purchase compared to just using larger volumes of supplies.



We also have canes! These reduce food use in all of what I'm now calling the challenging terrains - desert, polar, and mountainous - by 25%, 33%, and 50%, again depending on quality. These can be purchased at carpenters' shops and like the pitons will eventually wear out, but only as an extremely slow pace. On a side note I have to say I'm particularly happy with the generator I built for these, as it is (un?)surprisingly difficult to think of many ways to vary and make interesting and item that is, essentially, a stick of wood. Nevertheless, I think I did pretty well here!



And, finally, we have grenades! Modelled after pre-gunpowder and early gunpowder historical grenades, these will be available in powdermaker shops in civilizations with the appropriate technologies and policies. Shown here from left to right is a hallucinogenic grenade, an explosive grenade, and a smoke grenade, and I'm working on a couple of other types as well. As I've said before, I really am excited about working on combat when that starts coming into play, and these are a category of item I've been looking forward to adding into the game for a while now.



Speech

Part of what I have planned for this release is really expanding and developing the speech options. As part of this, therefore, you can now ask NPCs open questions of the type "What do you think about [X]?". This means you can now question NPCs about any alcoholic drink, any prisoner (if you're talking to a jailer), any historical event, any ship (if you're talking to a sailor), any monastery or monk (if you're talking to monks or priests), any political party (in relevant nations), any major family (in feudal nations), any gladiator (in relevant nations), any feudal nation, any tribal nation, any nomadic nation, any known disease or plague, any religious relic, any religion, any individual, any city, any town, any area of the world map, any animal or plant, any weapon, any artwork, any book, and any political ideology. Here's an example of these sorts of questions in the list of questions, and then an example of how it currently looks when you're selecting what to ask:





One of my next tasks, of course, will be to develop the responses to these questions! More on this soon.

Survival

I've always hated the minutiae and the constant need to keep yourself from dying in most "survival games" - eat food every few minutes, drink water every few minutes, etc. It's tedious and repetitive and doesn't really add a great deal (except in a few rare cases where it is so tightly integrated into the game design, as in something like Don't Starve). By contrast, the survival mechanics in a game like The Curious Expedition, which was one of my favourite games from last year, struck me as very different. In moving survival from the constant to the strategic, the question in TCE is instead framed far more as "planning for an expedition" and making sure you have enough to survive, making good use of your resources, planning ahead, and so forth. These sorts of framings really attract me and really fit in with the sort of thing I'm looking to do in URR. It shouldn't be something the player is thinking about every second of the day, but given the game's focus on exploration and the size of the game world, I'm really attracted to the idea that in order to push out from one's base city you need to make sure you have what you need to survive, and that to push out into more challenging terrains (desert, polar, mountains, etc) you need to ensure you've got what you'll need to be able to properly explore them.



So, progress has begun on the "planning for expeditions" side of things by adding three meters into the game which you can see now on the sidebar on the left - food, water, and equipment. None of these are required in cities, towns, and on ships, but to head out yourself, you'll need to stock up on supplies. Food is consumed each day you're out of a settlement / ship; water is consumed each day you're in the desert (the assumption is that outside of the desert you can find abundant water sources), and equipment is consumed each day you're in polar or mountainous regions (again, it's assumed this is easier elsewhere). These can be bought in cities when you enter/exit through the city gate (which is the part of this I'm now working on). These are pretty cheap goods, but naturally if one runs out and isn't in a settlement or a ship, bad things might begin to happen - which should be pretty fun to code. More on this soon!

Thrones

Thrones - despite having been generated over a year ago - now, actually, appear in-game when you look at a throne. So that's nice.



Bug fixes

I've also completed a number of bug fixes, such as:

-Resolved an issue where pressing ‘@’ to look at your character didn’t properly give you the same navigation option for looking at your character that pressing ‘l’ or ‘;’, and then manually looking at yourself, would.

-Removed a debugging option in the “Export” menu that I’d accidentally left in the game – whoops!

-Hopefully fixed a problem with the world generation sequence very rarely freezing (not crashing) if you move the “focus” on your computer away from it to another app; I think this has been resolved, but it might need a little more testing.

-Fixed bugs where several speech options resulted in crashes.

-Fixed a bug where pressing the “Exchange” option in a conversation would lead to a crash (though I will be coming back to this in more detail later).

-Fixed a bug where the game would crash upon going up stairs (!).

-Fixed some typos in the generation of monastery names.

-Changed the name generator for mercenary guilds, since some of the generated names were a little bit... iffy.

-Fixed a problem where sometimes asking soldiers about their armour caused a crash.

-Standardised the spelling of “civilization” to the American English version – most words in the game are British English, but I’ve always liked the look of the ‘z’ in that word (I blame Sid Meier) so I decided on that one instead.

-Fixed shading on signs outside buildings in city centres.

-Fixed a bug with a crash upon entering a fortress.

-Fixed bug where a cult ring would sometimes try to generate for a non-cultist civilization, resulting in a crash.

-Fixed a BIG and long-running crash bug with some towns on the coast not generating enough homes for people to live in, resulting in a crash! This was because the game couldn’t find somewhere to put a dock in time, and then ran out of “can I place a building?” cycles before it was able to get to placing houses (which come after the larger, more important buildings). I'm really pleased to have finally solved this one, as this now means there are very few remaining known major bugs - in fact, only really one.

-Fixed a bug where turquoise mines did not display correctly in the encyclopedia and caused a crash, and also sometimes appeared as “metal” mines instead of “gem” mines (even though I am quite sure turquoise is not a metal).

-Fixed a bug where looking at a mine in the encyclopedia belonging to a nomadic, instead of a feudal nation, caused a crash because it was trying to print the wrong kind of flag.

-The list of ships in the encyclopedia now shows the images of the ships alongside their names, destinations, owners, traits, etc.

0.10 Begins

So: I'm pleased to say that 0.10 is now going to be a release focused on the stuff I couldn't get into the last few releases, plus a load of new items, some new mechanics, plus a load of polishes and refinements and fixes for bugs and things of that sort. Again, I think it's really important for me to settle into a regular annual release schedule of any size, rather than focusing on huge releases across any time period. I just don't think after being pretty unwell for eight months that four months - even four months of focus - is simply enough to do credit to the book generation ideas I've started working on, and that I'm excited to deploy. With that said I'm sure I will be continuing to do a bit of work on book content generation, since that excites me and I'm incredibly keen on developing this system I'm building for this - which I think is distinct from others? - and seeing where it can go. However, my priority will be on this 0.10 content, building on 0.9, polishing, fixing, improving, developing, and fleshing out, what's in the game right now. 0.11 might be book generation; it might even be combat; it might be some combination, or something else; but 0.10 is going to be a release of significant size, deepening both the gameplay interactions in the URR world, and the game world detail, and I'm excited to get working on it.

Thanks for reading everyone, and I'll see you in a couple of weeks - I promise! - for the next update! :)
Logged

AlStar

  • Bay Watcher
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3228 on: October 06, 2022, 10:58:49 am »

Just wanted to say that the ascii art you produce is, by far, the best I've ever seen - those books are gorgeous!

ndkid

  • Bay Watcher
  • Player of Games
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3229 on: October 06, 2022, 01:59:11 pm »

Just wanted to say that the ascii art you produce is, by far, the best I've ever seen - those books are gorgeous!

This comment makes me wish this forum had an upvote mechanism, rather than me having to make a "ditto" post.
Logged

Dorsidwarf

  • Bay Watcher
  • [INTERSTELLAR]
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3230 on: October 06, 2022, 04:45:47 pm »

I definitely like the new resource consumption mechanics - Being well-prepared for an expedition really helping with expeditions but not strictly required if you cant manage to source a good bit of kit & arent going into too much danger.

I think the systems as stated also have good potential for tweaking down the line for balancing / adding "extreme" conditions to encourage extra preparation / purchases, even if that's not currently in scope (Compass reducing the travel-slowing effect of a theoretical "fog" condition for example, or "blizzards" increasing Equipment usage while climbing to the mountainous location of the sought treasture...)

Putting off book content generation in order to ensure that you don't feel under any time crunch so that you can do it justice is a good idea I think.

Can't wait to see what other interesting things await!
Logged
Quote from: Rodney Ootkins
Everything is going to be alright

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3231 on: October 09, 2022, 06:21:22 pm »

Just wanted to say that the ascii art you produce is, by far, the best I've ever seen - those books are gorgeous!

Thank you AlStar, that's super kind of you! I really appreciate it :).

This comment makes me wish this forum had an upvote mechanism, rather than me having to make a "ditto" post.

Haha, thanks ndkid!

I definitely like the new resource consumption mechanics - Being well-prepared for an expedition really helping with expeditions but not strictly required if you cant manage to source a good bit of kit & arent going into too much danger.

I think the systems as stated also have good potential for tweaking down the line for balancing / adding "extreme" conditions to encourage extra preparation / purchases, even if that's not currently in scope (Compass reducing the travel-slowing effect of a theoretical "fog" condition for example, or "blizzards" increasing Equipment usage while climbing to the mountainous location of the sought treasture...)

Putting off book content generation in order to ensure that you don't feel under any time crunch so that you can do it justice is a good idea I think.

Can't wait to see what other interesting things await!

Thanks dorsi (have responded on my site as well!), I'm so glad you like it all! Getting back to coding is always an exciting thing; I just need to master the art of doing things bit-by-bit across the year, rather than in some single mad burst towards the end of a year. I had that mastered in the past, but it *is* something that has eluded me in more recent times...
Logged

sageleaf

  • Bay Watcher
  • [PERMITTED_JOB:MAKE_MEME]
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3232 on: October 17, 2022, 02:44:15 pm »

the navigational resource system sounds amazing, and the items are gorgeous as well. I am curious on if there would be a system of gaining familiarity with a location to make travel easier, or hiring local guides?
Logged
~
If at all
~

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3233 on: November 02, 2022, 04:16:08 am »

the navigational resource system sounds amazing, and the items are gorgeous as well. I am curious on if there would be a system of gaining familiarity with a location to make travel easier, or hiring local guides?

Thanks sageleaf! Hmmm, that's an interesting question - maybe, maybe. Maybe certain areas reduce in food consumption the more often you pass through them, for instance. It's an interesting area and I do not dislike it!
Logged

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3234 on: November 02, 2022, 07:58:43 pm »

Welcome to the second URRpdate for the 0.10 release coming at the end of December! Quite a bit has been added in the last few weeks, so let’s get started:

Banking

To begin with, you are now able to deposit any amount of your money into the bank in a given civilization, which will then – slowly – accumulate income over time. Right now the system will be that you can deposit any currency into a bank, but the currency of that bank’s home nation will accrue income much faster than other currencies. I’ve been doing a bit of experimenting with compound interest calculations, and thinking about how fast the player moves around the map, how fast in-game time passes, all of these sorts of things, and I think an interest rate of around 1-1.5% per month for home currency will be appropriate; it’s obviously high (on a level we could only dream of in the real world under normal circumstances!) but there will be many demands on the player’s expenses, and banks in the URR world are local, not global (so you can only get your cash out in the right nation), and it will be a strategic choice to sacrifice the immediate use of your money for later income further down the line. This will obviously be something to playtest, but for now I’m adding the ability to deposit money, of any currency, and a 1-1.5% interest rate monthly for the home currency (and around a 0.5% interest rate for non-native currencies) in banks. All of this should – in time – add another nice strategic layer to the game world and the player’s actions, purchases, movements, and so forth. As such, I’ve now built the interface here for the player to both deposit and withdraw coins in various volumes, and to cycle through coins. You’ll also notice on the left-hand side of the below screenshot that each bank has a procedurally generated “special offer” which takes the form of “Do X to get Y” – one example is shown below. These will have quite significant benefits (this one, for example, would allow the player meeting the condition to buy any five items in that city’s shops!) and so I’m hoping these will also make interesting strategic considerations as well.



Holy Books and Ingots

Despite all the time and effort I put into working on the generation of holy books for religions as part of 0.9, I realise now that they (generally) don’t actually spawn at present! It is possible for a holy book to spawn in a “general store” but the odds are extremely low, given that anything can spawn in those stores and books are only one category, and then even within “books” there are many categories of which holy books are only one. I’ve therefore taken it upon myself to get holy books spawning now in religious buildings, where they appear on tables and sometimes appear having been left on chairs by previous worshippers. In 0.10, therefore, a few holy books will now appear in their appropriate religious buildings, which the player will be able to look at. In the future, of course, when systems for handling stealing and reputation are implemented, you might be able to grab them with reckless abandon, but now they are just there to look at. This is also the case for ingots, where I coded the graphics and the item information for them but never actually got around to putting them in the bank vaults in banks, mints, etc. They can therefore now be found in both – again, they cannot be picked up yet, but they just give a little more detail, and soon you’ll be able to do a bit more with them than you can right now. Holy books and ingots can therefore now both be found in their sensible in-game locations, and the effort I put in to generating their images is no longer going to waste!





Relic generation

In the existing version relics are hidden under-the-hood and never really appear, even though you can see reliquaries in religious buildings. The current relic generator is very generic and although it can produce a huge number, they tend to be of a few standard sorts, e.g. a bone of some description, a weapon of some description, and so on. Given that in a future version relics will be generated as in-game items that might be important for solving clues (or might just be worth a great deal of money, of course, or might be worth something else if given to the right person…) I decided to go back and just take a couple of hours to update the generator. There are a number of religion “archetypes” in the game that at least partly determine some of the traits of the religion and what its altars look like, and I’ve come up with over twenty different relic archetypes, such that now every religion will have a unique category / “type” of relic. For example, one religion’s relics might all be golden statues of animals; another religion’s relics might, indeed, all be bones of ancient saints; another religion’s relics might be mysterious metal cube etched with eldritch designs; another religion’s relics might be sacred feathers from ancient birds; or whatever. The game therefore now assigns a relic type to every religion, and generates a bunch of relics for that religion to have – one per normal religious building, one per cathedral, and a number that are perhaps lost, or buried, or in private hands, etc. This doesn’t do a great deal right now, but is setting things up nicely for later.



Building memory

One of the problems with URR has always been speed. I don’t claim to be the most technically skilled programmer on the planet, but I have been continually improving the game’s speed as much as I can. A significant improvement took place in 0.9 where I upgraded the rendering engine for the game’s world (particularly the larger outdoor areas rather than the smaller indoor areas) to the point where it was around 40-50% faster than it had previously been. I’m working on further upgrades of this technical sort for the future, mark my words, but I also want to speed up the player’s ability to navigate the world. One place where this has long stood out to me is in getting back to buildings; when you enter a district or a town you have already visited, you always start at the edge of that map grid and have to walk, again, into the area in order to find the shop or tavern or whatever it might be. Well: no more! The game now keeps track of every structure you’ve seen in a map grid, and from then on, whenever you return to that grid, the game now lists all the structures you know, and you can so straight there instead of having to walk the whole way through the grid again! After some playing with this it is clear that this is frankly a huge time-saver and really makes the game feel far faster to navigate and get around. I intend to later add the ability to add your own “checkpoints” for this system – e.g. if you know there’s something important hidden in a particular house in a particular district, you can put in a checkpoint outside that house, and then later when you return to that map grid, the checkpoint will be another option you can go straight to instead of walking back through it to get there. For now, though, I’m really happy with this addition, and it really speeds things up an astonishing amount, and streamlines the player getting things done to a huge degree. Without exaggerating I’d say it speeds up the time going from a bank to a shop by around 90% (assuming you already have both the locations), if not more – this is a huge improvement.

For these more informal areas, the game now identifies particular areas and ways of facing that would be good to “start” at a park, for instance – maybe on the right-hand side, facing left, and looking over a bridge – and then when you fast travel to a park, a memorial, or other comparatively amorphous outdoor areas, the game looks through these saved starting point, picks one, and puts the player there.

This has actually been the main thing I’ve been working on in the last couple of weeks since the game needs to be able to handle all kinds of buildings, in all kinds of areas, and to place you in logical locations for these buildings, and to accurately deduce how many steps should be iterated as you fast travel to them, etc etc – but it’s now done, and my goodness, it speeds the game up. This is a really fantastic addition in terms of what people these days like to call “quality of life” in game design, and I’m so glad to finally get it in there.





Bug fixes / polishes / etc

- Resolved a problem where buying some kinds of rifle balls / pistol balls would lead to a crash because the game couldn’t figure out what to call them.
- Noticed that weapon prices were not being appropriately modified based on their quality level (low/medium/high) and made it so that they will be.
- Fixed a crash bug with a certain (rare) class of book being unable to figure out what book cover it should be showing on screen.
- Added metaquestions for “What do you think of [plant]?” and “What do you think of [animal]?”, which also appropriately populate themselves with responses based on what the player knows about.
- Going from your inventory into a specific level of your inventory (e.g. “weapons” or “maps” or whatever) now correctly darkens the background inventory image.
- Fixed yet another problem with mines in the encyclopedia crashing the game sometimes – this should really, really, be resolved now.
- Using the keypad’s ‘5’ instead of ‘Enter’ no long causes a crash on the world map (!!!).
- Using the keypad’s ‘5’ now works fine for going up and down stairs, just like ‘Enter’ does (alongside the usual ‘<‘ and ‘>’, of course).
- Fixed an issue with some types of history books not correctly listing the name of the thing they are recording the history of, but merely the type of thing, so one got “Arena: A History” instead of “Redtooth Arena: A History”, or whatever it might be. These books now have the right titles.
- Fixed a far less common issue equivalent to the one above but for prisons, rather than arenas.

Next?

One of the problems with creating this kind of world is always the gaps. One creates a world map and thinks “but where are all the settlements?”; one creates settlements and thinks “where are all the people?”; one creates people and thinks “what can I actually do with them?”; and so on. This has always been a struggle for me psychologically as well, always feeling like new additions only suggest future additions, instead than standing on their own two feet. With that said, though, with this 0.10 release I’m finding a lot of satisfaction in going back and closing a lot of the “gaps” in the game world. The world is now already looking more polished, more complete, with fewer strange “gaps” in its nature, and with far more ease of navigating, exploring, seeing things, and just generally getting stuff done.

As such, for the next week or two I’ll be working on more of these improvements; more closing of the gaps; more polishes and improvements and optimisations; and generally just continuing to polish and more fully flesh-out what’s already there. Expect another update, all being well, hopefully some time in the middle of November!
Logged

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3235 on: December 04, 2022, 11:55:07 pm »

Welcome back everyone!

Lots of new developments again, so let’s take a look:

Buying supplies

When you enter or leave cities you can now stock up on supplies. These take four forms – canteens, food, water, and equipment. Canteens, food ration bags and equipment have generated images while water is a slightly more abstract image. In the case of canteens, these are empty containers that can be filled up with any liquid, and the player starts off with a canteen filled with ten units of water (which allows for ten days spent in desert). The images are of course generated with around a million or so permutations I believe – so hopefully you’ll never see the same canteen, as they are handmade after all! – and are pretty expensive items, but they have a lot of value for exploration so I think that’s justified (again, as more and more gameplay elements come in through 0.10 and 0.11, all of this will need balancing later on). Food is the only one that is needed in the everyday for moving around outside of settlements (except when on ships) and is consumed at a rate of one unit a day, and you buy food in blocks of ten; food, like water and so forth, is not needed when you’re in settlements, but only when you’re out in the wild. The image used here is an alteration of the graphics used for the gunpowder bags, and I’m sure I’ll find some more value for the “bag” image archetype further down the line. Water is bought separately and can be used to fill up canteens, and is again fairly cheap, and required when exploring desert in order to avoid dehydration and sunstroke (see hopefully my next update for info on these sorts of ailments etc!). Finally, equipment is the equivalent of water but for polar and mountainous regions, consumed at a rate of one per day, otherwise frostbite and hypothermia will be lurking just around the corner. I don’t see many games that model interesting conditions and illnesses and I think these will make for interesting strategic considerations (with some light alterations from how these work in real life), but that’s all to come later. Finally, as part of this the player now also starts the game with a supply of food, and a canteen filled with water, but not with any equipment nor any additional canteens.



Location discovery

As part of what I discussed last time – building-specific fast travel – I have also made changes to how locations are recorded. In 0.9 simply setting foot into a map tile would immediately tell you (on the world map) what was in it, i.e. entering a market tile and then going into your world map would tell you precisely what shops were on that tile, even if you (the player character) had not yet actually seen them. This worked fine for a while as a basis but given the new stuff I’ve implemented above about allowing you to fast-travel to specific buildings within a map grid, it seemed to make sense to also go back and make this fine rather more finely-grained than it is at present. To do this there is now a system in place that, while rendering an outdoor area, takes note of any doors you happen to see and then looks over those doors to see whether any of them are noteworthy doors (i.e. they don’t just belong to normal homes, for example). If the game finds a noteworthy door within your line of sight on a particular turn, it then checks to see what that is a door to (e.g. a shop, a cathedral, whatever) and then checks whether or not that building has already been stored in the player’s knowledge of building. If it has then it does nothing, but if it hasn’t, then the game adds it in and posts a little message in the text log below along the lines of “You have discovered a new X”, after which you will then be able to fast-travel back there next time you are on that map tile. URR therefore now keeps track of every important structure you find, and when coupled with the above, this makes exploration – and moving back and forth – almost ludicrously faster than it once was.











Image improvements

I’ve improved a couple of the old generated graphics in the game that just weren’t up to the current standard. Firstly, archery targets are now correctly shaded, which brings them a little more “up to date” with the quality of the other procedural graphics in the game; I’ve also optimised the image code here to make them generate / draw faster, as they were painfully slow. These are an extremely rare thing to see in the game – though now that I’ve put in the time to improve them like this, I am certainly incentivized now to make them appear in a few more places! – but they no longer stand out as a very poor graphic. Similarly, fountains have also now been significantly enhanced in order to bring them in line with the quality of the generated images in the game. These are rather more common so I think this was far more time well-spent, as the player (currently) starts in an upper-class housing district full of fountains, and many of the most interesting areas of cities and the like have fountains. These were not hugely time-consuming things, but I’m glad to have them done; readers will remember that in the 0.9 release I redid the graphics for the world generation because the original graphics were very outdated compared to the quality of visuals I’m making now, and it didn’t really do for the first thing the player sees to be something so rubbish! I’m not sure whether these meet my quality standards for the long-term, but for now updating these just adds a little bit of polish and smooths off a rough corner remaining from the game’s much earlier days.





Flavour messages

As further part of making navigation of the in-game world both easier and more interesting, I’ve taken a leaf from the book of games like NetHack and introduced messages that appear when you enter a new area. Naturally in NetHack (and other games that do similar things, like Spelunky and Noita) the idea is partly to warn the player in advance of something coming up in that area or acknowledge an unusual procedural generation choice, whereas here it is partly about flavour, but also partly about letting the player know that a particular thing might be present in this area which they might want to take note of. At the moment this takes two forms. Firstly, an “introductory” message will now always appear when you enter a district of a city, a town, a fortress, a settlement, and soon on things like mines, universities (see below), etc. This will give you some flavour and will also point you towards important things. For example, upon entering a lower class district in a city, it might say – depending on the cultures / policies of the area – something like…

“You enter the lower class housing district. As you watch the people in this area, you see items and goods often being traded from hand to hand. In the distance to the north-west you see a tall building with barred windows.” (A “barter” nation, and a prison with its location identified)

“You enter the lower class housing district. A call to prayer is being sung out from the north-east, and to the south you hear the roar of a crowd.” (A location hint for a religious building, and a location hint for an arena)

“You enter the low class housing district. You hear people talking about the outside world, and notice that their comments doesn’t quite match up with your ideas of lands beyond this one.” (An “isolationist” nation)

…and so on. By my calculations there are many hundreds of thousands of these possible messages across different locations with different sets of combinations present, and just from doing my own playtesting around the world these add a real lot of texture and feel to the world, and give a sense of greater weight and consequence to each particular area the player might go into. When coupled with the discovery messages mentioned above, the message log in URR is now far more full and far more active, and has things constantly being told to the player rather than just an endless sequence of “it is a new day!”, which can seem a little bit silly sometimes. I think these are a really important addition for, again, speeding things up, helping the player have a sense of where they might want to go in that area, and also deepening this sense of the world being a little more alive and a little more active as you walk around it.





The other sort is what I’m calling “ambient” messages show up every x turns since the last message has showed up, and take a similar form to the above messages, giving you information but on a much smaller scale. So, for instance, in a city centre district you might see messages like…

“You hear nearby an argument between some clerks about taxation for the outer areas of the empire.”

“You see in the distance an individual wearing fine clothes, who seems to be an emissary of some other land.”

“You notice a fine ring on a local passerby, marking them out as a person of high rank.”

…and so on. These again depend on the specific of each nation but are far less general than the first kind and don’t point to anything specific, but give a lot more life to each area. I’ve written a large number of these, including allowing them to vary and change depending on the specific place and context, and there’s also code in place to make sure that they don’t repeat too soon. Both of these systems are relatively small additions, but I’m actually really happy with how they’ve come together, and they give a heck of a lot more life to the world! Also, in the case of these ambient messages, the game keeps track of which ones have been recently used and doesn’t recycle until a large number have been gone through; it also slightly randomly generates the precise wording of each one in order to boost variation; and the time between these messages gets longer the more time the player spends in an area, in order to make the full selection last longer and because a player spending quite a while in one map area is probably working on something specific, rather than necessarily exploring. I think these are another really nice addition, and while the database of these isn’t finished as I write these – though there’s already hundreds! – I’m really happy with how these have worked out so far.

(A large number are shown in these testing screenshots, but in practice, they are far rarer, and have more variation in phrasing!)







Starting Relic Generation

One of the objectives for 0.11 will be generating religious relics. These will be very important items, having a lot of value (obviously) to particular religions, but also a lot of trade value if you can find the right people to sell to, a lot of potential for religions to become very pleased with you if you are able to return a relic that perhaps is being sold in a distant land, and relics will also sometimes be the rewards that one can get for figuring out the location being referred to in a treasure map. I’m really keen for these all to be very interesting, striking, distinctive items, that really get the player’s attention and signal clearly that this is something of high importance. As such, I have begun laying out the basic foundations for generating the images of the relics. As mentioned previously there are now several dozen different archetypes for religious relics, some tethered to particular archetypes of deity or religion (e.g. a “Lovecraftian” relic or a “Demonic” religion) while others can appear for any religion type, or most of them. I have posted a bit about how the image generation process in URR works before – both in the sense of “how do I design them?” and the sense of “how does it work under the hood?”, and I’ve just been making a little bit of progress beginning to sketch out some very basic initial text grids. Even without the slightest degree of colour or shading or anything else, some of these initial drafts are already giving a sense of how interesting and colour and distinctive some of these items are going to be, and I’m really happy with this initial groundwork I’ve been laying now for next year.



University planning

I’ve made a major decision here for the game – given that the game is / is going to be about information, discovery, exploration, reading, cryptic puzzles, etc, I’m not sure any more how much sense it makes for the player to begin the game in an upper-class district, or to begin the game in any way as part of a noble house. I’ve also been thinking for a while about adding in “university” areas to the game, similar to “towns” or “fortresses” or “mines” and so forth, and the more I think about it, the more I like this idea. I think starting the player off in a university would be a very novel opening; would enable me to develop a very cool and interesting little opening cutscene (which I will say no more about until I start working on it); and would give the player a very clear framing about what sorts of thing this game is about. It would also be a logical way to get the player started on the main quest and to give them a few initial items – maybe a book or two, a note or two, a cryptic item or two – to help them out on the start of their journey.

My current thinking right now is that universities will contain classrooms, halls, student accommodations, libraries (maybe you can pay to access any book there, but it costs more than finding the book in the wild and buying it? Would be strange in the real world but makes more sense in gameplay terms!), study rooms, maybe a museum of some noteworthy items (the University of Sydney, where I’m based IRL, has a number of these), and I think an observatory will be a cool addition as well (but I won’t say any more about that just yet). They will also vary, of course, across nations depending on their policies. For example, the university in a nation with “populist” politics is probably going to be quite limited (no intended commentary on the real world inverse relationship between educational attainment and voting for populist candidates should be inferred) whereas a university in a nation whose culture is far more focused on intellectual and cultural attainment will likely have a far larger university. Nevertheless, all nations will spawn with one university – for the player to start in – while I might perhaps have more intellectually inclined nations to have an extra university or two elsewhere in their territories. Like towns and mines and the like, these structures will be outside of cities and will be found somewhere in that nation’s territory (though I’m going to set them to generate near to the city to encourage new players to head into the capital city of that nation first when they depart the university starting location).

Anyway – at present I’m not sure whether this will be something for this 0.10 release, or for 0.11, but I’ve begun sketching out the initial code required to generate these areas, populate them with people, etc etc, and I’m really keen on this rather more novel start than what we currently had. More on this in the near future, I am sure!

Bug fixes / tweaks / etc

- Resolved a long-standing bug that somehow neither I nor any player had noticed for years (!) in which, rarely, the last letter in a sentence in a multi-line message would be chopped off and not displayed in the message window. In fairness URR has until now had very few multi-line messages, but I still can’t quite believe how long this one survived for!
- Fixed a bug with animal-archetype religious altars barely having any colour distinction between the background and the foreground of the altar and the design on it – it was very hard to make out the image, but is now much clearer.
- Given that I’m actually looking to do a big overhaul of the dialogue system to make it far more fluid and “human”, I’ve temporarily removed the variable questions (“What do you think of [X]?”) with the intention of coming back to them in 2023. - - The initial work on the questions and the replies however will still be useful – it just won’t be in this release!
- Fixed an issue with certain items very rarely not possessing the properties required to draw them correctly when in the player’s inventory, but only if they were added in a very specific manner.
- Dealt with a bug that very very rarely caused world generation to crash when it was trying to figure out embassies in city centres for certain kinds of civilizations (or rather, civilizations in certain contexts).
- Put in a few more optimizations and improvements to the systems that draw the terrain around the player when the player moves; I am keen to really improve this further in the future, but another little set of small refinements here again supports the objective of making the whole game a bit faster, a bit smoother, and a bit easier to navigate.

What next?

I’ve decided to shift releases to January instead of December, because releasing between the 25th of Dec and the 1st of Jan doesn’t really get much visibility because people are, generally, busy during that time. I’m therefore going to try a model of instead releasing “some time in January” the default going forward, and we’ll see how that goes. My next objective is to working on food / water / equipment consumption out in the wild, and start programming in some dreadful maladies to befall the player should they venture too far beyond their means; I’ll also in the next few weeks be working on bug-testing and refining these above systems and the ones from the previous updates, and working to clear out more bugs and polishes on my larger list of these as well. Next update in a couple of weeks, everyone!
Logged

Dorsidwarf

  • Bay Watcher
  • [INTERSTELLAR]
    • View Profile
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3236 on: December 06, 2022, 08:11:17 am »

I think I saw this update on the blog but extra thoughts:

I think the new fountain style is a real improvement, but even just the shading on the arrow butt has a great deal of value.

Being a university student with just enough money/supplies to begin definitely makes more sense than being the scion of a noble house! I think that's an aspect that URR's sorely needed for "adventure initiation" until now.

The (Exciting-sounding) religious artifact recovery concepts sound amazing. Something about the idea of being contacted by a priest who tells you that his religion's sacred icon is being auctioned in a rival city in thirty days just strikes me as such a "call to adventure" style thing, you know? It could even be tied with the religious artifacts thing, with them always taking other religion's artifacts off your hands, but offering less money than a private sale and offending said religion more in return. The line between archaeology and tomb-robbing was always a thin one classically...

Thanks for another great update Dr Johnson
Logged
Quote from: Rodney Ootkins
Everything is going to be alright

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3237 on: December 07, 2022, 08:27:57 pm »

I think I saw this update on the blog but extra thoughts:

I think the new fountain style is a real improvement, but even just the shading on the arrow butt has a great deal of value.

Being a university student with just enough money/supplies to begin definitely makes more sense than being the scion of a noble house! I think that's an aspect that URR's sorely needed for "adventure initiation" until now.

The (Exciting-sounding) religious artifact recovery concepts sound amazing. Something about the idea of being contacted by a priest who tells you that his religion's sacred icon is being auctioned in a rival city in thirty days just strikes me as such a "call to adventure" style thing, you know? It could even be tied with the religious artifacts thing, with them always taking other religion's artifacts off your hands, but offering less money than a private sale and offending said religion more in return. The line between archaeology and tomb-robbing was always a thin one classically...

Thanks for another great update Dr Johnson

Thanks Dorsi!

sorely needed for "adventure initiation" until now. - well said! This is something that's so important in the next couple of releases as I build up to 1.0.

Something about the idea of being contacted by a priest who tells you that his religion's sacred icon is being auctioned in a rival city in thirty days just strikes me as such a "call to adventure" style thing, you know? - yes! Some relics will show up in churches, but others might be found as part of treasure, some might be in private hands, etc. This more broadly is going to require a bit of code for "unique items" which don't currently exist yet, such as keeping track of their locations, enabling people to talk about them and discuss them, enabling them to (later) be mentioned in books that give you hints to their locations, etc...
Logged

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3238 on: December 17, 2022, 08:02:17 am »

Lots more has been coded in the past couple of weeks, so let’s get to it!

Supply consumption and use

I have now implemented an initial working draft of supply consumption use as you walk around the game world. So first off, here I am after a few days of walking around in a city (exactly 24 hours / one day increments each time you change map tile, whereas it’s in moving around on a map tile that moves time forward on a minute-by-minute level) and you’ll see that there are no messages in the message window talking about the fact I’m consuming food, and the counters for my three types of supplies in the sidebar are greyed out. Whenever you are in any kind of settlement – city, fortress, town, monastery, even a farm or a mine or (later) a university, you will not require supplies, the rationale here being that you’re able to get food and water in the place you’re staying.



However, I’ve now moved out of this city and two immediately important things are happening. Firstly I am using one ration of food per day as I move around (see the message log on this), and also the relevant part of the sidebar is now lit up to emphasise that these supply considerations matter because the player has now journeyed outside a settlement of some sort.



Later I find my way to a town, and although I’m not exploring it in foot, entering it is enough that my next movement will not cost any food (or water or equipment were I in desert, or polar / mountainous, terrain) because I’m in a settlement.



I then leave again and keep exploring, and two important things happen here. I find a desert, and roughly as I enter the desert, I use up my final food ration and the game gives me a warning to let me know that I’ve used up all my food supplies, and that unless I eat soon I’ll be in danger of two illnesses. A lack of food, a lack of water, and a lack of equipment, now all come with two potential dangers. A lack of food can bring on malnutrition (weakening the player) or starvation (potentially fatal); a lack of water in the desert can bring on dehydration (weakening the player) or heat exhaustion (potentially fatal); and a lack of equipment in polar or mountainous regions can bring on frostbite (weakening the player) or hypothermia (potentially fatal). I’m still working out the exact gameplay impacts of each of these – while also keeping in mind that combat will be coming soon and so I need to think about some of these in terms of effects to the player character’s body, abilities, etc – but this message is the warning that the first of these might be on its way before too long.



A few days later – note again that the messages are telling us we’re using a water ration with each step we take in the desert – we also run out of water, and are now in danger of both malnutrition and dehydration. Oh dear!



The same is also true for your use of equipment in mountainous or polar terrain:





There are still a few minor bugs I need to iron out here involving some potentially unusual map movements always correctly consuming supplies, and making sure that the sidebar is always correctly grey / not-grey depending on where the player is, but this is all coming along nicely.

General messages finished

Next, I’ve now finished the general messages that can appear when you’re just wandering around. This had several parts. Firstly there were a number of message contexts that I hadn’t finished writing out when I posted the last update, particularly potential messages for if you’re out in the wilderness (i.e. you are not in a settlement of any kind) and also potential messages for some of the more obscure cultural possibilities and combinations within a given civilization. Secondly I needed to implement a system to make the initial words in each one actually vary, and so rather than them all saying “You hear people” or “You hear someone” you will see in the screenshots below way more variation here in how the messages are actually framed and presented by the player. Thirdly, I needed to add a system that keeps track of how long it has been since you entered an area, and how long it has been since you’ve seen an ambient message, and to have that tick up over time as you’re going around and doing whatever you’re doing in a given area. This took a little while but wasn’t too difficult, and the game now works hard not to repeat these messages and also not to swamp you with them. Fourthly and lastly, and related to the last bit of the above, there is also now a system to prevent the same message from appearing twice even if the exact wording would be slightly different, so you can’t get “You hear a distant argument” and “You find yourself overhearing a distant argument” in immediate succession. I’m very happy with how these are working, and they definitely bring some nice extra life to the game world!





Bookmarks

You can now save your own bookmarks in any area in order to fast-travel back to that bookmark! You can do this by pressings the ‘B’ (or ‘b’) key and in each area you can, at present, place up to five bookmarks of specific tiles; when you do so the game asks you to select a description from a large number of presets (rather like the messages system in From Software games, except without quite so much potential for euphemisms) and to say what direction you should begin looking when you come back to this area. You might, therefore, save a bookmark as “Mystery Plant” or “Strange Statue” or “Important House” or “Cheap Merchant”, or whatever it might be. Any bookmark, once saved, is then added onto the end of the list of fast travel locations when you re-enter that district, so you can go straight to a shop, for instance, or instead go to the bookmark you placed in a location where you think something important might be buried, or which might be outside the home of an individual you think might be very consequential. You can also place bookmarks in areas that aren’t even settlements, so if later on you find something strange in the wilderness and want to come back to it later, you can put a bookmark on that. I really like this system, and again, it’s just another little quality of life thing that will start paying dividends more and more in the coming years or two of development. I haven’t yet programmed in the ability to return to them (that’ll be coming shortly), but the ability to save them is now fully implemented. So first you press ‘b’ and select a tile with the crosshair, shown here to the right of the player:



Then you put in the name for the bookmark you want:



And then your bookmarks, up to a maximum of five per map grid, show up on your map:



I’m really happy with this! In a game that is going to be all about information, discovery, exploration and the like, the more systems I have for the player to keep track of things, the better.

Plants

Now, let’s talk about plants. For several releases now the game has had appropriately generated images for plants in farms, with an appropriate range of permutations and the like. Although these were actually pretty early in the whole procedural graphics thing, I remain very happy with how these look (especially as a lot of standard farm vegetables and grains are surprisingly hard to make into interesting ASCII-esque graphics).



However, this doesn’t cover procedurally-generated plants which should be filling the game world, varying according to area and climate, and (like everything else) potentially being a part of a puzzle (e.g. maybe a riddle directs you to a place where a specific plant grows in immense numbers?). The original intention (And by “original” here I mean “in the early to mid 2010s”) was for plants to be important things that one could pick up and use to craft various things (this is obviously a common idea in many games), and back when URR was essentially a Dwarf Fortress clone, I was really inspired by the use of plants in things like Ancient Domains of Mystery and Skyrim, and felt this would be an interesting addition. I seem to recall I even – although sadly I can’t find the documentation now, ha – that I developed some interesting systems in my head for how plants would spawn, spread, potentially interbreed creating new strains, all these sorts of things. However, as URR moved away from “Dwarf Fortress clone” to “procedurally-generated clue-finding mystery”, I abandoned this and binned it. Nevertheless plants could appear on the map, denoted by a different symbol to the normal grass or savannah terrain or whatever it might be, and the game would generate names for plants that would be found in appropriate local areas. However, at some point I removed plants from the maps altogether – I think they were causing generation issues of some sort? – and somehow after five years I haven’t got around to putting them back in. This is particularly strange because the presence of plants as a terrain “type” was actually quite important for making some areas – such as city centres and upper-class housing districts – look a little bit swankier or more interesting, and without them some areas do actually look surprisingly sparse. Then, finally, because I just wasn’t sure what role if any plants would play (wanting to avoid implementing any kind of mechanic that encourages tedious grinding or searching around for valuable plants in a see of useless ones), I just shrugged and decided that I would figure out what the heck to do with plants at some later point.

Well, that time has finally come, and now plants have returned to the game-world and are merely decorative aspects to make parts of the world a bit more interesting. They now show up on the map and make areas look, frankly, a lot more interesting with these involved. It took a surprising amount of wrangling old code to get them to appear again, but here they are:









Don’t they add a ton of colour to the world?! Even better, though, is the fact that we also now have an image generator for all in-game plants! Whereas previously this was limited to the plants in farms – which have a relatively small number of possible visible permutations – this has now been extended to all of the game’s generated plants as well. Each plant essentially has three generated components based on the name of the plant. The first word – e.g. “lush” or “bristling” or “budding” or “broad-leaved” – determines what the stalks of the plant look like, how many leaves they have, their size, their number, these sorts of things. The second word or the first half of the second word – e.g. “azure” or “sun” or “somber” or “copper” – determines the colour of the flower, and also the colour with which this plant will appear on the human-scale map (as above). The third word or the second half of the second word – e.g. “lily” or “cup” or “flax” or “thistle” – determines the shape and size of the flower that the plant has. Combine these three, add in some general variation in stalk colour and some low-level grass and turf in front of the plants, and, kaboom! We have procedurally-generated plants, where the name of each plant and its geographical / climate distribution is determined during world generation, and you can now find them in the game itself.



The stuff at the bottom also varies of course based on the terrain the plant spawns in, so you might get things like this:



There are many thousands of possible generated plants, and as with everything else these will potentially be mentioned in clues, hints, riddles, and so forth, and I’ll be working on other ways to give you information about the local flora (and later fauna) too. Again, as well as adding lots of life and colour to the game, these – like everything else – will be in the pool for potential clues, such as hints pointing you towards areas where a certain plant grows, or areas where the plants are certain colours, or even second-level clues like one that mentions the plants researched by a particular scholar, and you need to study that scholar to discover the plant they studied, and then use that to discover where something might be located. And so here, finally, are some examples of the player in-game checking out some of the local plant life:









I have to say I’m incredibly happy with these, and with them appearing on the map again, they really add a ton of new life into the game world.

Bugs / polishes / etc:

- Given that black markets don’t actually appear or generate in game (and maybe never will, we’ll have to just see whether I can think of an interesting and worthwhile way to integrate them), they are no longer listed as appearing in districts.
- Resolved a number of lingering issues with several of the fast travel mechanics in cities, such as a Currency Exchange building in a market district adding to your fast travel list multiple times, the homes of noble families not adding correctly, castles failing to place you at the correct door when you fast travel to them, and various other minor issues.
- Fixed a bug where farmhouses would appear surrounded always by some other kind of terrain rather than the local terrain of the map grid they’re on. This was a rather strange one and I’m not entirely sure what triggered it, but it has now been resolved.
- Fixed a bug where sometimes a mysterious plant would appear in farms called “livestock” and the game would utter the immortal sentence “this is a clump of livestock”, which makes absolutely no sense at all.
- Cult shrines in cities no longer take a random potential shape for their basis, but instead use the appropriate shape that their home nation likes to use in its aesthetics.
- Fixed a laughably long-running (and often reported!) bug with the area of vision around the player being just one tile miscalculated when you’re facing in one of the four cardinal directions. I can’t even imagine how long this one has been here, but it’s gone now!
- As well as ‘?’, the Guidebook is no longer accessed via ‘B’ or ‘b’ (as those are now needed for the bookmarking function), but rather by ‘G’ and ‘g’.
- Fixed one of the last lingering bugs from the conversation from Python 2 -> Python 3, which is that (for some reason) the colours of water in the game (rivers etc) are all basically an identical blue, rather than a nice variation of lighter blues and cyans and so forth. This has now been resolved, and water looks rather lovely again now.
- Also done the equivalent of the above for lava, and now lava (on the rare time one actually, er, climbs a volcano?) shows up as a nice mix of red and orange colours that change each turn, rather than a uniform dull red.
- Fixed a bug where you could very rarely get on a ship without actually having the required money to pay your way.

What next?

Next I’ll be working on the illnesses and ailments that you can get while out exploring the world, polishing how supplies are used (in both gameplay terms and data management terms), and starting to look at how we can get some more optimizations out of the game, both in terms of map generation when you enter a map grid, and in terms of showing that map on the screen. Looking at the code now with my old (early 30s) eyes I see my earlier (early 20s) attempts to be, frankly, abysmal, and I’m sure that there are huge improvements to be made here. Again, 0.10 is a release for making everything faster, smoother, easier, and this is a big part of that. More in a couple of weeks!
Logged

Ultima Ratio Regum

  • Bay Watcher
  • Game Studies Lecturer, "Ultima Ratio Regum" person
    • View Profile
    • Ultima Ratio Regum
Re: Ultima Ratio Regum (0.9 released Dec 31 2021!)
« Reply #3239 on: December 26, 2022, 07:48:18 pm »

Hello! Since the last update I’ve made some major progress on a large number of major optimizations and improvements to the code and speed of the game, and in also in the development of new features, for URR 0.10. So, let’s have a look:

Field of view / map drawing optimizations

The first place I found to improve matters was in discovering that the fov computation was going significantly beyond the actual scope of the area the player can see. In URR you have a directional field of view, so what the player is able to see is dependent on which of eight directions (i.e. the eight main compass directions) they are facing, with a roughly 140 degree range of sight. Given the range of the sight coded into the game, this realistically meant that the player can see around 18 tiles in any direction at any given time. By this I mean they can actively see what is going on there, i.e. that area is lit up; of course if the player has previously explored some larger area they can see what buildings and terrain and so forth are there, but they are not actively seeing it, i.e. they are not seeing whether NPCs are moving around in it. Here are some examples of what this currently looks like:





So, even though the player cannot see things actively beyond eighteen tiles or so in any direction depending on what direction they are facing, I discovered that the fov calculation was using numbers more like 25 in each direction. So when the player is facing north, they can see a maximum of 18 tiles to the north and fractionally under 18 tiles to the west and east, meaning that the extra 7 or so in each direction are being unnecessarily calculated each turn. I recognise that I implemented this because we need a small buffer of tiles outside the player’s vision range to ensure that a tile which was visible the previous turn, but is now not visible, is correctly rendered not visible – but that needs to be only one tile (or two tiles to be absolutely confident), not seven. The initial and quite rapid improvement I was able to make was therefore really tightening the area around the player where these calculations are taking place, leaving only the slightest buffer of tiles which might have changed between this turn and the last. This saved a little bit of time on each calculation, but there was clearly more to be done.

The second optimisation was to notice that in the field of view code, a particular calculation was being done twice. There were some lines of code which in essence asked “if [calculation] < x, then do y”, and then if that was returned as a false, the next line was “else if [calculation] > x, then do y” – but it was doing the calculation again. This is a common mistake I made as an early programmer and lots of this code is literally a decade old or close to it, and was of some consequence here as this was a relatively computationally-demanding calculation that was definitely slowing things down by virtue of being unnecessarily run twice. It was therefore a trivial fix to just have a single calculation done for each tile and then have the outcome of that referenced twice, instead of doing the calculation anew each time. This again saved a handful of milliseconds on each fov calculation, but there was still more to be done.

The next optimisation was the realisation that there is actually a significant chunk of area which does not need calculating again each time. Take this diagram for instance (I’m doing all these diagrams in desert areas as they are the most devoid of stuff that gets in the way, and hence the clearest):



In this diagram imagine the red circle as being all the potential areas that the player might be able to see in (with a tile or two of buffer), and the green being the only area that needs to be calculated on this specific turn, i.e. the part of that red circle that the player is dealing with, as well as a small buffer on each side for any tiles which were visible and now should not be. My next big realization was that unless the player just changed height and some things might now be hidden over a hill that were previously visible, or the player has just entered a map tile for the very first time and hasn’t yet moved around within the map tile, or the player has just turned around and is looking at something that wasn’t in the green rectangle from the previous turn, then nothing within the blue square needs to be calculated each turn!



This seems a bit counter-intuitive, so let me explain. The player enters a new map grid and everything within the green rectangle is calculated and presented – all well and good. Then the player takes a step forward – whatever they might see has already been calculated within the green rectangle precisely because it has that 1-2 tile buffer around what the player is actually seeing that turn, and therefore it is the edges that need calculating again (as the green rectangle moves onto previously untouched tiles) – but not the middle. More broadly, generalising this to all directions, we could note that once the yellow rectangle is calculated on a given turn, anything within the blue rectangle does not need to be calculated on the following turn (again unless the player is changing height on the map, for example). This then looks like this…



…and all of this led to this realisation that because the buffer is always being calculated around the edge of what the player can see, whenever the player moves into those already-calculated areas (i.e. they become part of the blue rectangle), they’ve already been calculated! This was a big breakthrough, although it took a while to implement all the exception cases as mentioned above – the player first entering a map grid, the player changing height, and the player changing their facing direction, all require the blue rectangle to be calculated afresh. Nevertheless, this overall reduced by half the time it takes the time to calculate field-of-view stuff for the player! FOV calculations started at around ~15-18ms per turn; the previous optimizations had reduced it to something like 13-15ms/turn; and this reduced it down to around ~4-6ms/turn, and around ~10-11ms/turn when the player is, indeed, changing height.

With all of this done, it was then time to turn my attention to how the game prints this stuff on the console for the player, i.e. the actual playing of specific characters with specific colours. There was one obvious initial improvement to be made here – much like in the field-of-view context, the game was printing (and therefore re-printing) characters in slightly too wide an area compared to what might actually be changing on a player’s given turn. I reduced these numbers to just take in the barest of margins with a small buffer and this bought us a few extra milliseconds of grace on each calculation – but again, this was only the start. Looking over the code with a fresh eye I then noticed that there were a number of places where “player.z+1” and “player.z-1” were being calculated over and over and over, so I again just made that a pair of initial calculations, which between them maybe saved us a millisecond (but every little helps!).

I then discovered a piece of code that was actually completely superfluous under the new developments and improvements that I’d put in. There was a calculation being made for – I think (!??) – checking whether something was not in your fov but was a little bit outside of it and needed updating (I’m genuinely uncertain what this ancient code was for), but I discovered that disabling it changed absolutely nothing (I tested this at length!) and saved us another few milliseconds, so that mysterious line of code was out. I also then found that when the player was facing in a diagonal direction, i.e. northwest / northeast / southeast / southwest, a small optimization could be added by identifying the corner of the screen that is opposite from the direction you’re looking and automatically assessing that as an area that by definition must be out of vision, rather than doing a relatively complex calculation over every tile which would lead to the same conclusion. Again, removing this mysterious bit of ancient code another millisecond or two on average saved.

So: when I started work on this it was taking ~20ms to calculate the field of view each turn, and ~60ms to print what the player saw (and then on top of that it had to take the time to have all the NPCs in an area have their turns, etc). After about a week of work it now takes around ~5-10ms to calculate the field of view each turn and around ~30ms to print what the player is seeing. This is a more than 50% optimisation! I confess to being very, very happy about all this. My skill in programming is – to put it mildly – not to be found in this kind of deep optimisation / clean code sort of stuff, and I generally find it quite dull to work on this kind of deep-level stuff and it’s relatively unrewarding in m brain, as well as being the sort of programming that just doesn’t really resonate well in my mind compared to the more creative stuff. Given that general orientation to this kind of work, I’m actually pretty proud of myself for finding the brain space and energy to get this done; for finding so many solutions for improving the speed with which the game runs; and for the overall result and the > 50% saving of time in the fov calculations which the player has to encounter every time they take a movement. A lot of this release is about optimisation, about small improvements, smoothing off some of the rough corners and making the whole game just a smoother and easier experience to play and to navigate and to find your way around in, and the game really does run so much faster on the back of this. I’m very satisfied with all these improvements and all the workarounds I was able to find here, and I really think everyone will find the world a far more pleasant place to navigate as a result, especially when coupled with all the new options for fast-travel and all the new options for bookmarking and all the map generation optimisations I’ve also put in this week (see below!).

Map grid generation optimisation

My second main target for optimising the game’s speed came in the last week via working on map grid generation. To begin with we would note that this shares two main characteristics with the turn-by-turn rendering of the game world: this was code I generally wrote around a decade ago, and this is code that is incredibly slow for what it does. When I started work on this the average map grid took around 12-20 seconds to generate which is absolutely shocking for an ASCII game. Each map grid does admittedly consist of 40,000 tiles (200×200) but that should honestly barely take any time at all for a modern computer to create and fill with stuff according to some appropriately-scaled code. My goal was to get everything down to under five seconds and the lighter map grids – such as those which are just wilderness without buildings and NPCs and all this other stuff – to ideally maybe three or four seconds. I am unbelievably pleased to say that this has now almost been completed, with every map generation certainly now taking below eight seconds, and wilderness maps generally only taking five seconds – and there are certainly more optimisations for come. For now, though, I’ve managed to hugely speed up map generation in three major areas:

Terrain Dithering

Firstly, one area which I found was taking between two and five seconds (!!!) to generate for each map grid was the dithering of terrain on the edge of a map grid. What I mean by this is that if you enter a map grid which is savannah, for example, but the map grid next to it is a different type, such as tropical or desert or temperate, then the game will dither the terrain at the edge of that map grid in order to ensure a sense of a smooth and gradual blending between the two areas. This generally looks something like this, with the other terrain type becoming more and more pronounced closer to the edge of a map grid:







To my absolute horror I discovered that the method I developed for this when I was 22 and had barely finished the Python roguelike tutorial was to have the game go over the entire 40,000 tiles, calculate a random chance on every single one, calculate what possible terrains it should be on every single one, and then decide which of those terrains (if any) the existing default terrain for that map grid should be changed to. This is frankly atrocious and uses a staggering amount of wasted time engaging with tiles, and doing calculations on tiles, that don’t actually have anything to do with creating the intended dithering effect, especially if the dithering is only required on one side or even one corner of the current map grid. Instead, I have now created large sets of tile lists for each possible dither (each side, each corner, so eight in total) and if that side or corner needs to be dithered, the game goes through that set and dithers the tiles in that set. This means that no unnecessary tiles are touched by the algorithm, no calculations have to be performed over and over, and the final effect is literally indistinguishable from the earlier version. This has taken the time required to dither from potentially as long as 5 seconds (5000 milliseconds) all the way down to 0.1 second (100 milliseconds), with no loss of functionality! This is a massive improvement and I honestly can’t believe that such a catastrophically awful and time-consuming section of code has remained in there for so long – but either way, it’s good to be rid of it.

Spawning Plants

The next thing was to take a look at how plants were spawning. They had a similar method to what I’ve just described above and were carrying out a ludicrous number of calculations on every map tile, especially when we consider that relatively few map tiles actually end up having plants, especially in areas like deserts and tundra regions. These were therefore reworked in the same way as above, giving us a list of potential plant locations – where the list is of a sufficient size – in order to skip the tiles that don’t actually need to be addressed. This process took an unconscionable five seconds or so under the previous model, but now takes between 100 and 200 milliseconds (a tenth to a fifth of a second). Another huge improvement! Reworking how plants spawn also required me to interact with some other systems for spawning plants with certainty in specific places, such as gardens or other arrangements in upper class, middle-class or city centre districts, rather than (or as well as) just spawning them randomly. Some of these were actually fairly efficient already, but others needed a little bit of refactoring – again generally just changing them to a list of potential tiles, instead of iterating over every tile on the map – and this saved us a little bit of time here and there again.



Spawning Trees

The third area I’ve found so far for making huge time gains during map generation is in the placement of trees. The existing model was, again, alarmingly similar to the plants and dithering model – go over the entire map, do loads of calculations on each tile to decide whether a tree should be appearing there, and then eventually place the tree itself. Instead, therefore, I deployed a new model where the game now has a set of lists of potential locations for trees, and for plants. There’s a large enough number of these lists (and more than enough other stuff that varies with each map grid generation!) that I can’t imagine a player will ever spot when it’s repeating, but essentially it’s a long list of tuples – e.g. “(125,17)” – where trees or plants might spawn. A new map grid coming into existence selects one of these lists and then attempts to place some trees and some plants by looking at each tile according to the list (which totals only a small percentage of the total tiles on a map grid), rather than iterating over every tile on a map grid and running some randomization decision about whether or not some kind of plant should be appearing there. In other words, the old version tried to place a tree 40,000 times per map grid; the new version tries, at most, 1,500 times, and each of those attempts is more efficient than each attempt in the 40,000 attempt model. I think it’s not hard to see how much snappier this now is! The original version took 3-4 seconds while this new version is down to around 0.1 second, again with no change in the final effect or how things look when the player explores a given map grid.



Fast travel within a map grid

I’ve also been further refining the fast travel system. You can now fast travel to any of the important areas you find in a map grid (all the areas in your starting civilization being as pre-explored) but I’ve also now implemented a model whereby you can fast travel within a district. Pressing ‘T’ to travel, but then not moving outside your current district or town or whatever and just pressing enter instead, will again bring up the list of potential fast travel locations. You can then pick one and the game will quickly increment the required turns to get you there, and put you in the appropriate place, without having to reload the area. This again will help you get around faster (as I’ve said before, a lot of this release is about speeding everything up and making the whole game faster, easier, smoother, more user-friendly) and is a really nice improvement to assist in getting yourself around the map. Here’s are two gifs of me doing this in a town and in a city:





(If these gifs seem slightly “slow” given all that I’ve been hyping up speed improvements, don’t be alarmed – the gif recording slows things down, and there are debug messages playing in the background, but without both of these the in-district movement is genuinely *cracking* along!)

Farms, fences, hedges

With plants now fully implemented I want to start laying some early groundwork for animals. As such, I spent a couple of hours preparing some areas in the game’s generated farms. As well as plants and orchard areas, plants can also spawn with “blank” areas, i.e. fallow fields with nothing currently growing.



Half of these are now labelled instead as “livestock” areas instead of “blank” areas, and the first thing to do was to wrap a fence around them. A little bit of work quickly generated a system that could easily identify the limits of one of these farm quadrants:



And then a little bit more work enabled me to generate and place one of two new feature types, either fences or hedges. Here’s an example of a fence…



…and here’s an example of a series of fields enclosed by some hedges:



(And yes I know there’s a minor fov error in one of these screenshots, but it has since been fixed!). Each of these now finally implements the graphics for these that I’d generated during 0.9’s development cycle, so you can check those out as well:





This is all obviously just a very minor addition, but one that didn’t take up much time, adds some more variety, and prepares things for a later release as well once animals (wild animals, domesticated animals, horses the player can hire / ride, etc) come into being.

Bookmark fast travel returning

Lastly, in the previous release I described how the player could now place bookmarks of their own – up to five in a map grid – in order to then fast-travel back to custom locations such as the places that particular NPCs are, or a place where they think something might be buried and they need to come back with the appropriate equipment to dig it up, and so forth. I’ve done some more work on this and there are now a number of developments moving this feature closer to completion. Firstly, the actual act of placing the bookmark has now been limited substantially, ensuring that you cannot place a bookmark on a tile that you have not explored, and you also cannot place a bookmark on a building or some other structure. I immediately realised this would essentially be a tool that could be used to essentially teleport the player onto a rooftop or onto some previously-unseen part of the map, so this really needed resolving. As such, in the below screenshot, you can only place a bookmark on somewhere that has been explored, and somewhere which is the not a building (you will also see the two possible errors messages that can generate when you try to place a bookmark in an inappropriate location). I’ve marked excluded areas in red to illustrate what this looks like:



You also cannot place a bookmark on top of something like a tree trunk, a hedge, and so forth. The next thing was to not just have bookmarks appearing when you look at something on the world map, but also have them appear in the fast travel list as something you can warp to. The first part of this, however, was to rework part of the world map. Currently the game only shows you stuff that you’ve found if you’re in / hovering over looking at a city…



…but not if you’re doing the equivalent for a town or a fortress:



A few changes later, however, and the world map now gives you a proper description of what you’ve discovered in a town or a fortress (or anywhere else for that matter) and you can view these much as you would in a city:



There is still a minor bug in this screenshot – it should of course say that you have explored it! – but this screenshot nicely demonstrates how the map now looks, telling you both what is there and telling you at the same time what sorts of things you might be able to fast-travel to when you enter that area (town, fortress, later university, mine, etc). With this done the next step was to get the custom bookmarks appearing alongside the standard bookmarks whenever you enter an area that contains both. I will need some extra code for entering a wilderness area that contains no standard bookmarks but does have some custom bookmarks, but for now I focused this on cities, towns, and fortresses, which will always have the potential for standard bookmarks but can also include custom bookmarks as well. After some work, here’s what we have (with some silly bookmarks just for testing!):



You can now select any of these when you go back into an area you’ve placed bookmarks in, and much like the normal fast-travel locations, it will warp you to the place where you should be, and in doing so increment an appropriate amount of time. One thing did come up, however, which is that there is nothing visible which shows you where the bookmark is; if you were to mark out somewhere you want to dig, for instance, warp back to it, and then wander off to do something else just for a second (or even just leave the computer and come back!), it might not be immediately obvious where the spot is. So, to resolve this, I have also added a little feature that when you place a bookmark, the game prints a little message along the lines of “You have placed a bookmark with the label [XXXXXXXXX].”, and actually adds something new onto the tile where you placed the bookmark!



This is a “feature” on that tile like all other map objects (e.g. plants, trees, terrain types, doors, staircases, vases, shop stalls, tables, whatever) but can obviously be walked through and walked over since it isn’t really “there”, it’s just in the user interface, but can be looked at as a feature which just tells you that you placed a bookmark here, what it is called, and when you placed it.



The game will also place a ‘?’ on the world map if you place a bookmark in an area that doesn’t have anything else registered, i.e. is not a settlement or a farm or whatever, in order to aid in recalling things that might be far out in the wild.



I think these are nice little details and again, in such a vast world, should help the player to keep track of what’s going on and what they’re doing and when they did it. One of the next things to add is of course some way to see all of your bookmarks (this will probably be on ‘B’ whereas bookmarking is currently on ‘b’), and also a method to delete your bookmarks to free up room for others – I think these are all some very good additions to the fast travel system.

Ultimately it is clear to me that URR is, really, not very user-friendly at the moment, and so such a large portion of this release – speeding up every turn, speeding up generating every map, giving the player all these new options for fast-travel and custom fast-travel and everything else – is all in service to really trying to make the game a lot more approachable and a lot more accessible, and to give players all the facilities they might ever need for making sense of this vast world and its slowly coming-into-being mysteries :). I’m really happy with how all of this is coming along.

Bugs, miscellany, errata, etc

- Found a major issue with shops in towns sometimes not functioning correctly when you try to buy or sell something (unlike shops in cities which seem entirely unaffected by this) and causing a crash, but managed to resolve it after a fair bit of work.
- Fixed an issue where items that were not actually on stalls within shops were being counted as being “in” the shop and hence something you could purchase (and hence something the merchant would try to sell!).
- Pressing “P” now lets you press Tab to switch between information about the policies / culture of the nation you are currently in, and the policies / culture of your home nation, rather than just showing your home nation regardless of where you actually are in the game world. This now makes it a lot more useful.
- Fixed an issue with courts in appropriate civilizations not always generating correctly when the player tries to enter, and getting stuck in an infinite loop.
- Dealt with a bug whereby selecting unusual religion types in sufficient number during world generation could very, very, very rarely lead to a crash.
- General messages now accurately say “district”, “town” or “fortress” instead of (in some circumstances) always just saying “district” and assuming the player must be in a city.
- You can no longer just endlessly look at the same thing over and over – which tends to lag the game especially if you stack keyboard inputs – and instead you can only look at each thing once. This makes no gameplay difference except it stops some potentially quite significant lag if you press the same button repeatedly.
- Noticed that docks in towns were not correctly triggering with the new stuff in towns – i.e. intro messages didn’t mention them, they weren’t saving correctly as bookmarks, you couldn’t warp to them, etc – and resolved all of this.
- Resolved yet another bug that sometimes prevented docks from properly spawning in certain towns – docks should now always be able to appear no matter what.
- Fixed an issue with dock doors still sometimes spawning facing the ocean rather than facing the land – again, I was pretty sure this had been resolved before, but it has definitely (…?) been resolved now.
- Moving across a grid manually on foot, rather than with fast-travel, but not being in a city (so you’re moving through a gate between districts), now correctly handles things like calculating the initial field of view when you set foot for the first time in the next map grid rather than sometimes temporarily placing the player into a tiny shadow world for a few turns before allowing them to see the rest of the area.

What next?

My next tasks are essentially to continue working and finishing the systems already being implemented in 0.10 – fast travel, speed improvements, custom bookmarks, supplies and ailments, etc – and continue working through my list of known bugs, existing issues, small things that need polishing from earlier releases, and so on. I’m really happy with what I’m getting done here and enjoying the whole process just so much. As ever, if you enjoy this kind of detailed devlog, please do share it (https://www.markrjohnsongames.com/2022/12/26/ultima-ratio-regum-0-10-update-5/) around on social media or with friends you know who you think might be interested! More soon!
Logged
Pages: 1 ... 214 215 [216] 217