Page MenuHomeWildfire Games

[gameplay] introduce crossbowman templates
Needs ReviewPublic

Authored by Nescio on Jul 17 2020, 5:48 PM.

Details

Reviewers
Freagarach
Group Reviewers
Balancing
Summary

This patch is similar to several earlier patches:

  • D1036/rP20682 separate champion maceman template.
  • D1354 introduce maceman templates.
  • D1355/rP23780 introduce axeman templates.
  • D2595 separates elephant archer from cavalry templates.

This patch introduces crossbowman templates. Currently there is only in game, mace_champion_infantry_crossbowman.xml, but future additions are not inconceivable, and having the templates ready also removes the need to define them in individual mods (e.g. Han China).

As for the stats:

  • The <Attack> stats are mostly taken from the existing crossbowman.
    • The <MaxRange> is 60, nicely in between the slinger's (48) and archer's (72+).
    • Because of its high <RepeatTime>, the <Pierce> damage is raised significantly, to keep the damage per second equal to the archer (6.7).
    • Champions have double the damage of citizens, heroes double that of champions. This is also the case for other soldier types.
    • Because of their higher <Projectile/Speed>, lower <Gravity> and <MaxRange>, and higher <Pierce> damage per shot, they're more precise than archers, and quite different.
  • Citizens cost 30 wood + 20 metal, to differentiate them from archers, and for realism (crossbow bolts were made of metal).
  • <WalkSpeed> is the same as support units and infantry heroes (i.e. inherited from template_unit.xml).

Because the mace crossbowman is neither trainable nor used in any maps, this patch does not affect gameplay balance.

Test Plan

Apply the patch, open Atlas, select units/mace_champion_infantry_crossbowman.xml and verify everything still works.

Event Timeline

Nescio created this revision.Jul 17 2020, 5:48 PM
Owners added a subscriber: Restricted Owners Package.Jul 17 2020, 5:48 PM

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

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

borg- added a subscriber: borg-.EditedJul 17 2020, 5:59 PM

I think of them only as champion units. Make historical sense to have a citizen crossbowman?

historically I thought they had a range greater than a bow and arrow, am I wrong?

Good unit for a quite strong units like elephant or hero, good to use with walls. Very vunerable in open fights or short distance. Seems historically correct.

Which civilizations would be available?

Han Chinese. The templates could also be useful for medieval mods.

I think of them only as champion units. Make historical sense to have a citizen crossbowman?

For Macedonians, no, for Chinese, yes.

historically I thought they had a range greater than a bow and arrow, am I wrong?

There are many types of bows with vast differences in range, which is also not only influenced by the bow, but also the projectile used, and the strength and skill or the archer. Making some generalizations is unavoidable, but saying bows were categorically outranged by crossbows is wrong.
Historically the main reason for using crossbows is that they're much easier to use (an unskilled man can learn how to properly shoot with a crossbow in a week or two, whereas archery requires years of practice, and is thus a weapon for the elite leisure class), and more compact, hence why they're far more often used in siege warfare. The same reasons lead to the adoption of firearms in the early modern period.

As I thought I was writing here:

I think this is a good pattern. If units/ becomes strictly about specializing civ info, it's harder to miss civ-specific units when balancing.

This needs a rebase. Also, why introduce templates which are not used? I mean a mod that needs to introduce the template probably also needs different values? And the templates can be added if units that are to use them are added, right?

Nescio updated this revision to Diff 13903.Sat, Nov 14, 11:23 AM
  • rebased

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

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

Nescio added a comment.EditedSat, Nov 14, 12:04 PM

Also, why introduce templates which are not used?

Whether something is used and whether it something is useful are not necessarily the same thing. For instance:

  • template_unit_fauna.xml is used and useful
  • template_unit_fauna_breed_passive.xml is unused and useless
  • template_unit_fauna_wild.xml is used but useless
  • gaia/fauna_donkey.xml is unused yet useful

Likewise, D1355/rP23780 separated axemen from spearmen and introduced the full set of templates (basic/champion/hero cavalry/infantry); not all are currently used, but future additions are not unlikely, and they're also useful for mods situated in other timeframes.

I mean a mod that needs to introduce the template probably also needs different values?

It depends. A mod that alters gameplay (e.g. Delenda Est) probably wants to include the template to define different values, yes; but they also redefine the archer and slinger templates. On the other hand, a mod that just adds more content (e.g. Millennium A.D.) ought not need to (re)define generic template_*.xml files.
Currently template_unit_*_crossbowman.xml are present in the Han China mod; including them here in the public mod makes that mod easier to maintain.

And the templates can be added if units that are to use them are added, right?

Yes, they could; however, the advantage of including the full set, rather than one by one, is that completeness allows a more systematic approach to gameplay balance etc.
To be clear, I'm not saying anything should be included: that's quite a slippery slope. But if a certain entity exists (and there is a crossbowman in the public mod), then having templates is justified.

Freagarach requested changes to this revision.Mon, Nov 16, 9:26 PM

Can you please make sure the values don't change?

This revision now requires changes to proceed.Mon, Nov 16, 9:26 PM

The values do change (see summary), for good reason.
The current champion crossbowman was introduced in rP20690 and renamed in rP22731. The damage value was just copied from the archer, but its reload time is six times as high, thus the unit is six times as ineffective, which does not make a lot of sense. This patch keeps the reload time and increases the damage, to ensure a damage per second about the same as the archer; the non-champion crossbowman templates are proportional to that.
Likewise, D1355/rP23780, which introduced separate axeman templates, also assigned axemen different values from swordsmen.

Sorry, it was late ^^'
But, then the balancing department needs to take a look :) (rP23890)

Nescio updated this revision to Diff 14049.Thu, Nov 19, 11:40 AM
  • rebased

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

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:153:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
../../../source/third_party/fmt/format.cpp:145:7: warning: '_POSIX_C_SOURCE' is not defined, evaluates to 0 [-Wundef]
#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (defined(__ANDROID__) && __ANDROID__)
      ^
../../../source/third_party/fmt/format.cpp:145:37: warning: '_XOPEN_SOURCE' is not defined, evaluates to 0 [-Wundef]
#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (defined(__ANDROID__) && __ANDROID__)
                                    ^
2 warnings generated.
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.
builderr-release-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libnetwork.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libtinygettext.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libtinygettext.a(tinygettext.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblobby.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libglooxwrapper.a(precompiled.o) has no symbols
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:153:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libscriptinterface.a(precompiled.o) has no symbols
../../../source/third_party/fmt/format.cpp:145:7: warning: '_POSIX_C_SOURCE' is not defined, evaluates to 0 [-Wundef]
#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (defined(__ANDROID__) && __ANDROID__)
      ^
../../../source/third_party/fmt/format.cpp:145:37: warning: '_XOPEN_SOURCE' is not defined, evaluates to 0 [-Wundef]
#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (defined(__ANDROID__) && __ANDROID__)
                                    ^
2 warnings generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblowlevel.a(dbghelp.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblowlevel.a(file_stats.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/liblowlevel.a(vfs_path.o) has no symbols
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
1 warning generated.

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

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

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

If you make sure the values don't change, I can commit the addition of the templates and you can make a separate diff for the values to be reviewed by the balancing department.

Thanks but no thanks: doing that kind of defeats the purpose of this patch, because then mods with crossbowmen (e.g. Han China) still need to include these templates to define some reasonable values. Having crossbowmen with only one-sixth the damage per second as archers doesn't make much sense.
Going the other way around is more reasonable (i.e. changing the values first, introducing separate templates afterwards), but then we encounter the same limitation, and it would be more work (maintaining two patches), hence why I did it all in a single patch.

Sure, lets wait then ^^

Freagarach retitled this revision from introduce crossbowman templates to [gameplay] introduce crossbowman templates.Thu, Nov 19, 6:19 PM
Nescio removed a reviewer: Restricted Owners Package.Thu, Nov 19, 6:29 PM
Nescio removed subscribers: Restricted Owners Package, bb, s0600204.

@badosu, @borg-, @ValihrAnt, any opinions on the proposed values?
For comparison:

 pierce damage / reload time = damage per second ; maximum range
champion archer (unchange):     6.5 / 0.5 = 13   ; 76
current champion crossbowman:   6.5 / 3   =  2.2 ; 76
proposed champion crossbowman: 40   / 3   = 13.3 ; 60

@badosu, @borg-, @ValihrAnt, any opinions on the proposed values?
For comparison:

pierce damage / reload time = damage per second ; maximum range
champion archer (unchange): 6.5 / 0.5 = 13 ; 76
current champion crossbowman: 6.5 / 3 = 2.2 ; 76
proposed champion crossbowman: 40 / 3 = 13.3 ; 60

I think having their dps be about the same as archers is fine for now. When they are in the game we will be able to see how their lower fire rate plays out and adjust accordingly from there.

(They _are_ in the game already.)

(They _are_ in the game already.)

What I meant is available to be trained by a civilization, so we can see how they actually behave in a real game.

That is exactly what I meant also :) But I understand my wording was wrong.

D2901/rP23890 added the champion crossbowman to the arsenal. Moreover, various crossbowman units are available in the Han China mod: https://github.com/0ADMods/han_china