[0.13.9] [Pending] "Units" sometimes disappearing after being placed

Things that we don't consider worth fixing at this moment.
Post Reply
kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

[0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by kyranzor »

So in my mod Robot Army, you can place what are basically re-skinned spitters to fight for the player.

I found seen on numerous occasions, and have received reports from my mod users, that sometimes (not always!) if you place down some 'units' they will start randomly disappearing. They just vanish in front of your eyes.

I have not seen this happen with units that are spawned by the 'create entity' function which my droid assemblers use, I have only seen this happen with units placed by hand, but that might not be the case (it's just more obvious when you place them, and bam they start disappearing one by one).

I guess just get my mod and turn on cheat mode and unlock all recipes/techs and spam units down until you see it, to reproduce this issue.

Loewchen
Global Moderator
Global Moderator
Posts: 8413
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.13.9] "Units" sometimes disappearing after being placed

Post by Loewchen »

I think there is a pathfinder mechanic that removes units that have not found a viable path for some time, so that stuck units don't take up CPU time.
You should be able to observe this by spawning them on an island.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13263
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.13.9] "Units" sometimes disappearing after being placed

Post by Rseding91 »

Loewchen wrote:I think there is a pathfinder mechanic that removes units that have not found a viable path for some time, so that stuck units don't take up CPU time.
You should be able to observe this by spawning them on an island.
Indeed. That's by-design behavior. Units where never created with modding in mind so you always have these side effects.
If you want to get ahold of me I'm almost always on Discord.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [0.13.9] "Units" sometimes disappearing after being placed

Post by kyranzor »

These units were deployed it in the open with clear access to their intended move/path targets or even while in combat (not actively trying to go anywhere difficult)

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5153
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.13.9] "Units" sometimes disappearing after being placed

Post by Klonan »

Moved back to bug reports as the issue described isn't intended behaviour,

Could you provide some save game where the issue presents itself?

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by kyranzor »

I will upload a copy of my mod, plus a save game (a sandbox scenario) where just placing the units by hand (while I watched them) caused them to randomly disappear in the middle of an open grassy area and while in combat. Will be another ~6 hours before I get a chance to do this.

Edit: I've just spent almost an hour with the same conditions trying to reproduce it so i can pack it up and upload it for you guys, but I can't reproduce it. It's funny how when i'm not looking to reproduce it, it happens (and to other people too), but when you want it to happen it doesn't. This means it would be hard for you guys to reproduce it given only a save and some mods too. I don't want to waste your time, but maybe there's some logic in code that might explain what myself and others have noticed.

Edit 2: In any case this is how you might go about testing it in the quickest way possible:
- get latest version of Robot Army mod from https://mods.factorio.com/mods/kyranzor/robotarmy
- start sandbox map, get chest, enable all research and enable cheat mode
- look in the military tab and get lots of whatever droid unit type you want (yellow boxes around the ones that you can place by hand)
- spam these units in a way that you can keep track of them for at least a few seconds after they spawn and start moving/doing something, because this is when I usually see them disappear, is very soon after they are placed. They are unlikely to disappear, from my experience, if they haven't already within a few seconds.

There is something else happening which makes it hard to reproduce, but the symptom is units disappearing shortly after creating them. My best guess is the logic conditions involving despawning/removing a "unit" is hitting a corner case or some strange combination of conditions.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5153
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by Klonan »

I can't reproduce it myself, but i think that it is due to the pathfinder being too busy.

If the pathfinder takes too long to find a path, then the unit is destroyed to preserve performance, and unfortunately this is a needed optimization

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by kyranzor »

Is it likely that the pathfinder can be in such a state with a freshly generated map and with very few units placed? What is the approximate time before this destroy action is triggered? I see it happen in only a second or two, is that expected?

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by Oxyd »

Klonan wrote:I can't reproduce it myself, but i think that it is due to the pathfinder being too busy.

If the pathfinder takes too long to find a path, then the unit is destroyed to preserve performance, and unfortunately this is a needed optimization
That's not true. (Although maybe it should become true.)

A unit is deleted if its behaviour fails multiple times in a row. So really this all depends on what command those units are getting and the overall circumstances of the map that are causing it to fail.

In other words, without a save, the mod, and clear steps to reproduce it, there's nothing we can do.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by kyranzor »

It's a rare but annoying case, it's very hard to reproduce. I'll get my 'team' on alert to immediately save when they see it happen, and package that + most recent save prior to the event happening + mods and get them to you guys.

PurpleYouko
Burner Inserter
Burner Inserter
Posts: 13
Joined: Thu Sep 08, 2016 4:45 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by PurpleYouko »

I've found a pretty reliable way to reproduce this issue.

I have a single enemy biter spawner with a wall built around it at some distance then a bunch of laser towers set way back such that they hit the aliens just before they reach the inside of the wall.

I have a droid guard station just inside the lasers. The aim is to farm alien artifacts using the guard droids along with the alien artifact mod which makes them drop on death.
What actually happens is that the guard droids just mill around quite happily until an alien comes in range then they move towards it, get a few shots in and then gradually start disappearing.
I thought it might be pathing issues so I made a nice big hole in the wall on one side and backed it up with lots of towers to make absolutely sure the aliens don't escape.
They also have an easy path to any other part of the map too.

Even though the droids have a clear path and sometimes actually go inside the alien pen they still disappear all the time.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by kyranzor »

I'm sorry PurpleYouko for your bad experience with this issue...

I have had many people complaining about it on my mod's thread recently as well, it's a major frustration especially if the units are terminators (expensive).

We have certainly narrowed it down to a pathing/performance technique the devs are using to make sure biters (the normal case for unit pathfinding requests and actions) don't get stuck and cause UPS drops on people's Vanilla games.

The timeout for removing stuck entities is very fast, and perhaps doubling the time would result in almost never seeing it happen, but then their original intention was to simply remove sources of slow-down and that is still an issue, so they will probably not change it.

Personally, i'd like to see an increase in the timeout period (even if just trialed for a while in the experimental branches) and see what my mod user's say.

PurpleYouko
Burner Inserter
Burner Inserter
Posts: 13
Joined: Thu Sep 08, 2016 4:45 pm
Contact:

Re: [0.13.9] [Pending] "Units" sometimes disappearing after being placed

Post by PurpleYouko »

Thanks for the quick response Kyranzor.
I wasn't complaining about the issue. I just found this thread and heard people saying that it was hard to reproduce the issue so I thought I would chime in with a reliable way to make it happen.

My answer to the whole thing is just to visit the pen every now and then and manually drop a single droid. it will pick up the hundreds of artifacts and disappear a few minutes later. It's not a really big deal And other than this the mod works great.

The interesting thing is that if i put the guard station just a little further away then the droids don't disappear at all. it's only after they actually target something.

Thanks for the great mod anyway. It certainly beats having to manually run around in my alien pen and risk my personal lasers destroying the biter spawners. ;)

Post Reply

Return to “Won't fix.”