Capture The Relic gamemode.
Patch By: Sandarac
Differential Revision: https://code.wildfiregames.com/D152
Apart from probably invalidating tons of assumptions, why does this thing even need DamageReceiver and Health? (The latter might be due to being undeletable, but maybe that shouldn't be in Health.)
Cost also seems pointless.
Like? (Review was here https://code.wildfiregames.com/D152#8930 and afterwards some settings were discussed in irc and changed too)
Due to our favorite file from hell.
Implementing some dummy component could be done, but agreeing with Sandarac that this should be done outside of this proposal (lesson learnt from polar sea, no?)
The current filepath seems wrong, because something inheriting template_unit should start with template_unit, not other/somethingelse.
The new templates could also have casual health (to allow reuse) and implement an invincibility special filter used by the trigger script (which would also be used for the treasure seeker woman on survival of the fittest) as was intended by D230.
Like those in patches like the one that causes that missing Health breakage. Which sounds a lot like a broken attempt at fixing that one bug with fleeing units not being damaged... (r14517 that is)
So I'd be for fixing that broken code (or reevaluating whether we really want running speed to depend on health (and not just see health as an abstraction...)) code by not assuming that that is present there, and then dropping that from the template.
I'm against dummy components, especially if those we have can't deal with unrelated ones not being present (as opposed to healing not making sense when the healed thing has no health).
No issue with the path, but I'm not sure if putting special templates only useful for a single game mode next to actual game templates makes sense, or if we should just keep them in another folder to better group them.
rP14517 (mind the P, which should also cause insertion of a reference to this document in that commit) doesn't look that bad to me. An early return if healt isn't defined gets rid of that specific stack. Nuking health is also good because it means that the health bar won't be shown anymore!
Still expecting the unknown when disabling components. Bit more testing of random functions for example reveals that one can't capture the thing anymore if cost is disabled (No cost ref found in UnitAI, nor Attack, nor Capturable)
Are you sure the Capture thing isn't caused by removing Health? IIRC there is some code that reduces the capture regen based on health.
Not having certain components should be supported.
Slightly unrelated but possibly supporting different win times based on how the victory is achieved might be nice at some point in the future (that is possibly open a ticket about it if that is considered useful).
It was caused by removing health, I tested incorrectly again (missing ctrl+s?), so disabling that next time I touch the template (likely when adding the civ specific template to a new special subdirectory).
True, the endgame manager should store a different victory time per victory condition once we have #4014. And forum people ordered different defaults. Those should be numbers not dropdowns in the first place (also ticket somewhere).
This line in UnitAI makes units not pickup ents without DamageReceiver in the range queries, thus not auto-capturing the thing, even if the surrounding code is fixed. Sounds like a performance gain we might not want to lose.
this.losRangeQuery = cmpRangeManager.CreateActiveQuery(this.entity, range.min, range.max, players, IID_DamageReceiver, cmpRangeManager.GetEntityFlagMask("normal"));
Also slightly offtopic, but we must teach UnitAI and BuildingAI to ignore invincible units.
Something like this. Could also just keep the things template_unit entities are assumed to have.
Patch incomplete, something off with unitAI and rangemanager, relic sometimes picked up in queries, other times not.
Probably still many places in the code to change.
Which just shows that the attack code for capturing is broken. It should look for DamageReceivers if we want to damage them and Capturable if we want to capture. There is no performance gain here as there as we could just return the lowest entity id owned by some player, that would be even faster (but also broken).
Might be as simple as removing them from a few range queries by tweaking some flags.
Well that is using something for slightly unsupported purposes (but as I have both recommended doing that, and done that myself) we probably should fix that someday.
Well, that can be either solved by having players micro, or just wasting some time and attack strength if they don't.