Basic Conversations, Relics, Traits, Laws, Next Six Months

Another big update this week! (Isn’t it great to see URR development actually moving fast? At least, I think it is). As mentioned last week, I prioritised getting the basic conversation system totally finished this week, which is to say the ability to ask any question to any NPC, and get a logical reply, or at least the outline of a logical reply with some variables (like “[nation]”) that need to be filled in later. We had a lot of progress, and almost, but not quite, got there. But don’t worry! Other essential stuff for this release has been done instead of focusing 100% on the basic conversation system; we have still moved much closer to release in the last seven days, albeit in a slightly unexpected direction, by adding a range of other world detail that NPCs will shortly need to draw on when they reply to the player. I can also now finally announce some pretty big and very exciting changes to my life coming in the next six months, some projects ending, some new projects on the new, and what this all means for URR in the next half-year. Read on!

Basic Conversations Almost Finished

Basic conversations have been developed further this week, with NPCs now responding correctly to almost 100% of the large number of “option” queries they can be asked – which is to say, questions that need to draw on some other information and are fundamentally different depending on the outcome of that information, rather than simply being sentences which say “My homeland is X”, in a context where all NPCs will always have the same basic answer to that question. Option queries need to draw on a range of traits in most cases (within the NPC) and a range of broader cultural and religious elements (outside the NPC), and most of this code needs to be hand-written for every possible question, making it a fairly substantial piece of work. From these screenshots you can see that some bits of wording still need tweaking, but I want to stress, these are totally random selections from the hundreds of possible questions; although they aren’t perfect, I’m still extremely pleased with how these look right now, how much variation there is, and the fact that only some fairly minimal tweaks remain to be done to some minor typos, plurals, that type of thing. (Both of these is me talking to the first character I find, hence why I’m clearly talking to people from the same civilisation as me for the sake of these tests):

Irrelevant Replies

This week I have also begun implementing “irrelevant” replies – meaning things like “I have no religion” as a response to “What is your religion?”, and so forth – which apply when an NPC is asked a question they have no valid answer to, or is entirely irrelevant. This means a massive range of potential answers, some of which are specific to the question – such as “I have no siblings” – whereas others are more puzzled. An NPC might be asked about a painting they couldn’t possibly know of, for instance, in which case they would say “I do not know of that painting”. There’s close to a hundred of these irrelevant replies, all of which (like everything else) need to vary between cultures and individuals. Some of these require quite complex sentences, although others are relatively simple, but this has definitely need a substantial task. I’ve now put about fifty percent of these in place, and NPCs do correctly use them, too! Of course, in some cases NPCs can’t yet give the correct responses – the coding for siblings isn’t in there yet, so everyone just says they have no siblings – but the code for generating a sentence once siblings are present is in place. Dealing with these kinds of familial relationships and the answers to some of the more complex questions will come partly before the release of 0.8, and partly in the speedy 0.9.

Traits

Added some new traits this week, with a focus on four elements that will influence substantially what NPCs know (and what NPCs can tell the player) about the world around them. These are all affected by the individual classes of NPC – generally speaking someone who is likely to be wealthier and better-educated is likely to know more, but there is also significant variation written into the system, and the knowledge of individual NPCs (regardless of their NPC class) is then varied further by ideological preferences of their homeland. For instance, people from an internationalist nation will tend to know more about foreign matters; people from a nation with a system of vassalage will know more about their own nation than average; those from a bartering nation will know less about history, as few records are kept; those from a free trade nation will know more geography, as they travel to trade; and so forth.

geography_knowledge

How much the NPC knows about the surrounding area. This doesn’t mean the nations and peoples and so forth, but rather purely a question of physical geography – nearby mountains, nearby roads, coastlines, deserts, animals, plants, and the like. Affected

history_knowledge

How much the NPC knows about the history of the world (inevitably heavily, but not exclusively, focused on their own nation). This means their ability to talk to the player about the historical events they are familiar with, how many events they are familiar with, and also knowledge about historical artworks, people, places, and so forth.

national_knowledge

How much the NPC knows about their own nation – where things are, who lives there, where towns and monasteries and mines and so forth are and what’s within them, information about important people, etc.

foreign_knowledge

How much the NPC knows about other nations; their locations, capitals, ideologies, religious beliefs, leaders, famous people, practices, etc. As with all the above, this varies across NPC classes, and is then modified by ideological beliefs of the nations in question.

Relics

I’ve implemented the first part of the generation system for religious relics, which needed to go in now so that NPCs could actually talk about them. Naturally the image generation for these will take place at a later date, but for the time being the game can generate the names of religious relics, a little bit of information about them, and who they were originally owned by. Each religion will only ever create two kinds of relics, depending on their beliefs, and these fall into a randomly-chosen “major” and “minor” category. For instance, a religion might primarily produce “Crown” relics, but sometimes have a small number of “Bone” relics; or a religion might focus on “Book” relics with a small number of “Weapon” relics; and so on and so forth. Each has a unique generation system for selecting its name, and we can now end up with relic names like the following:

Twisting Key of Monn’morra
Slender Ring of Saint Ynnop
Wooden Garland of Grey Fox Running the Sacred
Orangejaw Moonblizzard’s Holy Engraved Locket
Fi-Un-Gat’s Pitted Skull
Consecrated Pointed Sceptre of Ibimmom, Sly Rose

The game also now keeps track of how many relics need to spawn in each church (which varies across different kinds of religious building) and ensures that an appropriate number will always appear. Generating the images for these is going to be a lot of fun, but isn’t going to come until 0.10 or somewhere beyond. Anyway, these are now in place, so NPCs will shortly be able to talk intelligently about relics, and specific relics will now be tied to specific reliquaries in specific churches and cathedrals!

Laws and Punishments

Three of the “list” questions (questions where the answer is often of the kind “A, B, C and D are examples of the X”) relate to the particular laws of a particular nation regarding various topics – currently “violence”, “trade”, and “religion” are the three listed in there. This means that nations now generate laws in each of these categories, and a set of punishments, and then assigns punishments to each broken law depending on the severity of the crime (as the nation sees it). Laws and punishments on trade are determined almost entirely by trade policy, but a nation’s perspective on smuggling is also affected by a range of other ideologies; “violence” laws are determined by a wide range of ideologies from across the eight main categories; “religion” laws are naturally primarily determined by the religious policy of the nation, with a few inputs from a couple of other policies.

To take trade as the example, there are now five possible laws that a nation can enact:

District Entry: how much money (if any) it costs to enter a district in the capital.
City Entry: how much money (if any) it costs to enter the capital city.
Foreign Goods: how much extra taxation is put on foreign goods (light, middling, heavy).
Black Markets: whether black markets are tacitly accepted or not, and if not, the punishment for using one.
Smuggling: the level of punishment for those caught smuggling/with smuggled goods.

Each of these then, if appropriate for the ideologies of that nation, has a value assigned to it. When punishments come into play, punishments now vary according to the five possible justice ideologies. I’m not quite clear on how the “Ordeal” justice policy is going to work out, so I haven’t really developed that element yet, but the other four now work nicely. The Frontier policy imposes fines on those caught breaking the law; the Vigilantism policy will see those breaking the law hunted by the general public, who for lesser crimes will demand items in recompense, or injury, or will hunt to the death in the case of severe crimes, the Penitentiary policy imposes a range of prison sentences, and the Gladiatorial policy involves battles to first blood for lesser crimes, and fatal battles for greater crimes. There is also something of the god system from DCSS here; I wanted to develop these in such a way that they would seriously affect the player’s actions in the future, and which nations they choose to take actions in, when they keep in mind what the potential ramifications are. Justice policies should now have a substantial effect on player decisions once implemented –  and, of course, NPCs can now talk about them, listing all the policies that are worth talking about in the area in question.

Next Six Months

In other news, some big changes are happening, which are going to lead to some very exciting things. Firstly, I’m leaving my position as a postdoc at the Digital Creativity Labs at the University of York – although keeping my current secondment as a Researcher in Residence at the UK Digital Catapult – and taking up a new six-month postdoctoral position at Goldsmiths, University of London, to study paper puzzles (crosswords, Sudoku, etc), and those who play them, design them, implement them, with a view to developing a new set of paper puzzles that might one day be able to challenge Sudoku in national and international print newspapers. Such an outcome is obviously an immensely ambitious goal, but that’s one of the many things that attracts me so much to this project; the potential to make such a big impact into the game-playing lives of so many people is incredibly exciting. I’ll keep you all updated on this goes as time goes by; this might lead into further research in this area, though I also have a range of other irons in the fire for the longer-term future.

Secondly, during this summer, I’ll be taking up a range of visiting fellowship positions at numerous institutions around the world. Firstly, the University of Alberta in Edmonton, where I’ll be giving talks and running and contributing to seminars on professional gaming and the intersections between video games and gambling practices; secondly, the Chinese University of Hong Kong, where my focus will be very much the same; and then the University of Nevada at Las Vegas, where I’ll be researching the histories of professional gamblers, specifically with a focus on how professional gamblers are represented and talked about in news media, films, literature, and so forth. Somewhere in the middle there I’ll also be giving a few talks at Nanyang Technological University in Singapore on my research, and potentially travelling to two other countries I’ve never visited before as well to offer guest lectures and further develop my Esports and live-streaming research, although those are still in discussion with the relevant parties. If you live in any of those areas, let me know – maybe we can meet up! The few times I’ve met fans in person has always been awesome, and I’d certainly be keen to do so again.

What does all this mean in practical terms? Well, firstly, my brain is going to be a lot clearer to focus on URR 0.8 and finishing my first book in the next four months. Travel has always been something that galvanises and focuses me tremendously well, and these, combined with a new position more closely aligned to my research interests, will do a lot for me. People who read this blog regularly will know the last few months have been tough for a range of reasons, and these new positions are going to be a big help with some of those issues. Onwards, to bigger and better things!

Next Week

Having really pushed on URR this past week, I need to focus on my academic work this coming week, so next week will be a games criticism entry; then by the week after I’ll be aiming to actually finish off the Basic Conversation system by fully implementing the answers to list questions, and making sure that the range of “irrelevant replies” are all implemented and functioning correctly. See you in a week! When we will be talking the notorious “P.T.”, or “Playable Teaser”, and its clever implementation of environmental puzzles…

The Hopefully Penultimate AI Update

Thanks everyone here and elsewhere for the kind well-wishes! I wound up taking two days off work and three more days working from home, but I’ve mostly recovered from my recent chest infection through the combination of rest, food, and copious amounts of medicine. This was originally going to be the penultimate AI entry, but having lost over a week in total from this bloody thing, we’ll see how that actually plays out. In the last fortnight, when not hacking and coughing, I’ve been working on finishing off the remaining NPC AI needed to put out the playtesting release in the near future. I worked on castles which were a lot of fun to do all the AI for, most of which is already working really well due to the ability to reuse their code from elsewhere; on making sure merchants, priests and guards in other contexts (i.e. not just cities) all worked correctly, on getting monks and abbots to behave correctly, and on fixing another huge volume of bugs. At this point it’s just castles and monasteries that need finishing, and these are my main tasks for the coming week (assuming, of course, no other illnesses that confine me to bed…). Read on!

Castles

Castles have proved to be a very enjoyable break from the rest of this hell – most of their NPCs never leave the building, their schedules are relatively simple, and they’re just so different and aesthetically pleasing that I’ve found this process all rather pleasant. At the moment almost everything seems to work, though there are some tricky things I’ve had to catch where I’d written code for a particular NPC class, forgetting that they could sometimes spawn in castles as well as elsewhere. One example was servants, who in upper-class housing and mansions automatically always sleep in the basement, but in castles actually live on the ground floor (if present); in castles it is only slaves (if present) who sleep below ground. I had to go through quite a bit of code and make sure that the game checked whether servants were in castles or mansions before directing them. The same applied to a few other NPCs, like guards that both sleep and work inside (unique) and so forth. Similarly, I also found that I needed to add in a special line of code for NPCs trying to do inside schedule targets in castles that checked they coud actually path to the target they’d chosen. This might seem obvious and surprising that I hadn’t put it in before, but previously all upper floors of buildings had only one large connected space (even if some of it had permission requirements), so one could always be sure an NPC could path from X to Y on a floor; by contrast, castle upper floors can have parts of turrets and towers that are disconnected from the main floor, and thereby impossible to path to from certain areas, and so NPCs now always check the path they’ve chosen can actually be walked, instead of relying on the game to never generate/choose an unwalkable path. As I say, this was the case until now, but it isn’t any more! Here’s me approaching a castle with some soldiers (‘5’) and guards (‘g’) outside, showing that this is a nation with a standing army:

Soldier Castle

Here are a few gifs and images from inside a castle (I’ve been using one particular civilization for all my testing, hence the universal silver/grey colour). First we have a throne room with a lot of knights (‘2’). This is a stratocracy, so the ruler’s throne (the yellow symbol in the middle, which will soon have its own unique generation system) has an unusually large amount of high-ranking protection.

thronn

The quarters of some soldiers, with various soldiers sleeping off-duty whilst their duplicates guard the castle outside (soldiers appear in castles in nations with standing armies).

Soldy

Some priests (very slowly) meandering in their respective chapels in a castle for a nation with religious freedom as its ideology; whereas priests in normal churches are programmed to wander around and look at altars and desks and statues and whatever, these folks use the same body of code as chieftains or prisoners or mercenaries, i.e. wandering around within particular confines (since it would be rather odd to have them looking at the altars of others!).

Priests

And here we have a servant on the ground floor going about their day, going up one of the towers at the edges/corners (depending on the layout) of the castle and cleaning one of the chairs on the upper floor; on that floor we also find a guard (‘g’) and a knight (‘2’) sleeping. Somewhere their equivalents will be on duty!

Serv

Here’s a monetary cache. This nation has a free trade economic policy, so they have a cache of coinage from a range of other nations in the castle – or, y’know, they will very shortly once I implement currencies. For now though, if you see two guards like this – that’s what they’re guarding. Alternatively, another policy (protectionism, I think) leads to a castle having a large cache of domestic coinage instead, and these are mutually exclusive policies, so there will only ever be one, or neither.

Cache

Merchants, Priests and Innkeeps in Towns

Merchants and priests all work correctly in towns. I had a momentary bit of panic as I realized that I’d only tested priests and merchants in cities, and although the code should work in towns just as well… there was always a chance it wouldn’t, since various things are stored in different ways in towns and cities. Nevertheless, a little bit of experimentation confirmed that everything was working fine there. Here are two shops in a town near the above castle:

Shop

Towntac

Monks and Monasteries

Wow. Monks and monasteries. What a nightmare. This is taking so much longer than anticipated – the complexity comes from having multiple buildings on one map, all of which might or might not be spawned, and the presence of tasks that take NPCs from one into the other… and various other things besides. Therefore, I have taken the decision to actually massively simplify them as spawning NPCs from this release. Their schedules are just too damned complicated ordinarily and need too much moving between buildings, acting outside buildings, blah blah… it’s all trivial to handle when the player is on the map grid, but when the player is elsewhere, or they’re present and they’ve spawned some buildings in the monastery complex but not others… urgh, what a nightmare. Therefore, for this release, despite the lovely gif of farming monks from a few weeks ago, monks will actually stay completely indoors. They will awaken, get up, do some work throughout the day, then turn back in. For 0.9 I’ll return here and get them tending to their vegetable gardens and visiting the religious building in their complex, but not just yet.

Bugs

Another fortnight with loads of new bugs discovered and dealt with.

Firstly, we had a bug with categories of NPC who all sleep on the same floor, in the same building, and go to their bed at roughly the same time. If two were targeting the same bed, they would not register it as an inaccessible bed since nobody was on that bed YET, so they would both go there, the person to get there first would claim the bed, and the latter would just stand next to the bed, desperately pining for the bed they could no longer have. Some new lines of code now detect if someone has just stepped onto the bed you’re going after, and NPCs now change directions appropriately; in a future release I’ll have NPCs actually claim specific beds, since right now they only go to general beds – servants will go to any servant bed in their mansion, priests will go to any priest bed in a cathedral, and so forth…

I then ran into a bug that took about four hours to resolve, whereby in a tiny subset of possible religious buildings, priests couldn’t figure out what to do. This took a disappointingly long time to diagnose, especially since it was a block of time that I’d marked out for making sure monasteries worked correctly, but in the end I sorted it out. It happened in religious buildings that contained pools and only a tiny number of chairs/tables, or contained only prayer mats without chairs around tables in the building. These are both pretty rare subsets, but basically the code for choosing locations for humans and priests to meander to weren’t correctly handling pools (they should just gaze into the pool, like the gif below) and weren’t handling prayer mats, since they are stored separately from “chairs”. This is now all sorted, and I think this should work fine for any and all religious buildings.

Pool

And here’s a rather nice gif of a matching prayer mat, clothing, and altar, just since I happened to be in a religious building with a pleasing level of colour-coordination:

Mats

Then ran into a rather strange bug, whereby people who work in buildings they don’t sleep in, and did everything from their work day before then going to bed and reaching their home away from the player’s observation, would fail to spawn when you then spawned their map grid and went into their home. This one was puzzling, since I’m sure this worked before… but on the other hand, there are so many permutations of saving/loading and whatnot that it may well have been a particular variation I’d missed on my first sweep a few weeks ago. Either way, it all works now!

Next Week

Castle AI finished, Monk/Abbot AI definitely functioning correctly, any remaining tweaking required to put out the playtesting release, and… who knows, I might even start working on the conversation window?!?! But let’s not get ahead of ourselves (for once)…

MORE AI OF COURSE

To anyone who sent me an email about playtesting and I didn’t reply: I’m very sorry! I think I’ve caught them all, but I’ve had a lot, and my inbox has recently been blasted with spam, so it’s possible I missed one. If so, rest assured it was entirely accidental and nobody has been shunned on purpose, and I *massively* appreciate every single offer!

But as for this fortnight’s update: YES, as I’m sure you could guess, I’ve done more work on AI, but my goodness, we’re getting close to an acceptable level of completeness here for the 0.8 release. I just realized with something of a shock how close I am to having this release’s AI finished: Chieftains, Priests, Archivists, Mercenaries, Clerks, Diplomats, Farmers, Guards, ordinary citizens, Innkeeps, Jailers, Merchants, Slaves, Tellers, Servants and Prisoners all work! If I can make sure officers work, and all the NPCs in castles and monasteries work, it’ll be done! Then I’ll do speech generation, then release 0.8, then return to finish off the more obscure NPCs – blacksmiths, delegates, explorers, gladiators, and so forth – in a much quicker 0.9. So here’s a run-down of everything this past two weeks, as I enter what I desperately hope to be the last week of concerted AI work in this release. I will be releasing the playtesting release on the weekend of 2/3 April, and I’m probably going for the closed playtest option. For now, though…

Servants and Slaves, Again

Found a few fascinatingly rare errors involving saving and loading specifically when important but non-unique NPCs were next to, or on, a staircase, and were either transitioning to sleeping or transitioning to doing their normal everyday stuff. If next to the stairs they were trying to find a new target when the game reloaded instead of continuing to the stairs, but if they were already on the stairs, they would cause a soft lock with the NPC trying to find another target. I’m pretty certain I’ve fixed this now for all NPCs this might apply to, and if it isn’t finished, they should roll over to a piece of code that will encourage them towards a chair or a bed for a temporary rest, rather than having them lock up the game, so there’s a slightly less-elegant backup solution in there in case the main solution doesn’t work. I went into the basement of a mansion and waited until it was time for the servants to wake up, quickly modified the code to make them all wake up around the same time instead of over a longer period in order to take a nice gif, and voila:

timetowakeup

Ambassadors

Ambassadors and innkeeps have a similar thing to them – they spawn and sleep on the upper floor of their building, and when they get up, they head downstairs and do their thing, and then return upwards. As far as I can tell (I know I keep putting this proviso on everything I write about AI, but the stuff is so damned complicated that I have to!) ambassadors work correctly, although there remains a tiny issue with innkeeps because in their business day they can sometimes drift onto the upper staircase, and if they decide to go to the upper staircase when already standing on it, they go up but then don’t look for a target, and freeze. Not quite sure why, but for the ambassadors, here’s a quick gif of one turning in for the night:

ambed

Clerks and Diplomats

Clerks and diplomats all now seem to work correctly, using effectively the same code as tellers, albeit with a minor slight difference. They live all over the city, head towards their appropriate embassies, and behave correctly, although there was a really strange issue for a while with the game trying to spawn a duplicate whenever one of them was due to act! Then we had another issue with clerks and diplomats sometimes deciding to sneak upstairs and occupy the ambassador’s bed! Cheeky buggers. All very odd, but now resolved.

Clerktoemb

Monastery Name Generation

To my amusement, I realized I’d neglected to get monastery names generating! I’d just left them with a placeholder, “Monastery of the Six Halos”, and entirely forgotten about them. I returned there this week and spent an hour putting in a robust name generation system which draws upon the specifics of the religion in question – whether it worships an animal god, a demonic god, a lovecraftian god, an “ordinary” god, a pantheon, etc – and then churns out a series of related but distinctive names for the monasteries in each civilization. Here are a few groups of examples:

Monasteries

Archivists again

Archivists weren’t behaving perfectly and couldn’t find their way back to their desk after a good night’s sleep. Now they do!

Mysexychair

Farmers

Farmers now farm! You can head into a farm, and for each farmhouse, we’ll see a farmer doing their thing, which basically involves moving from point to point in the fields, and only moving a few tiles at a time. By this, I mean they select a group of crops to work on, work there for x turns, then move no more than 5 or so tiles in any direction onto another crop, tend that, and so forth, and so you see them slowly moving around their fields. At the appropriate time, they head home. Here’s a gif of a farmer… farming… which is about as exciting as you’d expect, but hey, it works:

Farmoflage

And goes to their farmhouse:

Farmerbed

And going to bed:

bedtimeThrilling stuff!

Innkeeps

Innkeeps are now in the appropriate place in the day, and at night. As above, innkeeps use pretty much the same body of code as ambassadors since they sleep in the building they work, they sleep on a floor above their working floor, and so forth. At the moment they should come down stairs in the morning and tend to the bar. I’m also considering using the graphics for the beer barrels stored in the basement for barrels more generally, and adding those into the generation algorithms for some other buildings to add some variety to the standard chairs/tables (i.e. use them as food storage barrels and that kind of thing). For now, people do still come into the tavern when the innkeep is asleep, but that can be fixed some other time, and definitely fits into the “long set of very minor issues” category that I’ll handle in the future. I assume they just sit around and drink their drinks very slowly until dawn once more spins around.

inbed

Next Week

The final AI update before the playtesting release, and hopefully pretty much all the AI needed for 0.8… and what a relief that will be!

AI, for the Umpteenth Time

IRDC

This year’s US IRDC has now been booked, and will be at NYU from August 6th to the 7th! Unlike last year where various tedious things got in the way, this year I will 100% be dragging myself across the ocean for this, and staying at least until late on the 8th, and possibly a little longer depending on Various Factors. If I’m going across the Atlantic for it, those of you already in North America have no excuse! I hope to see a lot of URR fans there – for more information, you can check out the information here on Roguebasin. If you want a European IRDC – and naturally, I do too – then you should pester DarkGod, who volunteered to host it but has since gone mysteriously quiet…

This Week:

Well, in one sentence, even more NPCs now (as far as I can tell) schedule correctly. Here’s a run down!

Guards (again)

Yep, guards needed still more work. Found a bug where if you entered the house of a guard, even if they were actually meant to be in another building, so long as that building was a) in the same district and b) currently unspawned (e.g. an arena, whose guards always spawn in the same lower class district). This has been fixed. Also discovered a bug during testing that sometimes under very specific conditions actually duplicated an NPC – if an NPC went into a building, and you saw them go in (so they had been physically spawned), but the building had not yet been spawned, and you waited until they completed their initial task, and then entered (and thereby spawned) the building, they would appear in the building and behave correctly, but a doppelganger would be made and stored back into the list of abstract NPCs. Then, when it came time for that NPC to take another scheduled action, both the abstract non-existent NPC, and the physically spawned NPC, would both try to take the action (since they shared the same unique identifying number), at which point… Bad Things would happen. This has been dealt with. I know last week I said everything with guards was working, but now I *really* think everything with guards is working. Hopefully.

Prisoners

Due to a classic case of chaos theory, making a totally minor change that was essential to the game’s code for handling important NPCs had the unexpected side-effect of causing only the tiniest fraction of prisoners to ever actually spawn – only the secretly-important prisoners in jails were spawning, whilst the other prisoners who are classed by the game as “important”, i.e. they are saved and still appear when you change map grid, were not being spawned. This has been fixed! Here’s a jail full of prisoners (the “z” characters) wandering about their cells:

Newjail

And the jailer knows how to go to bed, though I slightly messed up this gif by going up the wrong staircase first and letting the mouse cursor stray in at the end…

Tosleep

And when I go back in at night, they’re all on their beds like good prisoners, and the jailer is where they should be in their quarters:

Beds

Jailer

Mercenaries

There was an earlier bug with mercenaries, and although I didn’t explicitly fix it, something I’ve coded in the interim seems to have fixed it, so I’m assuming it now all works perfectly. Hooray! Mercenaries are found in mercenary guilds, and spend their day wandering/pacing their rooms. In the future, of course, you’ll be able to engage with them, but that’s where they stand for now. Here’s a mercenary guild I entered at night, and sure enough found everyone in their appropriate beds:

Merc

And one waking up and starting to wander and pace:

Awakening

Servants and Slaves

I… think servants/slaves in upper-class houses are now working correctly. The important ones spawn and behave, the unimportant ones spawn and behave, and so forth. Here’s me running around the upper floor in a non-slaving nation (so “v” is servant, “s” is slave) and watching the servants going around their day – though in fairness, we’re in a equatorial region here, so both skin tones and wood colours tend to be darker, and combined with the brown/red in the floor patterns here, I admit that the servants are a little tricky to see! But there isn’t really much I can do about that, as it’s a rare occurence to have all three of those match up. Though this might finally galvanize me towards actually adding a 14×14 font size soon, that should help in situations like this!

Servantes

And in another mansion, at night, all the servants are sleeping in their quarters!

Sleeping

However, there is some remaining weird issue going on – if we’re physically present when they should be waking up, they don’t! This is the top priority to fix this coming week.

Bugs and Whatnot

Found a weird bug this week when a guard who had left their house and was going towards the arena to relieve the other guard there somehow got switched from the “Local Pathfinding” state (where they move from one point to another on the local map by any means necessary, regardless of roads) to the “Roadmap” state (where random crowd NPCs just follow roads). This should be totally impossible, and having gone over the code many times I cannot find how this could take place, and sadly I had no debugging stuff going to catch that happening since I’ve been doing AI for three months now and this is the first time that’s ever happened. Weird. I’ve put in even more safeguards into the code to prevent this happening, but I suppose there’s got to be a tiny chance that whatever weird collection of flukes led to this occurrence could still be lurking out there. Very peculiar.

Also discovered an issue with the way I was actually playtesting things; due to things now being saved in their own subfolders in the save folder instead of being saved in one massive file, saving/loading is vastly faster and more efficient, but it does mean it’s harder for me to “reset” the game to its previous state to continue testing the same thing in fractionally different scenarios. So I wrote in a bit of stability code to basically help me testing; this probably won’t be noticed, but it just makes saving and loading things in the background a little slicker.

Dialects

I’ve continued to take brief breaks from all this madness to work a little bit on the dialect generation system. I’ve identified a massive set of variables including word order and various other things, and it’s looking amazing even at this early stage. In my brief moments of dialect generation, I am coming to realize that before I go much further, I need a very clear and solid idea of what “a conversation” will actually look like. More on this in a near-future blog entry…

What next?

We are approaching a point where there is only so much I can do to try every possible scenario that I can imagine, and I’ll just need to release a playtesting build and rely on the skills of the masses (you wonderful lot!) to help me find it all. Still debating whether to do a closed or open playtest. Leaning slightly towards open right now, but I was leaning towards closed last week, so I’m very changeable at the moment on this point. I’ll update you all once I have more information. For now, though, my focus this week is on ambassadors, clerks, diplomats, innkeeps, delegates, and finishing that issue with slaves/servants.

More and more NPCs with working AI

———– Call For Playtesters ———–

Firstly this week, before anything else: I’m still looking for a small team of playtesters to test out all the AI stuff in the next URR release, probably starting some time next month. If you’re interested, please send me an email to mark at this domain name, and also link to your Twitter, or Facebook, or something that shows me a little about who you are, and just give me a line or two about why you’re interested and how much time you’d realistically be able to give it – please be honest! I want people who can really contribute to making 0.8 the best it can possibly be. I’m recruiting people to basically wander around the map, go into every building they can, check the NPCs are there and behaving sensibly, and do everything they can to mess up the schedules of the important NPCs. I’d suggest being able to commit at least 6+ hours would be a decent start, but I might ask for more if someone quickly finds a major bug, which I correct, and then upload a new playtesting version. Either way: if you’re interested, give me a shout! I should add, though, that’s it’s possible I’ll just decide to upload an explicit “beta” version with some massive warning saying THIS VERSION MAY NOT BE STABLE and let everyone test it… or I might not. So I’m not yet certain whether I’ll do a closed or open playtest for 0.8 (which I’ll probably just call 0.7.5). But to give me an elite team in case I do decide to do a “closed” test, please let me know if you’d be available by the method outlined above…

———–———–

This week we’ve been continuing to really push Roguelike Radio towards a major re-launch: our recent episode on Strategic and Tactical decision-making is particularly excellent, I think, and I highly recommend it. Meanwhile, we have another fairly big update this week, which is pleasing, since it shows that things are progressing at a good pace (although I do have a fortnight’s work here, so naturally there’s bound to be a lot). I’ve covered a whole bunch of new NPC types in the last two weeks, and it’s proving very reassuring that the pace at which I’m moving through these things continue to accelerate. Much like I said in the entry before my Umberto Eco post, at this point the task is more “check each bit of code works for each kind of NPC” than “add major new bodies of code”. It’s slow and difficult, but it’s coming together, and it feels so reassuring and pleasing each time a particular class of NPC seems to be working correctly and I can move onto the next one. Here’s a run-down of what we’ve had added since I last URRpdated you all:

Merchants

It turned out that merchants weren’t even close to finished, due to a significant complexity in getting NPCs to spawn at the right time when they are moving between things on a single grid of the world map, i.e. in this case they both live in work in the same district. This needed a lot of new code that would note when they should be spawned in certain scenarios, even if the player hadn’t seen them acting before then, but as far as I can tell this now works perfectly. The code should also carry over into a range of other NPCs that I’m slowly working towards testing, but suffice to say, merchants now appear in their shops at the right times and don’t appear at the right times. Here’s a merchant going from their house, leaving it, wandering across the map, and going into their shop to start the day’s business.

Housetoshop

Non-Cathedral Priests

Priests in standard religious buildings now behave appropriately, find their way up to the correct floor when they sleep, etc. Here’s a priest deciding to turn in and going to their bed – and this would happen in the abstract too, of course, if the player wasn’t nearby:

And then later on, they wake up, head downstairs (I foolishly let them get a few tiles ahead, but you can still see that we’re following them in a few glimpses on the upper floor), and start going about their way, in this case first settling down in one of the chairs in front of the altar.

Jocasta

And here’s a priest in another church going up to their bed late in the evening:

Priesty

Archive Guards

Archives – found in crypts, below cathedrals, and only in theocratic nations – now always have their guards switch over correctly. This necessitated a little extra complexity because they aren’t on the ground floor, but I’m pretty sure this now works correctly no matter what. Here’s a changeover from the outside, into the crypt, where the guards switch…

Guardchive

…and then the other guard heads upstairs, and out! (From a different crypt that was generated later, hence the change in layout)

Guardgoesout

Arena Guards

Arena guards now change over correctly, which means that at this point, I *think*, all guards, whether inside or outside, all work correctly on their schedules. It’s very possible that some other weird bugs still lurk out there, given the complexity of the thing, but I’ve been going around trying everything I can think of to break the game, and thus far I haven’t been able to.

Arenaswitch

And they get home, and I immediately barge in:

Guarhome

Archivists

Archivists have a super-simple schedule – get up, work, go back to bed – but they now do it correctly regardless of the player’s actions. I entered crypts at various times of day at various points in their schedule, and always found them correctly sleeping or working at their desk regardless. Here’s a gif of an archivist deciding it’s time to call it a day (they do sleep in the crypt/archives beneath a cathedral, which might make them a little peculiar once the conversation system is implemented). These NPCs were also quite tricky because they have various bits of special code determining where they should be sitting most of the day, and their relationship to the guards around them, and they aren’t on the ground floor of the building which adds to code confusion, but still, here we go:

Arcgisleep

A little bit of dialect generation…

In a spare couple of hours in the evening of Friday 19th, I officially started work on dialect, and therefore speech, and therefore conversation, generation. I have almost nothing to show for it yet, and I’m not really going to dedicate much time to it until all the AI stuff is working, and I’ve distributed the special playtesting version, and I’ve taken a week or two off, but: even from the earliest things I have right now, the variety is going to be amazing. More on this in a month or something, but I just had to take a minor break from coding this never-ending AI nightmare, and I’m incredibly excited about how speech generation is going to look.

Next Week

I’ve been doing the AI for around three months now. You all know the drill. MORE AI STUFF!!! As I’ve said before, though, the amount of new stuff I’m adding is slowly decreasing as time goes, and most of the time now is testing the existing code for every variation of NPC in every scenario. There will come a time when the issues of URR’s AI are finished… but alas, it is not this day. But soon!