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

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

Hybrid View

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

    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,566

    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,566

    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

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

    EDIT: Bad testing setup had led me to wrong conclusion. Post removed; I keep only the following part as it is relevant to next post

    Spoiler Alert, click show to read: 
    Code:
    Trait AntiTest
        Characters family
        AntiTraits Test
        Level Hexxed
            Description Hexxed_desc
            EffectsDescription Hexxed_effects_desc
            Threshold 1
        Level Hexxed 
           Description Hexxed_desc
           EffectsDescription Hexxed_effects_desc
           Threshold 2
    Last edited by gsthoed; July 09, 2018 at 09:00 AM.

  7. #7
    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.

  8. #8

    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

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

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

    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!

  10. #10
    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?

  11. #11
    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.

  12. #12
    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

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

    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.


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

    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.


  15. #15
    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.

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

    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.


  17. #17
    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.

  18. #18
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,482

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

    Quote Originally Posted by KEA View Post
    No, it's not broken, it simply cannot be used in EDCT. Only use it in EDA.
    Is it really true? In the Stainless Steel it's used in EDCT in some cases, for instance to signify that somebody has a provincial title, and I think it works well...

  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

    Quote Originally Posted by Jurand of Cracow View Post
    Is it really true? In the Stainless Steel it's used in EDCT in some cases, for instance to signify that somebody has a provincial title, and I think it works well...
    I don't know the EDCT of SS, but it doesn't work. Maybe the same trigger is in EDA as well.

  20. #20
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,482

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

    Quote Originally Posted by alreadyded View Post
    Has anyone ever released code of the anit-traits and nogoingback removed or replaced? I assume nogoingback can just be deleted right? Or will that mess things up?
    I don't mess with EBII, but in SSHIP if I want to have NGB effect, I put a "jump" in the thresholds of the levels. For instance, if I want the NBG3, the thresholds would be 1,2,3,14,15, and additional trigger for 4 points would be introduced, adding 10 points more. It's an effective no-going back. Sometimes it may be ackward, but you need to cope somehow).
    Does anybody see a problem with such a solution?

    Quote Originally Posted by KEA View Post
    I don't know the EDCT of SS, but it doesn't work. Maybe the same trigger is in EDA as well.
    I think I was not clear enough. According to the context, the question was about "HasAncType" condition. I think it works well in EDCT as well.

    ---
    Using the opportunity of this post, I would like to ask if the old AntiTrait bug (mentioned in the second part of this post) is still in the M2TW engine? If yes, then the result would indeed be to steer away from using AntiTraits...
    Mod leader of the SSHIP: traits, ancillaries, scripts, buildings, geography, economy.
    ..............................................................................................................................................................................
    If you want to play a historical mod in the medieval setting the best are:
    Stainless Steel Historical Improvement Project and Broken Crescent.
    Recently, Tsardoms and TGC look also very good. Read my opinions on the other mods here.
    ..............................................................................................................................................................................
    Reviews of the mods (all made in 2018): SSHIP, Wrath of the Norsemen, Broken Crescent.
    Follow home rules for playing a game without exploiting the M2TW engine deficiencies.
    Hints for Medieval 2 moders: forts, merchants, AT-NGB bug, trade fleets.
    Thrones of Britannia: review, opinion on the battles, ideas for modding. Shieldwall is promising!
    Dominant strategy in Rome2, Attila, ToB and Troy: “Sniping groups of armies”. Still there, alas!

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
  •