Page MenuHomeWildfire Games

Allow Promotion to add arbitrary modifiers when a unit reaches the next rank instead of changing entities
Needs ReviewPublic

Authored by wraitii on Aug 18 2019, 6:46 PM.
This revision needs review, but there are no reviewers specified.



With D274, Promotion can be made to add modifiers every time a unit gains a "level", instead of promoting to a different entity.
This is great for RPG or tower-defense mods. This allows creating entities that can gain a small amount of HP every time they gain a level, for example.
The system is designed with some flexibility, one can designate "ranges" where modifiers can differ (see tests).

With a bit more work, and a few more details, this could replace the existing Promotion->Entity system entirely, and would allow removing the Advanced and Elite technology hacks.

Test Plan

Check out the briton Hero caratacos, he gains 100 HP when he gains a level. But he can only gain one level for now.

Diff Detail

rP 0 A.D. Public Repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 8911
Build 14625: Vulcan BuildJenkins
Build 14624: arc lint + arc unit

Event Timeline

wraitii created this revision.Aug 18 2019, 6:46 PM

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

Link to build:

Stan added a subscriber: Stan.Aug 18 2019, 7:12 PM

What's the difference between this and a status effect ?




delete ?

In D2188#91103, @Stan wrote:

What's the difference between this and a status effect ?

This deals with "when to add a promotion modifier", and "what to add". I guess the "what" could be a permanent status effect... Needs some thinking.

Nescio added a subscriber: Nescio.Aug 19 2019, 11:20 AM
Nescio added inline comments.

This sounds great, but wouldn't it be better to follow the template format? E.g.

  <Whatever from="0" until="1">
        <Max op="add">100</Max>

Also, I don't understand the necessity of the <Whatever> wrapper.

It could indeed be a permanent status effect.


When there is no requiredXP, it does not necesarrily mean XP is not to be added?
There may be scripted use cases (I do not have any yet). So we might consider moving this down to under the addition?

Stan added inline comments.Sep 10 2019, 5:28 PM

It would be used for different levels

like level1 to level2 etc.

Angen added a subscriber: Angen.Sep 10 2019, 7:06 PM
Angen added inline comments.

!! cheat promote unit is replacing requiredXp with 0, so this is breaking cheats

Can this add a "visual" modifier were the unit assets are changed? IE: Shields, Weapons, Helmets. This option for have an "upgradable" weapon-like system for assault rifles like upgrading to Scopes or Handgrips or even magazines.

I don't think so, perhaps with D1989 that would become possible?