• Civilization 7 has been announced. For more info please check the forum here .

The Civilization IV AI mod project

Brain

Lost in thought
Joined
Jan 10, 2005
Messages
522
Location
Warsaw, Poland
Hello all.

As we know the AI in Civ, although very good, is still far from being "intelligent" and many exploits exist. We also know that the modding capabilities of Civ IV and specifically the AI will be very great. For these reasons, I would like once and for all to address the criticism of many players and present a general plan for modding the AI to create a better experience for all. Unfortunately, we don't have any specifics about modding and the AI SDK yet but it is still possible to present some rough ideas. I invite everyone to read through and, if you like, join me to create an AI modding project.

My main idea revolves around the following concept. We can assume that human players are always more intelligent that AI players. So then why not make the humans do all the thinking? Once the game is released there will be many players trying out many different things to beat the game. No matter how good the AI is, at some point players are going to find ways to outsmart the AI and win. Strategies will be worked out and put into practice. But what if we take all those strategies and put them all together in a common database that the AI can use? The AI could then use the same kinds of strategies against human players. Then counter-strategies would be devised, and those in turn could be added to the common database. In this way the AI would always play using the most advanced strategies known so far by all players.

Using this idea and given enough time and participation, we could produce an AI of much higher quality than anything Firaxis could ever deliver. However, it still requires a lot of work. For one thing, we must create a system that can evaluate the game, choose a strategy, and actually implement the strategy. This is not an easy task and requires more specific knowledge about the AI SDK.

I already have some ideas for actually implementing such a system, and I think I have enough programming knowledge to do it, but alone I can't do much. So I would like to invite everyone in the Civ community to participate in this project. People with programming knowledge can help modding and scripting the AI, but other people are also invaluable in order to find good strategies. The more people the better. I would also like to invite everyone to give their ideas for making such an AI mod.

Here are some links to other parts of this thread:
 
I like this idea. I allways wanted the computer to do the same strategy I do. But damn!! The AI is so dumb and boring once you realise it.

I'm sorry but my programming knowledges are null. But I will help in devising ideas. No prob. Even maybe create a website for this Mod, I could do that if the chance comes.

Sure. I like the idea.
 
Brain said:
I already have some ideas for actually implementing such a system, and I think I have enough programming knowledge to do it, but alone I can't do much. So I would like to invite everyone in the Civ community to participate in this project. People with programming knowledge can help modding and scripting the AI, but other people are also invaluable in order to find good strategies. The more people the better. I would also like to invite everyone to give their ideas for making such an AI mod. Please keep in mind though that not everything may be possible and that we will only be able to mod to the extent allowed by the game.

I know C++ really well, but do we know yet what language we get to use to program the AI? I'm not really familiar with what SDK means. :blush:
 
SDK = Software Development Kit

From what I've gathered, the AI will be a combination of C++ dlls and Python scripts.
 
My programming skills are completely outdated and most probably, limited time won't allow me to be of much help, but I will throw in some ideas now and then, if you don't mind.
At least, I will follow your efforts as a passive reader
 
I'm afraid that my programming skills are limited to the old BASIC variety :rolleyes: ! However, like Commander Bello, I am more than happy to stand at the sidelines cheering all you truly brilliant people along (as well as providing Mods which require little or no programming skills ;)!)

Yours,
Aussie_Lurker.
 
I am decent at programming too and would like to contribute. The idea is brilliant. But how will we do it over net without having a shared workspace?? Seems to me like some money is needed here.

- The Architect
 
I do have some rusted programming skills.
I'm practising Python by now.

I'm good at making code clean readable and efficient,
and at correcting bugs, but I don't have much time available.
So if I can help from time to time...

+

I'm more interested in expressing algorythms.

There is an area in which I think an improvement of AI would be rather simple.
global alliance strategy.

The objective of the game is to win, true ?
so I think that when a player is approaching victory, the other ones should dogpile him, regardless of past likeness or unlikeness..
somethnig like : one player has >50% of all land ? has 80K out of 100K needed for culture victory ? => he is the ennemy, let's all come together.
Even though this behaviour is less realistic than the implemented one,
it is how human players would do (I don't think the AI should abandon a losing game, btw :D )

on the other hand, it has to be balanced. a very small civ has no interest in declaring war to his huge neighboor. It just leads to it's quick destruction.

we need to have the AI getting nasty :
-try to ally against the stronger player.
-attack during anarchy periods.
-war by proxy, but efficiently : effectively help the side you want to win through gifts in money and/or units (if allowed)
-find a way to declare peace in a conflict if a stronger third party get's involved.
-if someone collapses, have your share. don't allow one civ to get all of the spoils for himself.
-attack strong neighboors when they are involved in difficult fights.

there are plenty of other areas where improvements would help, but I think such (relatively) simple would make the human "rush to victory" less easy.
It would also allow for some come back ,since AI expansions would also be slowed by the same mecanism.
 
As thrilled as I am about the AI SDK, it also makes me a bit scared... The programming of the AI is propably THE most hard part of any game. As my coding experience is limited to basic BASIC also, I dread the amount of IF's and WHEN's.

On the other hand, if people could actually read & make more AI code, it would make the experience SO much better. Ofcourse it won't happen overnight but if it happens, It will increase the lifespab of the game by years.

The major thing I'd like is that the AI would get into, and stay in, alliances!
 
The_Architect said:
I am decent at programming too and would like to contribute. The idea is brilliant. But how will we do it over net without having a shared workspace?? Seems to me like some money is needed here.
Not really. It depends how many people participate. If it's not too big then a forum thread would probably be enough. If it becomes bigger we can create a project on www.sourceforge.net or maybe convince Thunderfall to create a forum here. Anyway, until we have more specific details there isn't much we can do besides presenting some ideas.
 
I am an OK programmer, but I really don't want to get involved with programming this project. I can, however, contribute otherwise if needed.
 
Unfortunately, I have no experience in programming. But I know that projects like this are going to be the life-blood of the game. I found C3C more frustrating than enjoyable, mainly due to the shallowness of the ai. The silly ai made the gameplay feel hackneyed and I never got the sense that Firaxis wanted to make a game that would allow players to luxuriate in the gameplaying experience. Now I am ignorant about programming so I have no idea how hard it is to make a game like this. But as I played C3C, I kept wondering how much more difficult programming the ai for a turn-based game could be than programming the ai of an excellent real-time sim, first person shooter, or dog-fight flight sim. (BTW, if anyone knows anything about this, I'd love to hear from you).

Because C3C is the only Civ game I have played, my attitude towards the series was negative and I had no intention of buying the sequel. Still, I did see in C3C a lot of potential for a game I could just love.

And now with news that the ai may be profoundly moddable, my perception about the the sequel has been totally turned around. I have doubts that Civ4 out of the box will be a perfect game, but I have hope that somehow the Civ community will make it special. So I am hoping Firaxis will make us happy with a game that seems really to be a versatile start-up kit . . .

. . . and to you ai modders, I wish you all good luck.:)
 
What we should do is split the AI into parts, such as:
Military
Worker Movment
Growth
Foreign Policy
Science
...

Even then we could split Military into:
Air
Land
Sea

And then split them again based on certain eras.
 
SenJarJar said:
Now I am ignorant about programming so I have no idea how hard it is to make a game like this. But as I played C3C, I kept wondering how much more difficult programming the ai for a turn-based game could be than programming the ai of an excellent real-time sim, first person shooter, or flight sim. (BTW, if anyone knows anything about this, I'd love to hear from you).
They're completely different. FPS, flight sim games, etc. all have AIs which basically react to things. Player moves left, fire left. Plane is descending, need to ascend to compensate. In a game like Civ you need the AI to actually think and plan - or at least mimic it. It's relatively easy to 'teach' an AI how to react to things - it's completely different trying to teach it strategy.
 
This sounds like avery good idea which would probably improve the game a lot. I can't really help with the programming since I'm not familar with any of the mentioned languages, but I can be of assistance by finding counter strategies everytime the AI gets a new one.

One of the big changes that has to be made in civ4 is the AI using a strategy rather than a tactic. With strategy I mean a longer and thorough gameplan, while a tactic is a short one turn plan. This would greatly enhance the AI to above civ3 level.
 
Like most programming these days, compiling a DLL does not depend from the language used as long as the compiler is capable of producing dlls. This means we can use anything from assembler to rapid development tools such as Visual Basic and Delphi. Language specific header files will be needed, however the process of creating them is usually fairly automatic.
 
Brain said:
Not really. It depends how many people participate. If it's not too big then a forum thread would probably be enough. If it becomes bigger we can create a project on www.sourceforge.net or maybe convince Thunderfall to create a forum here. Anyway, until we have more specific details there isn't much we can do besides presenting some ideas.

We could also use a place like BBFree.com to host some kind of forums.
 
@vbraun: That's a good start, but you're getting slightly ahead. Before making specific strategies we must first create a system that can evaluate the game and choose a strategy. It might sound simple but that's actually the hardest part. I'll present my ideas for this shortly.

@Vael: There's nothing fundamentally different between RTS and turn-based AIs in current games. The Civ AI also only reacts to events. I can give you several examples of this in Civ3. In fact, I'm pretty sure I could explain all of the Civ AI behavior using events.

@Theoden: That's exactly what I'm getting at. AIs can be very good at the tactical level because of the way they work. However, the AI will never be as good at the strategy level. That's why I want to make human players think for the AI instead, and have it choose a best strategy depending on the situation.

@Reinhard: You're correct, but some languages may be easier/more natural for the task at hand. Also, if several people are going to work on a mod it's better to agree on common language.
 
Actually, there is one big difference between RTS and TBS strategy AIs. The RTS AIs have a huge crutch that they rely on. They can react to multiple things nearly instantly. Most RTS AIs are generally much simpler because of this. They can be 'smarter' by just being faster.

I wholeheartedly agree with you on your final point, Brain. Pick one common language for the team and stick with it. Otherwise the Tower of Babel effect will mire you down. I'd suggest adopting common naming and style also.
 
Top Bottom