Page MenuHomeWildfire Games

Prevent Upgrading units from moving
Needs ReviewPublic

Authored by Stan on May 31 2020, 11:16 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Currently units that upgrade are free to roam everywhere, which is kind of weird, and might allow some nice exploits like moving all over the map with a packing CC, and put it next the other players.

This could also be made optional

Test Plan

Install terra magna and play around with the Xiongnu Units

Unit TestsFailed

TimeTest
0 msJenkins > TestComponentScripts::test_scripts
Test failed: L"Running script simulation/components/tests/test_UnitAI.js" Assertion failed: scriptInterface.LoadScript(pathname, content)
0 msJenkins > cxxtest-debug.xml::[failed-to-read]
Failed to read test report file /Users/wfg/Jenkins/workspace/macos-differential/cxxtest-debug.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. at org.dom4j.io.SAXReader.read(SAXReader.java:462)
0 msJenkins > TestAllocators::test_da
0 msJenkins > TestAtlasObjectXML::test_parse_attributes1
0 msJenkins > TestAtlasObjectXML::test_parse_attributes2
View Full Test Results (2 Failed · 339 Passed)

Event Timeline

Stan created this revision.May 31 2020, 11:16 AM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2269/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/871/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1738/display/redirect

Nescio added a subscriber: Nescio.May 31 2020, 11:37 AM

The idea is nice, the question is whether it's desirable and consistent. If they are not allowed to move, should they be allowed to attack, build, gather, heal, train, etc.? I believe structures (e.g. towers) can do all that while upgrading; should that be changed then too? Treating structures and units differently is probably not a good idea.

Stan added a comment.May 31 2020, 11:39 AM

The order attack check might not be enough indeed. but currently they can't guard, patrol, walk, walk as formation; garrison

wraitii added a subscriber: wraitii.Jun 1 2020, 9:19 AM

This plays into two concepts:

  • Controllability (see D1960)
  • actually being able to move.

With regards to the former, we should wait for D1960.
With regards to the latter, I think the key distinction is whether the 'immobility' is something 'forced' or not.
Packing units are still supposed to accept move orders, so their immobility is not something that inherently prevents move orders. Turrets, as it stands, are strictly immobile and should refuse move orders.

If mods want units to not move on upgrading, it seems to me they would want turret-like behaviour (they wouldn't want the upgrade to auto-cancel on move order). Thus, I would say that this can go in the "AbleToMove" function directly (of course that was reverted, but I'll commit it again soon).
I do think this needs a template argument, because some entities might want to freeze on upgrade and others not.