Page MenuHomeWildfire Games

minor phase requirements clean up
ClosedPublic

Authored by Nescio on Sep 8 2017, 10:49 AM.
Tags
None
Subscribers
Restricted Owners Package
Restricted Owners Package
Tokens
"Like" token, awarded by elexis."Like" token, awarded by Grugnas.

Details

Summary

Removed “town phase” in brit and gaul blacksmiths; this relict is both unnecessary (it's already defined in the generic blacksmith template) and potentially problematic (if the blacksmith would be changed to a different phase, brit and gaul blacksmiths would still be town phase); for comparison, none of the other civ blacksmiths has these lines of code.

Also added “town phase” in maur elephant archer, to prevent maur from training them in village phase if they somehow acquire (e.g. capture or start with) an elephant stables.

Update:
Also added a “town phase” requirement to the healer.
Added a “town phase” requirement to Carthaginian mercenaries.
Removed unnecessary “city phase” requirement from maur and sele champion war elephants and mace champion pikemen; no other champions had this.
maur_hero_chanakya is the only hero with a “city phase” requirement (unchanged); this is necessary, because it's not based on a hero template, but instead on the basic unit template.
Furthermore, removed “town phase” from gates and “city phase” from champion skirmisher cavalry.

Test Plan

What I am I supposed to write here? It works, effectively changes nothing, and there is no reason why it wouldn't work. It's just a minor code clearup.

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

Nescio created this revision.Sep 8 2017, 10:49 AM
Owners added a subscriber: Restricted Owners Package.Sep 8 2017, 10:49 AM
Grugnas awarded a token.EditedSep 8 2017, 11:08 AM
Grugnas added a subscriber: Grugnas.

nice catch, especially for the mauryan elephant archer template.

Stan added a subscriber: Stan.Sep 8 2017, 11:30 AM

Actually I think this is the remnant of an old feature where celt blacksmiths would be available in the first phase. The person who added those lines must just have changed that without looking to the parent template. Nice catch.

bb added a subscriber: bb.Sep 8 2017, 2:51 PM

In the test plan there should be what the reviewer must do to check that the patch is correct and complete, so for this thing something along the lines:

Check code doesn't effectively change anything
Check that no other blacksmith has such an entry
Check that all templates that need a <RequiredTechnology>phase_town</RequiredTechnology> have one

However do code does change something: the visible classes of the two changes blacksmiths got changed, and are now better since they are the same as all other blacksmith (see where this relic can lead too), so that change is correct!

But it would be nice too fix some similar cases i.o there are some templates with <RequiredTechnology>phase_city</RequiredTechnology> that doesn't need it. These are mainly champion and hero units having it and the parent of them already has the tech specification. So if you want you can grep on <RequiredTechnology>phase_city</RequiredTechnology> and fix the cases popping up in that search. (one could argue that these changes are different enough so they can go in a new revision, so i propose doing that. smaller patch => easier review => faster commit :P)

However there are some changed that should be included similar to the maur fix: cart mercenaries, (all civ) healers have the same problem. (I can't think of more units that could have the problem and also actually have it, but its always nice to catch some more if there are)

Nescio added a comment.Sep 8 2017, 3:06 PM

Well, I'm willing to have a look at healers, mercenaries, champions, heroes, etc. later, but I believe I read somewhere it's important to keep patches small and do separate changes in separate diffs. Is there anything I have to do before this one (D887) could get reviewed?

elexis awarded a token.Sep 8 2017, 3:20 PM
bb added a comment.Sep 8 2017, 3:37 PM

Keeping patches small is indeed wanted but patches should be complete as well. So I suggest to change everything related to the phase_town in this patch (so add the healers and mercs). And then phase_city things can come in a later patch. (also a patch changing 5lines is not considered big at all, its more like we should avoid patches of like >2k lines when possible)

Nescio added a comment.Sep 8 2017, 3:44 PM

Given that this is my first time using phabricator and I'm still learning, how do I add more files to this diff?

bb added a comment.Sep 8 2017, 3:48 PM

Well download and apply the patch by typing arc patch D887 in the command line (when having a clean svn), then make all the further changes in the files (just like you made these). Then do arc diff --preview and attach the patch (using the webgui) to this revision.

bb added a comment.Sep 8 2017, 3:57 PM

Also before i forget please add yourself in the programming.json so you name will come into the credits

elexis added a subscriber: elexis.Sep 8 2017, 3:59 PM

You don't have to use arcanist at all. You can just as well uploaded a new patch via the web interface (old patches are still visible in the History tab).
(https://trac.wildfiregames.com/wiki/SubmittingPatches)

Nescio added a comment.Sep 8 2017, 4:36 PM

OK, I figured out how to update a patch. However, I think it's better to postpone adding
<RequiredTechnology>phase_town</RequiredTechnology>
into the template_unit_support_healer.xml file, because another revision (D889) also changes this file, and I don't want to cause an edit conflict.

PS Where is that programming.json file located?

bb added a comment.Sep 8 2017, 4:42 PM

binaries/data/mods/public/gui/credits/programming.json (when i don't know file location i just use "files" to search for them, ctlr+F ftw)

Also that patch doesn't seem to conflict with these changes, they might change the same file but not the same lines, and even if something breaks it would be an easy rebase anyway.

Imarok added a subscriber: Imarok.Sep 8 2017, 4:45 PM
In D887#34629, @bb wrote:

Then do arc diff --preview and attach the patch (using the webgui) to this revision.

Just do arc diff --update D887. By that you avoid using guis ;)

Nescio updated this revision to Diff 3580.Sep 8 2017, 4:54 PM
Nescio edited the summary of this revision. (Show Details)

Added a “town phase” requirement to Carthaginian mercenaries.
Removed unnecessary “city phase” requirement from maur and sele champion war elephants and mace champion pikemen; no other champions had this.
maur_hero_chanakya is the only hero with a “city phase” requirement (unchanged); this is necessary, because it's not based on a hero template, but instead on the basic unit template.

Nescio updated this revision to Diff 3581.Sep 8 2017, 5:03 PM
Nescio retitled this revision from minor brit and gaul blacksmith clean up; town phase elephant archer to minor phase requirements clean up.
Nescio edited the summary of this revision. (Show Details)

And also added a “town phase” requirement to the healer.

Vulcan added a subscriber: Vulcan.Sep 8 2017, 5:42 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://jenkins-master:8080/job/phabricator/1994/ for more details.

Vulcan added a comment.Sep 8 2017, 6:30 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://jenkins-master:8080/job/phabricator/1995/ for more details.

bb added a comment.Sep 8 2017, 7:46 PM

programming.json entry?
what about these:
./binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_javelinist.xml
./binaries/data/mods/public/simulation/templates/template_structure_defense_wall_gate.xml

further patch looks ok and commitable
(do notice that its not always true that completeness goes over patchsize, there needs to be some balance, however this patch size is quite ok).

Nescio updated this revision to Diff 3593.Sep 8 2017, 8:26 PM
Nescio edited the summary of this revision. (Show Details)

Cavalry has “town phase” requirement by default, javelin cavalry “village phase”; this leaves just six exceptions (mace, ptol, rome), far more efficient.
Furthermore, removed “town phase” from gates and “city phase” from champion skirmisher cavalry.

Owners added a subscriber: Restricted Owners Package.Sep 8 2017, 8:26 PM
bb added a comment.Sep 8 2017, 8:39 PM

aww not too happy with the cav change, certainly it is slightly out of scope (and this way the patch is growing biggish), so i suggest splitting of the cav change and push that into another revision. (probably just go to the previous diff and just change the 3 files my comment was about, the old this is found with using the "history tab" just below)

Nescio added a comment.Sep 8 2017, 8:46 PM

Actually that cavalry change is the logical result of your earlier suggestions, but if you insist, I'll revert it :)

bb added a comment.Sep 8 2017, 8:48 PM

well not entirely, its indeed related, but it is changing an entry around, not just removing useless ones or add missing (which is what the others are doing)

Nescio added a comment.Sep 8 2017, 8:53 PM

Effectively nothing is changed, so I fail to see this is different. Anyway, how do I load the older version via the command line (arc patch)?

bb added a comment.Sep 8 2017, 8:57 PM

arc help patch brings help :

arc patch --diff 3581

(3581 is the diff id found under the history thing)

Nescio updated this revision to Diff 3594.Sep 8 2017, 9:07 PM
Nescio edited the summary of this revision. (Show Details)

Reverted more efficient and consistent cavalry phase requirement

is adding this really necessary?

Also added a “town phase” requirement to the healer.

they train from temples only which is built in town phase

Added a “town phase” requirement to Carthaginian mercenaries.

they train from embassies only which is built in town phase

bb added a comment.EditedSep 8 2017, 9:23 PM

it is since those buildings could be there set from atlas on the map, and a player shouldn't be able to train them until town phase

bb accepted this revision.Sep 8 2017, 10:28 PM

patch ok and complete now imo
All cases of redundant and missing phase requirements are added.
thx for the patch (you now have to just wait and enjoy seeing me committing it :P)

This revision is now accepted and ready to land.Sep 8 2017, 10:28 PM

Thank you for your help. It was an useful exercise to learn phabricator etc.

Now, do you also want me to create a new patch for that cavalry change, or do you prefer to leave it unchanged as it currently is?

bb added a comment.Sep 8 2017, 10:52 PM

glad you have learned a good bit. regarding the cav change, i did leave it as is now, since i plan on changing th functionality of the RequiredTechnology (so multiple techs and stuff) and we can probably better do that change after that (so we nuke merge conflicts and so)

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://jenkins-master:8080/job/phabricator/2000/ for more details.

This revision was automatically updated to reflect the committed changes.

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://jenkins-master:8080/job/phabricator/2001/ for more details.