Page 1 of 4 1234 LastLast
Results 1 to 20 of 76

Thread: Anti-Trait+NoGoingBackLevel mechanic confirmed broken in Medieval 2 Kingdoms

  1. #1
    b0Gia de Bodemloze's Avatar Europa Barbarorum Dev
    Join Date
    Dec 2012
    Location
    Makedonia, Greece
    Posts
    1,927

    Default Anti-Trait+NoGoingBackLevel mechanic confirmed broken in Medieval 2 Kingdoms

    BEWARE THE ANTI-TRAIT BUG MATES!!!

    There is a reason why there are almost no anti-traits in EBII EDCT and that reason is that anti-trait mechanics is seriously broken in M2TW:K engine!

    The bug is a sinister one - it makes the trait disappear from the character scroll, so apparently everything is working just fine BUT the effects of the trait still linger on. It is worst with trai-antitrait pairs that get switched often (for instance the seasonal movement restrictions) - over a period of time the effects accumulate into ridiculous proportions.

    Therefore the only way to deal with this bug is really not use anti-traits at all (it is fine for no effect "trace" traits though) and basically double the ammount of triggers first to check whether a trait is present (and award the trait -1 value) and only if it is not to award the opposing trait its +1 value. I tried to revamp the triggers in this manner for all traits, but clearly I missed some altogether or just messed up yielding the observed absurd result such as "hesitant good attacker". Sorry, but please learn from my mistakes and do not re-introduce the anti-trait bug again!
    I want to ask what do you think about this issue?
    Last edited by b0Gia de Bodemloze; May 19, 2015 at 08:08 AM. Reason: Confirmed
    Under the Patronage of Veteraan.
    Proud member of Europa Barbarorum 2 team, developer of EBNOM, developer of EB 1.21, developer of Diadochi Total War, developer of Hegemonia City States and creator of one modpack for Megas Alexandros.


  2. #2
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    Interesting. I work a lot with anti-traits but didn't encountered any oddities that point in this direction. Is it confirmed?

  3. #3
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    BGR submod for SS has many antitraits and complicated triggers, and everything works fine.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    I tried it in vanilla Kingdoms grand campaign with these traits...

    Code:
    ;------------------------------------------
    Trait test_trait_A
        Characters all
        ;NoGoingBackLevel 2  ;commented out
        AntiTraits test_trait_B
        
        Level test_trait_A_1
            Description test_trait_A_1_desc
            EffectsDescription test_trait_A_1_effects_desc
            Threshold  2
    
            Effect Level 1
            
        Level test_trait_A_2
            Description test_trait_A_2_desc
            EffectsDescription test_trait_A_2_effects_desc
            Threshold  4
    
            Effect Level 2
            
    ;------------------------------------------
    Trait test_trait_B
        Characters all
        ;NoGoingBackLevel 1  ;commented out
        AntiTraits test_trait_A
        
        Level test_trait_B_1
            Description test_trait_B_1_desc
            EffectsDescription test_trait_B_1_effects_desc
            Threshold  2
    
            Effect Level 3
    
    VNVs:
    {test_trait_A_1}test_trait_A_1
    {test_trait_A_1_desc}test_trait_A_1
    {test_trait_A_1_effects_desc}Level 1
    {test_trait_A_2}test_trait_A_2
    {test_trait_A_2_desc}test_trait_A_2
    {test_trait_A_2_effects_desc}Level 2
    {test_trait_B_1}test_trait_B_1
    {test_trait_B_1_desc}test_trait_B_1
    {test_trait_B_1_effects_desc}Level 3
    ...this script...

    Code:
    monitor_event FactionTurnStart
    
      spawn_army 
        faction england
        character random_name, named character, age 20, x 100, y 150, label antiTest1
        unit Hobilars 	exp 0 armour 0 weapon_lvl 0
      end
      
      spawn_character england, random_name, merchant, age 18, x 102, y 150
      spawn_character england, random_name, assassin, age 18, x 103, y 150
      spawn_character england, random_name, priest, age 18, x 104, y 150
    
    terminate_monitor
    end_monitor
    
    monitor_event CharacterSelected AgentType merchant
      console_command give_trait_points antiTest1 test_trait_A 1
    end_monitor
    
    monitor_event CharacterSelected AgentType assassin
      console_command give_trait_points antiTest1 test_trait_B 1
    end_monitor
    
    monitor_event CharacterSelected AgentType priest
      console_command give_trait antiTest1 test_trait_B 1
    end_monitor
    ...and these entries in descr_character.txt for england named character...

    Code:
    faction			england
    dictionary		2
    strat_model		northern_general
    strat_model		northern_spy
    strat_model		catholic_priest
    strat_model		northern_ambassador
    battle_model	Northern_General
    battle_equip	gladius, chainmail shirt helmet and rectangular shield
    Selecting the merchant, assassin and priest affects the current trait of the named character, changing his strat model (via Level effect). e.g. Selecting the merchant twice in a row gives the NC 2 points in test_trait_A which makes it reach the first trait level: the NC changes to a spy model.

    It all works exactly as expected. However, note that this is awarding trait points via script instead of trait triggers. Maybe someone else can test that. (EDIT: nevermind, did it myself and triggers work fine too.)

    What I did find was that putting those NoGoingBackLevel lines back in made it go haywire. Selecting the merchant 3 times was fine (spy model and is now one point away from reaching level 2) but then selecting the assassin twice did nothing (it should have dropped the trait to below level 1 and therefore the model back to a general) ... in fact the NC's trait actually advanced to the second level of test_trait_A (but with still no change in the model). Bizarre.

    There is another known bug with AntiTraits as mentioned here...

    Assume you have a Trait A with AntiTraits B.
    Then, if you gain points in B, you lose them in A (if you have some points in A) unless that would result exactly in the loss of a level in A -
    in that case, you lose all levels in A.

    Still not understood? Here's an example:
    Imagine the following situation:
    You have a princess with the GoodPrincess trait at level 2 (2 points). She fails a diplomacy mission and gets one point in BadPrincess. Now, instead of simply going back to GoodPrincess level 1 (which would happen if she simply lost a point), she loses all points in GoodPrincess.

    A possible workaround if you don't use NoGoingBackLevel is apparently to have a NoGoingBackLevel that is higher than your highest trait level.
    I don't know if that was fixed in a later version. I haven't experienced it myself but I don't use AntiTraits or NoGoingBackLevel in my traits.

    It was also mentioned here in a RTW tutorial...

    This is one nasty bug. It does not happen often, but when it happens it's not pretty. For example, if your Assassin had 4 points in GoodAssassin (Superior Assassin), and after one failed kill got 1 point of BadAssassin, instead getting left with 3 points (Murderer), he'll lose all points in GoodAssassin. Careful inspection shows that this bug only happens with traits that have no "NoGoingBackLevel". Just giving virtual "NoGoingBackLevel" to all problematic traits will fix the bug. By virtual, I mean giving levels that are not possible to achieve, like 6th level for GoodAssassin (which has just 5 levels).
    ~~~

    In summary I'd say to steer clear of using AntiTraits and NoGoingBackLevel together. If the quote from the OP was not using NoGoingBackLevel then I question those findings: I'm certainly not seeing that problem here, so long as I don't use NoGoingBackLevel. Not saying that it's definitely wrong - maybe there are circumstances where it does happen which my test doesn't cover.
    Last edited by Withwnar; January 11, 2020 at 10:17 PM.

  5. #5
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    Quote Originally Posted by Withwnar View Post
    There is another known bug with AntiTraits as mentioned here...



    I don't know if that was fixed in a later version. I haven't experienced it myself but I don't use AntiTraits or NoGoingBackLevel in my traits.

    It was also mentioned here in a RTW tutorial...



    ...which is very clear in saying that NoGoingBackLevel is the cause.

    ~~~

    In summary I'd say to steer clear of using AntiTraits and NoGoingBackLevel together. If the quote from the OP was not using NoGoingBackLevel then I question those findings: I'm certainly not seeing that problem here, so long as I don't use NoGoingBackLevel. Not saying that it's definitely wrong - maybe there are circumstances where it does happen which my test doesn't cover.
    Well, I had same problem and I discovered Byg's traits, it's easy when you have a working part of code ) Tutorial says true, AntiTrait takes away all points of Trait. There's a very elegant decision in Byg's code - if you want to take away 1 level of trait using antitrait you first give 1 point of AntiTrait in trigger and then give necessary points for lesser level of Trait. That's pretty cool, you know )

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #6
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    Yes, the NoGoingBackLevel bug is known since RTW times.

  7. #7

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    This bug is different from the "NoGoingBackLevel" one. The point is not that an antitrait removes all levels of the trait, but that while the levels appear fine, the associated attributes still linger and if the trait-antitrait pair is used often, it stacks. It is most visible on attributes like movement points, which can be easily tested.

    I currently have no access to the EDCT file with examples of this bug, but if you wanna test it, try something like: trait A adds movement points (one level only), anti-trait B, one level, no effect.
    Triggers: summer - trait A is gained, winter triat B is gained to remove trait A. Test: run for several seasons and watch the movement points gradually increase.

    I no longer remember if NoGoingBackLevel was used or not, but I guess it no longer matters...

    EDIT:

    This is proven NOT to work:
    Traits:
    Code:
    Trait WinterEffects
        Characters family, spy, diplomat, assassin
        AntiTraits WinterEffectsOver, UnaffectedByWinter
    
    
        Level Winter_Effects
            Description Winter_Effects_desc
            EffectsDescription Winter_Effects_effects_desc
            Threshold  1
    
    
            Effect MovementPoints -8
    
    
    ;------------------------------------------
    Trait WinterEffectsOver
        Characters family, spy, diplomat, assassin
        Hidden
        AntiTraits WinterEffects
    
    
        Level Winter_Effects_Over
            Description Winter_Effects_Over_desc
            EffectsDescription Winter_Effects_Over_effects_desc
            Threshold  1
    Triggers:
    Code:
    Trigger Setting_of_WinterEffects
      WhenToTest CharacterTurnEnd
    
    
      Condition I_EventCounter ecAutumn = 1
            and Trait AridRegion < 1
            and Trait UnaffectedByWinter < 1
            and Trait WinterEffects < 1
    
    
      Affects WinterEffects  1  Chance  100
    
    
    ;------------------------------------------
    Trigger Resetting_WinterEffects
      WhenToTest CharacterTurnEnd
    
    
      Condition I_EventCounter ecWinter = 1
            and Trait WinterEffects = 1
    
    
      Affects WinterEffectsOver  1  Chance  100
    While this works just fine:
    Traits:
    Code:
    Trait WinterEffects
        Characters family, spy, diplomat, assassin
    
    
        Level Winter_Effects
            Description Winter_Effects_desc
            EffectsDescription Winter_Effects_effects_desc
            Threshold  1
    
    
            Effect MovementPoints -8
    Triggers:
    Code:
    Trigger Setting_of_WinterEffects
      WhenToTest CharacterTurnEnd
    
    
      Condition I_EventCounter ecAutumn = 1
            and Trait AridRegion < 1
            and Trait UnaffectedByWinter < 1
            and Trait WinterEffects < 1
    
    
      Affects WinterEffects  1  Chance  100
    
    
    ;------------------------------------------
    Trigger Resetting_WinterEffects
      WhenToTest CharacterTurnEnd
    
    
      Condition I_EventCounter ecWinter = 1
            and Trait WinterEffects = 1
    
    
      Affects WinterEffects -1  Chance  100
    EDIT2:

    I have discovered - to my utmost shock and horror - this bug on June 1st, 2014 - mere weeks before planned, and long overdue, release of EBII. At that time I was the only active scripter working with traits (and a few other things) and this bug meant re-doing basically the whole EBII EDCT...

    I know it is no excuse for not publishing this pretty serious bug immediately, but I am writing this now as a sort of an explanation.

    Because right now, when this matter was brought to my attention after I am for quite a long time no longer active because of RL limitations, I feel like a total ass for not posting about it once I found the bug. In fact I thought I have made this bug public, but I really did not - most likely because I just panicked at that very busy time and my only concern was to get the EBII EDCT into working order ASAP. So please accept my sincere apology - keeping this knowledge as my exclusive secret was NOT the intent. I am just a forgetful jerk...
    Last edited by V.T. Marvin; May 11, 2015 at 03:53 PM. Reason: update

    ...................................................

  8. #8
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    That's strange, because I made my battle surgery system, when general gets a Wounded trait with mp penalty. And if he has a medic anc he has a chance to get antitrait NoWounds. And his mp restore correctly.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  9. #9
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    I haven't observed this bug either using TrainingUnits, Command or Law. But I must admitt I haven't really looked out for it.

    This definitly requires some in-depth testing. May be we are lucky and get away with it being limited to Movement, negative values, or numbers above 5?

  10. #10
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    Mine, post 4, broke on Level. But only when NoGoingBack was used.

  11. #11
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    I am confirming this find:

    Code:
    ;----------------------------------------------------------------------------------------------------------
    Trait TestTrait
     Characters family
     ExcludeCultures
     NoGoingBackLevel 2
     AntiTraits Not_TestTrait
     Level TestTrait1
      Description TestTrait1_desc
      EffectsDescription TestTrait1_effects_desc
      Threshold 1
      Effect Command 1
      Effect TrainingUnits 10
      Effect MovementPoints -5
    
    ;----------------------------------------------------------------------------------------------------------
    Trait Not_TestTrait
     Characters family
     ExcludeCultures
     NoGoingBackLevel 2
     AntiTraits TestTrait
     Level Not_TestTrait1
      Description Not_TestTrait1_desc
      EffectsDescription Not_TestTrait1_effects_desc
      Threshold 1
     
    
    ;===============================================================
    ;== TRIGGER DATA STARTS HERE ==
    ;===============================================================
    Trigger  Test_Antitraits2
     WhenToTest CharacterTurnEnd
     Condition Trait TestTrait = 1
           and   EndedInSettlement
    
     Affects  Not_TestTrait 1 Chance  100
     
    Trigger  Test_Antitraits1
     WhenToTest CharacterTurnEnd
     Condition Trait TestTrait = 0
           and   not EndedInSettlement
    
     Affects  TestTrait 1 Chance  100
    The result was that the character was amassing command stars when moving in an out of settlements. Interestingly TrainingUnits wa stalled at 50%, but not rested either. So yes, Antitrait-feature is broken

  12. #12
    b0Gia de Bodemloze's Avatar Europa Barbarorum Dev
    Join Date
    Dec 2012
    Location
    Makedonia, Greece
    Posts
    1,927

    Default Re: Anti-Trait mechanic broken in Medieval 2 Kingdoms?

    So we mustn't use it anymore.
    Under the Patronage of Veteraan.
    Proud member of Europa Barbarorum 2 team, developer of EBNOM, developer of EB 1.21, developer of Diadochi Total War, developer of Hegemonia City States and creator of one modpack for Megas Alexandros.


  13. #13
    b0Gia de Bodemloze's Avatar Europa Barbarorum Dev
    Join Date
    Dec 2012
    Location
    Makedonia, Greece
    Posts
    1,927

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    It is broken in Rome Total War too?
    Under the Patronage of Veteraan.
    Proud member of Europa Barbarorum 2 team, developer of EBNOM, developer of EB 1.21, developer of Diadochi Total War, developer of Hegemonia City States and creator of one modpack for Megas Alexandros.


  14. #14
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    yes, at least not when traits have effects as well.

  15. #15
    b0Gia de Bodemloze's Avatar Europa Barbarorum Dev
    Join Date
    Dec 2012
    Location
    Makedonia, Greece
    Posts
    1,927

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    Quote Originally Posted by KEA View Post
    yes, at least not when traits have effects as well.
    Also is broken HasANCType' condition in the EDCT. We should check it and make a new thread.
    By Gigantus
    I did however come across the 'HasANCType' condition in the EDCT - I am not sure if that is a valid condition here, afaik it can only be used in the EDA. Apart from that the trigger will fail anyhow as this condition checks for the category of an anciallry defined by the type line entry and the triggers I have seen have ancillary NAMES as criteria.

    Simply trace the ancillary and change the type entry to something unique (I suggest [anc name]_type) and then adjust the EDCT (and possibly EDA as as well) trigger accordingly - that will fire if the condition as such is accepted.
    Under the Patronage of Veteraan.
    Proud member of Europa Barbarorum 2 team, developer of EBNOM, developer of EB 1.21, developer of Diadochi Total War, developer of Hegemonia City States and creator of one modpack for Megas Alexandros.


  16. #16
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    No, it's not broken, it simply cannot be used in EDCT. Only use it in EDA.

  17. #17
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    HasAncType also works in campaign_script.

  18. #18
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    Don't panic, you still may use anti-traits as hidden traits without effects in EDA, but with effect in campaign_script for some purpose.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  19. #19
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    Traits without effects are of little value. You would then need a second trait that has the effectd.

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Anti-Trait mechanic confirmed broken in Medieval 2 Kingdoms

    Quote Originally Posted by KEA View Post
    Traits without effects are of little value. You would then need a second trait that has the effectd.
    My RotK mod has dozens 'biography' traits without effect - it's a method to display purely informational content, effects are optional here.

    Other uses would be hidden traits to trace inheritances\family relations (uncle of, great father of, etc), again effects are completely optional.
    Last edited by Gigantus; May 23, 2015 at 01:23 AM.










Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •