Page MenuHomeWildfire Games

[gameplay] introduce axeman templates
Needs ReviewPublic

Authored by Nescio on Mar 4 2018, 3:48 PM.

Details

Reviewers
s0600204
Summary

This patch introduces (six) axeman templates, to differentiate axemen from swordsmen (cf. macemen). Axemen have a higher attack damage but a lower attack rate and one less hack armour level compared to swordsmen. Their damage is 3:1 hack: crush. Effectively this makes them somewhat better vs siege and structures but slightly worse against soldiers.
The Kushite Apedemak champion and the Persian Hyrcanian cavalry are redefined from swordsman to axeman (both actors are using axes, not swords); templates, class, icon, and actors are renamed.
More axeman units are not inconceivable in the future, therefore it would make sense to have templates, instead of giving individual units different stats (cf. maceman).

[EDIT]: compared to swordsmen, axemen have:

  • −1 hack armour level
  • less hack damage per second (infantry 6 instead of 5.5/0.75=7.33; cavalry 6.9 instead of 6.5/0.75=8.67)
  • additional crush damage, a third of hack damage per second (i.e. infantry 2, cavalry 2.3)

Effectively this makes axemen a bit more powerful against siege engines and structures, but a bit less effective against soldiers, especially swordsmen.

Test Plan

Check if everything works as intended and nothing is overlooked.

Event Timeline

Nescio created this revision.Mar 4 2018, 3:48 PM
Owners added a subscriber: Restricted Owners Package.Mar 4 2018, 3:48 PM
Vulcan added a subscriber: Vulcan.Mar 4 2018, 4:33 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|  97|  97| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
|  98|  98| };
|  99|  99| 
| 100|    |-Identity.prototype.Deserialize = function ()
|    | 100|+Identity.prototype.Deserialize = function()
| 101| 101| {
| 102| 102| 	this.Init();
| 103| 103| };

Link to build: https://jenkins.wildfiregames.com/job/differential/152/display/redirect

Angen added a subscriber: Angen.Mar 9 2018, 12:21 PM

I am not sure so only pointing this.
Should not be run speed at least a bit higher than walkspeed?

Nescio added a comment.Mar 9 2018, 1:34 PM

I am not sure so only pointing this.
Should not be run speed at least a bit higher than walkspeed?

Actually it already is. template_unit.xml has a walk speed of 9.0 and a run speed of 15.0, which are subsequently multiplied in child templates.

Angen added a comment.Mar 9 2018, 9:01 PM

I suggest to rename actors for persians from swordsman to axeman as they have not swords more

s0600204 requested changes to this revision.Mar 19 2019, 1:43 AM
s0600204 added subscribers: Stan, s0600204.

Well, I'm personally in favour of the change. I know that the Aristeia mod has an axeman unit, so this will definitely be of benefit to at least one of our community mods!

Attempting to apply your patch results in several rejected hunks - not your fault, but due to the passage of time and the contents of files changing in that time.

As Angen points out, the applicable Actor files should probably be renamed as well. Now whether you feel comfortable doing that, or you wish to leave it to someone else (@Stan?), is up to you. As such, I'm going to bounce this back to you "for updates".

This revision now requires changes to proceed.Mar 19 2019, 1:43 AM
Stan added a comment.Mar 19 2019, 9:44 AM

I've got only one concern with this patch. The AI. Last time I renamed camel cavalry to camelry I had to revert it because mimo told me to do so. Does the AI continue to use them after renaming ?

As for the AI, sword, spear, maceman, etc. are not hard-coded, neither as classes nor as templates, so the AI should be able to continue handling them after renaming.
On the other hand, Cavalry and Infantry are hard-coded classes (attackPlan.js, baseManager.js, headquarters.js, startingStrategy.js, worker.js). Personally I agree camels, chariots, and elephants ought to be separated from cavalry. I guess there are three equivalent options to make AI handle those:

  • introduce a Mounted (non-visible) class and replace the hard-coded Cavalry with it
  • insert || statements where the AI code asks for Cavalry
  • duplicate the Cavalry-related code for Camel and Chariot

Anyway, I'll update this patch to introduce axemen templates.
Similarily, perhaps separate crossbowman templates ought to be introduced as well; 0 A.D. currently has one (athen_champion_ranged_gastraphetes.xml, which probably ought to be renamed to mace_infantry_crossbowman_champion.xml), but the Han in Terra Magna and Delenda Est have b/a/e cavalry and infantry crossbowmen as part of their basic unit roster, therefore it would make sense to include generic templates in 0 A.D.

Nescio updated this revision to Diff 7594.Mar 19 2019, 12:00 PM
Nescio edited the summary of this revision. (Show Details)

Updated.

Nescio edited the summary of this revision. (Show Details)Mar 19 2019, 12:03 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|  97|  97| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
|  98|  98| };
|  99|  99| 
| 100|    |-Identity.prototype.Deserialize = function ()
|    | 100|+Identity.prototype.Deserialize = function()
| 101| 101| {
| 102| 102| 	this.Init();
| 103| 103| };
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1120/display/redirect

s0600204 requested changes to this revision.Mar 19 2019, 7:29 PM

Furthermore, this patch also corrects infantry generic names for consistency (e.g. “Infantry Swordsman” instead of “Swordsman”; cf. “Cavalry Swordsman”).

In a different patch, please.

The following maps will also need to be updated as they specify the old template filenames:

  • skirmishes/Egypt (3v3).xml
  • scenarios/Siwa Oasis.xml
  • scenarios/Cinema_Demo.xml
  • scenarios/Serengeti.xml
  • scenarios/Sandbox - Kushites.xml
  • scenarios/Sandbox - Persians.xml
  • random/wild_lake.js
  • random/jebel_barkal.js

In D1355#73264, @Stan wrote:

I've got only one concern with this patch. The AI. Last time I renamed camel cavalry to camelry I had to revert it because mimo told me to do so. Does the AI continue to use them after renaming ?

In D1355#73265, @Nescio wrote:

As for the AI, sword, spear, maceman, etc. are not hard-coded, neither as classes nor as templates, so the AI should be able to continue handling them after renaming.

The small alterations to the attack and defence strengths might alter the possibility of the AI using the units, but Nescio is correct - the units still have the relevant classes such that the AI is able to continue using them.

Personally I agree camels, chariots, and elephants ought to be separated from cavalry. I guess there are three equivalent options to make AI handle those:

  • introduce a Mounted (non-visible) class and replace the hard-coded Cavalry with it
  • insert || statements where the AI code asks for Cavalry
  • duplicate the Cavalry-related code for Camel and Chariot

Or a fourth, much harder, option: rewrite parts of the AI so it understands the distinction.

Similarily, perhaps separate crossbowman templates ought to be introduced as well

Something for another revision, or even a stand-alone mod, perhaps.

binaries/data/mods/public/simulation/templates/units/kush_champion_infantry_apedemak.xml
14

What happened to these attack bonuses?

This revision now requires changes to proceed.Mar 19 2019, 7:29 PM
Nescio updated this revision to Diff 7597.Mar 19 2019, 7:43 PM
Nescio edited the summary of this revision. (Show Details)

Updated, now with map files (I predict Vulcan will fail because of that).

Owners added a subscriber: Restricted Owners Package.Mar 19 2019, 7:43 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/1122/display/redirect

Nescio added inline comments.Mar 19 2019, 7:48 PM
binaries/data/mods/public/simulation/templates/units/kush_champion_infantry_apedemak.xml
14

Removed. Kush currently has two infantry swordsman champions and these bonus attacks were introduced to differentiate the Apeddemak from the Amun swordsman. Because this patch introduces separate axeman templates with an attack different from the swordsman, these bonus attacks are no longer necessary.

s0600204 requested changes to this revision.Sat, May 9, 1:53 AM

My apologies: I completely forgot to continue reviewing this, and in the meantime things have changed.

In other words, this no longer cleanly applies. Could I ask you to rebase/update this please?

This revision now requires changes to proceed.Sat, May 9, 1:53 AM
Nescio updated this revision to Diff 11858.Wed, May 13, 10:58 PM
Nescio retitled this revision from Introduces axeman templates to [gameplay] introduce axeman templates.
Nescio edited the summary of this revision. (Show Details)
Nescio removed a subscriber: Restricted Owners Package.

Rebased.
Art actor and icon renames are included in D2688.

Owners added a subscriber: Restricted Owners Package.Wed, May 13, 10:58 PM

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

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

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

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

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

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

(As usual, maps with spaces in their file names cause problems for Vulcan; see D1042.)

Bonus: with this patch the template_unit_champion_infantry_axeman.xml template can be removed from the aristeia and millenniumad mods.

Nescio updated this revision to Diff 12082.Mon, Jun 1, 11:12 AM

rebased

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

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

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

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