Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3196 closed enhancement (fixed)

[PATCH] Limit arrows on certain buildings

Reported by: sanderd17 Owned by: Itms
Priority: Should Have Milestone: Alpha 20
Component: UI & Simulation Keywords: patch
Cc: scythetwirler Patch:

Description (last modified by elexis)

Garrisoning units has different advantages currently:

  • It increases arrows shot in defensive buildings
  • Some buildings heal your units
  • It's possible to transport them in ships
  • It's good against the enemy trying to capture the building

For some of these effects, you need a big garrison capacity (f.e. big ships need to be able to transport a lot of units). However, if the fire rate enlarges linearly with the number of garrisoned units, the building becomes overpowered. So some buildings would profit from limiting the arrow count to a certain number:

  • The roman army camp should be limited to somewhere between a defense tower and a fortress. In history, it mostly served as protection for the army, while battles were being hold outside. Garrisoning more units will indeed protect them, and protect the building from being captured
  • Many ships need to have a limited fire power. A big sea battle requires many ships, while you can transport many units with a few ships

Attachments (3)

arrowLimit.diff (6.9 KB ) - added by sanderd17 9 years ago.
t3196_fix_tooltips_loading_tips_and_GarrisonArrowClasses.patch (7.2 KB ) - added by elexis 9 years ago.
Implements the changes suggested above. Maybe the loading screen tips for ship ramming attacks should be removed, while it's not implemented. If you want to test a particular loading screen tip, then add tipTextFilePath = "gui/text/tips/triremes.txt"; to loading.js.
limitArrows.diff (11.0 KB ) - added by Itms 8 years ago.

Download all attachments as: .zip

Change History (13)

by sanderd17, 9 years ago

Attachment: arrowLimit.diff added

comment:1 by elexis, 9 years ago

Component: Core engineUI & Simulation
Description: modified (diff)

Your patch works and the code looks very clean.

The tooltip displays the correct values and I also compared the attack damage in an actual battle (compared a ship with 30 units garrissoned with a ship that has only 13 units in it and they did the same damage). The heavy warship was the strongest ship so far, since it could garrisson 40 units and shoot 43 arrows (OP). Now it is limited to 13 arrows too, since it is considered a trireme internally.

The following things could be added:

  • Ptolemian military colony can garrisson 20 units and shoots 21 arrows
  • Seleucid military colony can garrisson 15 and shoots 17 arrows
  • With this patch, the heavy warship receives a tooltip that explains how to increase the firepower. However the other ships also need tooltips urgently, since most players don't know that you need to garrisson ships to make them stronger. (This usually results in empty boat spams, so don't fix this if you want that big sea battle :D )
  • There should be a loading screen tip that explains how to increase the ship firepower, so that even those people will be informed, that don't read (or didn't have time to read those) tooltips. Those tips are defined in binaries/data/mods/public/gui/text/tips, the images displayed are defined in binaries/data/mods/public/art/textures/ui/loading/tips.
  • Sword cav doesn't shoot arrows, while swordsmen and skirm cavalry does. That is because GarrisonArrowClasses contains Infantry and Ranged for bireme and trireme. One could add Swordsman to that list or rather remove the Ranged class from the list, so that all infantry but no cavalry shoots arrows.

Further I think that the balancing is okay. If you played with naval experts, then you could be certain that they would find out how many ships and units garrissoned you have on the sea and try to get more units on boats. This in turn means that you can lose all your boats and all your units while the expert keeps all of his boats alive and doesn't lose a single unit (if executed correctly). This balancing would mitigate this a bit.

Last edited 9 years ago by elexis (previous) (diff)

by elexis, 9 years ago

Implements the changes suggested above. Maybe the loading screen tips for ship ramming attacks should be removed, while it's not implemented. If you want to test a particular loading screen tip, then add tipTextFilePath = "gui/text/tips/triremes.txt"; to loading.js.

in reply to:  1 comment:2 by elexis, 9 years ago

Replying to elexis:

Sword cav doesn't shoot arrows, while swordsmen and skirm cavalry does. That is because GarrisonArrowClasses contains Infantry and Ranged for bireme and trireme. One could add Swordsman to that list or rather remove the Ranged class from the list, so that all infantry but no cavalry shoots arrows.

Maybe the most coherent fix would be to only make ranged units shoot arrows on ships? Another idea might be to let all military units shoot arrows.

comment:3 by scythetwirler, 9 years ago

Great concept. However, I'd prefer avoiding using the numerical stat in the tooltip to avoid string translation chaos (though I'm not too sure on this) if it needs to be changed.

comment:4 by Itms, 9 years ago

Milestone: Alpha 19Alpha 20

in reply to:  description comment:5 by elexis, 8 years ago

Replying to sanderd17:

A big sea battle requires many ships

In r16776, the attack rate of warships had been reduced by 50%. Empty ships still fire 3+1 arrows (#3763), making it more a risk than a profit to garrison units, rewarding empty-ship-spam. If you want to have sea battles at all with warships, then it shouldn't be plain spamming, but tactical maneuvering of garrisoned (armed) ships.

=>

  • the multiplier should be increased again
  • the number of arrows limited (to 20?) using the patch above
  • the default number of arrows should be modified proportionally to the multiplier

comment:6 by elexis, 8 years ago

In 17784:

Don't shoot an undocumented arrow from UnitAI if the entity also has a BuildingAI component shooting arrows. Fixes #3763.
Instead, add the arrow to the affected unit templates (except bireme and trireme, refs #3196).

comment:7 by Itms, 8 years ago

Rebased and merged with elexis' patch.

by Itms, 8 years ago

Attachment: limitArrows.diff added

comment:8 by Itms, 8 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 17882:

Limit arrows on certain buildings and ships. Patch by sanderd17, fixes #3196.
Balancing by elexis, reverts r16776 in favor of the new total arrow limit.

comment:9 by Itms, 8 years ago

Keywords: review removed

comment:10 by elexis, 8 years ago

In 17944:

Return Infinity instead of undefined in BuildingAI.GetMaxArrowCount. Refs #3196, #3846 and r17939.

Notice the previous check if (count > this.GetMaxArrowCount()) implicitly relied on
numerical comparisons returning false if one of the two arguments is undefined.

Note: See TracTickets for help on using tickets.