[2.0.45] Proxy-container entities are not taking Damage from Asteroids

Bugs that are actually features.
eugenekay
Filter Inserter
Filter Inserter
Posts: 420
Joined: Tue May 15, 2018 2:14 am
Contact:

[2.0.45] Proxy-container entities are not taking Damage from Asteroids

Post by eugenekay »

What did you do?

Installed the Cargo Bay Inserters mod

What happened?
Cargo Bays are not taking Damage from Asteroids.
Screenshot 2025-04-17 002205.png
Screenshot 2025-04-17 002205.png (3.23 MiB) Viewed 283 times

What did you expect to happen instead? It might be obvious to you, but do it anyway!
Cargo Bays would still take damage from Asteroids. Or the damage would redirect to the Platform Hub.

Does it happen always, once, or sometimes?
With the mod "Cargo Bay Inserters" enabled. I have reviewed the code for this mod and there is nothing that suggests that this is intended behavior. The Mod does appear to attempt to handle "deathrattle" events, but since one is never triggered it is hard to Debug...... If this is somehow intentional or a Bug in the Mod, then I apologize for opening a spurious Bug Report.

Thank you for reading!
Attachments
PlatformDamage.zip
(902.25 KiB) Downloaded 12 times
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 173
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

Re: [2.0.45] Proxy-container entities are not taking Damage from Asteroids

Post by Quezler »

Hi, this issue is completely due to the mod and should have been send to that mod's author (me) instead of the forum, this should be moved to not a bug.

Now let me explain what is happening:

When an asteroid collides with a space platform tile the "heuristic entity search" goes through all the entities who's collision boxes encroach on that tile, the order of which seems completely unpredictable or at the very least undefined.

The proxy container gets a subtle `deconstructible = false` applied to it in the control stage, and if the order in which the asteroid tries to damage the entities comes across the proxy first it'll absorb all damage, it does not care about any sort of collision mask whatsoever.

The simple solution would be for me to decrease the collision box to not be around the edges of the cargo bay so the asteroid will only hit normal entities first, but that would also interfere with inserters, i'll have to modify the mod so the proxy can be damaged and revive itself the next tick so practically all damage -1 will end up hitting the cargo bay as it should.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3839
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.45] Proxy-container entities are not taking Damage from Asteroids

Post by boskid »

Proxy container rejects damage because it is marked as `destructible=false`. https://lua-api.factorio.com/latest/cla ... structible
I think the most reasonable solution here would be for this mod to restore the "destructible" flag and listen for on_entity_damaged events where all the damage would be forwarded away from the proxy container and applied to the cargo bay.
eugenekay
Filter Inserter
Filter Inserter
Posts: 420
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [2.0.45] Proxy-container entities are not taking Damage from Asteroids

Post by eugenekay »

Quezler wrote: Thu Apr 17, 2025 9:20 amThe proxy container gets a subtle `deconstructible = false` applied to it in the control stage, and if the order in which the asteroid tries to damage the entities comes across the proxy first it'll absorb all damage, it does not care about any sort of collision mask whatsoever.
A-ha! I did not spot the “deconstructible” / destructible flag in my read-through of the code. I did not try to reproduce the Issue with a raw proxy-container primitive purely for the Bug Report, since I did not fully understand what was going on to begin with.
Post Reply

Return to “Not a bug”