Why "consistently silly" is IMO better than "usually smart" -- Hearthling AI and micro vs macro. AKA "stop digging yourselves into a corner!"

First up: the title is probably a good warning, but this post is going to have a lot of words. There will be examples, analogies, some speculation, and some experience gleaned from other games. I’ll try to keep it straightforward, but… no promises.

So, we’ve all been in that situation of watching our hearthlings perform a seemingly simple task, and come away shaking our heads and questioning how they can mess it up so badly. For example, tell them to mine out that 4x4x12 strip of dirt; a single hearthling can do it in a couple of minutes… so three hearthlings should do it in 1/3 of the time, right? And yet, how it actually goes down is that hearthling A mines out the block hearthling B wants to stand on, so hearthling B takes the long way around to get to their mining task, meanwhile hearthling A (who is now standing on hearthling B’s mining target) mines out the block in front of them, and hearthling C comes in to mine out the block which connects hearthling A’s location to the ground. Long story short: hearthling A is now stuck, and needs the player to get them down.

What went wrong? Well, the short answer (i.e. the intuitive answer for when the same thing happens among humans) is that the hearthlings didn’t communicate, and they got in each others’ way. However, that answer is deceptive, and not really applicable. Hearthlings, after all, are very much not humans. They don’t think like us, in fact they barely think at all. They’re not supposed to need to think very much.

The problem, then, is really that the hearthlings are being left to make decisions which really should have already been made for them. Instead of the hearthlings choosing from available blocks they could reach at that time in order to select a mining target, their targets could have been pre-planned to prevent any one of them getting in another’s way, or to totally avoid any chance of getting cut off.

But that solution introduces a new problem: if the game has to pre-plan every action to avoid bottlenecks, it’s going to take unreasonably long to guarantee even the simplest operation will be completed properly.

Now, if only there were some other option, a very rapid problem-solver which could pre-plan and look ahead easily. Wait a second… that sounds a lot like where the Human player comes in. Surely the Human player, being an active supervisor and observer, can simply take control and command the hearthlings to do the job correctly, step by step? Well, sure… if the Human player wants to work at a snail’s pace, and leave 80% of their town idle while they micro-manage a single task.

So, leaving it all up to the game AI doesn’t work, and leaving it all up to the player doesn’t provide the right kind of experience. The solution needs to be a compromise – an interface between the player and the game which allows the player to intervene and take up some of the decision-making load. This can’t be something the player is regularly called upon to do; so the best way to minimise the need for this intervention is to have it be taken right at the start – get the job done right, so it only needs to be done once.

What I’m talking about, effectively, is giving the player an opportunity to lay out the complicated orders step-by-step; so that the hearthlings completing them never need to make any decisions. They simply check what step they’re up to, and do it.

Now, here comes the speculation; 3 big ones to be precise:

  1. the game is probably quite capable in its current state of breaking up tasks into their individual stages – we’ve seen that with the building editor, the game generally gets the order right thanks to the dependency trees. However, when things go wrong, they go badly wrong; and the results look nothing like what was predicted/expected. Usually, there’s a random factor involved, and there’s also some kind of interaction that the game can’t predict. The building editor can’t predict, for example, that there will be an invasion and that the player will choose to put the town into Defence Mode, and that because of that Defence Mode the construction jobs already claimed may get completed in a different order to the order they were claimed in… that sort of situation can’t be predicted by anything short of a genuine learning AI; effectively equivalent to a Human intelligence. Of course, the player can’t predict that event with certainty either… but even so, the player can create a contingency plan for it.
  2. Even though most players are capable of figuring out such a situation when prompted, there’s no guarantee that they will notice it ahead of time. I would speculate that the majority of players don’t go looking for problems which haven’t reared their heads yet.
  3. For most players, absolutely perfect efficiency probably isn’t worth the time it takes to set up. If the tasks are completed with no errors serious enough to stall the workflow, I would expect that to be good enough for the vast majority of us (I know it would usually be good enough for me, and I’m an efficiency nutter with a perfectionist streak). We’re here to play, not to micro-organise a production with to-the-moment choreography.

With those three speculations (and the assumptions that underlie them) in place, it becomes possible to weigh up the pros and cons of actually changing the current system to allow player intervention. And this is where experience from other games comes in handy:

Regarding that last point of “micro-organised productions choreographed to-the-moment for complete efficiency”, such games already exist. SpaceChem, Factorio, Transport Tycoon… even good old Dwarf Fortress offers tools to scratch that itch. There’s a lot of crossover between Stonehearth’s players and those other games; but clearly we want Stonehearth to offer something slightly different – otherwise, we’d be busy playing those other games rather than Stonehearth lol. Stoneheath’s fans seem to want to be able to lay out a task and have the game figure it out; at least there haven’t been many contradictions to that idea.

But at the same time, the fact of that genre crossover means that there is some demand for the ability to more tightly choreograph how our hearthlings perform their tasks; at least enough to make sure they don’t dig themselves into a corner when we haven’t specifically told them to. This is where we run into a tricky balancing act: if the game gets things right 80%+ of the time, but the other 20% of the time is really painfully frustrating to some players, what’s an acceptable tolerance?

And here, I’d like to offer my suggestion for a solution which should hopefully satisfy both ends of the spectrum: let players choose how much they want to intervene, but rely on the game to do the heavy lifting. So, when the player creates an order, have an option to preview how that order is expected to be completed; and then allow the player to alter the process so that if they have an idea on how to optimise it they can use that optimisation.

Practical example: going back to the original case where one hearthling mines out the other’s access path; the player can eliminate that mistake if they manually order the mining to be done one layer at a time. That solution is tedious though; and moreover, the game is smart enough to automate breaking down the large mining order into one layer at a time. So, a solution which works for both kinds of players is to introduce a button into the mining zone’s UI (that is, the dialogue which pops up when you select the mining zone) to tell the hearthlings to complete one layer fully before starting on the next layer. That way, it’s impossible for a hearthling to get stuck on a two-block-tall protrusion in the middle of the mining area, or to mine out an overhang they can’t reach the top of.

Another, more complex example: say the player is building a bridge across a very long ravine. Currently, the hearthlings will try to work from both ends; meaning they’ll walk around the ravine and waste a lot of time. If the player could set the priority for construction, they can tell the hearthlings to complete a single strip of the bridge first, providing a much shorter way to cross the canyon and allowing work to speed up dramatically. The interesting thing to note is that this solution isn’t to prevent the hearthlings working from both ends at once; rather it’s about recognising how they want to do the job and helping them to do it that way.

That’s basically the crux of what I’m getting at – the hearthlings don’t need to be smart all the time, they just need to be consistent enough to plan around. We Human players are smart enough to plan around a lot of different potential outcomes; it’s just that we currently have little to no control over how the game proceeds with the orders we give it.

In the past, trying to talk other players through how to overcome this hurdle in games like Towns, Factorio or even Stonehearth itself, I’ve used the analogy of sled dogs. Sled dogs will run exactly how you tell them to, and if you don’t give them an end-point, they’ll run until they can’t run anymore. It’s exactly the same with hearthlings – they’ll work at the job you give them until it’s done, or they can’t work at it anymore. The problem for games like Stonehearth is that when a hearthling becomes unable to work, the issue stopping is more wide-spread than that single task. It means one of two things: either that particular hearthling can do nothing else until the issue is fixed; or else the hold-up is stopping all the other hearthlings from doing that kind of job until the issue is fixed. Either way, it demands your attention as a player, and leads to the situation where players are thinking “if only I could have told them how to avoid that situation, none of these things would be going wrong now”.

So, that’s my feedback and suggestion on this part of the gameplay loop – the Stonehearth engine does a great job of figuring out a lot of problems, but it still can’t self-diagnose and it can’t look ahead to prevent mistakes or bottle-necks. As a player, it’s incredibly frustrating to watch a bottle-neck piling up, and to know that the only way to do anything about it is to completely shut down production, cancel the order, and either a) wait for the game to catch up, or b) manually lay out a step-by-step version of the order just cancelled, making sure that the hearthlings can’t mess it up this time.

I realise that fixing these situations is a lot easier said than done. However, I think that you can leverage your existing problem-solving ability built into the engine, and simply expose the solutions it generates to the players so they can manipulate that output and correct any oversights/mistakes. That is, after all, what a supervisor or site manager or factory manager does. If Stonehearth is an ant farm game, we need to be able to get in there with our tweezers in order to keep the colony stable and productive. That doesn’t mean micro-managing a full solution; just removing a major hurdle (often one that the game doesn’t even see as a hurdle) and then withdrawing to let the game sort the rest of the issue out.


  1. expose the solutions that the game comes up with to players, allowing them to scrutinise those solutions before any problems spiral out of control.
  2. allow players to intervene in the game’s decision-making process, adjusting the priority or order in which tasks are completed.

Thanks for sticking with the thread this far!

Cheers @YetiChow, I immensely enjoyed your posting - mostly though because I disagree with you in respect to the solution. Of course it was the inspiration to a different approach, which I just fell in love with because it so much reminds me of the very old game “Little Computer People”.

You state “the hearthlings didn’t communicate” and just leave it at that.
But why is that okay?
I believe it is a great idea to have the hearthlings communicate, at least in stress situations and by stress I mean situations where they get in each others way.
So one miner is about to work on a block, which will put another hearthling into a corner it can’t get out of, exactly such situations are very good to have them yell at each other.
It could be a basis for moods like anger and such.

Or the player decides to have a ladder unbuilt.
Wouldn’t it be cool if the hearthling that is supposed to do the job would check if there are stragglers around and yell to them to hurry down? Or the hearthlings get so angry about the players decision they yell to the player out of the screen. I remember that I nearly jumped from my chair when my guy in Little Computer People knocked on the screen inside the first time.

I love “consistently silly” though. No matter how game/job breaking issues are handled in the future I very much hope it will be with a consistent silly approach! :smiley:


:heart: ed for LCP because that game gave me so much joy just knowing it existed even if I didn’t get to play it until I was much older. I don’t know if Stonehearth’s AI will ever be that sophisticated but gosh if it isn’t a cool idea.

That would be an amazing solution, and I’d prefer it by a long way over what I suggested. It would mean that instead of breaking up the work-flow, the game would not only sort the problem out itself, but give players a clear indication that they’ve missed something important. If a player sees their hearthlings getting upset, or sees them having to constantly yell “hey, get down, we need to finish this and move on!”, then it’s an indicator that the hearthlings are probably being over-worked.

The reason I suggested working within the current system and borrowing the player’s brainpower is that it should be fairly easy to implement; at least compared to making the hearthlings properly communicate with each other. Having played some of the more recent offerings in this genre, I’m used to running into the “it’s simply not practical to have them check for so many things at once” barrier; so I was designing my solution with that in mind.

But it would seem I’ve missed a real gem in Little Computer People, I’ll definitely check that one out. If Radiant can learn something from how LCP gets its workers to work together, that would be an awesome improvement.

It is worth pointing out that some of the crafters have a second- or third-level ability to pick up a task where another crafter left off; so that might hint at the start of this kind of intelligent communication. However, that’s a much narrower set of decisions to make (is there a half-finished crafting task with nobody working on it? Do I meet the requirements to do it? Ok, I’ll do it); having workers check who is occupying the block they want to mine or check if a ladder is needed for access would be another level of challenge altogether.

But frankly, if anyone can pull those kind of mechanics off, Radiant are in a pretty good place to do it. So I hope that this idea of proper communication ends up becoming reality, it would be amazing to see in action.

Ah I fear we are out of luck here, its an old old old game, just thinking about it makes me feel old Little Computer People - Wikipedia - there ain’t no workers or building stuff. By today’s standards its not qualified as a proper game even I guess.

But I just miss that way of having the game break the fourth wall and if the player keeps on messing things up for the stonhearthians why not have them do that too? The letters addressed to the player were so cool. I wouldn’t mind having such lines included in the stonehearth diary. Lets assume one hasn’t built beds for over 10 days why not have something in the log like “Hey you. You in front of the screen! I have hinted again and again at how unhappy we are to sleep on the cold hard ground and you keep ignoring us. Do something about it!”

1 Like