NPC Lumber Disaster

So I set 2 NPCs to cut down trees for about 1 day and I come back to check on them


It said something of an infinite loop and turned debug on for me.

Did the deaths / infinite loop occur, the moment they became visible and re-entered the reality bubble?

Not Visible but upon bubble re-entry

Yeah this is a wider problem with NPC activities, that are gonna need some clever workarounds.

Depending on what direction you approach from, there is one turn where the NPC is in the reality bubble, but the thing they are working on, is not yet there.

They try to continue their activity, but the thing they want to work on dostn exist, I need to find a way for them to handle this gracefully and wait a few turns to resume activity, instead of exploding their heads.

This will be the same with other activities too.

1 Like

Can an NPC simply force the tile they want to operate on to load into the reality bubble when they go to act?

That could be a fairly generic function where anytime entity X is trying to do something outside the reality bubble, they force load that tile.

It’s not a great idea for them to load a tinymap that’s partially inside the reality bubble. Things get strange because the reality bubble map and the tinymap have separate caches.

I ve had the same problem with surgery on NPCs, the autodoc would leave the map before them, which would lead to them being butchered by the desapearance of the autodoc mid operation, and “solved it” by adding a check for being deep enough in the bubble. It’s in operation_do_turn I think, maybe you can use something line this, and have them just wait a few turn if they are too close to the edge.