Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411596 Posts in 69387 Topics- by 58445 Members - Latest Member: YomiKu_0

May 07, 2024, 08:38:23 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsDwarf Fortress meets The Outer Wilds? "Ultima Ratio Regum", v0.10.1 out Feb 2023
Pages: 1 ... 36 37 [38] 39 40 ... 53
Print
Author Topic: Dwarf Fortress meets The Outer Wilds? "Ultima Ratio Regum", v0.10.1 out Feb 2023  (Read 178026 times)
Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #740 on: February 29, 2016, 02:35:54 PM »

———– 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 my 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 (http://www.roguelikeradio.com/2016/02/episode-117-strategy-and-tactics.html) 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.



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.



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



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…



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



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.



And they get home, and I immediately barge in:



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:



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!
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #741 on: February 29, 2016, 08:50:49 PM »

I would be glad to help for playtest but I'm already wildly flailing at defining my current game I can't Cry

Also back in the day when it was still a DF clone I told about information flows in story and games. I have start drafting an article about it if you are interested.
https://forums.tigsource.com/index.php?topic=18040.msg1226213#msg1226213

My ambition is to unify game design with story writing as fundamentally the same things (emotional exploration of crafted mental model through facts collection organized in emotional flows) and increase expressiveness of games.

It's not complete yet, the next part will bridge once and for all not only game and story but also provide insight in emotional reception base on measurable element of pacing.

When I see you "struggling" with Ai I'm glad I dodge that bullet using the above model and correlation over simulation ... although it's not completely validated as I haven't implemented it in a full game yet. That's an amazing detailed works you are doing here, I was too afraid of that lol.

Keep up the good work!
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #742 on: March 01, 2016, 03:47:46 AM »

Haha, no worries! Hope your project is going well - it sounds massively ambitious (and I would know something about that...). As for the detail: yeah, maybe I'm slightly regretting all the damned detail going in here, but it should be damned good once it all functions correctly!
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #743 on: March 01, 2016, 10:38:30 AM »

That's the best way to do great things:
- do things
- you didn't know was hard
- regret them for the work they ask
- but carry on anyway because deep inside them
- ...
- profit the greatness that naivety put on your path

Ignorance is bliss
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #744 on: March 04, 2016, 02:06:44 PM »

That... is not far from the truth, I'd say.
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #745 on: March 07, 2016, 12:18:49 PM »

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 http://www.roguebasin.com/index.php?title=IRDC_2016-usa. 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:



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…



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:





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:



And one waking up and starting to wander and pace:



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!



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



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.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #746 on: March 07, 2016, 12:46:39 PM »

Wooo I didn't expect dialect generation, congratz for still going strong too! You are doing an amazing job.
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #747 on: March 08, 2016, 03:24:00 PM »

Thanks! Slowly edging towards AI completion, we'll be there one day...
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #748 on: March 13, 2016, 06:58:10 AM »

AI stuff going well, aiming for 26-27 on playtesting release, and in the mean time, I wrote up a piece about the AlphaGo vs Lee Sedol matches this week, for those of you with particular interests in AI: http://www.ultimaratioregum.co.uk/game/2016/03/13/alphago-lee-sedol-and-grand-ai-challenges/
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #749 on: March 13, 2016, 09:20:39 AM »

Great article, I think alongside you that many make the mistake to evaluate ai base on its competitive strength, as if ai is reduced to that.
The problem is that most ai so far (in the general sense) lack "global experience", they match "symbol to concept" and then do the reverse operation.

Human go one step further, they match "experience to concept and then concept to symbol" then constantly ping pong the process. This allow for analogic reasoning, we can spend some time "experiencing" a situation, extract concept then use these concept to make a game, an article, a poem, or a death wish, human translate unrelated domain to each other, that's "analogy".

Here is the thing and there isn't enough talk about, we have recently discover the wonderful property of vector space in semantic representation, that the concept space have emergent intuitive reasoning, for example operation such as king + woman = queen are naturally possible. This is something leverage in image annotation as the word space and the image space share the same superposed mapping, but it works for image generation (make someone older by translating teh concept in the vector space) and of course it is leverage in machine translation. So we are really just one step away from a semantic revolution, leveraging this emergent property to make AI reason intuitively about its own experience.

so the ultimate yardstick of ai shouldn't be competitive problem or even social integration, it should be: can a ai understand the three laws of robotics on its own?
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #750 on: March 14, 2016, 11:27:28 AM »

Glad you liked it! I was having similar thoughts a while back about basically trying to create an AI that is fundamentally built around recognizing *playstyle*. Could you create an AI that bases its decisions upon creating a model of how the opponent thinks, and how the opponent plays, and creating a counter playstyle? So rather than doing extensive searches for the "best" mathematical solution, instead try to build up a more psychological model of how the opponent thinks and find the best move to counter their *thinking* instead. Now, AI isn't my field, but I do wonder if something like this would be possibly. Like I hinted at in the article, I think a model of this sort is going to be essential for any kind of pro-level poker AI - it simply *has to* take into account playstyle/metagame, as far as I can see.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #751 on: March 14, 2016, 11:48:52 AM »

I'm not into teh field either, but I do read a lot of paper, so while I have so broad view, I'm not a reference either, that said:

As far as my knowledge know, it mean the ai is able to build hi level abstraction, class actions into these abstraction then reason about it on enemy basis.

Right now I don't think there is model like that. Either the abstraction are handed down and hardcoded or they are in a black box machine learning (generally ANN). And so far I know no instance of hi level semantic reasoning based on those black box abstraction.

Right now we basically use ML as a way to prune possibility space or have a probabilistic prediction (both can be seen as teh same) for traditional technique, alpha go works that way, it use NN pattern recognition as probalistic prediction and to prune the possibility space of MCTS search (which is basically a sophisticated minmax). In practice it assume ideal move to win and don't care for playstyle. Though the way pattern work it might be effectively matching playstyle.

The idea you propose mean might be simply emergent in the way pattern are store in ANN, so it might became more of a semantic debate of how the term you use really mean. A playstyle is a pattern and a search tree algorithm can be seen as reasoning, although I think you are thinking about different process than those two? But if the ai achieve the same mean through different process than human, is this still equivalent?

That's tough stuff lol

Though thinking more about it it might be possible, we have just to define what the profiling and countering it actually mean "for us", what constitute profiling, is everyone profile the same way? etc ...

...

Or we might look for what poker ai research do lol
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #752 on: March 20, 2016, 02:45:02 PM »

Ha, yeah, it is rather tricky, isn't it. I might write some more on this some time, I think. Maybe the playstyle-AI-idea has absolutely no legs whatsoever, but I think it would definitely be an interesting angle to pursue...

---------

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:



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:



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.



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:



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!



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:



And goes to their farmhouse:



And going to bed:



Thrilling 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.



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!
Logged

saluk
Level 2
**


View Profile
« Reply #753 on: March 21, 2016, 11:57:34 AM »

What an exciting update! It's so cool seeing all of the examples of the little people all running around doing their thing. AI is so challenging and takes so long to accomplish seemingly simple behavior, but the payoff when everything is finally (almost) working together is pretty sweet. Can't wait to start stalking people. In your game I mean  Well, hello there!
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #754 on: March 22, 2016, 11:27:19 AM »

Haha, thanks! It is really nice seeing it all slowly come together.
Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #755 on: March 30, 2016, 09:36:10 AM »

I was going to publish this update on Sunday, but I decided to leave it until today so that we could hopefully have all the monastery stuff done. Almost all of the monasteries’ AI now works correctly, along with the other stuff, which means next week’s update will be on castles and everything else that needs doing in the interim. This update looks at monasteries and a ton of extra work on innkeeps and farmers, and a pretty exciting selection of bugs that came up in the process, the combination of which prevented me from also getting castles done this weekend (in the UK we have a four-day easter weekend, so I’ve been coding all Friday and today as well as Sat/Sun/Mon). What all of this means is that in a fortnight from today, I should be releasing the playtesting release. It’s just castles and a few monastery issues to go, and then clearing and neatening some things up, then we’re (finally) good to go to move onto speech. Thanks to everyone for sticking with me this long – it has been tough, but we are so close to having all the AI stuff working for the playtesting release. If you want to be part of the interim playtest, you can still email me at my first name at this domain. For those who haven’t seen me mention this before, this is not 0.8, but rather an interim closed playtesting release for making sure that all the AI stuff is working correctly. For now, though, here’s a summary of all the final AI stuff implemented this week:

Monasteries

Monasteries and castles were always going to be two of the hardest areas to make work perfectly. Castles are complex because they have so many different classes of NPC going about their day and many different floors, whilst monasteries were always going to be challenging because they can contain many buildings – the monastery itself, a nearly religious building for worship, and potentially delegate housing if in a democratic nation that allows its monasteries to have delegates – and the schedules of the monks include interior and exterior behaviours within the monastery (studying), within the religious building (prayer), and outside (tending to the vegetable garden). Additionally, monasteries are an area with a tiny number of important NPCs (i.e. a couple of the monks) and a large number of semi-important NPCs who should be indistinguishable from the other monks (i.e. the rest of the monks), and these categories need to work correctly despite having quite different code with regards to their scheduling. I’ll be working on all the NPC schedules we need in castles this coming week, but as far as I can tell monasteries are now all working correctly! Here are some examples – you’ve seen lots of monks before, but they now tend their vegetable gardens correctly, and head to bed correctly, although there remain a few minor issues that need resolving for next week…





And a monk (I’m using “monk” for women and men, since “nun” has a lot of connotations that are distinct from monk) in such a monastery:



More Farmers and Innkeeps

As is becoming a pattern, it turned out that farmers and innkeeps were not working perfectly. The issue with the former was in matching up both important and non-important farmers in their homes at the appropriate times in their schedules (e.g. night) and then making sure those farmers are the ones that start farming in the day, instead of spawning a second copy. Later issues were then discovered with various combinations of being in buildings, out of buildings, being important, being unimportant, etc, including a few weird errors that arose because “Farmhouse” wasn’t in a few places it should be in order to acknowledge it as a potential type of house for an NPC.

The issue with the latter was that although 95% of the ambassador code was usable, I had forgotten that the usual movement for innkeeps (wandering around behind the counter) uses a very different chunk of code from ambassadors (wandering around their embassy and sitting at chairs and talking to people), which meant that innkeeps, if they had just been awoken and then the player entered and therefore spawned the building, it would often place them outside the bar’s counter and get them wandering around their own tavern instead of serving drinks! I’ve now fixed all of this nonsense.



Bugs

A huge number of bugs were resolved this week. For some reason, wandering NPCs who enter a building whilst the player is outside and the building is not spawned, and then the player enters and spawns that building, were not behaving properly and were causing the game to crash by attempting to path outside the building. I don’t understand what caused this, since I don’t think I changed any code that deals with that stuff, or even any code related to that stuff, but either way, it’s now fixed; fixed by dealing with the effect instead of finding the cause, but fixed regardless.

Then we had another very weird bug which took a while to track down, but basically if you moved onto the same tile as a sleeping NPC, on a different floor, and that NPC was of a specific class and had been spawned in a particular way, they would move onto the staircase down, and then just sit there doing nothing. Turned out this was an incredibly old line of code that wasn’t fit to handle buildings of multiple floors, and just needed a single line added, but that took a good few hours to hunt down…

Another bug emerged whereby when you went up a staircase, if you then immediately tried to move onto a tile which was occupied by another NPC, and that NPC wasn’t moving, you could switch places with them. This one meant that, in effect, you could transfer someone off their bed, whilst sleeping, and put them on the staircase. Very silly. Like the first in this list, I’m still not completely sure what caused this, but I’ve fixed it regardless by adding a special line of code that prevents you doing a “force switch” with another NPC so long as you’re on a staircase, since the staircase definitely creates the problem.

I also ran into a really strange bug involving the corners of city walls placed outside those walls. If you were going from Map Grid XlY to Map Grid X,Y-1 and there was a city on Map Grid X+1,Y or Map Grid X+1,Y-1, then the game would check whether you could path to the corner of the map grid (as it should), but rather than concluding that this couldn’t be pathed to (on account of being city wall), it instead concluded it could be pathed to with a path time of 0 moves. As in, it defaulted to 0 as the “error” path length, rather than 9999 or some equivalent. This took a while to find since it has been a long time since I’ve handled the code for keeping track of the time it takes the player to move around the map, but has now been fixed, and no longer teleports the player into impossible corners if they then instantly re-enter a map grid after travelling out of it, and there’s a city wall in the corner.

Another bug emerged where it turned out that moving from map grid to map grid on foot, if the player was outside a city, caused the important NPCs to mysteriously vanish into oblivion. This was because I had originally codded it on the assumption – falsely, but it just didn’t occur to me – that only cities would have important NPCs… but of course monasteries, farms, towns and so forth do as well. This meant that when you simply walked from grid to grid, it didn’t think to check in on important NPCs because the player wasn’t going through a city gate, and everything was tethered to the gates. This was a quick copy-paste job to call the same “Check what important NPCs are doing” function when going over map grids, and as far as I can tell, that should have done it.

Honestly, a ton of this week has been on bug-fixing. It’s a real case of two steps forward, one step back: I code a bunch of new AI stuff, and then discover loads of weird new bugs in the process, spawned from the massive complexity of URR 0.8. Still, there can’t be that many bugs left now… right?

And finally, since this is a relatively screenshot-light entry, some NPCs from a nation I ran into during the process of playtesting. See you all next week for finished monastery AI, and hopefully the completion of the biggest challenge of all – CASTLES.





Logged

Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #756 on: April 11, 2016, 09:47:18 AM »

Well, 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:



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.



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).



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!).



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



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.



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:





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.



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:



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)…
Logged

s0
o
Level 10
*****


eurovision winner 2014


View Profile
« Reply #757 on: April 11, 2016, 12:46:56 PM »

Can't wait for the release!
Logged
Ultima Ratio Regum
Level 7
**


Game Studies Lecturer, "Ultima Ratio Regum" person


View Profile WWW
« Reply #758 on: April 14, 2016, 03:17:35 PM »

Thanks! Soon... mildly soon.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #759 on: April 14, 2016, 08:55:47 PM »

Poping up to encourage you and say good job! Can't wait for dialogue design!
Logged

Pages: 1 ... 36 37 [38] 39 40 ... 53
Print
Jump to:  

Theme orange-lt created by panic