Page MenuHomeWildfire Games

Resolve build and phase problems in Structure Tree
AbandonedPublic

Authored by s0600204 on Jun 15 2017, 11:33 PM.

Details

Summary

This revision solves two issues made apparent by @wowgetoffyourcellphone's Delenda Est mod.

  1. For some time now in vanilla-0ad, production queues in structures such as barracks have contained a list of all possible units trainable in that building, using the string {civ} as a placeholder for a civ's unique code. If a unit cannot be trained by the civ that owns the structure, then that entry in the list is ignored. Along with reducing duplication, this helps facilitate structure capturing.

    In Delenda Est, wowgetoffyourcellphone extended this to the build queues of units, permitting listing every constructable structure in the game in the parent templates of units. Unfortunately, the Structure Tree doesn't support this, and errors out.
  1. When loading the Han Chinese civ in the structree whilst running Delenda Est, the tree draws it... incorrectly. This is partly due to the fact that there are more than three phases in Delenda Est, and that the unravel_phases function didn't have any way to properly deal with the case where both a given tech's phase and that tech's prerequisite tech's phase did not exist in the list that this function builds.
Test Plan
  • With the Delenda Est mod is enabled, run 0ad and open the structree. If there are no errors starting "CCacheLoader failed to find [...]" and the tree draws correctly, great!
    • Note: if you recieve a warning about a "Iphicratean Reforms" tech not researchable, then ignore it. This is intended behaviour.
  • Now select the Han Chinese Mod. The tree should draw correctly, with the phases in the correct order, and no warning about "Town Phase not being researchable in any building".

Event Timeline

s0600204 created this revision.Jun 15 2017, 11:33 PM
Vulcan added a subscriber: Vulcan.Jun 16 2017, 12:21 AM

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/1562/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

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

This may need fixed since the last changes moved a lot of GUI files around.

bb added a subscriber: bb.Oct 9 2017, 2:25 PM

structree files have been moved so we need a rebase

patch looks ok, still gotta test it though

binaries/data/mods/public/gui/structree/load.js
213

Notice we now have all cases:
my in, req out => add req before my
req in, my out => add my after req
both in rq>my => swap them
both in my>req => we are good
both in my==req => we have a serious bug :P
both out my<req add them in the end like req, my, with this if (!phaseList.length) becomes unneeded

s0600204 abandoned this revision.Oct 9 2017, 4:36 PM

Closing due to the fact that these fixes were contained within the changeset of D295, and thus were committed when that was.