 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
quote: Originally posted by Martin Gühmann
Note that I used the cheat editor to switch to the Barbs in order to let the AI play, so both games are saved as Barbs.
-Martin |
I'll look at the savegames...
Hint :
If you don't know, you can let any player play as AI, by
using the '/attach numplayer' (where numplayer is the player you want to play as AI). (in message box)
same command to disable AI : '/detach numplayer'
You can also play turns automatically with '/rnd numofturns'
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:34
|
|
quote: Originally posted by calvitix
If you don't know, you can let any player play as AI, by
using the '/attach numplayer' (where numplayer is the player you want to play as AI). (in message box)
same command to disable AI : '/detach numplayer' |
Actual I tried it in a GoodMod game, and I got the suspicion that the civ didn't act like an AI, at least it was buggy sometimes it did but not always. Not moving the units not filling the build queues, etc. Actual this is a good way in my opinion to monitor the game. One thing that is currently bothering me is the fact that no Barbs pop out of goody huts, even if the diff level says Barbs only from huts.
For the path finding I think it is not a good idea to let it search five times for a good path for instance, if you want to avoid pollution on the way, you should modify the EntryCost function, actual you have a lot more to consider then pollution, is all of the territory owned, can a road build on every tile, avoid enemy terrain, but don't avoid allied terrain. Actual it is very simple forbidden tiles get a high cost and allowed tiles a low cost.
code:
sint32 CityAstar::EntryCost(const MapPoint &prev, const MapPoint &pos,
float &cost, BOOL &is_zoc, ASTAR_ENTRY_TYPE &entry)
{
if(m_pathRoad){
const TerrainImprovementRecord *rec = terrainutil_GetBestRoad(m_owner, pos);
if(g_player[m_owner]->IsExplored(pos) == FALSE
||(g_theWorld->AccessCell(pos)->GetOwner() >= 0
&&(g_theWorld->AccessCell(pos)->GetOwner() != m_owner
&& !AgreementMatrix::s_agreements.HasAgreement(m_owner, g_theWorld->AccessCell(pos)->GetOwner(), PROPOSAL_TREATY_ALLIANCE)))
|| !rec
){
cost = k_ASTAR_BIG;
entry = ASTAR_BLOCKED;
return FALSE;
}
const TerrainImprovementRecord::Effect *effect = terrainutil_GetTerrainEffect(rec, pos);
if(!effect){
cost = k_ASTAR_BIG;
entry = ASTAR_BLOCKED;
return FALSE;
}
cost = float(g_theWorld->GetMoveCost(pos) * effect->GetProductionCost());
if(g_theWorld->AccessCell(pos)->GetOwner() == -1){
cost *= 10000;
}
entry = ASTAR_CAN_ENTER;
return TRUE;
}
else{
return TRUE;
}
}
That does a lot I wanted to see in and it should also bypass polluted tiles, because road improvements cannot be build on dead tiles, therefore terrainutil_GetTerrainEffect returns NULL and a dead tile is avoided.
-Martin
|
|
|  |
 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
OK, I'll try with it... it seems effectively quite better... (I just applied what I'have done for units, it was less appropriate for roads)
|
|
|  |
 |
|
Martin Gühmann
|
 |
Berlin, Germany
Mar 2001 time: 06:34
|
|
quote: Originally posted by E
Are you guys integrating some of the modded AI stuff too? I could see frenzy AI suitable for some personalities or if your reputation drops. |
Why should we integrate frenzy AI into the game, it is actual just a bit of slic code, that is actual not very effective. I think the current AI is already better then Frenzy AI, maybe we need bigger stacks, but if you share with an AI the continent then you should get some decent attacks. Maybe the stack size has to be increased. But I think the main goal should be that the AI can coquer other AIs, even on different continents. So if an AI cannot conquer another AI how should it being able to conquer a human civ.
quote: Originally posted by E
OK, I'll try with it... it seems effectively quite better... (I just applied what I'have done for units, it was less appropriate for roads) |
Overall I think I have the road part done. For the blocked part, I think the EntryCost function is the appropiate place to do it, but for the dangerious tile part we have to wonder whether this is the best place, because increasing the costs here means to return a wrong number of needed turns, for the human player. Alternativly the additional coasts are only given if the player is an AI.
-Martin
-Martin
|
|
|  |
 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
quote: Originally posted by E
I have another annoying uestion regarding AI.
Is there anything in the code that changes the AIs attack behavior depending on the Human or other AIs strength. |
There are bonuses for each goals that are applied :
PowerBonus
EnemyValueBonus
AlliedValueBonus
So Ais behavior will change depending on others strength, but AI don't have a real strategy :
It has several goals (defined in 'goals.txt'), and it affects units foe each goals. It has not global strategy, each army is working for itself. No massive attack, or invasion are planed. It happens several times (And with my latest tests Ais is able to invade another 10 cities civilization), but its only a succession of SEIGE goals).
quote: Originally posted by E
Specifically, If a player develops nuclear weapons the AI should:
1) increase the use of spies and try to steal nuke technology
2) once it has nukes of its own threaten a mutually assured destruction scenario
3) when both have nukes the AI should use more Special/stealth units (almost Frenzy like) against the player to avoid a full on war but still try to achieve objectives through covert means.
I'm not advocatin scripting a whole new AI but I'm hoping there is something there that changes behavior depending on the situation.
I do think making the threat of nuclear annihilation from the Ai plausible could change the tedium of the late game also make the conquest victory less likely since its easier to do it with modern units, but the nuclear check would prevent that. |
As I said, AI don't have global strategy... I didn't find anithing about AI changing its strategy during the game. It's always the same strategy, but the goals become available with advances.
It would be a great job to introduce special AI comportments (depending on situation), but also lot of works...
For the moment, we are working to enhance the existing AI by giving it the possibility to achieve thei goals (too many units are blocked (no path, no transport,...)). maybe when it 'd be done, we will concentrate in that objecive.
Now I'm back, I'll post reports and new modifications ASAP...
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:34
|
|
I think we should re-examine the way that armies are implemented.
There's always been a problem with having planes and land units in the same army. For one thing it's
(arguably) unrealistic and for another it messes up the AI.
Also, it's always struck me as being a bit silly that when you attack a coastal city you can find your
land units fighting sea units.
So, I propose that we keep land, sea, and air units in separate armies. In both Civ3 and RoN they keep
planes separate from land units but I don't really like either of the ways they've implemented the
separation.
This is going to entail a lot of work and I'm not at all sure of how we should begin. Each cell has a
CellUnitList *m_unit_army. Perhaps, we can start by adding two more such lists to the cell: m_unit_sea
and m_unit_air. Notice that this would mean that in a coastal city you could have up to 36 units present.
Also, it would mean that we have to change the UI so that you can toggle between which unit list you want
to see and manage.
Anyway, if we were to implement a system like this it would mean that we could rewrite some of the AI
code and, I think, make it more effective.
|
|
|  |
 |
|
Maquiladora
|
|
quote: Also, it's always struck me as being a bit silly that when you attack a coastal city you can find your
land units fighting sea units. |
I like the idea of splitting them to help the AI but what would happen if say 12 tanks attacked a coastal city with 12 marines, 12 fighters and 12 battleships inside? Would the 12 attacking tanks only engage the 12 marines in battle? and if so what happens to the battleships and fighters? The fighters and battleships could take a free shot at the tanks before the tank v marine battle begins, and if the tanks still win, then the fighters and battleships would have to scramble outside the city, which is a bit weird.
|
|
|  |
 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
Hi, I posted on 'altered sources' a new update to my Army movement patch (1.2)
This time, I think the AI armies movement is quite better on ground, with grouping, seiges,...
I mostly fixed some cases were units were blocked during the 'rally' phasis, and integrated the check methods in UnitaStar into the entrycost method.
Agressive AI are now able to win the game
(as the example here : English wins by conquest in 1980, (small map with continents, with 5 civs, moderate) !
I'll now work on transport and AI behavior with sea and air units.
Perhaps it will be time to post a new playtest ?
About separating armies by movement type, I agree with Martin, we have to respect the 12 max limit, and we'll restricted the units that can be grouped together.
Attachment: testarmymovement1.2.jpg
This has been downloaded 180 time(s).
|
|
|  |
 |
|  |
 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
quote: Originally posted by Martin Gühmann
I looked into it, and it looks like that the checks are at the right place, however the CheckIsDangerForPos doesn't look finished. One think to note is that the units aren't in danger, when the other one is an ally.
-Martin |
That was the second step I prepared (the code in comments). I had a problem with getting the diplomat global variable (when I include the diplomat.h, I have a lot of errors, I actually don't know how to solve them).
About Code enhancement, I'll do it.
About missing files in list, I was impatient to post the update, I don't check it twice. I'll do my best next time .
quote: Originally posted by E
calvitix,
Did you see any AI stuff that may make the AI seek out goods and defend good tiles or even try to take them from other players?
|
No, I don't think there is anything in that way. We can perhaps add a bonus for the SEIGE goal if there is good in city range (or for particular building as wonder).
|
|
|  |
 |
|
calvitix
|
|
Strasbourg (North-Est France)
Jun 2003 time: 05:34
|
|
Thanks for reports.
I'll Add them to my TODO list.
Here's a list of problems about sea transports :
1. Armies doesn't regroup before going into transport, so most of transport are not full.
2. Transport are very often attacked (they have to be protected)
3. Armies with Seige goals are unload too near to the enemy city (they are bombarded before they can be all regrouped)
4. The units in transport that have a defend goal aren't unload in the city (but stay in cargo)
I'm now working on those problems for the moment
quote: Originally posted by Martin Gühmann
Two problems I saw are:
1. I saw goals assigned to units that cannot reach a spot, because there is water on the way. They were stucked for ages.
|
I think what you see (with armytext) is the last goal that have been tested for that unit (after the match cycle), I didn't write NO_GOAL anymore, because there was a problem with somme goals.
But there is still a problem : units have to have a goal each turn. (the problem is linked with the Match_Cycles,
we have to find a way to test all the possible matches without too much time consuming...)
quote:
2. Another problem is that the AI doesn't build enough special units, I just saw one Slaver and only one city with a slave. Actual I wat to see cities with a lot of slaves. That way the AIs are more warmonger and not such peacy milksops.
|
I didn't want to work on cities production for now (they is still a lot to do with army movement...), but I agree with you. We have to rebalance a little bit : all the AI are now aggressive)
|
|
|  |
 |
|
UGHQ_Tempus
|
|
If I'm reading this correctly, the "sea" issue is the lack of coordination between islands and continents.
Sounds like we'd need to make a global manager and then make manager instances for each island/continent that the AI has units (or cities) on.
I haven't really looked over the AI code so I have no idea if this is able to be added within the context of this game. I'm just brainstorming.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:34
|
|
Can any one of you help me check where the ai picks the destinations for exploration goals? I can't find that in the code (I am unfamiliar with the code structure).
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:34
|
|
Sounds like you're looking for CtpAi::AddExploreTargets.
|
|
|  |
All times are GMT. The time now is 05:34. Apolyton Time is 00:34. |
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
|
|
|
|
|
|