A24.4 "Thinking Flag" Game Crashing Bug

Summary:
So there is this one engine error that keeps coming up on all of the games I’ve started in A24.4 and it sometimes occurs randomly and sometimes it seems prompted from buttons I click on, buildings I build, or even the dialog options on the story line windows. It doesn’t directly affect anything but I think this is the reason all my games have been crashing since the new alpha update after about an hour or so of gameplay and then about 30 minutes each time after that. On past saves I have had a handful of other errors pop up (that usually all contain this SH-OB0-BUILD thing in the first line) in one game but they dont start appearing until this “thinking flag unset” bug shows up. This error is the only thing stopping me from being able to enjoy the alpha content as relaoding from the last autosave every thirty minutes is not fun.

Sorry if I didnt explain this well or confused anyone but it confuses me too so

Steps to reproduce:

  1. Start a new game
  2. Establish an outpost
  3. Choose the name and banner I wanted (vitality banner)

Expected Results:
No engine error and I can continue on

Actual Results:
Persistent Engine Error that keeps occurring throughout my game, this is the first one I got on this particular save.

release-811 (x64)[M]
CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\compound_action.cpp:357 Thinking flag unset while restarting thinking.
stack traceback:
radiant/modules/commons.lua:53: in function ‘report_traceback’
radiant/modules/commons.lua:64: in function <radiant/modules/commons.lua:58>
[C]: in function ‘clear_think_output’
…th/ai/actions/find_best_reachable_entity_by_type.lua:140: in function ‘_set_result’
…th/ai/actions/find_best_reachable_entity_by_type.lua:76: in function ‘found_cb’
stonehearth/components/item_finder/item_search.lua:169: in function ‘_call_found_cb’
stonehearth/components/item_finder/item_search.lua:187: in function ‘_call_found_cbs’
stonehearth/components/item_finder/item_search.lua:156: in function ‘_on_leased_solution_ready’
stonehearth/components/item_finder/item_search.lua:117: in function ‘instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:285: in function ‘trigger’
radiant/modules/events.lua:375: in function <radiant/modules/events.lua:374>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:374: in function ‘_fire_async_triggers’
radiant/modules/events.lua:452: in function ‘_update’
radiant/server.lua:67: in function <radiant/server.lua:64>

Later after crafting a few items with my carpenter this appeared.

release-811 (x64)[M]
CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\execution_unit.cpp:205 bad unit transition “set_think_output” from “starting” in action pickup item type
stack traceback:
[C]: ?
[C]: in function ‘set_think_output’
…ehearth/ai/actions/find_path_to_reachable_entity.lua:61: in function ‘cb’
stonehearth/components/pathfinder/astar_search.lua:131: in function ‘_on_solved’
stonehearth/components/pathfinder/astar_search.lua:99: in function <stonehearth/components/pathfinder/astar_search.lua:98>

About 20 or 30 minutes after this my game closed with no error message or anything.

Notes:

This bug does not always appear when I select my banner but it will always appear either randomly or when a action is taken in any of the new games I start. I can’t really find out what it does as nothing about my game changes for a while until it crashes at about an hour or so later. On an old save I had my heartlings would move slower the longer I played causing me to reload every thirty minutes or so.

Attachments:

Here is the log for this save:

stonehearth.log (237.0 KB)

Version Number and Mods in use:

A24.4 release 811

Mods:
Froggy’s Cook Mod
Patrol Points Mod
(I have also received this error on other saves without these mods installed)

System Information:

Windows 10 (64-bit)
AMD Ryzen 5 1400 Quad-core Processor 3.20Ghz
8GB RAM

I just got this exact one myself, as well. In my case, this didn’t happen at the beginning, though my settlement is only 4 days in. I’m waiting to see if it crashes the game yet or not, but when I get these ‘thinking flag’ bugs, they usually recur until the game does actually crash.

release-811 (x64)
CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\compound_action.cpp:357 Thinking flag unset while restarting thinking.
stack traceback:
radiant/modules/commons.lua:53: in function ‘report_traceback’
radiant/modules/commons.lua:64: in function <radiant/modules/commons.lua:58>
[C]: in function ‘clear_think_output’
…th/ai/actions/find_best_reachable_entity_by_type.lua:140: in function ‘_set_result’
…th/ai/actions/find_best_reachable_entity_by_type.lua:76: in function ‘found_cb’
stonehearth/components/item_finder/item_search.lua:169: in function ‘_call_found_cb’
stonehearth/components/item_finder/item_search.lua:187: in function ‘_call_found_cbs’
stonehearth/components/item_finder/item_search.lua:156: in function ‘_on_leased_solution_ready’
stonehearth/components/item_finder/item_search.lua:117: in function ‘instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:285: in function ‘trigger’
radiant/modules/events.lua:375: in function <radiant/modules/events.lua:374>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:374: in function ‘_fire_async_triggers’
radiant/modules/events.lua:452: in function ‘_update’
radiant/server.lua:67: in function <radiant/server.lua:64>

No mods.

System Info:

Windows 7 (64-bit)
Intel Pentium CPU G3240 @3.10GHz 3.10GHz
16GB RAM

Im so glad its not just me with this error haha. Yeah I continued to play on the save that I reported above and kept receiving them until the game crashed as well. I also found that when I recieve these errors in a save I no longer recieve prompts for the story line, I had 14 people on the last save and still was never prompted to choose a hearth for my village so maybe it does have something to do with the main quest line.

No, it’s not just you.

There’s also another potentially game breaking bug that’s similar but it affects individual Hearthlings. I had a thinking flat come up on a character that I’d just promoted to cleric. She was stuck in promotion mode, not completing and not moving. She wouldn’t (or couldn’t) fulfill her wants/needs and simply stood there in one place without doing anything even after she was commanded to join her combat unit to attack some wolves. Damage wouldn’t shake her out and nothing I did with the debug mode fixed her, either. Reloading the game/save had absolutely no effect.

I just started a new game in A24.5 and as soon as I got the letter from the bird I got this again…

release-819 (x64)
CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\compound_action.cpp:357 Thinking flag unset while restarting thinking.
stack traceback:
radiant/modules/commons.lua:53: in function ‘report_traceback’
radiant/modules/commons.lua:64: in function <radiant/modules/commons.lua:58>
[C]: in function ‘clear_think_output’
…th/ai/actions/find_best_reachable_entity_by_type.lua:140: in function ‘_set_result’
…th/ai/actions/find_best_reachable_entity_by_type.lua:76: in function ‘found_cb’
stonehearth/components/item_finder/item_search.lua:169: in function ‘_call_found_cb’
stonehearth/components/item_finder/item_search.lua:187: in function ‘_call_found_cbs’
stonehearth/components/item_finder/item_search.lua:156: in function ‘_on_leased_solution_ready’
stonehearth/components/item_finder/item_search.lua:117: in function ‘instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:285: in function ‘trigger’
radiant/modules/events.lua:375: in function <radiant/modules/events.lua:374>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:374: in function ‘_fire_async_triggers’
radiant/modules/events.lua:452: in function ‘_update’
radiant/server.lua:67: in function <radiant/server.lua:64>

Just started another game in A24.5 and recieved no errors and still got a hard crash after maybe ten minutes

Do you have a crash dmp file? Or the stonehearth.log?

1 Like

These are from my most recent save in A24.5, I have only recieved one “thinking flag” engine error so far but it has crashed twice now.

crash.dmp (168.2 KB)

stonehearth.log (132.7 KB)

1 Like

I am going to keep playing this save and see if it continues to crash.

Upon continuing this save I immediately got this error again follow by a crash five minutes later.

release-819 (x64)
CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\compound_action.cpp:357 Thinking flag unset while restarting thinking.
stack traceback:
radiant/modules/commons.lua:53: in function ‘report_traceback’
radiant/modules/commons.lua:64: in function <radiant/modules/commons.lua:58>
[C]: in function ‘clear_think_output’
…th/ai/actions/find_best_reachable_entity_by_type.lua:140: in function ‘_set_result’
…th/ai/actions/find_best_reachable_entity_by_type.lua:76: in function ‘found_cb’
stonehearth/components/item_finder/item_search.lua:169: in function ‘_call_found_cb’
stonehearth/components/item_finder/item_search.lua:187: in function ‘_call_found_cbs’
stonehearth/components/item_finder/item_search.lua:156: in function ‘_on_leased_solution_ready’
stonehearth/components/item_finder/item_search.lua:117: in function ‘instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:285: in function ‘trigger’
radiant/modules/events.lua:375: in function <radiant/modules/events.lua:374>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
radiant/modules/events.lua:374: in function ‘_fire_async_triggers’
radiant/modules/events.lua:452: in function ‘_update’
radiant/server.lua:67: in function <radiant/server.lua:64>

I had the same bug, but it went on like this:

release-815 (x64)
@stonehearth/components/ai/ai_component.lua:564: (9320 Brindi Asalar) has not yielded after 11 ai spins. Are they in a bad state? Last abort reasons: <destination (492589 stonehearth:resources:wood:oak_log) is no longer valid at start. filter description: pickup nofilter(player_1) (ground) (x11)>
stack traceback:
radiant/modules/commons.lua:53: in function ‘report_traceback’
radiant/modules/commons.lua:258: in function ‘verify’
stonehearth/components/ai/ai_component.lua:564: in function <stonehearth/components/ai/ai_component.lua:503>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
stonehearth/components/ai/ai_component.lua:503: in function ‘_thread_main’
stonehearth/services/server/threads/thread.lua:273: in function <stonehearth/services/server/threads/thread.lua:270>
[C]: in function ‘xpcall’
radiant/modules/commons.lua:73: in function ‘xpcall’
stonehearth/services/server/threads/thread.lua:270: in function ‘f’
radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

Save: WoodenTemple.rar (3.6 MB)

Ive had a bug like that before but not in the recent unstables. What alpha are you playing?

It’s the newest builder alpha r-815.

Oh maybe thats why, I haven’t tried that out yet as Im already having enough bugs and crashes going on.
I’ve heard its very unstable though, perhaps that why you are getting that error.

@superliminal we’re trying to reproduce these crashes even though they seem to happen randomly, so I have some more questions about it.

Were you playing at normal speed or at a higher speed?
How many hearthlings did you have?
Did you have many stockpiles? Or storages like crates?
What were the hearthlings doing in general when the crash happened?

Do you feel that the crash always happens after some minutes after that AI error?

I usually play at the highest speed from the start but its never given me issues like this before. I have yet to top about 20 hearthlings with any of the saves that I have been recieving these crashes and thinking flag errors and on the most recent save above I have only 9. I had only 3 chests and about 3 stockpiles. My hearthlings are in the middle of building a modest size town hall and harvesting berries. I can upload the save if you guys want to look at it.

1 Like

And the crashes on 24.5 have been very close together and about 5 or 10 minutes after the error occurs but on 24.4 the crashes were a lot more random, as were the thinking flag errors.

1 Like

@Relyss To help you with your questions:

I play the game at normal speed.

I get the error flag as early as 9 Hearthlings, but I haven’t played an error flagged save past 22 Hearthlings.

One 20x20 stockpile (171/400) with currently 2 large crates and 18 stone chests.

When the crashes happen in my games, the Hearthlings are restocking items or mining.

But, I’ve had individual Hearthlings get stopped dead in their tracks with thinking flag that targets them specifically. The most recent one of those was a character who was promoting from herbalist to cleric. During the promotion animation, the flag hit and she was frozen. It had her action listed as ‘promoting,’ but she was listed as a cleric. She didn’t move when commanded to join her combat unit. She didn’t move during the next meal time. Her becoming hungry and getting that thought bubble over her head was how I actually managed to find the poor dear.

Hope this helps you guys.

1 Like

I think we have fixed

CHECK failed: C:\rb\ihome\root\SH-OB0-BUILD\stonehearth\source\lib\lua\ai\compound_action.cpp:357
Thinking flag unset while restarting thinking.

in our internal branch. Next time we update unstable, please let us know if you still get this error and / or crashes.

1 Like

@Relyss Maybe that’ll help with the directed Hearthling thinking flag. I’m being optimistic, but it’d be nice. If I get that particular error again, I’ll make sure to post about it and I’ll tag you in the post so you see it ASAP.

1 Like

Thanks for getting on this so quick and updating the unstable, its running very smoothly now!

1 Like