Category Archives: Blog

Stonehearth Alpha 9 Released!

stonehearth_alpha_9

Hi everyone. Alpha 9 is officially out the door, and man this one was a big one! Humble Bundle users, you can download the new build from your My Library page at http://humblebundle.com. This release contains some big new features, along with performance and stability improvements. Thanks to everyone who helped test the build and provide bug reports.

Here are patch notes for this release

Stonehearth Alpha 9 Patch Notes

 

  • 64-bit Client! We are now shipping both 64-bit and 32-bit versions of the game. If you’re running a 64-bit OS, we highly suggest using the 64-bit version. Choose your game version from the System tab of the Settings screen.
  • New Harvesting Commands. The new commands are:
    • Clear, to completely destroy unwanted items
    • Cancel Orderm to undo previously issued harvest commands
    • Loot, to steal items that belong to someone else. For now this means just the goblins
  • Combat Rebalance. Each individual goblin is now much more of a threat, but they will come at you in fewer numbers. Also, there are now serveral different kinds of goblins, with different stats and behaviors.
  • Combat Scenarios. The goblins now organize themselves into structured raiding camps. You’ll need to find a way of dealing with them once they set up camp near your town.
  • Combat Music! The music will now change when one of your hearthlings sees an enemy.
  • Shops. Travelling merchants will visit your town every now and then. You can sell your excess inventory for gold, and use that gold to buy from all merchants
  • Autosave! Turn autosave on and off from the save/load screen. When on, the game will save every 5 minutes.
  • Bug Fixes
    • In the build HUD, don’t show zones that the player doesn’t own.
    • Fix display of ghost item rendering on structures
    • Inanimate objects no longer write journal entries when they die
    • Fix tearing down buildings after construction has started
    • More region calculation optimizations
    • Speed up the ambient-occlusion algorithm
    • Fix bug in the selection of doors, windows, and doodads in the building designer
    • Significant performance increases to nav-grid calculation (used by the pathfinder). The game should not longer hiccup when building roads or mining.
    • Properly restore real-time timers on load (fixes zombie worker bug)
    • Fix demotion of the Shepherd
    • Fixes to calculation of water-tight regions (shhhh, you’re not supposed to know about water yet)
    • Fix for unexplored region being misplaced on load occasionally
    • Fix bug where job talismans were not properly assigned to their workshops
    • Increased logging infrastructure to help us better diagnose your automatic crash reports
    • Error boost::interprocess::bad_alloc should be eliminated, or at least very greatly reduced.
    • Clicks will no longer go “through” the UI and hit the game world when the game is not exactly 1.777:1 aspect ratio. AKA, the “ghost UI” bug
    • The chromium log no longer spams when starting or loading a game
    • Fixed script error when growing corn
    • Fix bug where on some systems the game would take several minutes to startup or load when there were many save games present

Desktop Tuesday, CSI at the Scene of an AI Bug

zombie_worker_1

So as you many know, we’ve spent the last two weeks or so focusing on bug fixing and performance work in advance of Alpha 9′s release. For this week’s dev update, I thought I would do a little something different and share a horror story of a particularly nasty bug, which quickly became infamously known as the “Zombie Worker” bug.

What follows is the account of Team Radiant member Albert, who did the investigation and ultimate fix of the bug.

The “Zombie Worker” Bug

A few weeks ago we started to get an increasing number of reports of zombie workers just standing around doing nothing. We’ve seen this occur when building a large town with many workers and zones (particularly stockpiles and mining zones) that are far apart. As a result, we’ve been optimizing the pathfinding and improving the AI system so that it can scale to handle lots of difficult tasks.

The crazy thing about this bug report was that the pathfinder and AI systems seemed completely idle. We knew this because of the little performance bar that we put in the lower right of the game screen. Check out this screenshot from a player who reported the Zombie Worker bug

zombie_worker_1

Everyone is standing around doing nothing, and will eventually starve to death. Awesome. The crazy part is, look at the little bar in the lower right. It’s completely green, which means the system is idle! If the AI or pathfinder was going bonkers, that bar would be all yellow or orange.

So, based on everything we understand about Stonehearth, this is a completely impossible situation. Hmmm…

Mission: Repro the Bug

The first step in improving the system is to reproduce the problem so that we have a good understanding of the root cause, and so that we can address the underlying problem as opposed to just covering up the symptoms. None of us had seen these zombie towns first hand, so we set about trying to reproduce the problem.

Speculating that this was a result of the AI running out of time and just giving up, we played the game in ways that would stress out the AI system. We saved and loaded the game countless times. Tom even busted out our slowest and oldest computers and played for many game days, but the zombies were nowhere to be seen. Reports of the zombie plague seemed common among our players, but everybody at Radiant seemed immune to it. What were we missing?

Stonehearth Tester Army to the Rescue

It turns out that quite a few of you are excellent sleuths and through many playthroughs, Vince5754 on the forums started to see a pattern:

  1. Play the game.
  2. Go to sleep.
  3. Overnight, all of your hearthlings have turned into zombies.

Seriously, we couldn’t have invented a more imaginative bug. What in the world was creeping into everybody’s computer at night and infecting all their hearthlings ? After more investigation, the second breakthrough came when Tempered posted that the bug always happens after rebooting, and upon loading, every hearthling had become a zombie.

With that, we were able to reproduce the bug and look into what was going on. After a bit of debugging, we saw that our real-time timers were behaving oddly after rebooting. First, a bit of background. In Stonehearth, we use two types of timers: calendar timers and real-time timers. Calendar timers keep track of game time and control events like when to eat and how fast crops grow. Real-time timers keep track of real-life time that we humans live in and are used for things like measuring performance, capturing player input, and… scheduling worker tasks.

So, what was happening? All timers restore their state (the information they need to operate) on load and usually everything just works from there. In this case, the timer itself was restoring properly, but the real-time timer that we read from Windows resets to zero on reboot.

So basically, the timer for task scheduling says, “The Windows real-time timer currently reads 10000. Wake me up when it reaches 10001.” We now save the game and reboot. When Windows boots up again, the real-time timer is reset to 0, but the task scheduler is still waiting for it to reach 10001, which is a really long time. As a result, no new tasks are assigned to any hearthlings and they stand around like zombies wandering about with nothing to do.

If you wait around long enough for the timer to reach 10001, the problem fixes itself. But of course, in almost every case your hearthlings will starve to death first.  The good news is that once the bug was identified, it was pretty straight forward to fix in a matter of hours.

Thanks to the hard work from our players in identifying this bug, our real-time timer is now restored properly on load and this bug is now squashed!

Alpha 9 Release Candidate, release-256, Updloaded to Steam latest Branch

stonehearth_alpha_9

Hi all. Over the past week we’ve added quite a few performance and stability fixes. Things aren’t perfect, but they’re good enough for us to consider releasing Alpha 9 and continuing with feature development.

Here are patch notes to the newest build uploaded to the Steam latest branch.

Patch Notes, release-256

  • Autosave! Turn autosave on and off from the save/load screen. When on, the game will save every 5 minutes.
  • In the build HUD, don’t show zones that the player doesn’t own.
  • Fix display of ghost item rendering on structures
  • Inanimate objects no longer write journal entries when they die
  • Fix tearing down buildings after construction has started
  • More region calculation optimizations

Progress! Stonehearth latest Branch Updated to release-240

latest

Great news! We have finally nailed a major cause of the “workers get randomly stuck” bug. Our latest build greatly reduces that problem, if not out-right eliminating it. Thank you everyone who provided consistent feedback, which enabled us to finally repro this bug in house. This was one insanely tricky bug…we’ll share the gory ins and outs of it in a future Desktop Tuesday.

Along the way to fixing that key bug, we’ve made hefty share of performance improvements and bug fixes. Here are the full patch notes.

Patch Notes: release-240

  • Speed up the ambient-occlusion algorithm
  • Fix bug in the selection of doors, windows, and doodads in the building designer
  • Make sure shop items are actually usable after they are purchased
  • Significant performance increases to nav-grid calculation (used by the pathfinder). The game should not longer hiccup when building roads or mining.
  • Properly restore real-time timers on load (fixes zombie worker bug)
  • Fix demotion of the Shepherd
  • Fixes to calculation of water-tight regions (shhhh, you’re not supposed to know about water yet)
  • Fix for unexplored region being misplaced on load occasionally
  • Fix bug where job talismans were not properly assigned to their workshops

 

 

Desktop Tuesday, Alpha 9 Title screen speed paint

a9_speed_paint

Hi. The Alpha 9 bug-fixing continues. Thanks for all your bug reports. For this week’s video, here’s a speed paint of our new title screen, featuring the goblins! We’ll get Alpha 9 out to all of you as soon as it meets our stability requirements. Stay tuned!

Oh, and here’s the finished image

stonehearth_alpha_9

 

Watch Us Live, Tuesdays & Thursdays

We stream our development live on Tuesdays and Thursdays, @6pm PST!

Come say hi and ask questions at twitch.tv/stonehearth

Get Stonehearth!

The Stonehearth Alpha is now available through Humble Bundle.

Dev Roadmap

Connect with Us