Author Topic: Ultima Ratio Regum (0.8 released after five years!)  (Read 253035 times)

Zireael

  • Rogueliker
  • ***
  • Posts: 604
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #45 on: May 10, 2015, 06:02:07 PM »
For the Hunter-Gatherer, I suggest Shamans :)

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #46 on: May 19, 2015, 09:07:19 AM »
For the Hunter-Gatherer, I suggest Shamans :)

I'm working with/on something like that! See below: here's this week's blog entry, though you'll have to head to http://www.ultimaratioregum.co.uk/game/2015/05/17/policies-and-nicknames-part-2/ to get them! Just a short one this week.

--------

Well, I almost missed a weekend update for the first time in over a year, but in my current timezone (Germany) it is still Sunday, so here we are! Just a quick one this week, but I’ve got a few really long and interesting updates, and some more abstract discussions, scheduled for the coming weeks. However, since this entry is rather short, here are four of my most recent conference/lecture presentations, in no particular order. Enjoy!

Talk to AISB AI & Games conference on designing URR’s upcoming NPC AI:

Talk at a conference on literary dystopias about Command and Conquer: Tiberian Sun

My main talk at DiGRA about Japanese arcade culture, danmaku games, high scores, and some other cool stuff (a full paper version is going to be published as a chapter in a book on Gaming and East Asia in 2016)!

My secondary talk at DiGRA about civilians in the original Command and Conquer

Remaining Policies


Thanks to everyone for their ideas on the remaining policies. I realized as I read through the suggestions that something had been a tad unclear: Tribal Knowledge, Chiefdom and Escort Cavalry are policies which can only appear in hunter-gatherer and nomadic societies, and are therefore rather like “placeholders”, so suggestions for those – although there were some great ones and I might integrate them as general buildings/NPCs/etc! – won’t be directly integrated into the policy system. So, without further ado, the Militia policy will result in citizens owning weapons in their homes; the Imperialist policy will allow that civilization to seize colonies (currently all feudal nations can do this, but this’ll therefore be changed); the Hegemony policy will mean that race (which is to say, skin tone) will directly affect citizens in that nation in some way, but I haven’t yet decided precisely how; and the Vigilantism policy will cause bounty offices to spawn, listing wanted individuals and the bounties on them. That means interventionist – by which I mean covert operations, spying, espionage – remains undecided.

Nicknames

So, as well as city nicknames, I’m working on nicknames for people. This means both historical figures, and living figures who the game considers important. Right now I’m splitting this into two categories: people from important noble families have a certain generation algorithm underlying their nicknames, whilst anyone else who isn’t high-born but has still become “important” will have a different generator. Firstly, if someone is from an important family, the game looks at the coat of arms for that family. If their coat of arms contains a “distinct” pattern, it will go to a unique generator for that pattern; if it doesn’t, then it will default to a more “general” generator. This generator can sometimes use words from the terrain of the homeland of this person as well.

So, for example, let’s say someone comes from an ice/tundra area, and their coat of arms contains the pattern of the dragon flying “upwards” (I’m sure many of you will have seen it). They might be nicknamed “The Roaring Breath of the Ice”, “The Adorned Wyvern”, “The Drake of the Hailstones” or “The Ennobled Dragon”. Alternatively, someone who hails from a temperate region and has a coat of arms containing a trident might be nicknamed “The Halberd of the Bluffs” or “The Invested Spear”; someone from a family with a harp on their coat of arms and who lives in the desert might be “The Singer of the Dust” or “The Sand Melodist”… and so on. Alternatively, if a coat of arms is generic or geometric enough to not merit any special words, it instead defaults to a name based on the policies of that person’s nation: “free trade” as a policy might yield “The Glorious Merchant”, “frontier” as a policy might yield “The Grand Marshall”, “theocracy” yields “The Sublime Conduit”, and so on. I still need to finish off some of the generation possibilities, but these are basically done.

And that, I’m afraid, is all for this week! I’ve been at a conference so haven’t been doing any programming this week, but there’s a lot of cool stuff on its way. See you all next week for probably a URR update, or a discussion of one of the many interesting game-related things this conference has got me thinking about!

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #47 on: May 25, 2015, 05:03:30 PM »
Teaser for the next URRpdate:


UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #48 on: May 31, 2015, 06:06:30 PM »
This week's update:

So, last week I posted an entry which generated a huge amount of discussion here, on Reddit, on Twitter, and (if past experience is anything to go by) probably a few other places I haven’t even noticed. To those who I still owe replies to – I’m getting to them! I’ll be posting a follow-up next week, but this week we’re onto another URRpdate, finally!

Clothing Generation

This week I’ve been working on both generating clothing styles for different civilizations. There are currently six “archetypal” clothing styles, each of which has three sub-styles within it, and each sub-style has its own variation between specific items of “identical” clothing (just small things like the width of clothing relating to the size of its owner, fractional colour differences, that kind of thing). As the maximum number of feudal civilizations the game allows at any one point is eighteen, this works out perfectly, so all/most of the styles will be reflected in each game (though I might add more later). I’ve so far worked entirely on upper-class clothing for rulers, aristocrats, military commanders, etc. There are several dozen colour combinations, and each nation will pick one for its upper-class clothing and then have those same colours reflected, to a lesser extent, in its middle/lower-class clothing. This week we’ll have the upper-class clothing, then next week the follow-up to the metagame post, then the week after that, probably the remainder of clothing and some early development of crowd mechanics, if we’re lucky?! So, here’s an illustrative sample of five of the six “archetypal” clothing styles (the last one is not yet finished):



Going clockwise from the top left, these are inspired by “classic” Western medieval clothing of leather (or other material) waistcoats and a shirt underneath, though here I’m treating them as a single garment; the second is inspired by Japanese kimonos; the third is inspired primarily by older Chinese styles of dress, and also some more “tailored” Western styles; the fourth (i.e. the bottom-right corner) is inspired from a range of styles including far more ancient Babylonian and Hebrew dress; the fifth is based on a lot of Eastern European royalty, and the sixth will be based on Renaissance Western Europe (but is proving surprisingly tricky to realize). These then have the three sub-styles as described above – which consist of different patterns, different locations of buttons, lengths of sleeves, sizes of collar, colour schemes, etc. To take a closer look at the variation within one archetype, let’s go with the Hebrewlonian (???) archetype, of which I’ve included three below. (There are actually a dozen different possible patterns which can appear on the “clasps”, but just weirdly enough, all three I took for this picture happened to select the same one, and now I’ve only just noticed this and I’m severely disinclined to go and generate them again, so we’re just going to have to make do with these). The right is “average” size (which will include “muscular” or whatever other build definitions I wind up with), the middle for someone slim/athletic, and the right for someone much heavier-set. So these would be belong to three neighboring civilizations who might have experienced a level of cultural bleeding between each other’s society, but maintain their own styles of dress nevertheless:



So, each of these might be tethered to a different culture, but I’ll also be sure to place those cultures next to each other (think pre-modern China, Korea and Japan, for instance), so that you get some sense of “similarity” (sometimes) between clothing styles of nearby nations (though given that many nations might have complex territorial shapes, there is only so far this can be pushed). Naturally there will be coupled with appropriate lower-body garments, boots, gloves, etc, and then we’ll be done with clothing for this release (with armour and weapons… next release?). In the new NPC lookup (or the same for the player) you’ll be able to scroll through all the clothing on an NPC to let you examine what culture you think they might be from. Maybe a logical mechanic would be to have NPCs judge the player, at least in part, based on their clothing style (and many other factors) so that there might be some ability to attempt to pass “undercover” in nations unfriendly to your own. As with everything else: the game will never tell you “this is the clothing style of Nation X”, but once the player has that learned that, you should be able to come to recognize those you encounter in the street, or the origins of foreign merchants/travelers, etc.

I’m now working on two things simultaneously: crowd mechanics, and remaining items of clothing for middle-class and lower-class citizens, and then lower-body garments, boots/shoes, etc. I’m basically working to an “interim” deadline right now since I want to show off a stable build with crowd mechanics functioning (and all clothing items implemented) at the IRDC 2015 I’m hosting on 27-28 June, so all academic work is on hold now whilst I grind towards that goal. Metagame follow-up next week, then more delicious URRpdates!

Avagart

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 567
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #49 on: June 01, 2015, 12:10:11 AM »
Impressive. As always. I'm very interested in algos and technics which are used... You made amazing work!

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #50 on: June 04, 2015, 04:17:39 PM »
Impressive. As always. I'm very interested in algos and technics which are used... You made amazing work!

Thanks! I rarely do technical updates, but a few people have been asking for those recently, so I may produce one in the next little while :)

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #51 on: June 14, 2015, 04:00:16 PM »
This week I’ve finished off procedural clothing generation for the richest individuals in feudal nations. The game can now create upper-body garments, lower-body garments, and boots, for each civilization. These different garments across a given civilization maintain a consistency of colours, a general consistency of size/aesthetic, and a consistency of whether the patterns etched into the clothing are circles, octagons, squares etc, based on the visual preference of the nation in question. Thus far these are only the “upper-class” clothing variations, but I think one can reasonably extrapolate how the others will look (which will come in a few weeks, I expect). Here’s a summary of the three layers of clothing currently implemented – I’m also going to add gloves and cloaks this release, but haven’t got around to them yet (since they’re hardly a priority compared to implementing crowd mechanics before the UK IRDC in a fortnight’s time!), but they’ll probably reflect the coats of arms of important houses if upper-class cloaks, and then just have some appropriate patterns on for middle-class, and nothing special for lower-class. Anyway, onto the clothing of our procedurally-generated aristocrats:

Upper-Body Garments

There are currently seven “archetypes” for upper-body clothing, an example from each being shown below. I’m working on an eighth archetype but it is proving extremely challenging to make it look anything other than awful, so that one might not see the light of day. Regardless, each of these has three sub-archetypes, making for twenty-one high-level “clothing styles” at present, each of which then undergoes extensive randomness within that clothing style, meaning that even if the maximum number of feudal nations are present, there will still be several “unused” high-level clothing styles left over – so that’ll do for now.



Lower-Body Garments

It is very challenging to make “trousers” which look even vaguely as interesting as upper-body garments (or boots or gloves, for that matter!), but I’ve done my best. The “Japanese” and what I have taken to calling “Hebrewlonian” archetypes in the above picture (middle top, and third bottom) will count as both upper- and lower-body garments, whilst the lower-body garments shown here will be distributed to the rest of  the clothing styles. Although in many nations there will be little sexual dimorphism (so to speak) between clothing styles for men and women, this will not be the case in some cultures, and a “dress” clothing archetype has yet to be worked on (I’ll get to it in the next few weeks). So some nations have the J/H archetypes above for both sexes; some nations will have the other above clothing for both sexes; some will have different clothing for the two sexes (and this will all, obviously, be chosen procedurally). So, some trousers/skirts etc (skirts are especially hard to make interesting, but I’ve done my best):



Boots

Now onto the “paired” items of clothing – boots (and gloves). I decided for the time being to forego “shoes” and go with something of a Game of Thrones/TV-adaptation-of-Wolf-Hall logic, i.e. that even those at the very top of society have to give something towards practicality and pragmatism, and basically wear extremely nice boots, rather than wearing beautiful footwear which never comes anywhere near a bit of mud. Boots, like gloves, have a distinct item for each in a pair, so that we can handle things like losing limbs, damaged limbs, etc, later in the game. Gloves and boots use the same colour system – they take the established colours from the clothing above, and then blend it 70% into a generic “leather” colour, to give the impression of dyed leather. Boots are therefore deliberately a tad less “striking” in colour than other items, but still maintain a strong semblance of the same colour schemes. Remember, as always, that you’ll never see these next to each other in game!



Gloves

Gloves are coming soon… but possibly not before the end of June, since now that I have the three most essential items of clothing in place, I’m working solely on NPC mechanics in preparation for showing off an interim “0.8”-ish building at the UK IRDC at the end of the month.

Complete Generated Clothing Sets:

Here are some complete (aside from gloves) “sets” of clothing – note, of course, that the zoom level does vary across each item of clothing so that the player can see maximum detail, and you’ll obviously never see them all in-game “lined up” like this, but I think it’s quite nice to look at some of the aesthetic consistencies across different items of clothing belonging to the aristocratic echelons of a given civilization:









(Note that Set 4 contains no lower-body garment since the robe covers both the upper- and lower-body slots, and also in some of these examples, the underlying pattern – square, diamond, etc – varies, which it won’t in the actual game.)

I will be working on middle-class and lower-class/slum clothing soon, but that’s taking a back-seat now to work on some mechanics for the version I want to be able to show off at the UK IRDC. There will also, of course, be distinct clothing styles for nomadic civilizations and tribal civilizations, but those are going to come along later, although I do have some ideas for what types of generators I’m going to build for both of those.

Future Mechanics

Clothing generation is increasingly pointing towards an obvious but potentially very interesting and unusual mechanic: the ability to “fake” being a member of a given culture. Perhaps you can don clothes of other cultures (and perhaps lighten/darken your skin, as many real-world explorers and “adventurers” in the distant past did for exactly this reason?) and attempt to “pass yourself off” as a native in a distant land… which then yields potential gameplay around attempting to maintain the deception, say appropriate things in conversation, and give nothing away, whilst perhaps other NPCs are capable of noticing slightly unusual things about your character which suggest to them that all is not as it seems? I think this could be some really interesting territory to explore in the future…

What next?

Well, we now have heads, upper-body and lower-body clothing, and boots, so I’d say we’re about to ready to actually create URR’s NPCs. This week I’m going to be working on optimizing the field-of-view algorithm which needs some serious improvement for the next release, creating the new “character lookup” window which has room to include a face and to scroll through their clothing (and in 0.9 their armour and weaponry, if any), and continuing to work on crowd mechanics, spawning/de-spawning NPCs, etc. See you next time for an update on hopefully all of these things!

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #52 on: June 21, 2015, 10:33:57 AM »
Other stuff to read

Before we start this week’s entry, I have some other stuff you might all like to read! This week I had a piece published at First Person Scholar about the intriguing player-AI dialogue which develops in the danmaku game “Warning Forever” (http://www.firstpersonscholar.com/warning-forever/), and a piece in Memory Insufficient about the alternate history aesthetics of the Red Alert series (http://meminsf.silverstringmedia.com/art/alternate-history-aesthetics-in-red-alert/). If you’re interested, do give them a read and support those other two sites!

Now, on to this week’s many attractions:

Clothes as Items, and Inventory Changes

Clothes have now been transported out of the file I use for working on the game’s graphics and added into the game itself, and turned into items (with a horrifyingly large number of variables – it took me much longer to integrate them than I expected). When you look at an item of clothing, it tells you nothing except the quality of the tailoring – “ornate”, “well-made” or “poorly made” – and what type of thing it is – “shirt”, “pair of trousers”, etc, and tells you nothing about the nation it is from, as that’s part of the learning/discovery process. Along side this implementation, the inventory system has been changed. Previously there were different keys for each action, so one would press ‘d’ to ‘drop’, ‘D’ to ‘drop several’, ‘t’ to throw’, and so forth; they’d then bring up your inventory, you’d select the item you wanted to perform the action with, and go ahead and do it. However, this meant you only saw the picture of the item when you pressed ‘i’ to simply look at your inventory, and that meant the images were (to an extent) being wasted. I’ve now changed it so that there are only two inventory functions: ‘i’ brings up your inventory, and ‘D’ allows you to drop many items at once (without looking at them). When you now press ‘i’, therefore, and choose an item, a line of text at the bottom of that item lists everything you can do with that item, so you always get to see the graphics, and the range of possibilities for each item is made a lot clearer (so things you can wear, or things you can use in some way, or eat, or whatever). I think this is a lot better, makes more use of the graphics, and tidies up the UI a little (given how many roguelikes use every damned letter on the keyboard). An example of a piece of clothing currently un-worn, and one being worn:



Character look-up

The look-up window for any character (player or NPC) has now been significantly changed and upgraded, and faces have also been moved out of the graphical-testing file and fully integrated into the game’s code. The first page currently shows the face of the NPC you’re looking at (or your own), and lists everything that person is currently wearing (which is visible; rings are “invisible” if they have gauntlets/gloves). The second page will soon show health, but I’m still working (yet again!) on thinking through how health is going to work, so we’ll have to see, and for now it has been removed (and will probably stay removed for 0.8 unless I finally figure out how health will work, even though I know how combat is going to work). So here’s a shot of me (without a first name, so the name up there is my family name), and this time I happened to be in the “scarification” civ. You’ll also notice I’ve made all eyes into a light grey instead of white! The reduced contrast is far less jarring.



Browsing clothes

The coolest thing about the new look-up? You can now hit Enter and browse through all the things a character is wearing, using the arrow keys. As you move around the “grid” of things the character has on them, each image then appears on the right-hand side (the first time the right side of the screen has ever been specially used!). For now, therefore, you can look over the upper- and lower-body garments, and boots, but I’ll be working on all non-armour garments in this release, meaning that we’ll be adding gloves, and probably cloaks too, but armour will come next time, and necklaces and rings will come… whenever. Either way, here are some nice illustrative screenshots of this! (With some placeholder first names and surnames…)







NPCs are now spawning

This speaks for itself, really, given the above screenshot. They don’t move, think, react, converse or do anything yet, but they are there, and the game can handle them and draw them correctly, and the player can ‘l’ook at them and browse what they’re wearing. My objective for this coming week before the IRDC is to really crunch and try to get crowd mechanics working to the point that NPCs will spawn and despawn out of the player’s line of sight. As for line of sight and field of view, there’s something cool on that point later down this entry…

Genetics, Culture, etc

I’m pleased to say (and one might extrapolate this from the integration of the facial images) that we’ve now got a model for genetics and cultures spreading around the globe. Genetically the game now chooses large chunks of land for eye and hair colours (they bleed out around the edge, but these screenshots show only the dominant colour in each region; equally, although these are very geometric and unsmooth, that doesn’t ultimately matter, since populations of NPCs in-game will always blend and travel). The first picture shows eye colour variation, the second hair colour, in a generated world:





As for how these work for individual NPCs, basically, each nation has a “core” set of values for their skin tones, eye colour, etc, and that’s based on what values are present in their capital city specifically. Equally, they can also spawn NPCs who might have been born hundreds of miles from the capital, but are still within the same nation. The further you get from a nation’s capital, therefore, the more and more people you’ll see who are born according to the demographics of that particular area, and the closer you get to the capital, the more you’ll see people who look like the people of that capital city. Cultural norms will be maintained however far you go – so people in the capital and a distant colony have the same hairstyles – but visual/genetic markers (eyes, skin, hair colour, etc) will vary as you move around. So if you have a capital city on the far, far east, and a colony of that nation on the far west, and in that colony you might expect 25% to “look like” they came from the capital in terms of eyes/skin/hair colour, most to look “native” to that colony in eyes/skin/hair etc, but they will be visually unified according to their hair styles, other cultural markers, beard styles, clothing, etc etc. So we basically have two layers – the “genetic” and the “cultural” – and these blend and intertwine as you move around the world. Also, different types of civilization have different levels of cultural variety – the open and well-traveled nomads have the most variation within a nation, the small tribal societies have the least, and the feudal civilizations are somewhere in the middle.

Field of View Optimization (at last!)

People have been asking for this for years, so I have finally put some time into optimizing the field of view algorithm, and now you can see basically everything on-screen at one time. Buildings will still have a reduced field of view, and it’ll reduce at night, too, but here’s a screenshot and a gif of wandering outside in the daytime:





Next Week

Well, the IRDC is in a week’s time, and I’m crunching like mad to get some kind of NPC pathfinding/crowd mechanic simulation going there. It’s going reasonably well, and I think I’ll have something good to show off, but I’ve been running into some fundamental design questions – can NPCs push past each other, for instance, if one occupies a tile the other wants to get past – which have surprisingly far-reaching algorithmic implications for how pathfinding and gameplay will actually play out in the longer run.
« Last Edit: June 21, 2015, 02:31:07 PM by UltimaRatioRegum »

Avagart

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 567
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #53 on: June 21, 2015, 11:21:17 AM »
Amazing idea (and, I belive that, good implementation) with genetics and cultures. Do you plan to expand this feature? Maybe region-dependent skin colour, or more cultural (and less genetic) issues like, dunno, tendency to specific weapons or city types?

I don't know if I like your FOV algo and I don't know if possibility to see everything on screen is good thing. In URR is a lot of obstacles, which block the field of view. With long-range of vision it might be a bit... illegible? This is proper word? Like bizarre, uncomfortable.

chiguireitor

  • Newcomer
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #54 on: June 21, 2015, 02:18:31 PM »
Liking a lot the progress here.

One thing, you can relax the voronoi vertices a little to enhance the geometry to a more natural look using Lloyd's relaxation.

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #55 on: June 23, 2015, 10:02:47 AM »
Amazing idea (and, I belive that, good implementation) with genetics and cultures. Do you plan to expand this feature? Maybe region-dependent skin colour, or more cultural (and less genetic) issues like, dunno, tendency to specific weapons or city types?

I don't know if I like your FOV algo and I don't know if possibility to see everything on screen is good thing. In URR is a lot of obstacles, which block the field of view. With long-range of vision it might be a bit... illegible? This is proper word? Like bizarre, uncomfortable.

Oh yes, skin colour is region dependent, but everything like weapons/cities/etc is entirely culturally bound; each nation has its own preferences for basically everything which is then reflected and reproduced through the nation in its architectures, its people, it relationships with other nations, etc. FOV - interesting point, and I do see what you mean, but I still definitely think this is an improvement over the old tiny-FOV :).

Liking a lot the progress here.

One thing, you can relax the voronoi vertices a little to enhance the geometry to a more natural look using Lloyd's relaxation.

Thanks - that link is interesting, but I actually think that looks way less natural! The example in the link looks so artificial and formal, I'm far happier with what I've got going here. Yes, of course, some genetic areas are going to sometimes cut across massive regions of ocean, and perhaps that is a little peculiar, but I think that's less peculiar (or at least more "natural") than the kind of examples in that wiki page!

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #56 on: June 29, 2015, 04:27:53 PM »
This week's blog entry: a round-up of this year's (UK) IRDC from the past weekend! http://www.ultimaratioregum.co.uk/game/2015/06/29/irdc-2015/

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #57 on: June 30, 2015, 02:06:25 PM »
If you are removing combat (or even making it simpler) it will be nice, because then there is one possible competitor less for Kaduria. I want to be the winner when Kaduria is released.

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #58 on: July 05, 2015, 05:05:03 PM »
This week I’ve been developing the crowd mechanics, and it’s going well, but first we need to talk about how exactly I need this to work:

We have two levels of resolution: the map grid the player is walking around on, and then every other map grid (in the 250×250 tile world map) which is not currently loaded. Therefore, any NPCs who are important but are not currently spawned must be tracked by the game when they’re on a non-loaded world map tile. This, of course, gets very complicated when you have an important NPC start on the loaded map tile the player is walking around, and then step off that map tile onto another… and then how do we track them over, say, 50 turns if the player THEN decided to follow this important NPC onto another map tile, spawning that tile (which the NPC has been walking in, even though it hasn’t been spawned)? Well – for the time being we aren’t worrying about that, although I think I have a good solution. What I’ve been doing this week is getting the standard crowd spawning and walking around sensibly in city districts, which means Lower-Class, Middle-Class, Upper-Class, Military, Market, City Centre, and Religious districts (docks and castles are still not spawning; castles will be coming 0.9, and docks either 0.9 or 0.10 depending on how development plays out).

I tried a few systems last week where NPCs could walk freely around the map without paying attention to the roads, and this ran into two issues. Firstly, having 100+ NPCs moving at once was necessary for the city districts to not feel like a ghost town (even if I made sure the game slyly spawned/de-spawned NPCs around the player to give a false impression of greater density) and this, on 200×200 maps, was beginning to cause minor performance issues; secondly, it just didn’t look very interesting, and there didn’t seem to be any real method or deliberate action to what NPCs were doing. If you trailed them until they hit their target location, they’d just then choose another location, and repeat.

So, this new method had three logics: firstly, to create a form of pathfinding which doesn’t actually need the game to calculate paths to reduce CPU usage; secondly to make NPC movement seem more deliberate; and thirdly to allow NPCs to “path” (or rather, fake-path) towards the gates at the edge of cities, and thereby withdraw themselves from the map if the player trails them long enough, rather than just continuing to identify new locations on one map which they are allowed to travel between. So, I got to work.



The first step (above picture) was to identify areas of the map which a) any NPC could walk (light green), b) which any NPC could walk on and which were curves in the road which the NPCs would have to stop walking straight to traverse (yellow), and which only certain NPCs would be allowed on (dark green) for each of the seven current city districts. There are also some areas of the map which aren’t roads which are blocked to some NPCs (like the courtyard in a mansion, for example), but those aren’t integrated just yet. I created this secret road map, got NPCs spawning on roads, wrote a bit of code for them to be able to identify another road coming off the first road, and let it run.



The first trials would up like the above picture. NPCs spawned on roads, and could sometimes path correctly… but they were always looking for other branches of the road networks they could move onto, but seeing parts of the road they were already on as being a “different” road, and therefore they kept flicking uncertainly back and forth between hundreds of subjective “roads” which, to a human player, would be obvious.The next step was to add a road_direction variable (basically the same as the player’s facing variable) where they keep track of what direction they have been moving, and they can’t read a “road” into their current direction, or their opposite direction, and thus will only detect new roads to explore if those roads are at right-angles. I then upgraded the code for the curves, creating hidden “lanes” for the NPCs to path along:



Which can be usefully compared to the overall pathfinding map for the same district…



…for when we come to NPCs moving off the roads.

Anyway. With that fixed, I upped the number of NPCs, and we got this wonderful image:



This looked cool, but it was a bit too dense, and they looked too similar all sticking to the road paths rather than diverting. We’ll be coming to the “going off the road” issue later in this entry, but the next step was to try and balance their spawning, de-spawning, and the density of the crowd. I firstly needed to make sure an equal number were spawning in front of the player and behind the player, and that some NPCs would spawn directly at the gates, even if those gates are in full sight of the player, and that they would then cut back across the player’s movement. Once that was done, and people were likely to spawn in front of the player, and behind, and at all different locations – and a full complement of civilians was spawned before the player even set foot into a map grid – we had something which looked much better. Here’s a gif of watching a wide range of people wandering around (for now it is spawning them with a random culture, rather than spawning an appropriate population distribution for each nation), and then after they’ve walked around for a bit, I decided to have a closer ‘l’ook at one of them and browse their clothing:



And here’s a comparable screenshot of  “examining a passing NPC” in progress, which I have chosen simply because I really liked how this guy looked:



Two stages now remain: to ensure this works for all city districts (and then extend it to tribal settlements, fortresses, towns, etc), and to also make sure that sometimes NPCs wander off the road and go exploring on their own. The first is still in progress, but the second seems to be going reasonably well. The objective is to get the NPCs very rarely “breaking off” from the road and heading to other places on the map, either a randomly-selected location (which they are allowed to walk on), or a door they are allowed to go through (so a random “human” (‘h’) can path towards a random house in a lower-class or middle-class district, and then if the player sees them go through, that NPC is then associated with that house). Equally, we should have a small number of NPCs spawn off roads out of the player’s line of sight, and then path towards the roads, and then move towards road properly. When working nicely, this gets the majority of NPCs keeping to the roads, whilst very rarely we see one of the NPCs break off and head elsewhere, and if you follow them, they will either carve a path through the terrain or make their way to a door and then pass through – I’m clearly going to need some flavour text for “You see a person go through a door”, “You hear a door open and shut” if you’re right next to it but don’t actually see them go through, etc (whilst making sure this doesn’t get obnoxious and it doesn’t fill up the message log). As was suggested in a previous thread, I’m also going to add lots of flavour text when you enter/exit buildings, but that’ll come later this release. I’m still finishing off the pathfinding to non-road areas, so that’ll probably come next week when I’ll likely have finished pathfinding (I hope) and have the remainder of that to show off, and possibly some other clothing too? See you then!

chooseusername

  • Rogueliker
  • ***
  • Posts: 329
  • Karma: +0/-0
    • View Profile
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #59 on: July 05, 2015, 08:05:41 PM »
Looks great, as usual.

I've been going over old libtcod projects looking at the unique and interesting ones, and looking at this reminds me of Cult/Empyrea.  When the kickstarter funded effort was abandoned, he released the source, and people were all like "duh, no surprise, he has a 1 MB python script, WTF, trust me I'm an armchair expert".

Are you still fighting the good fight for one file Python scripts?  How large is it now?

And how have you upped your game to counter the Kaduria threat?