Recursive AI error

So, I had a game running smoothly for several days. I then started adding in some crates to see how it would handle it. Somehow I developed a bug where some code is recursively calling itself over and over and then terminating.

About the only thing wierd that happened was being unable to place a crate or two because they were in a hearthlings backpack a short time previously.

I do have some random mods installed. Gonna try and start a new game and see if I can get a similar bug to occur.

Here is an example from my stonehearth.log. Also attached the whole log below.

2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code | -- Script Error (lua) Begin ------------------------------- 
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |    stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_frame.luac:672: stonehearth/components/ai/execution_unit_v2.luac:316: bad argument #2 to 'format' (string expected, got userdata)
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |    stack traceback:
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:656: in function <stonehearth/components/ai/execution_frame.luac:649>
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        [C]: in function 'error'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:672: in function '_exit_protected_call'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:667: in function '_protected_call'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:439: in function '_run_from_started'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:101: in function '_run'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:338: in function <stonehearth/components/ai/execution_frame.luac:329>
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        [C]: in function 'xpcall'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:658: in function '_protected_call'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/execution_frame.luac:340: in function 'run'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/components/ai/ai_component.luac:128: in function '_thread_main'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/services/server/threads/thread.luac:90: in function <stonehearth/services/server/threads/thread.luac:89>
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        [C]: in function 'xpcall'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        stonehearth/services/server/threads/thread.luac:89: in function 'f'
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code |        radiant/lib/env.luac:8: in function <radiant/lib/env.luac:8>
2015-Jul-15 01:09:54.651157 | server |  0 |                         lua.code | -- Lua Error End   ------------------------------- 

stonehearth.log (397.1 KB)

1 Like

Thanks! It looks like some AI is barfing on a string deep in an AI tree somewhere. Any info you can provide on getting it to happen again would be really useful!

1 Like

I suppose I could upload a save with the mods I had (obviously won’t load without them). Haven’t had any luck in getting the AI to barf on a new save yet, but the original save is pretty reliable in erroring out fast.

I uploaded it to dropbox.

2 Likes