Error code when continuing game

Hi!

When I was about to continue my game, an error code popped up immediately after I entered the game. I have yet to find out what caused the error, but I’ll post it below for the developers to investigate :slight_smile:

release-687 (x64)
std::logic_error: 'invalid reference in native get_id’
stack traceback:
radiant/modules/common.lua:237: in function 'report_traceback’
radiant/modules/common.lua:248: in function <radiant/modules/common.lua:242>
[C]: in function 'get_id’
radiant/modules/entities.lua:307: in function ‘get_world_grid_location’
…nehearth/services/server/terrain/terrain_service.lua:310: in function ‘_get_entity_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:263: in function ‘_get_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:193: in function ‘_update_regions’
…nehearth/services/server/terrain/terrain_service.lua:181: in function ‘_on_tick’
…nehearth/services/server/terrain/terrain_service.lua:128: in function '_fn’
radiant/controllers/timer_controller.lua:95: in function 'fire’
radiant/controllers/time_tracker_controller.lua:82: in function <radiant/controllers/time_tracker_controller.lua:82>

radiant/controllers/time_tracker_controller.lua:82: in function ‘set_now’
…hearth/services/server/calendar/calendar_service.lua:379: in function ‘_on_event_loop’
…hearth/services/server/calendar/calendar_service.lua:37: in function 'instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function 'xpcall’
radiant/modules/common.lua:257: in function 'xpcall’
radiant/modules/events.lua:285: in function 'trigger’
radiant/modules/events.lua:398: in function '_trigger_gameloop’
radiant/modules/events.lua:446: in function '_update’
radiant/server.lua:61: in function <radiant/server.lua:58>

1 Like

The below error popped up after I logged in for the first time on a new day of game play. I had logged out the previous day after playing for several hours and doing lots of things. I do not know what all I did in the previous session of play to have caused this.

release-687 (x64)
std::logic_error: 'invalid reference in native get_id’
stack traceback:
radiant/modules/common.lua:237: in function 'report_traceback’
radiant/modules/common.lua:248: in function <radiant/modules/common.lua:242>
[C]: in function 'get_id’
radiant/modules/entities.lua:307: in function ‘get_world_grid_location’
…nehearth/services/server/terrain/terrain_service.lua:310: in function ‘_get_entity_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:263: in function ‘_get_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:193: in function ‘_update_regions’
…nehearth/services/server/terrain/terrain_service.lua:181: in function ‘_on_tick’
…nehearth/services/server/terrain/terrain_service.lua:128: in function '_fn’
radiant/controllers/timer_controller.lua:95: in function 'fire’
radiant/controllers/time_tracker_controller.lua:82: in function <radiant/controllers/time_tracker_controller.lua:82>

radiant/controllers/time_tracker_controller.lua:82: in function ‘set_now’
…hearth/services/server/calendar/calendar_service.lua:379: in function ‘_on_event_loop’
…hearth/services/server/calendar/calendar_service.lua:37: in function 'instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function 'xpcall’
radiant/modules/common.lua:257: in function 'xpcall’
radiant/modules/events.lua:285: in function 'trigger’
radiant/modules/events.lua:398: in function '_trigger_gameloop’
radiant/modules/events.lua:446: in function '_update’
radiant/server.lua:61: in function <radiant/server.lua:58>

1 Like

Welcome to the forum, @CollectorJim :slight_smile:

Could you upload the savefile where that error popped up?
To upload a savefile:

  1. Find the save folder for the saves you wish to upload. By default, they are located in C:\Program Files (x86)\Steam\steamapps\common\Stonehearth\saved_games (assuming a default Steam install).
  2. Zip the folder.
  3. Right click the folder (should be a long set of numbers).
  4. Left click on Send to in the menu that appears.
  5. Left click on `Compressed (Zipped) folder).
  6. (Optional) Rename the folder to something different than the default set of numbers.
  7. Upload the save.
  8. If the zip is less than 10 MB, you can upload it directly. Either use the upload button or drag and drop it into the compose window,
  9. If larger than 10 MB, upload it to a cloud storage site like Dropbox, Google Drive, File Dropper, etc. and post the sharing link here.

I have two save files. I am pretty sure I know which one generated the error, but I’m giving both files just in case. They are named pretty easily to figure out which file to look at first.should be this one.zip (8.4 MB)

but might be this one.zip (5.3 MB)

I didn’t get the error after loading the two saves, I wonder if it’s one of those that happen randomly once :confused:
Anyway, thanks for reporting and for the savefiles :slight_smile:

Posted the exact same issue like 3 days ago and still no replies for me :slight_frown:
Link to my thread

Btw, I haven’t experienced the error since, but I do know that no error happens without a reason so I think spending some time and resources to look over it would be wise :wink:

1 Like

Thanks for the link, @Sophie-chan (I’ve merged the reports); and welcome to the forum :slight_smile:

Still going over all the reports from last week (devs also have to rest :wink:)

So, does this error always appear after loading a certain savefile? If so, could you upload it?

If not, what was going in the game? Did you have any mining zones, buildings, or perhaps a goblin camp was being restored? Did you use any debug tools at some point?

1 Like

Paging @Albert , the master of the terrain_service. :slight_smile:

The error only happened once so far. I will let you know if it pops up again.

The thing is, though, that I am certain I had another savefile for a different town where I also got an error which seemed to have denied me any continued construction on a wall that I was upgrading. This was my most recent game before I left home for a few days, but when I came back the entire savefile was gone and the error in my other (current) savefile appeared immediately after I entered the game.

Other than that I still haven’t noticed anything specific to report.

I can see the symptom of the problem in the code (processing a destroyed entity), but it’s not clear to me how the game got into this state. If anyone has a save that shows this, I’d love to take a look.

I had a heavily damaged door at that point, which is still present as far as I can recall. Other than that none of my buildings were damaged. Though I think maybe I had demolished a wall or something earlier and then rebuilt it. Could that be the cause?

It would have to be a hearthling, pet, or monster. For example, it could be a monster raid that was leaving the world for some reason.

ahh, those I’ve had multiple times due to the location of my town and the walls protecting it :slight_smile:

Perhaps the issue lies in that the monster raids vanish because they register the walls as terrain or something, so they won’t even attempt to destroy them or the doors? I have seen a few attack them, but usually those are large monsters like mountain and that large green, four-legged monster

Hello,
yesterday I played the game and saved it. Today I want to play again. I clicked on “Continue” at the main menu. But the houses were away and everything other. I got an error:
release-687 (x64)
std::logic_error: 'invalid reference in native get_id’
stack traceback:
radiant/modules/common.lua:237: in function 'report_traceback’
radiant/modules/common.lua:248: in function <radiant/modules/common.lua:242>
[C]: in function 'get_id’
radiant/modules/entities.lua:307: in function ‘get_world_grid_location’
…nehearth/services/server/terrain/terrain_service.lua:310: in function ‘_get_entity_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:263: in function ‘_get_visible_region’
…nehearth/services/server/terrain/terrain_service.lua:193: in function ‘_update_regions’
…nehearth/services/server/terrain/terrain_service.lua:181: in function ‘_on_tick’
…nehearth/services/server/terrain/terrain_service.lua:128: in function '_fn’
radiant/controllers/timer_controller.lua:95: in function 'fire’
radiant/controllers/time_tracker_controller.lua:82: in function <radiant/controllers/time_tracker_controller.lua:82>

radiant/controllers/time_tracker_controller.lua:82: in function ‘set_now’
…hearth/services/server/calendar/calendar_service.lua:379: in function ‘_on_event_loop’
…hearth/services/server/calendar/calendar_service.lua:37: in function 'instance’
radiant/modules/events.lua:291: in function <radiant/modules/events.lua:285>
[C]: in function 'xpcall’
radiant/modules/common.lua:257: in function 'xpcall’
radiant/modules/events.lua:285: in function 'trigger’
radiant/modules/events.lua:398: in function '_trigger_gameloop’
radiant/modules/events.lua:446: in function '_update’
radiant/server.lua:61: in function <radiant/server.lua:58>
END
this is it. If you need a screenshot I will send you.

Thanks for help

Im an idiot. Everything is working

Welcome to the forum, @BenniApfel :slight_smile:

Good to know you got it working (why was it happening?)

I merged your report here anyway because the error you got is the same.