Alpha Centauri Forums
  Old Test Forums
  AI bots?

Post New Topic  Post A Reply
profile | register | prefs | faq | search

Author Topic:   AI bots?
Octopus posted 11-15-98 03:38 AM ET   Click Here to See the Profile for Octopus   Click Here to Email Octopus  
If SMAC had the capability to have an interface so that we could program our own AIs to play against, how many of you would actually try to write an AI?

Personally, I've wanted to try to write an AI for a long time, but in order to do so I'd have to write an entire game around it, which I'm certainly not willing to do that (or even capable of doing it). My AI might not be great, but I'd probably cut down on my complaining about bad AI in computer games if I knew first-hand how hard it was .

This sort of feature seems to be really cool, but I'm skeptical about how many people would actually take advantage of it. Civ II had customizable graphics, but I never made any of those customizations myself. Should this be the kind of feature we want from Firaxis in their next game, or would their time be better spent on other stuff (their own AI, graphics, sound, etc.)?

Steel_Dragon posted 11-15-98 03:45 AM ET     Click Here to See the Profile for Steel_Dragon  Click Here to Email Steel_Dragon     
I like the idea.
DJ RRebel posted 11-15-98 03:59 AM ET     Click Here to See the Profile for DJ RRebel  Click Here to Email DJ RRebel     
hmmmn ... very interesting idea !!! I'd probably give it a go !!!

You have to realise though, that a good AI can account for over half of a program (and that's not including the intros and movies and stuff)

And what is certain in my oppinion, is that the algorithmic planning of an AI is an intensive extensive thing !!! Not for the weak of mind !!! I'm guessing that once you've done it once, that subsequent times will be about 4 or 5 times easier !!!

dushan posted 11-15-98 04:15 PM ET     Click Here to See the Profile for dushan  Click Here to Email dushan     
I'll definitely give it a go if I'll have some spare time. Many times I've been tempted to write a civ-clone that would get rid of many annoying things in civ and allow for a plug-in AI, so that anyone can write his/hers own. There could even be competitions between AI bots only! :-)

I just hope it will be sufficiently documented (or at least have a usable sample).

Dushan

Foxtaur posted 11-15-98 05:04 PM ET     Click Here to See the Profile for Foxtaur  Click Here to Email Foxtaur     
Here's an idea... how about Firaxis simply sets up a message board for AI complaints and suggestions, and releases monthly AI updates? (Multi-player games would automatically update each other to the latest version, of course, or simply auto-download the latest patch from the alphacentauri.com site.)
Octopus posted 11-15-98 05:15 PM ET     Click Here to See the Profile for Octopus  Click Here to Email Octopus     
I've got not objections if Firaxis wants to continuously update the AI. I just think it would be fun to take a crack at it myself.

There would be other potential benefits to writing this sort of AI interface from Firaxis' perspective as well. If they wrote their AI routines in a parameterized manner, they could simply randomly choose parameters, dump all of the AIs into a pool of machines all running SMAC, and then find the winners. You then take the parameters that win (possibly varying them slightly) and have THEM fight it out. Eventually, you should get an AI that is able to consistently beat other AIs that are thrown at it. The evolutionary aspects would be likely to find several different successful AIs, each with a unique strategy. The trick there is writing the parameterized AI, which is probably no simple task.

dushan posted 11-15-98 07:49 PM ET     Click Here to See the Profile for dushan  Click Here to Email dushan     
Cool, AI evolution :-)
Brother Greg posted 11-15-98 09:23 PM ET     Click Here to See the Profile for Brother Greg  Click Here to Email Brother Greg     
I tell you what, if you want to find out how hard it is, just try and write out an AI for CIV II on paper. Take everything in the game into account, and just write it out on paper.

If you're wondering how to do it, just use something like the following (a quick example of the AI deciding how to make people happy):

IF: there are more unhappy citezens than there are happy citizens (i.e the city is so unhappy it goes into revolt)

THEN:
____IF there is no temple built
____AND if we have researched ceremonial burial

____THEN:
_________IF we can afford to buy one this turn (should we)
e.t.c

And I tell you what, if you can honestly write an AI that covers everything in the game (and then improves upoin it), you will be a genius, and should submit it to games developers to ask for a position on their staff. And no, I am not being facetious there, I am being dead serious.

As someone else pointed out, AI can take up heaps of a game, and when you consider that you have to write scripts for everything in a game, the task is simply monumental.

So, anyway, go out and try writing that script. Don't forget to decide when to build wonders, what tax/science/luxuries rate to set, how to handle your relations with other countries, what tech to research (taking into account what you need right then), what government to use, when and how to explore, etc, etc.

Oh, and don't forget, don't just make it reactionary, make it pro-active. So that it will analyse it's situation, and make decisions that will help it in the future. Make it learn from it's mistakes, and built better strategies.

And if you do all of that, I'll see you sometime in about five years (or more).

By the way, this is just to give you an idea how hard it is. Try it out for a day, see how far you get, then try and imagine how much there'd be left to do. Believe you me, it wouldn't be easy...

Brother Greg.

Octopus posted 11-15-98 10:16 PM ET     Click Here to See the Profile for Octopus  Click Here to Email Octopus     
Well, Greg, your confidence in me is overwhelming.

1) I never said it'd be easy.

2) I'm not going to engage in any thought experiments where I need to invent both a framework and a solution. It's just not worth the energy. That's why I want a framework, to figure out how hard it would really be. I'd be happy to try to work on a solution, at least for a few days.

3) I would consider taking you up on your challenge, but I don't currently have Civ II on my computer, so I have no hard data to work with. It would also never do anybody any good, and I despise doing throw-away work.

4) The SMAC team is writing an AI in under 5 years. I don't believe their programming team is very large. They also need to worry about other things, like creating the interface, etc.

5) I have no interest in working in the gaming industry. How many profitable game design houses are there out there? I'm quite happy in my current job.

6) The AI doesn't need to learn from its mistakes if it doesn't make any mistakes in the first place. Performing the kind of self-directed analysis you ask for would be outrageously complex, and of questionable utility. We need something that will provide a challenging opponent here, not pass the Turing test.

7) Just because you think you would be unable to do something doesn't mean I can't do it. I'm quite confident in my ability to write a passably good AI, the only question is if I would remain interested long enough to actually do the job. Maybe it wouldn't be as good as the one Firaxis comes up with, but they have a lot more experience. I couldn't possibly estimate a time frame, because I don't know what I'd have to start from.

8) Solving trivial problems is boring. I like a problem that is complex enough to challenge me. Maybe writing an AI IS too complex. I'd like to find out.

Brother Greg posted 11-15-98 11:31 PM ET     Click Here to See the Profile for Brother Greg  Click Here to Email Brother Greg     
Sorry, I didn't mean to imply that you couldn't do it. Given enough time, a lot of people could do it, myself included (I am a programmer by trade). I was just trying to give you a bit of an idea as to how hard (and complex) it would be, is all.

And for one person with no experience, I reckon that 5 years to write the whole thing would be just about right. Well, part-time, anyway. I was assuming that you would still have to work or go to school.

When you talk about a framework and a solution, what do you mean exactly? Are you talking about you just wanting to find a solution to a particular problem in the AI? You mean you want an example to go by, to try and judge how hard it would be? Sorry, I don't quite get you there...

As for the points on whether the AI should "think", and "learn", sorry, just getting carried away there. That would be the next step in AI evolution though, and I expect to see games with simple learning in the next 5-10 years.

Did you ever play CIV II? If you did, you'd remember the computer throwing lone units at your cities. Same city most of the time, and a unit or two here and there. Imagine if you could write an AI that learnt from those mistakes, and next time sent in a larger force, to see if that worked.

If that didn't work, it might try a split attack, or a feint, or eventually just realise that is was useless, and give in.

And I can honestly see AI getting this clever shortly. As for writing an AI that never makes mistakes, what would be the point? No-one would ever be able to beat it, would they? But I see your point.

But hey, what is more challenging, a good AI with set limits, where people could find it's weaknesses, and exploit them? Or one where it learnt from it's mistakes, and indeed, learnt from your successes. Granted, we won't see that in SMAC, and it is going too far to ask you to write it for CIV II.

I remember that in CIV II, the manual stated that "Deity" (I think it was) level was for those that wanted to be seriously humbled, and have the occasional victory. And yet, within a month or so, people were posting 200% scores from games on Deity level. Even the designers were amazed.

All because of the fact that an AI that doesn't learn will always have loopholes in it, and all it really takes is for you to find them, and then exploit them.

And I was just trying to let you know how hard it is, not say you couldn't do it. Gotta admit that reading my previous post, it could be seen that way, but I honestly didn't mean it that way. Sorry.

From what I understand, there are some downloadable AIs on the net, from user's groups and the like. Why don't you have a look at some of them? Might give you an idea or two. Don't ask me where to look though, I haven't looked for them.

Brother Greg.

Octopus posted 11-16-98 12:23 AM ET     Click Here to See the Profile for Octopus  Click Here to Email Octopus     
Maybe I shouldn't have been so defensive

As for not having time to do this, you forget that I have no life outside of work (otherwise why would I spend so much time on the SMAC boards?).

What I meant by framework and solution was that I don't want to have to implement both the way the AI interracts with the game (the framework that the AI operates in) and the AI itself.

I don't see the "trying again because the first attack failed" being learning from mistakes. The AI attacked with the first force because it thought it could win. Once it gets new info (such as the actual ability of the defenders), it will be able to better judge the true situation and make more appropriate actions. Maybe that is learning, but not the way I think of it. To me, a learning AI would realize things like "aha, he never reinforces his flanks! I can sneak around him and nail him from behind!".

As for the "never makes mistakes" thing, what I meant, basically, was that if the AI was smart enough to understand that a particular action was a mistake, then it probably should be smart enough to not do it in the first place. Also, a scene from Star Trek the Next Generation springs to mind: Data loses a game of strategema to a visiting strategy expert and is concerned that he is malfunctioning, because he can't figure out what mistakes he made. Somebody points out "it is possible to make no mistakes, and still lose". I don't know what's more depressing, that I have that scene wasting valuable memory space in my head, or that a line from Star Trek is actually used by me to support an argument

And the best solution for the "every AI has holes in it" problem is to have lots of people on the net writing AIs. Then, when you start up a game, you don't know what your opponent is like, and you will need to figure it out as you go. If, after a couple of turns, someone could say "Oh, that's an Octopus-3.2, it spends too much on research and not enough on defenses", that would be pretty damn cool in and of itself.

I'd like to fight a truly intelligent AI myself, but I don't see it in the near future. Maybe that's just my opinion, but I think that would require a several orders of magnitude advance in game design. The complexity to me would seem to spiral out of control. It would need to evaluate its different strategies, and figure out "what would have worked better". A hard problem, even for people who do this for a living.

As for downloading other people's current AIs off the net, I'm really not interested right now. I want to try it myself first, without having other people's ideas polluting my brain. Once I fail miserably, then I'll see what other people have done, but not before. If I fail, I want to fail in the most spectacular way available

dushan posted 11-17-98 08:24 AM ET     Click Here to See the Profile for dushan  Click Here to Email dushan     
Damn it Octupus, once again you leave me with little to say.

I think I'd be able to code my favourite style of play into an AI-bot, given time and dedication. Although it would play pretty much the same in each game, as you've said, the idea is to have a pool of AIs from which you can choose. I think finding loopholes in the AI is part of the fun.

However even more fun would be overcomming the actual challenge of coding working AI - even if no one else would ever play against it.

Even a very simple AI might be interesting to play against, such as:

for each city:
-build best defensive unit
-build settler send it to the most efficient city site & build a city
-build settler and make it improve the terrain around the city. When finished, sentry it in the city to clear potential pollution.
-build city improvement from the provided list, as they become available. (disovering new techs might make a new thing more important -> change production). If production level high, buld a wonder that no other city is building.
-if new defensive units become available, replace the old ones with them.
-when stronger attacking units become available, produce one or two if no high priority jobs available to actively defend the perimeter of the city

Now you need a list of priorities for different improvements and techs, and a simple implementation of diplomacy. Diplomacy is rather trivial in civ, so this very passive civ would try to always go for peace and try to exchange techs. The tax rate would be always set so that you have minimal positive income. When all the improvements are built, the cities would just produce tons of defensive units and such a civ would be rather difficult to get rid of.

On top of this AI you might add something like:
-if no high priority building jobs && we have a large enemy && we know where his capital is (from trading maps, as no exploration is implemented yet) && he hasn't got democracy:
-> build 2*(capacity of our best transport ship-1) of our best attack unit
-> build 2 defensive units and 2 trasport ships
-> load all on the transport ship and get them as close to the city as possible
-> try to achieve ceasefire with the enemy
-> Unload each ship onto a separate map field and progress towards the capital
-> Attack the capital (breaking any treaties, if government doesn't allow -> revolution). Hopefully capture it, and even if you can't hold it you've split the enemy in two.

An alternative would be to try to get as much money as possible and subvert small cities, while never ever getting into an armed conflict.

I know there are a lot of details to be resolved, which might be difficult. But difficult != impossible, and it has a potential to be a lot of fun.

Mortis posted 11-20-98 02:46 AM ET     Click Here to See the Profile for Mortis  Click Here to Email Mortis     
There's this shareware game, called something like AI bugs or something like that. Where you program a machanical insect with AI and sent it into battle against other AI bugs.
OmniDude posted 11-19-98 01:02 PM ET     Click Here to See the Profile for OmniDude  Click Here to Email OmniDude     
Octopus: Wanna do AI work without having to deal with setting up a framework? Check out "AI Wars", a sharewaregame/-prg. by John A. Reder (http://ourworld.compuserve.com/homepages/John_Reder/)
It's not a totally awesome program, but it does make it possible to dabble a bit with AI without getting your feet wet. I like it (though it's not a genuine AI by my definitions, but then game AI's seldom are)
OmniDude posted 11-20-98 04:46 AM ET     Click Here to See the Profile for OmniDude  Click Here to Email OmniDude     
Very same thing, Mortis.

Thread ClosedTo close this thread, click here (moderator or admin only).

Post New Topic  Post A Reply
Hop to:

Contact Us | Alpha Centauri Home

Powered by: Ultimate Bulletin Board, Version 5.18
© Madrona Park, Inc., 1998.