[SDK MOD] Dynamic Leaders and Traits

alexwebb2

Chieftain
Joined
Feb 11, 2006
Messages
92
Okay, so I recently posted some ideas up about this in another thread, and it seems to have been generally well-received. I've officially begun coding this mod in C++ and I will merge it into the game relatively soon after the SDK is released.


Dynamic Leaders

This mod will add in the ability to choose a new randomly generated leader for your empire every four turns. These leaders will give bonuses and/or penalties to your empire depending on what traits they possess.

From 4000 BC to 1000 AD, these leaders will be called Dynasties.
From 1000 AD to 1700 AD, they will be called Ruling Houses.
After 1700 AD, they will be called Politicians.

You will choose your first leader immediately after starting your game. Every four turns (a term, from here on) you will be able to switch leaders. No leader can be kept for more than five terms.


Dynamic Traits

Dynasties, Ruling Houses, and Politicians have their own classes of traits. Within trait classes are trait families, and within trait families are individual traits. For example:

  • Class - Politician
    • Trait Family - Military
      • Traits
        Despised By The Troops (Military Unit Production Cost +20%)
        Disliked By The Troops (Military Unit Production Cost +5%)
        Respected By The Troops (Military Unit Production Cost -5%)
        Idolized By The Troops (Military Unit Production Cost -20%, +2 XP per new unit)

There will be at least a dozen trait families to start off, with that number increasing significantly in subsequent versions. Each leader is given a few traits, anywhere from two to five.

Now here's the kicker: these traits can change over time. There is a chance that a leader who is Disliked By The Troops when he begins his first term will be Despised By The Troops at the end of the term. At this point, you'll have to decide whether you want to keep him or jump ship and switch to another leader.

Of course, if that's all there is to it, it's an easy choice. But what if he's also Very Charismatic, which gives you a +4 boost in foreign relations? What if he also Devoutly Follows The State Religion, which increases the rate of your religion's spread? You might think twice about canning him, depending on how you want to play that particular game.

---------------------------------------------

Okay, so I've laid out the main objective here. I started coding it yesterday and I've just finished the random politician name generator. I'd like to announce that our first five candidates are Jefferson Kessler, Benjamin Hayes, Diego Espinoza, Vincent Barker, and Nathaniel Gregory!

In fact, as an added touch, I think I will program a little something extra into that as well. I will give each politician a home city, so it would be Jefferson Kessler of Atlanta, etc. and Atlanta would get one extra happy citizen while Kessler was in charge.

Now there are a few things I need as far as mod support goes.

First, I need people to show some interest in this mod if it is something they are looking forward to seeing. It's all well and good for me to code something because I'd like to see it, but it definitely helps a lot when people show some interest and keep me motivated throughout the project.

Second, I need input on the traits. I have a few general ideas of what traits to put it, but if you have any ideas, please post them!

Third, I need somebody to help with art. Specifically, I would like to have a few dozen small thumbnails of distinct headshots, royal crests, logos, etc to give one to each potential leader. This is not at all necessary for the mod to work, but it will help to give the mod some variety and help the overall presentation.

Lastly, I need names and ideas for the Dynasties and Royal Houses. If someone can compile a list of historical and imaginary(but realistic-sounding) ones, that would be great.

Alright, that's it for now. Now give me some feedback, let me know any suggestions/requests you might have!

-alexwebb2
 
One question, so how do you know that you are coding up your mod correctly without seeing the SDK?
 
alexwebb2 said:
From 4000 BC to 1000 AD, these leaders will be called Dynasties.
From 1000 AD to 1700 AD, they will be called Ruling Houses.
After 1700 AD, they will be called Politicians.

You will choose your first leader immediately after starting your game. Every four turns (a term, from here on) you will be able to switch leaders. No leader can be kept for more than five terms.

I highly suggest that you don't hard code the date values into your mod, you should make these configurable though an INI file or such.



alexwebb2 said:
Lastly, I need names and ideas for the Dynasties and Royal Houses. If someone can compile a list of historical and imaginary(but realistic-sounding) ones, that would be great.

For Dynasties and Royal Houses you should look at places like wikipedia.

Here are a couple of links I got:
http://en.wikipedia.org/wiki/Dynasties
http://en.wikipedia.org/wiki/Royal_houses

It should really help out with your names :)
 
TheLopez-
Right now I'm writing general C++ functions that do what they need to do - little sub-programs, if you will. These sub-programs do the real crunch work, and they can be cut and pasted in with what Firaxis is giving us (which they will hopefully do within the next two weeks or so). Then I will make sure the names of each returned value are what the game wants them to be.

It's like buying furniture for a dorm room. You're not quite sure exactly where you're going to put it, or what you're going to have to return, or what you're going to throw out, but you can still get it and know that you're more prepared for move-in day. :-)
 
TheLopez said:
I highly suggest that you don't hard code the date values into your mod, you should make these configurable though an INI file or such.

Good idea, I will definitely keep that in mind. And thanks for the links!
 
these traits can change over time
In the case of the Military opinion, mayhap it could change according to the number of victories/losses made. Someone who loses a lot of battles and gains no ground is going to be despised by the military whilst someone who uses tactics well will easily be a popular figure in the military.
Someone who builds churches and goes on crusades may make a popular spiritual leader but one who ignores the will of god/the gods/etc. or who pays too much attention to the unholy 'sciences' (until something to seperate church and state? ie Free Religion, maybe? ) will not be so well liked by the church, maybe?
 
Lord Olleus said:
the name rome:total war is ringing in my ear for some reason.
Personaly i think that this will lead to micro-management.

R:TW is where this idea came from. I'm looking to adapt that system for Civ4.

This won't be a micromanagement issue because it's a relatively quick decision that will only be made every four turns. One main goal is to make it so that the leader and their effect on the empire is not shaping the way you play the game, but rather, that the way you play the game affects which leader you will choose to drive your empire in the direction you want to. From there, the strength of the leader may influence your timing and priorities.

For example, let's say you're going the military route. You're building up an army for your next war, and then you happen to elect a leader who decreases unit build cost and gives extra XP to new units. This might enable you to make a slightly larger army than you would have, being a little more aggressive or reckless. This is what I'm aiming for: leaders that bring out your individual play style and give your empire a distinct personality.

Of course, some neurotic people might say, "Okay well according to this line of code there's a 40% chance that this trait might go up soon and I can get an even bigger bonus so I should wait until then and maybe I should calculate the possibility of spreading this religion here sooner so I can switch civics and get an extra XP for units here...." and so on and so forth. But that's not the purpose here. I will not make the benefits and punishments so great that players are changing the production in every city or manually going around and switching which tiles they're working on.

The purpose of this mod is to give your empire a little history, a little flavor, a little personality. If your empire is going through some tough times under Nathaniel Gregory, I want the player to think back and remember how much they loved having Jefferson Kessler. At the end of the game, I want people to look back on some particularly good chain of leaders and think of it as their glory days, their own sort of golden age. I want people to look back at some particular era and say, "Man, that's where my empire really shined".
 
From 4000 BC to 1000 AD, these leaders will be called Dynasties.
From 1000 AD to 1700 AD, they will be called Ruling Houses.
After 1700 AD, they will be called Politicians
This should NOT be based on dates, but on your civics. It would make more sense that way.

As for names, I have some:
Chinese Dynasties:
Sān Huáng Wu Dì
Xia
Shang
Xī Zhōu
Dōng Zhōu (Warring States Period- I guess this means civil war)
Qin
Xī Hàn
Xin
Dōng Hàn
Sān Guó
Xī Jìn
Dōng Jìn
Nán Běi Cháo
Sui
Tang
Wu Dài Shí Guó
Běi Sòng
N Sòng
Liao
Jin
Yuan
Ming
Qing

Here is a link to my source, so you can look at it in more detail to get trait ideas.
http://en.wikipedia.org/wiki/List_of_Chinese_dynasties
 
ToV said:
This should NOT be based on dates, but on your civics. It would make more sense that way.

Yeah, that would make more sense. But I want this to be fairly portable, and that might really interfere with mods that have their own civics. I suppose I could have something like civics... maybe a button on the civics window that brings up a screen asking for which type of leadership your government would like?
 
Alright, so I've started working on the traits now. I'd like some help in brainstorming them, so if you'd like to contribute, here's the way it works. There are going to be four traits in each trait family. The first two are bad and the last two are good. The format for the traits is:

TraitFamilyand# ("Trait Title", "trait description", "Effect1", "Effect2")

Where the trait description finishes the sentence "This leader...", and Effect2 is optional.

For example, the first one I have done is the Bravery family.

Bravery1("Coward", "is a complete and total coward", "Happiness -10%", "Foreign Relations -3")
Bravery2("Wimpy", "is viewed as being something of a wimp", "Happiness -5%", "Foreign Relations -1")
Bravery3("Confident", "is confident and not easily shaken", "Happiness +5%", "Foreign Relations +1")
Bravery4("Fearless", "is widely viewed as a strong, fearless leader", "Happiness +15%", "Foreign Relations +3")


This will make it very easy to churn out summaries like this:

Harry Nolan is widely viewed as a strong, fearless leader, and he is a true patron of the arts. However, he is somewhat disliked by the military.

Fearless (Happiness +15%, Foreign Relations +3)
Patron of Arts (Culture +20%)
Disliked by Military (Unit Cost +5%)


So there's the basic format and my reasoning behind it. Here is the list of effects at the various levels (I'm definitely open to input on these - whether it's new ones, changing the values, etc.):

Population Growth Rate (-15%, -5%, +5%, +20%)
Religion Spread Rate (-10%, -5%, +5%, +15%)
Unhealthiness (+10%, +5%, -5%, -15%)
Technology (-10%, -5%, +5%, +15%)
Production (-15%, -5%, +5%, +20%)
Happiness (-10%, -5%, +5%, +15%)
Unit Cost (+15%, +5%, -5%, -15%)
Income (-10%, -5%, +5%, +15%)
Culture (-15%, -5%, +5%, +20%)
Foreign Relations (-3, -1, +1, +3)
 
Alright, so I just pumped out 10 trait families. Note that I changed the effects slightly and renamed Bravery to Confidence. I'm also trying to avoid crossover effects (e.g., Happiness being affected by Religion, Culture, Confidence, Charisma, Health, etc.).

Population Growth Rate (-15%, -5%, +5%, +20%)
Religion Spread Rate (-20%, -5%, +5%, +20%)
Unhealthiness (+10%, +5%, -5%, -15%)
Technology (-15%, -5%, +5%, +15%)
Production (-15%, -5%, +5%, +20%)
Happiness (-10%, -5%, +5%, +15%)
Unit Cost (+15%, +5%, -5%, -15%)
Income (-10%, -5%, +5%, +15%)
Culture (-15%, -5%, +5%, +20%)
Foreign Relations (-3, -1, +1, +3)
New Unit XP (0, 0, +1, +3)
Barracks Cost (+100%, +50%, 0, 0)


Confidence1 ("Coward", "is a spineless coward", "Foreign Relations -3")
Confidence2 ("Wimpy", "is seen as something of a wimp", "Foreign Relations -1")
Confidence3 ("Confident", "is confident and not easily shaken", "Foreign Relations +1")
Confidence4 ("Fearless", "is widely viewed as a strong, fearless leader", "Foreign Relations +3")

Culture1 ("Hates The Arts”, “has a personal, deep-seated hatred for the arts”, “Culture -15%”)
Culture2 ("Does Not Value Arts”, “sees no value in the arts”, “Culture -5%”)
Culture3 ("Promotes Our Culture”, “promotes our empire’s culture”, “Culture +5%”)
Culture4 ("Patron Of The Arts", "is a true patron of the arts", “Culture +20%”)

Technology1 (“Technophobe”, “fears the march of technology and does his best to restrict it”, “Technology -15%”)
Technology2 (“Slows Research”, “favors a slow, careful approach to technological research”, “Technology -5%”)
Technology3 (“Advocates Research”, “believes in the importance of scientific research”, “Technology +5%”)
Technology4 (“Technophile”, “strongly believes in the power of science to strengthen the empire”, “Technology +15%”)

Immigration1 (“Ultra-Nationalist”, “hates foreigners, believing that we should preserve the purity of our empire”, “Population Growth Rate -15%”)
Immigration2 (“Xenophobic”, “dislikes foreigners, placing new restrictions on immigration”, “Population Growth Rate -5%”)
Immigration3 (“Welcomes Foreigners”, “welcomes foreigners into our country”, “Population Growth Rate +5%”)
Immigration4 (“Encourages Immigration”, “encourages immigration into our empire”, “Population Growth Rate +20%”)

Charisma1 ("Terrible Speaker", "is a terrible speaker, such that he is an embarrassment to the nation", "Happiness -10%"
Charisma2 ("Poor Speaker", "is a poor public speaker", "Happiness -5%)
Charisma3 ("Good Speaker", "is a good speaker and usually draws large crowds", "Happiness +5%")
Charisma4 ("Charismatic Speaker", "has won the affection of the masses with his irresistable charm", "Happiness +15%")

Military1 ("Despised By Military", "is despised by the military", "Unit Cost +15%")
Military2 ("Disliked By Military", "is somewhat disliked by the military", "Unit Cost +5%")
Military3 ("Well-Liked By Military", "is generally well-liked by the military", "Unit Cost -5%")
Military4 ("Loved By Military", "is loved and idolized by the military", "Unit Cost -15%")

War1 (“Anti-War”, “thinks that ignoring our military will save us from war”, “Barracks Cost +100%”)
War2 (“Pacifist”, “would like to avoid war if at all possible”, “Barracks Cost +50%”)
War3 (“War Readiness”, “wants our troops to be ready for war at any time”, “New Unit XP +1”)
War4 (“Military Dominance”, “wants our military to have unquestioned global dominance”, “New Unit XP +3”)

Management1 ("Corrupt", "has been repeatedly accused of corruption (with good cause)", "Income -10%", "Production -15%")
Management2 ("Poor Management", "does not know how to effectively manage the country", "Income -5%", "Production -5%")
Management3 ("Good Management", "has some experience with management", "Income +5%", "Production +5%")
Management4 ("Experienced Management", "knows how to make the country run smoothly and efficiently", "Income +15%", "Production +20%")

Health1 ("Cuts Health Programs", "favors cutting health programs out of the national budget", "Unhealthiness +10%")
Health2 ("Unhealthy", "cares nothing for his personal health or hygiene and sets a poor example for our citizens", "Unhealthiness +5%")
Health3 ("Advocates Healthiness", "has made campaign promises to improve the nation's health", "Unhealthiness -5%")
Health4 ("Health Programs", "has implemented programs to improve the health of our cities", "Unhealthiness -15%")

Religion1 ("Scorns Religion", "publicly scorns religion and alienates religious citizens", "Religion Spread Rate -20%")
Religion2 ("Ignores Religion", "does not advocate the people's faith", "Religion Spread Rate -5%")
Religion3 ("Respects Religion", "respects people of faith", "Religion Spread Rate +5%")
Religion4 ("Devout Believer", "is a devout believer and a defender of all faiths", "Religion Spread Rate +20%")


Thoughts? Suggestions?
 
----------------------------------------------------------------------------

The 97th candidate is Earnest Mason.
He fears the march of technology and does his best to restrict it.

Technophobe (Technology -15%)

Would you like to try again? y

----------------------------------------------------------------------------

The 98th candidate is Abraham Finch.
He believes in the importance of scientific research.

Advocates Research (Technology +5%)

Would you like to try again? y
----------------------------------------------------------------------------

The 99th candidate is Milford Haley.
He has made campaign promises to improve the nation's health.

Advocates Healthiness (Unhealthiness -5%)

Would you like to try again? y
----------------------------------------------------------------------------

The 100th candidate is Clifton Covington.
He has a personal, deep-seated hatred for the arts.

Hates The Arts (Culture -15%)

Would you like to try again? y

----------------------------------------------------------------------------

The 101st candidate is Jefferson Kessler.
He is such a terrible speaker that he is an embarrassment to the nation.

Terrible Speaker (Happiness -10%)

Would you like to try again? y

----------------------------------------------------------------------------


That was all copied directly from the generator. As you can see, it is working pretty smoothly! :-D

Unfortunately, Jefferson Kessler is not turning out to be the leader we were all hoping for. But hey, that's politics for ya, right?

Anyway, a good part of the groundwork has been laid down. Here's what I have left to do:

Loop the program to generate three or four traits.
Make sure all the traits are from different families.
Enable a candidate to be selected up to five times.
Force some traits to switch to adjacent traits unless they are level 1 or 4.
Allow for the other two leader types (tripling all the code, basically).

And then of course there's integrating it within the Civ4 interface, which will be a whole other story. For that I will likely need an experienced Python person to help me out... any volunteers? :-)

Also, I still need two more trait families... can anybody help me out with that?
 
I like the idea of leader changing over time but, to be honest, I do not like the idea of choosing a leader every four turns. I also am not a big supporter of your traits system which I think goes too far, especially when implemented to me as a player.

When playing, I want to make decisions myself and do not want my abilities to be determined by a computer. However, with the AI, it is not that bad but I think traits could stay as they were shipped with vanilla Civ IV.

However it is a very good idea and I have some ideas that may not be that hard to implement (at least for someone who is familiar with Python):

1/ a leader is represented by a "king unit" (similar to Civ III regicide)
2/ a leader dies when either the king unit is destroyed (in battle or by a spy) or when he becomes too old (each leader has pre-determined age) or because of illness (i.e. caused by unhealthy conditions of a city in which he resides)
3/ when a leader dies, another one is appointed - in case of natural death by a member of the dynasty
(4/ if a civil war system was implemented, the king could even be replaced by a member of a rebellious faction and so new dynasty would be born. I have the whole concept of civil wars in my mind as well :) )

The reason why I would like to have the king unit is that the king could participate in battles thus increasing the whole army morale (represented by promotions). And when the king dies too young not having offsprings, a civil war can break out.

Moreover, replacing leaders/dynasties could even improve relations with other nations especially when the old one was very aggressive and the nations are hoping for a turn in the nation's foreign policy. Or you could attempt to secretly kill someone's leader by a spy/assassin when mutual relations are not good.
 
great idea and i will try to use it! :goodjob: however will the AI pick leaders this way too, or will it just be for the human with an immortal AI leader
 
Jouda:
With the range of leaders you can choose from every term, you will almost always be able to pick a leader that is well-suited to your play style. The bonuses/penalties will be worth taking into account, especially if they are at the extremes, but they will not be so great that you will have to significantly alter your strategy. If you somehow get stuck with a really crappy leader, you can always switch him out after four turns. What I'm trying to say is that these traits will be like the vanilla traits in that they will be a nice touch without fundamentally altering the gameplay.
As for your four suggestions, those ideas are all doable and they could very well work their way in eventually. Obviously, though, the priority right now is getting the background code working the way it needs to. :-)

RoboPig:
Glad to hear you're interested! What I am most likely going to do about AI leaders is have the names change and leave it at that. They will switch leaders on the same turn cycle as the user and their leaders will be replaced at random intervals (not more than five terms).

--------------------

Now about the mod...

I've given some time to the next few steps and they are now working, for the most part. I've settled on a constant four traits for each politician - every leader will have two good traits and two bad traits to start off. That's done. I've also made sure every trait is from a different trait family. Each candidate can be selected up to five times, so that's taken care of. I'm currently working on the trait morphing, which is tricky, so I'm going to wait until this weekend to really try and tackle that one.

After that, I'll start tripling some areas of the code to allow for dynasties and royal houses... and I am still desperately in need of traits for them! If you have any ideas whatsoever, let me know!
 
All right then. I'm starting to like your idea :-)

But still I think that it would be better not to elect a leader every four turns but after he dies, as I proposed.
 
Hmmm...maybe this would open the door to assasination attempts?

I'm not sure what to think of the mod as proposed so far. I like the idea of change in traits over time, but it seems to me that it would get a little cumbersome over time. Either way, it looks like a mod with plenty of potential!

DO you need ideas for particular dynasties, or just traits in general?
 
Jouda:
I suppose I could make it so that the leader stays in for a random number of turns until he dies, at which point the player can decide between a politician with the same last name (his heir) or another random politician (his rival). The number of turns for a leader to stay in would have to be limited, though... so what lifespan would you suggest? Maybe 10 or 15 turns?

Che Guava:
Hmm. I like the idea of assassination. How should it be done? By having a king-unit that can be killed, or by spy missions, or something else? If it's spy missions, then that limits assassinations to very late in the game.
I wonder how hard it would be to add assassination in as a diplomatic option. As in, "Okay Mr. King of England, I'll pay you 1000 gold to assassinate the King of France".

I think I have enough names for dynasties and houses now, but I haven't started thinking about general traits for them (I might be able to use one set of traits for both of them). Any ideas?
 
alexwebb2 said:
I suppose I could make it so that the leader stays in for a random number of turns until he dies, at which point the player can decide between a politician with the same last name (his heir) or another random politician (his rival). The number of turns for a leader to stay in would have to be limited, though... so what lifespan would you suggest? Maybe 10 or 15 turns?

I am not quite sure about the lifespan. For some people, changing leaders 50 times a game could be too much whereas for those preferring long and realistic games 200 leaders in a 6000 years long history is all right. What I am trying to say is that it depends on number of turns. Switching leaders every 15-60 turns is OK with 6000 turns in a single game but insufficient for "normal" 500 turns games.

Long story short: I would suggest 15 turns minimum for the lower limit and the upper limit to be dependent on number of turns. 10 turns mean nothing in most of the games, especially in the very beginning.

alexwebb2 said:
Hmm. I like the idea of assassination. How should it be done? By having a king-unit that can be killed, or by spy missions, or something else? If it's spy missions, then that limits assassinations to very late in the game.
I wonder how hard it would be to add assassination in as a diplomatic option. As in, "Okay Mr. King of England, I'll pay you 1000 gold to assassinate the King of France".

I like it too (as I mentioned in one of my previous posts). It does not really matter whether to have a king unit or not but still I would prefer a king unit so that he could join battles and die in battles too. He could also move from a city when feeling in danger there.

alexwebb2 said:
I think I have enough names for dynasties and houses now, but I haven't started thinking about general traits for them (I might be able to use one set of traits for both of them). Any ideas?

I thought traits would be random?
 
Back
Top Bottom