Factories canReclaim = false - #8159
Conversation
|
The factory doesn't do the reclaiming, but the builders it produces will. So you can just exclude factories in the defensive stance code if you need to. |
|
This is a bit of bad engine design where "can the unit actually perform this task" is lumped together with "can the unit receive an order about this task" despite them being at least technically independent. |
This pr is the right approach. The factory cannot in fact reclaim anything. Describe reality. |
|
Nah, prescribe reality |
Here's a bunch more stuff they can do: |
Enable in ModOptions Experimental tab "New Defend Firestate" to use Is greatly aided by merging: #8159 as well to prevent falsely considering factories as threats. Replace the mostly unused Return Fire with a new and more useful Defensive firestate. A defensive unit will shoot targets that are a threat to itself on a 1v1 basis. What's a threat? If the target run up and shoot you before you can kill it, it's a threat. This is done with prebaked math related to DPS, Distance, movement speed, and health. What's this useful for? 1. I don't want to shoot unarmed units. Useful during raids to take down defenders. 2. I don't want to waste shots on trash until I really, really have to. Useful for starlights, banishers, etc. Random notes. - units with >2000 range, Starburst Missiles, or are aircraft will shoot anything at max range regardless of threat. Because they can't hit moving things anyway or it's not relevant. - constructors that can reclaim are considered threats same as if they had a weapon - cloaked defensive units will not shoot until they're no longer cloaked. - kamikaze targets will always be shot - units with multiple weapons are biased to shoot things at farther distances just to be safe (more precision would be less performant in a stinky way) - to prevent taking hits from radar things over and over with no reaction, defensive units that take damage will aggro against radar dots regardless of source. Logic being, if there are things closeby they'll prefer them anyway. If there are only radar dots to shoot, they'll shoot. This resets upon changing firestate or after being healed. - under the hood, return fire is unchanged so ruins unaffected. Defensive is a virtual firestate that uses fire at will with AllowWeaponTarget filtering for its behavior. I'm most active on discord, you can participate in the brunt of discussion here: https://discord.com/channels/549281623154229250/1520166826435280998/1520166826435280998 AI disclosure: Used claude 4.8, gpt 5.5, and cursor's "auto mode" to conduct research, suggest and write some of the changes, and change the unitdefs. The shape of the functions, flow, and design and decisions for changes are strictly mine.
Since they're builders and canReclaim is undefined, it seems the engine considers them as able to reclaim things. This is impossible for them to actually do as factories. This messes up the WIP FireState Defend I'm working on. #8139
Merge this with it.