Page MenuHomeWildfire Games

Don't spawn indefinite CC attackers on Danubius
ClosedPublic

Authored by elexis on Aug 9 2017, 11:04 PM.

Details

Summary

As reported at https://wildfiregames.com/forum/index.php?/topic/22688-new-players-rekt-by-gaia-on-danubius/ if one side of the river is completely wiped out and if there are more than 2 teams,
then gaia units are continuously spawned at that civic center, creating indefinite lag slowly but surely.

Test Plan

Start a 1v1 on that map and resign. Your side of the river should not spawn any more units while the other side continues.
You can set ccAttackerCount = 5 and ccAttackerInterval = 0.2 to make it easier to notice.
Notice ships already consider that fact, so merge the according code.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Aug 9 2017, 11:04 PM
Vulcan added a subscriber: Vulcan.Aug 9 2017, 11:50 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1832/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/maps/random/danubius_triggers.js
| 239| »   if·(remainder·!=·0)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/danubius_triggers.js
| 456| »   if·(remainder·!=·0)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/maps/random/danubius_triggers.js
| 645| »   »   let·siegeEngines·=·attackers.filter(ent·=>·Engine.QueryInterface(ent,·IID_Identity).HasClass("Siege"));
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/danubius_triggers.js
| 646| »   »   let·others·=·attackers.filter(ent·=>·siegeEngines.indexOf(ent)·==·-1);
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/maps/random/danubius_triggers.js
| 668| »   if·(data.from·!=·0)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/376/ for more details.

bb accepted this revision.Aug 10 2017, 11:48 AM
bb added a subscriber: bb.

code works as advertised, after pressing "suppress" on the segfault popping up after few seconds (is already present in current code)
Period can be added when committing

binaries/data/mods/public/maps/random/danubius_triggers.js
309 ↗(On Diff #3066)

notice isLeft iff !isRight so correct

544–545 ↗(On Diff #3066)

period

547 ↗(On Diff #3066)

riverside is one word so correct

This revision is now accepted and ready to land.Aug 10 2017, 11:48 AM

Thanks for the review!

There is still one catch: players can garrison their last female in a house. Then both ships and CCs will attack that riverside.
That can be solved either by using "Unit" instead of "Structure" in this patch or preferably by changing the patroling units to not ignore Structures after all units on that riverside disappeared.

elexis added inline comments.Aug 11 2017, 7:04 PM
binaries/data/mods/public/maps/random/danubius_triggers.js
557 ↗(On Diff #3066)

As discussed on irc, "Structure" becomes siegeTargetClass so that both ships and CCs stop spawning units if the only remaining buildings are ignored by units and siege engines.
Thus the enemy doesn't have to fight an unlimited amount of gaia attackers to wipe out the last garrisoned house.

Gaia units should eventually become smart enough to look for remianing houses too after the prefered targets are gone.

This revision was automatically updated to reflect the committed changes.