 |
|
MrBaggins
|
|
Yes... A* is a great pathfinding algorithm.
However, the threat map i'm doing doesn't use paths... its based on areas. It depicts collaborative 'influence' of units. Its purpose is to show how vaguely grouped units can threaten particular locations.
Last edited by MrBaggins on 31-07-2003 at 07:30
|
|
|  |
 |
|
hexagonian
|
 |
Gnawing on your mind...
Jun 1999 time: 23:29
|
|
quote: Originally posted by MrBaggins
My thought as to a better solution to the science problem, is an "elastic lead" or "knowledge spread".
Consider if there were 8 players in a particular game. Civilization 1 researches a particular tech. All other civs researching that tech gain 1/7 of the total necessary points to research the goal. If another civ starts to research it, they gain a bonus at the start of research equal to (x/7) of the goal, where x is the number of civs already having researched the technology. |
Actually, the MAX_BEHIND, MIN_BEHIND settings simulate this to some degree, but with a subtle difference.
The following is opinion and nobody may agree with it - still I will throw it out for discussion.
First off, the game boils down to the player against all other AI civs - that is the premise of the game - to beat all other civs.
The problem with this model is that it removes much of the incentive for the human player to maximize science - if this model also applies to the player. Fall behind and the human player can coast because he receive a bonus for being behind (...cheaper tech cost). Push ahead and the player actually gives the AI opponent more help.
Its the first aspect of the setup that I'm not too crazy about (falling behind...). The second one is not a problem for me because it does not remove any incentive - in fact it makes sure that I stay focused on maintaining a science lead, and to me, it simulates the feeling of tech by osmosis.
I know that this should cut both ways - the player should also benefit from tech by osmosis, but its the whole idea of removing incentive to do your best that bothers me.
I also know that there is the incentive to reach the most powerful units first, as well as the wonders, but the way to handle tech differences between civs is to make the benefits more gradual (more advanced units have small differences in stats over the slightly earlier ones, but as you get further ahead, the differences become greater) Thus there are no gamebreakers unless you have units that are greatly advanced over your rivals - as it should be. The battle for domination becomes more subtle, and takes more time to achieve, without sacrificing the incentive to do so.
(And you make sure that the AI can upgrade all obsolete units when it reaches the required tech - in my mind this is most critical.)
civ3 used this knowledge spread model and coupled it with an all-too effective tech/gold trading system which ended up wiping out most incentive to focus on science research.
|
|
|  |
 |
|  |
 |
|
marc420
|
|
Oceania
Jun 1999 time: 05:29
|
|
Hello,
I'm enjoying reading this discussion, and as I haven't done any modding, take what I say with a grain of salt. But I'm thinking of two different sets of AI systems here, so I thought I'd add them to the mix.
1) Mulitple solutions with result-scoring.
An early message mentioned the problem of knowing when to change a global slider versus when to change the number of entertainers in a city/cities. When I thought about how I sometimes solve this problem, it occurred to me that an AI could probably use the same method to solve the problem.
The way I go through and do this while playing some game is to set the sliders on one setting, then go around and tweak each city till its the way I like it. Then go write down empire-wide totals. Then go change the global slider, and repeat the process of tweaking each city. Then again look at the empire-wide results.
If the AI "knows" at the start of this that it is trying to maximize production, or balance production and science, then their aren't so many slider settings that it couldn't go through this sort of process for each slider setting and compare the results.
2) AI that learns.
This is the one I've really wanted to see in a game some time, an AI that learns over time.
Give each civ's AI a "rating" for a particular strategy. Maybe its a strategy that tries to balance offense versus defense. Each civ in a game has an AI that has a different rating for this.
At first this may be almost random, or it may be random but centered around the ai-writer's best guess. Then, at the end of the game, the AI system looks at the scores/final results of each of its AIs. The ones that did poorest get a low score, the ones that did best get a high score.
Next game, the civ's in the game all get AI's generated again, but the now the generated ratings are more tilted towards the one's with a higher score based on previous results.
Two things seem nice about this approach. One is that the AI-writer doesn't need to arbitrarily setup the perfect AI. Getting it close as a starting point would help, but then the system will adjust (hopefully). The second is that this sort of system would tend to adapt itself to the strategies that work against the player on that computer.
And one general last note. Once I had a chess program where the strength of the AI was controlled by the amount of time you gave it to makes its move. It used a tree system like the one I mentioned about the sliders above. If you gave it more time to make its move, it could study more alternatives and go deeper down the tree. So more time = better AI.
I've always been curious if a strategy game could do something like that. Out of the box its set to play pretty quickly. But as you beat the AI and wanted tougher games, you would move up the amount of time the AI had to think, and thus give the AI time to look at more alternatives.
Personally, after I've played one of these games for awhile, I wouldn't mind a slower/smarter AI. Even if you got up to letting the AI think 15min or 30 min in doing its turn(s) (plural for all the AIs in the game, 30 min might mean 3 min each for 10 civs), I'd be willing to take that delay in exchange for a more challenging game.
Those 30 min delays would still be a lot faster than PBEM. 
just a few of ideas I wanted to throw out.....
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:29
|
|
With regard to the fuzzy logic, there's a Word document about how it worked in CTP1 on my website (link at the top of this post) and I also have some lecture notes on the subject of fuzzy logic and neural nets in general (in pdf format) if anyone wants them.
If you want learning AI and fuzzy logic, then one option is to go is with fuzzy neural nets. If AI learning goes from game to game, it might be nice if they stuck more or less to the same civ, so that the civs developed their own personalities and you could grow to love and hate them. Of course, this will be an extra advantage to the human, who knows the AIs personalities. Another thing to consider is providing the option to just run games containing only AI as fast as possible, so you can leave them learning while you're not there.
But there's a lot of "if"s and "might"s there, so I won't get too carried away.
I guess I know enough to at least implement a fuzzy logic system, but I don't know enough AI to plug in all the right numbers, choose the right defuzzification methods, etc.
I know that in CTP1 it was found that increasing the time allocated to the AI (which, fortunately, could be altered in Const.txt) improved its performance. It would be nice to have the AI thinking during the humans turn, too.
|
|
|  |
 |
|
MrBaggins
|
|
I think the issue with any learning AI we might consider is insufficient sample size. Also it seems to me that we will find it difficult to measure success.... or more specifically slight degrees of less or more success.
|
|
|  |
 |
|
Solver
|
|
Apolyton Duke Of Something
|
 |
Latvia, Riga
Sep 2000 time: 07:29
|
|
Tamerlin, there can be different cheatings. Decreasing unhappiness bonus is a subtle cheat, it's not immediately visible. Giving the AI two extra Settlers at start is too visible, as it absolutely outexpands you, no matter how hard you try.
Marc,
Ahh, the AI that learns... many have wanted to create that, yet there's no game AI that learns properly . I am sure that creating it with our limited resources is impossible.
Hex,
Yes, Civ 3 uses the knowledge spread model, and does it well somewhat. That I like. Still, you are right about the problem where human players (actually, they have no other choice on higher difficulties) turn off science and simply buy all their techs through gold.
There are, however, solutions to this we can implement. First, give the AI better comparative values. In Civ 3, the key is to research techs that AI doesn't - and, if you have 1 tech it doesn't, the AI will happily give you 3 techs that everyone else has for it. So, prevent the CtP2 AI from giving techs away for cheap merely because they are researched by many civs already. Also, don't make it grab any new tech from human just for the sake of it - do some evaluation. And, give it a concept of science lead, which would force the AI into, to a degree at least, keeping its science lead. Civ 3 AI is never in the science lead, because you can get all its techs with money... CtP2 AI must be able to think like "if I give human that tech, he gets Cavalry, but if I don't, my units are far superior, so I should not".
|
|
|  |
 |
|
st_swithin
|
|
10069
Nov 2002 time: 05:29
|
|
A* is the WORST pathfinding algorithm EVER!!!
Actually, A* should have been [0] in the array of 'required bug fixes.'
What a piece of poo! And I thought I was a poor programmer! I'M NOT THE WORST!!! I'M NOT THE WORST!!!
|
|
|  |
 |
|
ToonGoon
|
|
I am neither a programmer or SLICer but I am enjoying these discussions so much that I did a search for more info.
There look to be a few good links here.
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:29
|
|
quote: Originally posted by MrBaggins
Measurements at a strategic level produce 'needs' or tasks at a lower (tactical or operational) level; |
This is the problem with the CTP2 AI, it doesn't have top level goals like:
Conquering the World
Achieve the Gaia Science Victory
Build up an world alliance
Just survive to the end of time
Usually a human player has one of these goals, when he starts a game and is able to change his goal during the game.
All these top level goals imply lower level goals. To conquer the world you need first a production base for units, so you have to build some cities. These cities need buildings to increase production and population that will also increase production. You need a road network to bring troops to the front, you see only roads between cities of the AI but never roads to the front.
The current AI can't think on top level goals it just thinks on the very low level goals like sending an army to an enemy city, it checks for armies without goals 5 to 6 times wich new goal could be assigned. So the AI will conquer by accident the enemy if it has enough units to send into the slaugter. A higher level goal would be here conquer this particular civ, a lower level goal would be then: Conquer this particular city, now it should check how many armies are available should these armies rearrenged, are transporters needed, are transporters available, are enough troops available and so on.
So here is a list of goals that are needed to accomplished so that world conquest can be accomplished:
Build cities so that the civ can get new production bases
-Make cities grow so that the production output can be increased
--To make cities grow build farms and fisheries around the city.
-While city grows secure this city and make shure new cities can be founded
-To avoid that newly founded cities can be conquered some Defenders must be build before production can be switched.
-To accomplish above goal Settlers are needed so build settlers in existing cities.
Well it looks like this is a long list of things to do to achieve world domination. But this is stratigical thinking than moving some units through the area and hoping the AI gets an advantage.
-Martin
|
|
|  |
 |
|
st_swithin
|
|
10069
Nov 2002 time: 05:29
|
|
I would have suggested the original fuzzy logic pathfinding system in C:CTP, but it got stripped out by the subsequent AI programmer, who deemed it too highly obfuscated to be of any use.
Always made perfect sense to me, though. I don't know how much of it is still resident in the CTP2 codebase.
|
|
|  |
 |
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:29
|
|
quote: 1. Generate your enemy threat influence map (based on areas, or sites as I call them, of highest enemy threat).
2. AI determines which site to send unit to.
3. Combine enemy threat & terrain influence maps together (to get the influence of enemies and terrain obstacles).
4. Through the generated influence map into A* and watch it weave a path from source to target avoiding all other threats and obstacles (to ensure the unit reaches the intended site) till it reaches the target site.
This is the path I'm taking. |
You'd have to re evaluate that every turn in case the opponent moves their units or loses some of them: The map totally changes in such a situation. That's also a problem with the regular path-finding, because a 12-stack on an isthmus can block a path, move away and open it again, making it possible to lure a path findign algorithm that takes into consideration dynamic things like units. This is VERY tricky:
Imagine the ai computes the threat map, and then decides to go some way. The player then moves their units to a place which was not defended, and the ai moves right into them. Unless it evaluates the path every turn, in which case units moving in and out of chokepoints can make the ai path oscillate.
How do you solve that? You have to consider that some changes to a path must be done, and too many changes to a path mustn't be.
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:29. Apolyton Time is 00:29. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|