Civ4 style civics

Nightinggale

Deity
Joined
Feb 2, 2009
Messages
5,281
Back when Firaxis wrote Colonization, they used BTS as a starting point (no big surprise there). As a result, the code (including network code) for BTS style civics is left in the dll and can be used if we add a GUI. The code is currently used for the constitution effects when declaring independence, but nothing will stop us from adding more civic categories and make the new categories available in a BTS style. All we need is the GUI and perhaps a bool in the civic categories (xml) to tell if it should be added to the GUI or not. Both are non-issues, partly because copying the design from BTS would be a good idea (familiar to most players) meaning we already got most of the code. It's not that I can't code it from scratch and in fact I might do that in order to provide better support for modern monitor resolutions.

The question is, if we add civics, how should they be used? It's my impression that paying an upkeep doesn't work well with the Colonization system, meaning civics would have to be tradeoffs in some other way.

If we take slavery, then we could have say 3 civics in that category: free, related, hard working. Each of those will then affect how the slave units behave in terms of running away and productivity. Once you free your slaves, you can't go back meaning you disable the other two civics and you also disable the ability to get slaves from Africa or natives. Relaxed slaves are less likely to run away, but at the same time they have lower production. Freed slaves aren't that productive (game balance concerns), but they can be converted to free colonists if they spend enough time in schools. How much is "enough" depends on game balance.

Implementation wouldn't be that difficult. Just make 3 slave units, possibly sharing graphics and they share UnitClass. Civics can then say UnitClass X should convert to Unit Y. Each civic has a different Y, hence 3 xml setups for unit productivity, run away risk and what else we can set up for units in xml. Making it this generic means we can reuse it for other purposes as well. Since the units are plain xml units without new modifiers, game speed shouldn't be affected much if at all while applying production modifiers to certain units would likely slow down the game.

The "pick unit for unitclass" feature should be in CivEffects and then let Civics grant a CivEffect. That way we can reuse the code for other CivEffect granting xml entries, such as eras.

CivEffects can lock or unlock civics, meaning you can make say a trait, which prevents using a specific civic. The code for that is already in place (though not really tested).

What do you say about this? Is it something you would like to see in the game? Also what other civics could be useful to add to the game?
 
I like the general idea a lot actually - but we need to get a real game concept to make use of the functional implementation in DLL and XML setup.
If team and community like it as well, this could really become the base for a lot of stuff.

1. Concept Phase: Collecting ideas of Civic Categories and Options (incl. their desired effects)
2A. Implementation of Functionality: Building DLL logic and base XML setup
2B. Implementation of AI
2C. Creation of graphics (icons / buttons)
3. Setting up XML configuration of Civics (incl. Texts and Translations)
4. Testing and Fine Tuning of Balancing

Potential Categories and Choices:
A) War (Only Defensive Wars, Offensive Wars allowed, Military Domination)
B) Religion (Strong Believes, Religious Freedom, Secularism)
C) Slavery (Slavery is Gods Will, Freedom by Hard Work, All Men are Equal)
D) Domestic Market (Open Markets, Limitted Protected Goods, Full Protectionism)
E) Production (Capitalism, Planned Production, Strategic Subventionism)
F) Immigration (Uncontrolled Immigration, Selective Immigration, Planned Immigration)
G) Native Contact (Careful, Open Minded, Aggressive)
H) Relations to Motherland (Unquestioned Obedience, Limited Autonomy, Full Autonomy)
...

And yes you are absolutely right:
1. Each Civic should have a trade-off between advantages and disadvantages.
2. They need to offer meaningful choices that you might need to reconsider after some time.
3. Changing Civics should come at some cost (e.g. potential uprest because some part of the population might not like it)

By the Way:
This would make the Civic choices we get when declaring WOI a bit pointless though.
Maybe we should remove that then.

Edit:
If we ever also implement a "Tech Concept" some of theses Civics might only be unlocked by specific "Techs".
 
Last edited:
Just to be clear: there is no technical reason for having 3 civics in each category. It might make sense from a gameplay perspective, but technically we can have 3000 civics in one category (that would be bad for players!). This means proposing 2 or 5 civics in a category might make sense. Also keep in mind we can make eras unlock civics meaning progressing an era can be used to give the player more options in the civic screen. We should totally add a notification for era progression if we use it like that though. We could use other triggers for adding or removing civics.

F) Immigration (Uncontrolled Immigration, Selective Immigration, Planned Immigration)
Civics already grants CivEffects and CivEffects can currently control the number of units on the dock. Right now the dll default is 0. The default CivEffect sets it to 4. Each player adds up this number from all owned CivEffects and that is the number you get in Europe. This means we already have the code to make a civic, which grants +2 units on the dock and the player will then have 6 units to choose from. I tested it with 15 or something like that and while the dock is so crowded that clicking a specific unit (and not the next one) is an issue (fixable if we really want it), it does work as intended. The total is capped at 1 because bad stuff happens if the code tries to handle a list of 0 or negative number of units.

2A. Implementation of Functionality: Building DLL logic and base XML setup
2B. Implementation of AI
2C. Preparation of Creation of graphics
I think the GUI would need to be in 2A as both A and B would benefit from having a visual indication of what is going on. 2C would then be completing the display for how the player should see the screen (no debug text etc).

As for graphics, it would technically be possible to add without any graphics whatsoever. However adding button graphics for each civic would be a nice touch.
 
Considering the WOI is just a small part of the game, I'd prefer the civics influence the rest of the game. And It's not like there was really that many actual choice for the WOI.
 
I have to admit I haven't yet played a full game of WTP, but I am really happy to learn that you already have an AI which is able to fight properly, make strategic decisions and deal mostly flawlessly with the economic principles in Col.
Thinking of adding Civics, which will need quite some strategic understanding on the side of the AI otherwise wouldn't make much sense, but just making the game even easier for the human player.
 
Thinking of adding Civics, which will need quite some strategic understanding on the side of the AI otherwise wouldn't make much sense, but just making the game even easier for the human player.

AI wil not necessarily be weakend.

A) All Civics have positive and negative effects. The negative could be implemented "Human only"
B) All Civics should come with a cost for changing (e.g. Uprest) which would probably also be implemented "Human only"
C) We could probably implement a good weighting system for Civics to have AI make good usage (considering its current situation)

If we implement it in such ways I really belive that AI will not be weakend.
 
AI wil not necessarily be weakend.

A) All Civics have positive and negative effects. The negative could be implemented "Human only"
B) All Civics should come with a cost for changing (e.g. Uprest) which would probably also be implemented "Human only"
C) We could probably implement a good weighting system for Civics to have AI make good usage (considering its current situation)

If we implement it in such ways I really belive that AI will not be weakend.
A) So another example of human and AI playing by different rules
B) And again different rules
C) I severely doubt that anybody can come up with a weighting system enabling the AI to make at least decent decisions for an at least somewhat dynamic system as Civics are meant to be, especially in a very dynamic general environment like Col provides. Even less when those decisions are based on the current situation while the proper choice of Civics is (or should be) very much based on future plans. That is exactly the reason why a human player after having understood the principles and consequences will be able to make a meaningful decision and the AI typically will be falling flat on its nose.
 
Well yes, currently AI of Civ4Col cannot match a Human brain.
Is it not even close to that. Even if we modders try to create the best AI we can with the current engine.

Thus if AI should be at least any competition to the Human Player you simply need to give it some advantages.
But ingame seriously the Human Player will not really notice any of that.

Players must simply stay realistic and just pretend that another Human is playing against them.
They need to admit that programmers give the AI just a little advantage and pretend they believe the immersion we modders try to create ...

Sorry to break the illusion. :(
But Civ4Col AI has never been able to plan strategically it can simply evaluate short term / tactically.
 
But Civ4Col AI has never been able to plan strategically it can simply evaluate short term / tactically.
Oh, I am more than aware of that.

That is exactly why I am strongly advising against your plans. The more options you offer the AI, the more likely bad decisions will be made. Not a good way to improve game experience for the human player when he will be rolling his eyes in despair even more.
 
The AI in BTS can evaluate which civics to use, which is done by assigning a score to each. The score depends on the current state of the game, like in terms of production civic, if some civic relies more on lumber than other civics, the AI would loop through the colonies it owns to check for lumber storage and production capacity (like are there any forests at all). It shouldn't be impossible to write similar AI code in WTP.

So another example of human and AI playing by different rules
That's not the goal I had in mind. However in a worst case scenario we can teach the AI to not change civics and then we can set civics in the leader xml. If the civics are as balanced as I want them to be, that's not as bad as it sounds. However I would prefer an AI, which can change civics according to the situation.

How to make the AI able to handle this remains to be seen, but first we should figure out what precisely we want from this, then look at what we can make the AI do and in the end we should hopefully be able to make those two meet in some acceptable way.

That is exactly why I am strongly advising against your plans. The more options you offer the AI, the more likely bad decisions will be made. Not a good way to improve game experience for the human player when he will be rolling his eyes in despair even more.
It's a design goal to balance the civics to ensure that the AI can't make horrible choices. The goal is to make the civics AI friendly in the sense that there is no "wrong" choices, only different choices. It's not like there are choices, which reduces the income from selling in Europe in exchange for cheaper slaves and then the AI picks that one without buying slaves. We need to design this to avoid AI pitfalls, which in turn would also avoid human pitfalls.
 
Please have a little confidence in the team. :)

Give us a little trust in advance if we say "We can teach this to AI."
We will definitely try hard to not make AI worse that it is and to teach it new mechanics.

1. We have more experienced programmers on board then ever.
2. devolutions main focus currently is AI.
3. We do consider AI very carefully in our concepts.

And yes, sometimes - if really necessary - we might need to give AI a little bit different / easier game mechanics or some compensation.
But if we need to do that, we will do it in ways that the players will not notice ingame and thus not break his immersion.

A little bit of immersion is needed for every game. ;)
 
Last edited:
Nightinggale has perfectly explained it. :thumbsup:
(And yes since there is such a logic in BTS we should be able to implement it as well.)

With my "Human only" examples I only wanted to give possible "worst case solution" if everything else fails.
I did not explain that correctly though. :(

How to make the AI able to handle this remains to be seen, but first we should figure out what precisely we want from this, then look at what we can make the AI do ...
Exactly. :)

We should not give up implementing a good idea before even having tried.
If modders really want something and are motivated to invest time and effort they will find solutions.
 
However in a worst case scenario we can teach the AI to not change civics and then we can set civics in the leader xml. If the civics are as balanced as I want them to be, that's not as bad as it sounds. However I would prefer an AI, which can change civics according to the situation.
Well, if not changing civics doesn't do any harm, what would be the point of having them anyway?

And I would be the first to cheer and praise you guys if you were able to make the AI make meaningful decisions. I really would.
But I am having severe doiubts as I will explain below.
Give us a little trust in advance if we say "We can teach this to AI."
1. We have more programmers on board then ever.
Frankly, no.
More programmers doesn't help you in creating a good AI. It isn't about the coding, it is about the understanding of what certain principles will be doing in the big context of the entire game.

Let me give you an example.
In another thread I have mentioned the weaknesses of RAR's implementation of the Town Guard. Now, I once again will admit that I am not yet very familiar with WTP where all these problems may have been solved already, but in RAR there was "more" - here the Town Guard.
Yet, the AI wasn't able to deal with it, leading to using it as a scout. Which not only obviously was a bad, bad, bad decision but even more killed any immersion if you spotted that unit aimlessly walking the countryside.

Was that due to a lack of programmers? I really don't think so. It was due to a lack of understanding of how the AI was going to deal with a weak city defender.
And the list would go on and on and on. Ever looked in an AI controlled city? The stupidest collection of buildings in there in the most cases. Yes, in RAR the player did have "more". The AI however wasn't able to make any meaningful choice anymore. Frankly, if you would have set buildings randomly in her cities, the results might have been better. Then at least she would have had a bit of everything, and maybe sometimes even in the right cities.

Now, you guys may be excited about the idea of having more differentiation between FF's and having Civics and what else. I can understand that, I really can.
But as long as the AI isn't able to fight a war, as long as the AI isn't giving you a hard time due to her overly strong economy (and I am not talking about giving her another or more bonusses, but about meaningful choices and decisions) you might consider concentrating on these areas first.
Or concentrate on making transports work in a meaningful way. That willl make it more enjoyable for the human player and will actually help the AI.
And then, after you have achieved this goal, then you may introduce evern more icing on the cake.

But please, for the sake of the players, don't spend your time on introducing even more "more" whilst the AI will not be able to handle it. She is bad enough already.
 
If modders really want something and are motivated to invest time and effort they will find solutions.
Well, prove it.

Make the AI successfully fight wars. Make her surprise you and even frustrate you from time to time - while fighting under the same rules as you do.
Make the AI win the economic victory without throwing insane bonusses at her.
Make her competitive.

I think that should be motivation enough already.
 
Well, if not changing civics doesn't do any harm, what would be the point of having them anyway?
For the same reason as we have different leaders with different traits. While they aren't identical, it's not like there is a wrong choice when selecting a leader. You could be Spain and decide not to fight natives, but even that isn't horrible.

More programmers doesn't help you in creating a good AI. It isn't about the coding, it is about the understanding of what certain principles will be doing in the big context of the entire game.
While I agree with that statement, you jump to the conclusion that the team knows nothing except C++. That's not the case and this is likely where the current team differs most compared to past teams. We can actually handle "certain principles" and "big context".

In another thread I have mentioned the weaknesses of RAR's implementation of the Town Guard. Now, I once again will admit that I am not yet very familiar with WTP where all these problems may have been solved already, but in RAR there was "more" - here the Town Guard.
One of the big differences between RaR and WTP is the view on how to handle the AI. Simplified RaR added new features and the AI would ignore it if nobody knew how to teach the AI to use said feature. The WTP team seems to be significantly better educated when it comes to issues related to the AI (and likely programming in general) and as a result we have a more ambitious AI plan, which is realistic considering the current team.

In short you can't conclude anything related to how we want to handle the AI based on what RaR treated the AI.
 
For the same reason as we have different leaders with different traits. While they aren't identical, it's not like there is a wrong choice when selecting a leader. You could be Spain and decide not to fight natives, but even that isn't horrible.
But that seems to be the very point.
The human player can pick any leader he prefers and decide whether to exploit his traits or not.
Seems to me that the AI leaders are all the same, though. Ok, Peter Stuyvesant will become angry at you (the human player) quicker than Adrian van der Donck, but that's about it. There is literally no difference who will be your neighbour as they more or less are playing all the same way.
In Civ4 you wold be really nervous when spawning next to Shakka or Monte. In Col I just don't care at all, even less (if even possible) after around turn 100. Then my economy is going well and my military has been built up a bit and nothing is going to happen to me anymore.

So, you as a human player may pick Hernan, if your day had been bad and you want to have some decent genocide to blow off steam. I just fail to see the AI playing according to the traits.
 
Hi guys,

small suggestion:

Could the general AI discussions please be moved to a general thread "AI Discussions" or some other general thread?
That way we do not clutter or hijack feature thread.

What is currently going on is actually I bit impolite im my opinion since some users might acutally really want to discuss the features only.
It is fully ok to say "I don't think AI can handle this" in the feature thread and the answer for the specifical feature should also stay in its thread.

But the current AI discussions go way beyond that.
Thanks a lot in advance. :)
 
Well, prove it.

Make the AI successfully fight wars. Make her surprise you and even frustrate you from time to time - while fighting under the same rules as you do.
Make the AI win the economic victory without throwing insane bonusses at her.
Make her competitive.

I think that should be motivation enough already.

The WTP 2.7.1 AI is capable of fighting and winning the WOI but it usually requires more than 300 turns. Not too long ago I had a game where AI Hernan Cortez won by about t260. These results are from autoplays. The settings were standard or large, revolutionary difficulty, standard gamespeed.

I am working on to achieve that at least a single AI player declares independence before t250 and then to win by t300. I think those area reasonable numbers to work with.
 
Last edited:
These results are from autoplays.
I know that I am sounding very negative and I apologize for that.
But sorry, autoplays means just one bad AI fighting "another" bad AI. This doesn't prove much.

Ideally a scenario would be set up with like 10 cities for each party and then the human would have to fight the AI. That is the real test.
Have like 5 units be stationed in each city, declare war and watch what the AI is doing and measure it against what your plans would have been in case of having been in her position.

Take notes and repeat it with different reactions from your side. Take notes of the different AI behaviour.
Rinse and repeat.

All this of course would not only mean watching troup movements, but also what the AI will be doing inside her cities, meaning does she adjust to wartime requirements? Does she start to produce weapons and concentrate food in just one city for having new units quickly? And so on....

Edit: and have some native villages in the scenario. My experience is the AI doesn't hesitate trying to send out missionaries even if an enemy army is in the vicintiy.
 
Last edited:
Of course we're going to have civics enabled by a tech and\or civic tree :) eventually.

I would not worry about the tech\civic AI since AdvCiv already has sophisticated AI that we'd port. The age of writing stuff from scratch is over and we should import and adjust the better modpacks from BTS. I have several candidates in mind but at the moment we already have plenty of stuff to work on.

As for the autoplays, I am focusing on the economic AI for now. I don't want the AI to simply be a roadblock\obstacle for players so it has to be capable of winning on its own when there are no human players involved. When we have that baseline we can make the AI far better at countering human strategies while pursuing its own victory condition.
 
Top Bottom