Engine Error related to building


#1

Built a road hearthlings didn’t finish it removed the road during removal got error message. Also custom building plan wouldn’t close and let me build any other buildings

Error message recieved
release-549 (x64)
std::logic_error: 'invalid reference in native get_id’
stack traceback:
[C]: ?
[C]: in function 'get_id’
radiant/modules/entities.lua:301: in function ‘get_world_grid_location’
…rth/services/server/build/scaffolding_builder_2d.lua:186: in function ‘_create_builders’
…rth/services/server/build/scaffolding_builder_2d.lua:171: in function ‘_on_project_changed’
…rth/services/server/build/scaffolding_builder_2d.lua:129: in function <…rth/services/server/build/scaffolding_builder_2d.lua:128>

A15

I5 3450
windows 7
Radeon 7970 2gb


Bug when removing one structure under another
#2

http://discourse.stonehearth.net/t/bug-when-removing-one-structure-under-another/21117
Seems like it’s the same issue.Didn’t think about unfinished buildings affecting this.


#3

Ah yes I did try to find a bug report similar to the problem i had must of overlooked this one. But it does seem to be the same or at least similar.


#4

Your topic is older than mine :wink:


#5

cough yes… I totally noticed that and everything… whistles nonchalantly Say look at that interesting thing over there…


#6

Summary:
The same engine error when trying to build one structure on top of another, then remove the lower structure.

Steps to reproduce:

  1. Build a foundation with height=1 from slabs
  2. Put a building from template on top of that foundation. Start constructing it. The building in now above ground level and doesn’t require a foundation pit dug up. However the building’s native foundation visually overlaps our foundation from slabs.
  3. Pause building construction before it is finished. Select the foundation we’ve made from slabs and order to [Remove] it.
  4. As soon as the last brick of this foundation is removed (leaving only our half-finished template building), the error shows up.

Expected Results:
Removed artificial foundation, lifted building.

Actual Results:
The procedure in general completes successfully. The building can be finished and functions properly. However when the artificial foundation is completely removed the engine shows this error:

release-549 (x64)std::logic_error: 'invalid reference in native get_id'stack traceback: [C]: ? [C]: in function 'get_id' radiant/modules/entities.lua:301: in function 'get_world_grid_location' ...rth/services/server/build/scaffolding_builder_2d.lua:186: in function '_create_builders' ...rth/services/server/build/scaffolding_builder_2d.lua:171: in function '_on_project_changed' ...rth/services/server/build/scaffolding_builder_2d.lua:129: in function <...rth/services/server/build/scaffolding_builder_2d.lua:128>

Notes:
none

Attachments:
none

Version Number and Mods in use:
0.15.0 rev. 549

System Information:
Win7 x64


#7

Love to see a screen shot of the before and after


#8

Merged, @MelOzone :slight_smile:


#9

@Relyss That was lightspeed o_O

Before. The farmhouse construction has not yet begun, foundation is completed (note that the foundation is actually two buildings since I found out it’s not big enough and expanded it later). Farmhouse template placed, starting removing foundation.

After. One part of the foundation is completely removed. As soon as the last block of it is removed, we see an error.


#10

Any chance you have a template that will result in this error? You said the foundation was 2 buildings… typically, adding on to an existing building results in the 2nd building ‘merging’ with the 1st and at that point it should all be one building…

Sounds like, and I’m no coder, but it sounds like when the title is getting confused with the build. Let me try to explain…

  1. You build a foundation, it is given a building #
  2. Start the building process and the hearthlings go to work
  3. Start to build the blueprint for your building
  4. You realize the foundation isn’t what you want
  5. You ‘BUILD OVER’ the original foundation with new foundation which is given a 2nd Building # for some strange reason but I assume because the 1st foundation was already built
  6. You continue with the blueprint, probably while game is paused(this might be an issue)
  7. You finish up your blueprint start the build process and unpause

Let me know how close I am…?

At this point, the game is trying to build Building #1 Which includes parts the actual structure and not just foundation. Changing the foundation results in trying to build building #1 on building#2’s foundation. I think this is the problem as the game ‘can’t’ build building #1 on a foundation for building #2.

Not 100% this is the issue but it is what it sounds like through the assertion debug


#11

Don’t think the template is the culprit. It’s quite a simple one, nothing fancy. And of course it was created without that foundation trick first. I use this trick to prevent ground digging, so I can remove the building later without trace if I have a change of heart or town rebuilding in mind.
The foundation (both parts) is completed before I start placing the template, otherwise it won’t let me place it (template requires a flat solid surface to build upon). And usually I build temporary foundations in one clear cut. I was somewhat lazy to carefully count the size at this time.

Doing some things during the pause can have something to do with it, as I’ve noticed the error is not consistent. Sometimes it’s there, sometimes it isn’t.