Thread Tools
Old July 3, 2001, 13:51   #1
magnwa
Settler
 
Local Time: 11:17
Local Date: October 31, 2010
Join Date: May 2001
Posts: 13
Better AIS?
Has anyone thought of writing an AI and using the play by email option to use the AI in the game? Meaning.. something that will take a save game, decipher it, and play a move?

I s there any way not to have the AI make such stupid moves?

Magnwa
magnwa is offline  
Old July 3, 2001, 17:54   #2
Kirnwaffen
Warlord
 
Kirnwaffen's Avatar
 
Local Time: 05:17
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Boulder, CO
Posts: 281
People have been tweaking the game's AI since the beginning. As I understand it, it is possible to make the AI build more intelligently (to an extent), but it's tactics are still pathetic. Unfortunately, no matter how much anybody tweaks it, the AI is still a computer and still can't go beyond it's programming. Hence, the AI will always be, as you so eloquently put it, stupid.
__________________
"Beauty is not in the face...Beauty is a light in the heart." - Kahlil Gibran
"The greatest happiness of life is the conviction that we are loved; loved for ourselves, or rather, loved in spite of ourselves" - Victor Hugo
"It is noble to be good; it is still nobler to teach others to be good -- and less trouble." - Mark Twain
Kirnwaffen is offline  
Old July 4, 2001, 03:03   #3
Basil
Warlord
 
Basil's Avatar
 
Local Time: 03:17
Local Date: October 31, 2010
Join Date: Apr 2000
Location: Vancouver, B.C., Canada
Posts: 212
I've never seen anyone talk about doing that for SMAC, Magnwa. It seems to me that that would be a huge amount of work...

As Kirnwaffen says, there are various ideas around for improving the AI, but they focus on improving its economic strategy by tweaking the config files (such as alpha.txt). I don't know of anything that would help its military tactics other than, as you suggest, writing a program to work with save games. It seemed to me that it played less stupidly in SMAC than it does in SMAC-X, though that's not a scientific observation.

If you're interested in other Civilization-genre games, FreeCiv is an open-source game.
Basil is offline  
Old July 4, 2001, 20:57   #4
Kirnwaffen
Warlord
 
Kirnwaffen's Avatar
 
Local Time: 05:17
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Boulder, CO
Posts: 281
Actually, there has been some very interesting discussion lately about improving the AI. According to two threads (See "The Hardest SP Game..." and "Factions too Agressive") it would seem that the AI plays better when all factions are set to pacifist. In addition, giving the AI an extra former to begin with seems to help, as well as using a pre-terraformed map.

Also, elaborating on the AI programming, designing and programming an AI is a mammoth task, as Basil says, and would require large amounts of time and creativity. Besides that, the game would practically have to be dissected piece by piece to write an AI specific to the game. I myself have done very little beyond very basic programming, however, I do know that a new AI wil not be written unless we come up with a way to split the work between the more technically inclined members of the board.
__________________
"Beauty is not in the face...Beauty is a light in the heart." - Kahlil Gibran
"The greatest happiness of life is the conviction that we are loved; loved for ourselves, or rather, loved in spite of ourselves" - Victor Hugo
"It is noble to be good; it is still nobler to teach others to be good -- and less trouble." - Mark Twain
Kirnwaffen is offline  
Old July 4, 2001, 23:45   #5
Avenoct
Prince
 
Avenoct's Avatar
 
Local Time: 06:17
Local Date: October 31, 2010
Join Date: Apr 2001
Location: NC, USA
Posts: 777
Good idea Kirnwaffen to split up the work. I'd definately put a hand in helping redo the AI if it ever happened. I'm not much of a programmer, but I suspect that we'd need an uncompiled version of the game, which would never happen, well, maybe not untill a new game replaces it on the market. I for one would much prefer waiting 10 times as long between turns if the AI needed more time to decide what to do quasi-intelligently. If wishes were fishes...
Avenoct is offline  
Old July 5, 2001, 01:04   #6
Kirnwaffen
Warlord
 
Kirnwaffen's Avatar
 
Local Time: 05:17
Local Date: October 31, 2010
Join Date: Jul 2000
Location: Boulder, CO
Posts: 281
I agree with you whole heartedly on all points, Smack. Me thinks there are just too many long shots involved to get it all together. There's always hope though.
__________________
"Beauty is not in the face...Beauty is a light in the heart." - Kahlil Gibran
"The greatest happiness of life is the conviction that we are loved; loved for ourselves, or rather, loved in spite of ourselves" - Victor Hugo
"It is noble to be good; it is still nobler to teach others to be good -- and less trouble." - Mark Twain
Kirnwaffen is offline  
Old July 8, 2001, 00:16   #7
John Paul Jones
Prince
 
John Paul Jones's Avatar
 
Local Time: 11:17
Local Date: October 31, 2010
Join Date: Apr 2001
Posts: 738
I'm mid-way through writing a civ clone but i havent coded much of the AI yet beyond the pathfinder, map-recognition and some simple scripts for unit movement. One idea i've been toying with (but it's way out of my league right now) is to use some of the algorithms used in chess programs,eg. have the computer look ahead maybe one or two moves. I can imagine this would require a huge amount of processing power- but would improve tactics big time. Now if this could also be applied to the meta-game we'd see a massively improved AI. Any other ideas ?
John Paul Jones is offline  
Old July 8, 2001, 08:49   #8
Scipio Centaurus
Prince
 
Scipio Centaurus's Avatar
 
Local Time: 11:17
Local Date: October 31, 2010
Join Date: Jan 2001
Posts: 317
n-ply look-ahead - even if you could apply sophisticated alpha-beta pruning - would likely not be practical with the number of units and factions that could be in play at any given time. It would also suffer from the search horizon limitation inherent in n-ply look-ahead. "Rats! If I could have set it to look ahead n+1 moves instead of n moves it wouldn't have fallen into your trap."

My guess is heuristic (rule of thumb) programming would be required. In other words codify game specific strategies and write specific software sequences to allow the AI to recognize which heurisitc(s) to employ in a given situation, and then write additional code to allow the AI to organize its resources and implement the strategies.

If you are really ambitious you could code the heuristics inside a neural network to allow the AI to try to learn from its mistakes. AI thinking to itself: "Let's see... I used heuristics 1,2 and 7 to try to take out the Gaians and I got my butt kicked because heuristic 2 only achieved 37% efficiency. I'll try heuristics 1,3 and 7 next time I come up against the Gaians."

This latter strategy is actually employed in some types of advanced R/W applications like medical diagnostic software, weather forecasting and the like.

Try web searches for 'heuristic', 'alpha-beta pruning', 'alpha-beta minimax', 'fuzzy logic', 'neural network' and of course 'artificial intelligence'. You'll get some idea of what would be involved.

- Scipio
Scipio Centaurus is offline  
Old July 9, 2001, 17:39   #9
Nadexander
Warlord
 
Nadexander's Avatar
 
Local Time: 03:17
Local Date: October 31, 2010
Join Date: Mar 2001
Location: Saratoga, California
Posts: 122
While it is extremely difficult to make a strategic political/military thinker out of the AI i think it would pretty straight forward to make it do osme really great building/teraforming. The problem i think lies in that Firaxis really didnt understand all the dynamics of the game before making it, which are easy for us to identify after having played it so long. Some pretty simple code to make the AI exploit forests/tree farms/crawlers combined with the advantages they have on trancend and some decent set of predesigned units could make the computer an extremely tough opponent. The main problem then is that the AI takes the same naive approach to building and terraforming that most of did in our first game. What is most needed is a patchable AI so that once dominant strategies are revealed by extensive play testing (i.e. the primacy of formers/crawlers and the power of copters) then the AI could be modified to adjust to these strategies. Even better would be a user modifiable AI , but im not getting my hopes up yet.

-Nadexander
Nadexander is offline  
Old July 9, 2001, 18:18   #10
Avenoct
Prince
 
Avenoct's Avatar
 
Local Time: 06:17
Local Date: October 31, 2010
Join Date: Apr 2001
Location: NC, USA
Posts: 777
Nadexander makes some good points. I have to revel in the already amazing ability to customize the AI as it already is. The alphatext and factiontext are incredible additions/methods that Firaxis DID have the foresight to include in the AI's Tweakability. Further adding build priorities (ie tree farms and crawlers) should be easy, but getting the AI to use Crawlers would be an actual rewrite. Certainly it wouldn't be impossible, but would require a whole new intel pathway to terraform land FOR crawlers rather than just for the base. I celebrate every borehole that the AI manages to make in my SP games, and I can imagine just how tough the AI would be with the simple (seemingly) addition of smart terraforming.

-Smack
Avenoct is offline  
Old July 9, 2001, 19:45   #11
Blake
lifer
PolyCast TeamCivilization IV: MultiplayerC4DG Gathering StormCivilization IV CreatorsApolyton UniversityApolytoners Hall of Fame
Beyond the Sword AI Programmer
 
Blake's Avatar
 
Local Time: 00:17
Local Date: November 1, 2010
Join Date: Oct 2000
Location: I am a Buddhist
Posts: 5,680
As has already been mentioned it would be almost trivial to improve the AI's economic play with access to the source code (well we can dream on...) what is inexcusable is the AI improved little between SMAC and SMAX, as the excuse of not fully understanding the dynamics of the game is a fairly lame one when SMAC had already been played for a considerable time.

The "ultimate" solution for games is to have the AI in it's own DLL, then release the source code for the AI DLL only, this would allow smart players to tweak the AI, or even create new AI's. The second best option is to have a list of priorities in a .txt file, which would have a list of all facilities, terraforming etc, then the priority under BUILD, EXPLORE, DISCOVER, CONQUER (even better listed under faction leaders too, so different leaders have a different strategy, even under the same settings as another faction). This is not as good as a DLL, because it is limited in it's scope, and special case code is needed anyway (for example if the base has drones, force a rec commons to be built). This special case code is a major PIA for anyone trying to tweak the priorities.

"Learning" AI's are IMO, a bad idea. The NN approach to choose between strategies could work, but utilimately AI's are too stupid to come up with there own strategies, so the best option is to make the AI code easily modifiable by players, so as new killer strategies arise the AI can be modified to use them. Then in a perfect world the game company would actually include the best new AI's in patches.
Blake is offline  
Old July 10, 2001, 10:50   #12
Scipio Centaurus
Prince
 
Scipio Centaurus's Avatar
 
Local Time: 11:17
Local Date: October 31, 2010
Join Date: Jan 2001
Posts: 317
I would just like to see the AI made smart enough to actually be a credible 'teacher' of the game. To help myself learn I would even be willing to set up scenarios and study the way the computer play against itself. I think there are some existing mods to the rules configuration files that would be suitable for that w/o going to the extremes of writing YAAI (yet another artificial intelligence). Perhaps such a mod could even be used to play incoming PBEM turns as a verifier of a player's strategy. Letting a'puter play your turn should probably be classified as cheating in competition or rated PBEMs though.
Scipio Centaurus is offline  
Old July 10, 2001, 13:02   #13
johndmuller
Alpha Centauri PBEMACDG Peace
King
 
johndmuller's Avatar
 
Local Time: 06:17
Local Date: October 31, 2010
Join Date: Feb 2001
Location: Capitol Hill, Colony of DC
Posts: 2,108
Magnwa, I think the basic idea of using the PBEM "hook" for a custom AI is interesting, although one might want as well to link to some independent datafile to provide turn-to-turn continuity and to handle any "additional features" that might reveal themselves. There are people who have decoded at least some of the .sav file structure and while Firaxis would (understandably?) be reluctant to publish their source code for us, they might conceivably reveal the .sav file structure. They might want to keep some of it secret either because they imagine it to be revealing of some private gimmick or because they would be professionally embarassed. Perhaps they could be induced by some promise of code sharing on our part - it would not be an entirely worthless new feature to add to the next version of the Civ family. It is even at least possible that the necessary file specs could remain reasonably unpublished after sharing them with us.

As to whether or not we could (and would) make a better mousetrap out of the AI, that would depend on how much we were to put into it. It is easy to disparage the current AI, but having dabbled in this area, I know how hard it can be to create a program to even get to the "stupid" level, so I wouldn't underestimate the effort necessary to even equal the current AI. The least appealing aspect of this project might be the amount of effort required to build the logic necessary to understand and respect the basic features and rules of the game in general, as well as the particular situation of the current PBEM game file; all of that would be necessary before we could even start dealing with strategy. I would think that vast amounts of gratitude, praise and stroking would be required to recruit the wonderful, extremely talented people needed to take on this task (please consider this to be an adulation down payment). If any(awesome-genius)one(s) were to take it this far, I for one, and I suspect many others would be eager to volunteer work and energy to go the next step.

Once there was a working engine, we would have some strengths to bring to the table, not the least of which would be time, numbers and motivation. Many improvements and well defined development sequences have already been aired in this forum. Everyone knows many AI problem areas and reasonable fixes. If looking ahead were being done, it would presumably be easy to have a user adjustable look-ahead depth, so future situations could be evaluated as far ahead as one's cpu power and patience allowed (assuming we figured out just how to evaluate the positions). It would really be great to have something like this to play with and/or against.
johndmuller is offline  
Old July 10, 2001, 22:50   #14
Blake
lifer
PolyCast TeamCivilization IV: MultiplayerC4DG Gathering StormCivilization IV CreatorsApolyton UniversityApolytoners Hall of Fame
Beyond the Sword AI Programmer
 
Blake's Avatar
 
Local Time: 00:17
Local Date: November 1, 2010
Join Date: Oct 2000
Location: I am a Buddhist
Posts: 5,680
Unfortunately releasing file specs would simply make it to easy to cheat in MP, so our own hope would be hack the file. I doubt it would even be possible, the SMAX AI is not fundamentally bad, and we would probably have more luck whining for Firaxis to fix up the AI code, improving terraforming and building choices (and the AI seeing hidden units), then releasing a patch. Ofcourse neither is very likely...
Blake is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:17.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team