Ultimate AI

Arathorn said:
Instead of spending hundreds of hours working on building a single great AI, why not spend hundreds of hours working on building a customizable AI?

Hundreds? I think you are off by at least one order of magnitude. Hundreds is only a couple of weeks work.

Your request (which I would like to see) would mean that they would need to build a scriptable AI and all the scripts for it. Just because a player can play at Sid level doesn't mean that they could write a script for it. Firaxis would have to have good scripts out of the box. This means that they would have to double their work.

I wouldn't buy the game if it wasn't ready to run out of the box and provide me a challenge.
 
You're right, of course, on the order of magnitude. Not sure what I was thinking.

The AI would have to be playable (and challenging) out of the box, no doubt about it. Externalizing a lot of the AI's decision-making process to the modding community, however, shouldn't be an order of magnitude harder than hard-coding it. That's what I'm looking for.

It should not be double the work. When doing AI coding, it's not a LOT harder to externalize the reason for going to war, or the worker actions, or the... than it is to hardcode it. You do the coding to accept ... whatever (scripting, variables, full code sets, ... Whatever the team decides is best) at the same time as you're building the input. More work? Yes, but I don't think it should be double.

Arathorn
 
Pardon the techno-speak sure to creep into this post. :)

Within the last few months, I designed and coded the plug-in, modular architecture for customer written "policy" for my company's medical application. The policy itself is somewhat simpler than an AI is, but the part that made it customizable by the customer was significantly more difficult than a plug-in AI system would be. It took me, working alone, about a month to get the design and code complete, including one major revision to cover things I missed the first go around. For a modern programmer, this stuff isn't Hello World simple, but it's hardly rocket science.

So we are not talking double the work. We are talking about a small addition to the work. The trick, however, is to plan for this from the beginning of the application. I was able to move so quickly because we did not have existing "policy" throughout the application that had to be worked around. Plus, you get some of your development time back, because such an AI is easier to debug and tweak. (It's easier to split up the work, as well.) It does require that the AI developer(s) communicate with the plug-in developer(s) to get the interface correct. If these developers are not the same developers, that part could hit some snags. (An AI developer that already understood plug-ins or quickly learned plug-ins would have no difficulty, because he would already have a sufficiently abstract view of AI development to know where to draw the lines.)

Moreover, if the modular part is sufficiently robust, the AI can be less than stellar and still be superior to what we currently have. For example, assume that the developers spend another week or two on the modular part so that not only can it be changed, but that it can support multiple sets of AI's during a single game--or even change during the game. IIRC correctly, we have seen essentially three barbarian AI behaviors during CIV3 development: 1) Beeline for cities, workers, or settlers in stacks. 2) Attack a nearby city. 3) Wander around aimlessly looking for a easy pick. I also seem to recall some game reports where players took advantage of a known AI strategy by moving a single defender around. Now assume in Civ4 that a given barbarian stack will approach your territory, then pick one of the three strategies at the last moment. It just go more difficult to game the AI.

In summary, good modular design that allows some customization is a good idea--and likely to save development time in the long run--even if you do not intend to let modders loose. The modders contribution is all gravy.
 
I like the idea of players been able to create their own AI. The developers should create an API for AI writters to use. The API would consist of very simple things, like move X unit to Y location. Attack Y location with X unit. Then there should also be events an AI can register for. i.e. getting notified when a new resource appears on the map. Been notified of when a opponent actions (i.e. movement.)

They should give players a scripting language to interface with the game, like www.lua.org

They should then use this interface to program the AI that gets shipped with Civ 4. This way it will guaranteed that the API is useful for the civ community and not just a gimmick.

Blizzard Entertainment has been doing this with their games for a long time and it's wonderful. They create powerful open-ended tools, that are used for creating the game content, and package those tools as part of the game release. i.e. Warcraft 3 world/map editor, is the same tool that the development team used for scripting the entire single player storyline. World of Warcraft's UI is completely created by scripts, by which the player can completely re-write. A player could write entire mini-games into WoW, via the scripting language, that's how powerful it is.

Anyways, I really hope that Civ4 provides some hooks for the players to provide their own AIs. The chances that Civ4 will ship with a smart AI, is dim :(

Mad Hatter
 
warpstorm said:
Hundreds? I think you are off by at least one order of magnitude. Hundreds is only a couple of weeks work.

Your request (which I would like to see) would mean that they would need to build a scriptable AI and all the scripts for it. Just because a player can play at Sid level doesn't mean that they could write a script for it. Firaxis would have to have good scripts out of the box. This means that they would have to double their work.

I wouldn't buy the game if it wasn't ready to run out of the box and provide me a challenge.

That is untrue, it would not be double the work. For the AI writters, it should be no additional work. The person in charge of writting the API, will need to make access to it public, instead of private. You imbed a third-party scripting language into the game usage, which is not diffiult to do. Then the person writting the API, provides native functions that can be called by the script writters. Like move X unit to Y location.

Then you can have a configuration file somewhere, that specifies which AI file to load for what civilization when the game launches. Design & code wise, it's hardly any more work, exposing the AI API for the game community to make use of.

Mad Hatter
 
You assumed that Firaxis wrote an API in the first place, rather than hard coding everything...

In the case where the AI is hard coded, yes, it would be more work.
 
warpstorm said:
You assumed that Firaxis wrote an API in the first place, rather than hard coding everything...

In the case where the AI is hard coded, yes, it would be more work.

I'm positive they have an API for the AI. You don't write a full-fledge complex application, like Civ 3, as one giant function.

Mad Hatter
 
Some things I would like to see.

I would like to see AI in any strategy game be approached in a similar fashion as the AI for computer chess games. I would like to see the AI analyze terrain, compute probabilities for different actions and their results, this in combination with scripted behaviours. The higher the difficulty, the longer the AI takes calculating its moves.

Now I realize that a game like Civ III is much more complex than a game like chess. However, I still think that kind of approach to strategic AI could be used. It could be "broken up" to make it more manageable, but still with each module taken into consideration in the calculations for every other module.

But by all means, externalize it as well, make it moddable.

edit: I would also like to see a heavy emphasis on randomization and choices, so that the AI isn't predictable.

Having said that, I do think that the AI for all the Civ games is probably the best I have seen in any strategic game I have played.
 
warpstorm said:
Just because a player can play at Sid level doesn't mean that they could write a script for it.

I don't know about conquests and sid level but in the normal game there's only one AI and the only change from dificulty level to level is the amount of free stuff it's given. that takes about five minutes of extra time to program.

and the whole idea of making it modular is to make it easier to build in the first place.
 
Back
Top Bottom