Unit Experience Enhancements (destroyedTUV)


  • Donators Moderators Admin

    I will preface this FR by saying this is really just a brainstorming thread examining a method by which to achieve the goal... I am really just wanting to cultivate dicussion about what would be cleanest... most versatile and (above all else) reasonably achievable.

    So I have been beating my head against a wall trying to help another map maker to develop a way of creating a way to gain "experience" based on combat (destruction of units) for both attacker and defender.

    To that end I started to look at some of the "unit attachments"... one that jumps out at me is the following...

    	whenCapturedChangesInto				values: allows a unit to change into a different unit when captured from a specific player to a specific player.  "fromPlayer:toPlayer:transferAttributes:unitType:numberOfUnits".  accepts "any" instead of a player name. allows multiple.
    													examples: <option name="whenCapturedChangesInto" value="any:any:true:Minor_Factory:1"/> and <option name="whenCapturedChangesInto" value="Russians:Germans:false:gold:3:lumber:1"/>
    

    Now... although it is not explicitly defined... this attachment seems to only be capable of being attached to "is infrastructure"... and if you attach that to all combat units then no one would be capable to attacking since all units would be captured(or destroyed) as soon as they move into an enemy territory. However... in looking at this attachment... it made me wonder...

    Would it be even possible to make a similar attachment but specifically for "non=infrastructure" units?

    Something like...

    	whenDestroyedChangesInto				values: allows a unit to change into a resource(s) when destroyed in combat from a specific player to a specific player.  "fromPlayer:toPlayer:transferAttributes:resourceType:numberOfresource".  accepts "any" instead of a player name. allows multiple.
    													examples: <option name="whenDestroyedChangesInto" value="any:any:true:PU:1"/> and <option name="whenDestroyedChangesInto" value="Russians:Germans:false:experience:1:leadership:1"/>
    

    I have no idea how the engine tracks destroyed units during the course of a battle so I have no clue as to whether an attachment like this is even possible.

    Again, just brainstorming.


  • Moderators

    I have no idea how the engine tracks destroyed units during the course of a battle so I have no clue as to whether an attachment like this is even possible.

    This is the big question. The engine clearly keeps track of this, its displayed on the side bar and in the history section.

    You already have the game tracking an attacker, a defender, lost attacking units, and lost defending units. The map designer wants to able to access that information and convert it into a resource.

    The first idea is to call that data and use to activate triggers. This is halfway done, you can do it for attackers but not defenders (the information for defenders cannot be checked by a condition).

    The other way would be to skip triggers and have the resource given directly. Ideally a unit attachment (called bounty?) that gives a resource to whoever kills that unit (as determined by attacker/defender status, AKA whoever rolled the dice)

    I think either of the above would be much cleaner than trying to have units transforming into things which produce a resource then get immediately removed.


  • Admin

    Guess I'm not really following how this is different than Civil War leadership and using destroyedTUV? Do you just want more options around that or is this something completely different? Maybe easier to lay out an example of what you want to achieve.



  • I must say - I heard today about this and my first idea was - this is how I will convert my Peasants into Ashigaru! But then... if it would be so easy, why noone did it before?


  • Moderators

    @redrum
    I was told that DestroyedTUV only includes the units you destroy on your turn. This is the big problem, the defending player does not receive credit for what he kills.

    If there was a mirror version of destroyedTUV for defenders, that plus triggers would be enough to get a version of this that I would be satisfied with.


  • Admin

    @crazyg Correct, it only counts units that are attacked (also ignores neutrals). Adding a parameter to it that makes it count towards both attack and defense shouldn't be too difficult. So something like:

        <attachment name="objectiveAttachmentConfederateLeadership100" attachTo="Confederate" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player">
          <option name="destroyedTUV" value="allRounds:both" count="100"/>
        </attachment>
    

    So the second optional parameter could be: attack, defense, or both (defaults to attack).


  • Moderators

    @redrum Any personal opinion on who would tally it when multiple players are defending or any defending player is not the territory owner?


  • Admin

    @cernel Not a strong one. Either each specific defender or the owner of the defending territory makes sense. I'm probably leaning towards each specific defender though depends a bit on how easy/hard each of those would be to implement.


  • Moderators

    @redrum
    How exactly would "each defender" work. A mixed American/British navy kills 3 german fighters while defending. What boat killed what? Especially in low luck? Just randomnly selected?

    The overall defender (whoever rolled the dice) seemed like a simple answer to me, even if it occasionally has weird behaviors.


  • Moderators

    @redrum @CrazyG

    1. If by each defender you mean factually multiplying the tally by the defender number, I'd definitely advise against it, as it would not make sense and would induce players to exploit it.

    2. I tend to prefer the owner of the defending territory, but the next question would be what happens when there is not a territory owner (normal for sea zones), and my answer would be, either, not giving the tally to anyone or having a prompt in which you can decide who gets the tally, with all players having to agree, noone getting any if they don't (if all players are played by the same user, no acceptance is required; so it would not matter for 1v1: you just decide).

    3. Unless the way the selector is determined is improved from current (implementing the actual intended rules), I'm against going with the selector, as I don't even know how that is determined in case there is not a territory owner, while I believe it is the territory owner, if any non null one (so it would be just cleaner, then, to directly say it is the territory owner: go to point 2).


  • Admin

    @CrazyG Yeah, good point on LL. I think if you did each defender then you'd have to do it by percentages. Here are the 2 options I see (use revised example of 2 UK inf and 1 USA tank defending a Russian owned territory):

    1. The overall defender gets all the destroyedTUV credit (Russia gets all destroyedTUV credit).
    2. The destroyedTUV credit is distributed based on percentage of ownership of units of the defenders based on either number of units or TUV of defending units. They either split (2/3 for UK, 1/3 for USA) or (6/11 for UK, 5/11 for USA). Would need to have a clear rounding strategy since its track using integers.

  • Moderators

    @redrum
    2 is the better option, just round and distribute in a somewhat logical way and display the information at the end of battle screen (which will be available to check in history mode). I think its alright if sometimes the XP gets divided a bit weird.

    Just an idea which Hepps and I discussed (that I will put out there). It would be nice if you could track any destroyed resource, not just total unit value. The are instances where TUV or PUs aren't what we really want to focus on.

    For example, there was the idea that you could split into land experience and naval experience. Or have rewards tied to a unit independent of its cost (maybe you could unusually high rewards for sinking battleships. You earn moral points for sinking subs and bombers? But earn infamy for destroying infrastructure? Ideas like this). You also can get issues when units have weird production costs (for example, I believe the 2 artillery for 7 PUs still has the engine valuing both artillery at 7 TUV in NWO).

    I would be more than pleased with just a defender destroyed TUV, but I wanted to point out the extra flexibility more options could give.


  • Admin

    @crazyg Agree and maybe even just always rounding down for distributing would be best to keep it simple. Yeah, resources other PUs are a real awkward point in TripleA still right now as many things are very PU centric like TUV. There are a couple of different approaches to dealing with that such as looking to make all resources have a general 'TUV valuation' so that you still end up with a single value vs trying to allow for specifying which resource vs trying to create some sort of basic scripting functionality where you could specify resources even with various weights. I think that consideration is mostly outside and beyond this particular feature though.


  • Moderators

    @redrum
    I was thinking you could make a unit attachment option called "bounty". Something like this:

            <option name="bounty" value="nameofresource" count="1"/>
    

    And rather than have the engine calculate TUV for killed units, it checks this trait to find what reward could be given. TUV could be the default path if this isn't present


  • Moderators

    @redrum

    1. To repeat, I strongly believe this needs to have the casualty selector defined in a clear and communicated way, enabling also the gamers to easily know for sure who is going to be (all I know is that it is the territory owner, but I don't know (and I guess mostly don't) how it works when no territory owner or if it is owned by the one who is attacking or by someone not hostile with the attacker). Also, let's not forget that how it works is not how it should work, by intended rules (casualties are supposed to be agreed amongst all defending players or chosen by the attacker).
    2. This feels really unboardgame like, computing dependant and, thus, not in the spirit of an Axis & Allies style game.

    At this point, my suggestion would be rather to distribute the tally between all players taking part in the defence (not the territory owner, if no units of it taking part in the battle) equally, rounding down, except in the case there is a defender that is also the territory owner, in which case this player would get all.


  • Moderators

    @cernel said in I Get it, I got it, I know its good. The experience I got you wish you could.:

    Also, let's not forget that how it works is not how it should work, by intended rules (casualties are supposed to be agreed amongst all defending players or chosen by the attacker).

    We aren't creating a Larry Harris game anymore. The intended rules are whatever the mapmaker wants.