1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Dynamic Traits

Discussion in 'Civ4 - Mod Components' started by Grey Fox, Mar 24, 2011.

  1. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    Dynamic Traits
    Dynamic Traits is a System that allows the leaders of civ to dynamically gain and lose traits based on their choices and actions during a game. Including random traits, and temporary traits that can create a more interesting world, where small rewards or penalties can be given to players. Techs, Events, quests, anything you could think of could reward a temporary trait. I have prepared a showcase mod, that will demonstrate some, if not all of the features of this System.​
    Here is a more in-depth list of what this mod component does.
    Mechanics
    Core Changes/Additions

    • Traits can now have a Trait Class
    • Traits can now have levels
    • The trait display have been updated, with sorting of traits and hiding of temporary traits until you press shift. (This actually requires you to press and hold shift before you hover the flag). Trait names are now colored Orange to separate from techs that also used the Green Highlight color
    • Every civ can have one Trait that all their leaders start with
    • Leader now have:
      • Minimum amount of Traits
      • Maximum set by Trait Class
      • TraitLoss boolean, can this leader lose traits? - default true
      • TraitGain boolean, can this leader gain traits? - default true
    Trait Counter

    • Trait gain and loss based on points
    • All counters and requirements are modified by gamespeed
    • Counter on all traits and points that can be awarded from techs, units, civics, buildings, and python, so basically from anything
    • Initial Trait Counters can be specified on a per leader basis, so you can set a certain leader to have a massive Trait Counter on a certain trait. Making it virtually impossible to lose it, or you can set the trait counter to -1000 or lower, which makes it impossible to ever gain the trait for this leader (set by global define).
    • Threshold Minimum and Difference, which specify the minimum points required in a trait to gain it, with the difference being used if you have reached your max number of Traits and another Trait is competing for it's place. - Default 100, and Difference 20 (but a global define modifier modifies this value depending on what gameturn it is).
    • Minimum required points can also be set on a per trait basis, the highest of the thresholds will be used
    • Traits can give points to itself when you gain it (so that once you gain it, it will be harder to lose it right away)

    Trait Levels


    • Traits can now have levels and "Level Up", each level is another trait, but gameplay-wise it is treated as one trait.
    • Trait Level bonuses stack, so trait level 2 does not replace trait level 1, but instead add to it.
    • The Level 1 trait is called a parent, and how this works in the xml is that you set a <NextTrait> on each trait that have a "next" level, and on each child you set which trait is the parent with <ParentTrait>
    • Traits level up, if they can, by gaining additional points towards any traits in the "trait chain" (they all go to the parent anyways, and typically it's the parent you give points to)

    Temporary Traits

    • Traits can now be Temporary, and last for any amount of turns
    • Temporary traits can be set to not-temporary or even permanent with Python

    Random Traits

    • Random Temporary Traits by Trait Class, that can be gained from techs, goody huts, units, wonders, and python
    • Traits can be disabled by other Traits, Units, Buildings and Civics
    • Goody Huts can now give random temporary traits by class

    The GreyFox Debug Window ;)

    • I'm working on a debug window which will hopefully be quite useful eventually
    • Currently it is far from finished, but to show it click SHIFT+C
    • After a turn or a few turns you should see new tabs showing some debug messages. Currently I have it show Trait Counters, Trait Losses and Trait Gains. But only on the current player atm. In the future I will add a dropdown to change which player to display

    Other Features

    • More Tags - Almost everything that civics can do, traits can also do now. [A Full list and explanations will be somewhere later]
    • Traits can give free specialists to buildings
    • Traits can be Permanent, which means they can't ever be lost (unless they lose their permanency somehow, which can be done with python)
    • Traits can be Unique, which means only one civ can have the Trait at one time
    • Traits can affect other leaders attitude towards you
    • Traits can be invisible (so they don't show up on the flag or otherwise).
    • Traits can change the yields of features, improvements, etc (so a Trait can give +1 Food on forests for example).
    • Includes DaveMcWs mod that show all hidden attitude modifiers.
    • AI Autoplay can be activated by pressing Ctrl+Shift+Z
    • I'll explain more once I have written a section for all tags, and exposed python functions...

    Screenshots
    Spoiler Screenshots :

    Regular Trait Help:
    Spoiler :

    Holding Shift while mousing over Trait Help:
    Spoiler :

    Trait Counters from techs:
    Spoiler :

    *NEW* Trait Popup
    Spoiler :

    Unique and Permanent Traits:
    Spoiler :

    Traits Breakdown (with levels and temporary trait countdown)
    Spoiler :



    I will share the source at a later date... For now I need playtesting and maybe some ideas for the showcase mod. It's not meant to be balanced or anything, just enough stuff to showcase the things you can do with the mod.

    Download Dynamic Traits
     
  2. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    ...reserved just in case...
     
  3. arcticnightwolf

    arcticnightwolf Emperor

    Joined:
    Jun 8, 2008
    Messages:
    1,301
    Location:
    Prague, Czech Republic
    yay for GreyFox
     
  4. Trappisto

    Trappisto Chieftain

    Joined:
    Jan 10, 2010
    Messages:
    83
    wow. cooooool. In for 1.4 ????
     
  5. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,123
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    This is great! Can you please, please, please make this for RevDCM?
     
  6. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    Yeah this will be in Rise from Erebus 1.4 in a limited way. Will talk more about that later on.
     
  7. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,881
    Location:
    DE/NL/FR
    OMG great.
    Perpentach's coming to BtS :D.
    Great work :goodjob:.
     
  8. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Glad to see this released, means we'll get it included soon :p

    It'll be in RifE, with each LeaderStatus behaving differently.
     
  9. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    (Already commented on your file; just didn't see this thread...)

    Very impressive!

    EDIT: since you've asked for suggestions:

    How about allowing the counter to be influenced by actions such as declaring a war, or sending explorers away, or founding cities?
    I know it's probably possible using Python, but adding some of these basic actions to an XML file could prove useful...
     
  10. CoffeeShopFrank

    CoffeeShopFrank Warlord

    Joined:
    Jan 18, 2011
    Messages:
    111
    Looks awesome! :)

    Can you show us some more traits you added? I can't download this right now, so I'll have to wait before I can see more.
     
  11. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    To answer the question in your other comment: IIRC, source will come once it is included in RifE (at least via an SVN update). Grey Fox is working on that now, just has to have some modifications (we're controlling it by LeaderStatus, not by individual leader).

    On the rest... Founding cities or declaring war could be useful, but most others would be very situational.

    They may even be possible already, I can't remember. :lol:
     
  12. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    Yeah these are all possible with python. Not sure if I will implement them via XML.
     
  13. cybrxkhan

    cybrxkhan Asian Xwedodah

    Joined:
    Aug 10, 2006
    Messages:
    9,687
    Location:
    The Universe
    Insane and awesome. Good job.
     
  14. Pohlmann

    Pohlmann Warlord

    Joined:
    Feb 24, 2009
    Messages:
    232
    a big part of the pedia is broken right now, right?
    got 3 gamecrashs until i decided to simply start a game :D.
    wanted to look traits up but iguess they dont have their own entries yet.
    im gonna test it now !

    edit: the yieldchanges dont work for me. it says 1 production on tiles with 4 but my plains hill mine has 4 hammers.
     
  15. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    I noticed the same thing. There are also some other things that are not working correctly.
     
  16. Pohlmann

    Pohlmann Warlord

    Joined:
    Feb 24, 2009
    Messages:
    232
    the bonus food for forests works though.
    just the global bonusyields dont seem to work.

    i really love how the trait hover tooltip has been changed. Brilliant

    this concept and realization is really really good. the only problem would be that all those boni via tech etc are just adding tons and tons of stuff to read but its just too much.


    the concept should be a bit (dont know how to express it in english that well) softer and more in the background. like i can find out how it works but the concept itself doesnt bombard me with tons of entries in every other screen of the game (popup, techtree, yet another popup, text-popup)

    (i do know its just a first show-off)
     
  17. iwolfiii

    iwolfiii Chieftain

    Joined:
    Mar 29, 2011
    Messages:
    1
    This may be a stupid question but where do you install this in the MOD, directory or elsewhere. I keep getting kicked out of game, and it doesn't load back up.
     
  18. WilliamOfOrange

    WilliamOfOrange King

    Joined:
    Jul 17, 2003
    Messages:
    998
    Location:
    Lincolnshire, UK
    Grey Fox, this is a great innovation and will definitely be placed in my mod. I have been wondering about doing something like this and had hoped to tackle it in the future. I am only doing XML stuff until I get some vacation time to learn Python, etc.

    I know that others had worked on this before (how I found this thread) so I want to thank them and you are this amazing piece of modding genius. :goodjob:

    I will be on the look out for more details of the documentation and the other features you have added. Thanks again.
     
  19. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    Awesome :D
     
  20. Chiyochan

    Chiyochan King

    Joined:
    Jul 28, 2007
    Messages:
    710
    Location:
    Chiyochan's Country
    why did i start as a leader outside my civ?
     

Share This Page