Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > Questions about Frenzy code
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:18
  Old Post 02-03-2002 06:56 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Questions about Frenzy code Support Apolyton buy from Amazon

From what I have read, the frenzy code gathers up the AIs units into armies, and moves them to the borders of your civ whenever war is declared. Is this correct, and is this all that it does?

If this is all, then it would seem to hurt a weaker AI, who could not use those units for defense, and even with a stronger AI I think they would attack anyway if they are on the same continent as the human.
If the frenzy code can get the AIs to launch credible amphibious invasions, though, then that indeed would be a big score in its favor.
I have never played with the frenzy code, so general observations on it are also welcome.
I am working on an update to Crusade, and I would like to know if this code is worth implementing and why.

Btw, I was going thru the strategies.txt, lowering the time to fix pollution, and saw that the setting was missing from the diplomatic AI. This may account for why some civs don't clean up their pollution.

Also, anyone who has played with the AI able to terraform, please give me evaluations on how they handled it. Usually, if an AI ability is coded into the game, but "turned off" like this one was, it means that the AIs could not intelligently handle the ability. I am thinking about putting this up as a beta after I get the update released.

Leonidas is offline Leonidas
King

May 2000
time: 05:18
  Old Post 02-03-2002 08:00
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Civilization 2

If the AI can handle sea battles, carriers, etc, then it might be possible to design a great WWII Pacific War scenario.

The inability of the AI in CivII to use carriers properly, really hindered this type of scenario. . .

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:18
  Old Post 02-03-2002 19:35
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Avatar Enlargement: We've got the solution

I do play with frenzy, but not in craddle (In my mod). So I have made some changes in the code to fit into my mod like add my special units and increase the AI hate increase over the time. And I do see some big AI Stacks walk around frequently. I just dont know how different from the Original Game it is.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:18
Post  Old Post 03-03-2002 00:13 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Re: Questions about Frenzy code Support Apolyton, buy Civilization 2

quote:
Originally posted by WesW
Also, anyone who has played with the AI able to terraform, please give me evaluations on how they handled it. Usually, if an AI ability is coded into the game, but "turned off" like this one was, it means that the AIs could not intelligently handle the ability. I am thinking about putting this up as a beta after I get the update released.


Actual it is a question if they just disabled the possibility of terraforming for the AI or if they had just no time to finish it. So far the only problem is preventing the AI from terraforming goods but I already offered a slic sollution.

Martin

WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:18
  Old Post 09-03-2002 10:32 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Put an end to popups!

Guys, any comments here?

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:18
  Old Post 09-03-2002 16:48 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Re: Questions about Frenzy code Support Apolyton buy from Amazon

From what I understand (without having studied the issue in detail), the Frenzy code from Cradle is a bit different from the one BlueO originally made, it's far less destructive to the AIs. Dave and some other people might know more about that than me though...

quote:
Originally posted by WesW
From what I have read, the frenzy code gathers up the AIs units into armies, and moves them to the borders of your civ whenever war is declared. Is this correct, and is this all that it does?


What it appears to do, is to find for all AIs an army which is can be used for a Frenzy attack and the human city that is closest to this army (so the army can be sent to a tile right next to this city). Armies used for this are armies which fortify outside a city and which are of the right size (what size this is depends on the 'hatelevel' the AI has towards the human). While the armies are moving towards their target, they also group with other units along the way to form larger armies, but this only happens outside cities and with combat units (so no settlers or anything).
quote:
If this is all, then it would seem to hurt a weaker AI, who could not use those units for defense, and even with a stronger AI I think they would attack anyway if they are on the same continent as the human.

AFAICS, it only uses armies that fortify outside cities, armies who apparently don't have anything useful to do anyway. So the drain on defense is minimal, in most cases. And of course, don't forget that offense is often the best defense (this wasn't the case in the original Frenzy code but as I said, the Cradle version is a little more sophisticated).
quote:
If the frenzy code can get the AIs to launch credible amphibious invasions, though, then that indeed would be a big score in its favor.

This code is certainly equipped to make the AI use it's navy in an aggressive fashion but there's no code specifically designed for making AIs use transport ships or anything, so I don't know how much it really helps for amphibious invasions.
quote:
I have never played with the frenzy code, so general observations on it are also welcome.

Well, Cradle changes a lot more than just Frenzy of course, but Cradle's AI does a really good job both in offense and in defense, part of this no doubt because of Frenzy.
quote:
I am working on an update to Crusade, and I would like to know if this code is worth implementing and why.

Adapting the code for Crusade wouldn't be terribly much work so I say it's certainly worth a try...

quote:
Btw, I was going thru the strategies.txt, lowering the time to fix pollution, and saw that the setting was missing from the diplomatic AI. This may account for why some civs don't clean up their pollution.

That's cool.

quote:
Also, anyone who has played with the AI able to terraform, please give me evaluations on how they handled it. Usually, if an AI ability is coded into the game, but "turned off" like this one was, it means that the AIs could not intelligently handle the ability. I am thinking about putting this up as a beta after I get the update released.

I haven't yet (not much anyway), so I can't help you here.

hexagonian is offline hexagonian
King
Gnawing on your mind...
Jun 1999
time: 23:18
  Old Post 09-03-2002 18:24 Visit hexagonian's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Call to Power 2

Wes,

Locutus pretty much summed up the Frenzy setup in Cradle. BlueO had released a weakened version of Frenzy, which is the base that I used in Cradle. If you look at the in-code notes/readme, you will see what BlueO did. The most important thing, IMO, is he does have different levels of Frenzy that can be adjusted within the code - so Suicidal Frenzy can be pushed back to the late game.

There are still some things I would like to have addressed - the most pressing one is that when an AI takes a city from a human, sometimes it will vacate that city as it continues to press on, but the Building Destruction SLIC code is a nice counterbalance - retake the city and it is gutted...

However, in Cradle, the AI defenses do stay strong. And Frenzy does do one thing very nice - it brings multiple civ armies into your territory (almost like having a knife over your head) I don't know how many times I planned an assault in Cradle and had some other civ attack my cities when my forces were abroad...and this is good. You do have to have a high setting for SEIGE and ATTACK in strategy.txt so that those armies will be more of a threat too.

One thing that I am glad to see that you did for your MedMod update is to boost the settings in DiffDb. I have been making that suggestion for a long time now.

It seems that you already have Frenzy as an option in MedMod, but I would suggest making that option as an official ModSwapper entry (a nice feature of Modswapper) so that players can pick and choose easily.

It is good to see you back here too.

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:18
  Old Post 10-03-2002 04:13
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Put an end to popups!

Although I've glanced at the Frenzy code before, I'd never actually gone over it line by line until today. Here's some of the things I found:

1) It's no good for Multiplayer: In 'FAI_set_AttackTarget' the targets that the AI civs are aiming at are set at the end of a Human player's turn. If there's more than one Human player, these targets will be constantly changing and the AI's armies will mostly wander aimlessly.


2) In 'FAI_Initialization' the following is supposed to happen before the game starts (pre the Barb's beginturn):

code:
i = 0; while (i <= FAI_MAXPLAYERS) { // try all possible players player[1] = i; if (player[1].units > 0){ //true when i=1 GetArmyByIndex(player[1], 0, tmpArmy); i = FAI_MAXPLAYERS; // break the loop } i = i + 1; } for (i = 0; i <= FAI_MAXPLAYERS; i = i + 1) { FAI_PlayerAge[i] = 1; //these work FAI_HateLevel[i] = 0; FAI_FirstArmy[i] = tmpArmy; //the Human's settler? FAI_SecondArmy[i] = tmpArmy; //the Human's settler? FAI_AttackTarget[i] = tmpArmy.location; //ditto }


But at this point in time, no-one's got any proper armies, just settlers. So as I see it tmpArmy is either going to be the invalid one or an army that contains a settler.

3) In 'FAI_New_Age' there's a problem in the bits that go:

code:
for (i = 1; i <= FAI_MAXPLAYERS; i = i + 1) { if(IsHumanPlayer(player[0]) && FAI_HateLevel[i] <= 25) { FAI_HateLevel[i] = FAI_HateLevel[i] + 5; } }


It's necessary to check "IsPlayerAlive(i)" because FAI_MAXPLAYERS is set to 31. So presumably the FAI_HateLevels weren't being incremented properly, but this is fairly benign.

4) The handler 'FAI_hate_level_city_capture' is set to run "post", after a city's been captured. But consider:

code:
if (IsHumanPlayer(tmpInvader) && !IsHumanPlayer(tmpCity.owner) && FAI_Init == 1000) { FAI_HateLevel[tmpCity.owner] = FAI_HateLevel[tmpCity.owner] + 7;


Since the city has been captured, tmpInvader==city[0].owner and the condition will never be fufilled.

5) In 'FAI_hate_level_city_nuke', there's a similar condition involving player[0]. But there is no player[0] passed by this event.


Those are are fairly minor, but now there's some bigger ones:

7) The function 'FAI_AttackEvaluateLocation' is supposed to return the direction of a Human city or unit adjacent to tmpLoc (=evalLoc), the location being evaluated. But:

code:
for (i=0; i<=7 ; i=i+1) { GetNeighbor(tmpLoc, i, tmpLoc);


should be

code:
for (i=0; i<=7 ; i=i+1) { GetNeighbor(tmpLoc, i, nextLoc);


in order to 'look around' the tmpLoc tile. The former code does a sort of "ramdom walk".

7) The function 'FAI_CheckGroupage' returns 0 if the location of the army being checked is either a city or also has various civilian units on it. This is fine for early warfare but doesn't allow for planes, which could be captured by the grouping and probably run out of fuel.

8) The biggest problem is with the Handler 'FAI_set_AttackTarget'. This is supposed to find the nearest Human city to the AI's designated attacking army:

code:
for(j = 0; j < player[0].cities; j = j + 1) { GetCityByIndex(player[0], j, tmpCity); tmpDistance = Distance(tmpCity.location, FAI_FirstArmy[i].location); if (tmpDistance < minDistance && !IsUnderseaCity(tmpCity)) { if(IsContinentBiggerThan(tmpCity.location, tmpDistance) && IsContinentBiggerThan(FAI_FirstArmy[i].location, tmpDistance)) { GetRandomNeighbor(tmpCity.location, tmpLoc); FAI_AttackTarget[i] = tmpLoc; minDistance = tmpDistance; } } }


The second argument of "IsContinentBiggerThan" is supposed to be an area not a distance, but even if you were to put in
tmpDistance*tmpDistance, it still wouldn't necessarily work. I think that what he was trying to get at is "Can we attack them by land?" but SLIC has very sparse geographical vocabulary and I don't know how to express this. The above code will have unpredictable results: sometimes it'll work, sometimes not.

That's the point at which I realized that it would be hard work to fix this and so stopped looking. There's probably more problems to be found.


So given that this program is ridden with bugs, how come nobody's noticed? I think that the changes Dave made to Strategies and Goals are probably just as, if not more, important in making Cradle's AI agressive than the Frenzy code.

WesW is offline WesW
CTP1/2 Modification Site Admin
Florence, Al., USA
Jan 1970
time: 23:18
  Old Post 10-03-2002 08:27 Visit WesW's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Increase the size of your Attachments

Great work, Peter. Perhaps all this can be fixed. It is certainly good to know about it.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:18
  Old Post 11-03-2002 06:40
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Frenzy &amp; WAW Tired of ads?

I used Cradle's frenzy and strat/goal/diffdb/const.txt's for a base in World At War. I did change a few things to suit the more specific era of the MOD, ie: frenzy only uses the third frenzy level (modern era of the original script).

I've found that the AI is very good at defending/attacking now. I believe it's more to do with the txt files than frenzy. I think frenzy is just "getting the ball rolling" for the AI.

In my latest game yesterday (with the progressing 1.02 WAW), it was up to about turn 150. The AI and I all had marines/early tanks/fighters/M2 artys as our top units. I'd conquored one Civ in a 100 turn war to secure my continent, and in the process of that had ended up in a sub/battleship skirmish war with an AI on the next continent. After mopping up the first civ I amassed 3 stacks of 4/4/4 marines/early tanks/M2 artys for an invasion of his continent. I proceeded over, invaded and took one city. In the AI's turn, he used his extensive rail network to move stacks of 11/12 units with a good mix of marines/infantry regts/M2 arty's/fighters to kill off my stacks and reclaim his city. In one turn, he sent 4 of these stacks at me, and I defended successfully but was reduced to one stack of about 8. In my turn I moved two more stacks into the beachhead area to help the attack. The AI responded with 5 more stacks of the same to pound me into the sea and retake his city. And then to rub salt into the wounds, my battleship escorts and transport ships got attacked by roving subs and destroyers!!!

So for the next 50 turns I made 3 more attempts at getting a secured beachhead. And 3 times the AI pounded me into the sea. I was not a happy chappy!

In the meantime, over the last 150 turns, other AI's had been in wars as well. I was friendly with two other civs, and all 3 of us were swapping maps frequently due to our peace treaties. In that time I watched two civs pincer a civ between them and WIPE THEM OUT!

So my point is, the AI knows how to attack and defend well. I don't think frenzy is doing THAT much to the AI. I think it's my combination of low amounts of improvements, higher movement rates and Martin's ComForAIs slic that allows the AI to pay for huge mobile armies.

But I will say, I got a hellova shock from the AI!

Hope this helps Wes. With a combination of all our individual manipulations you're sure to get something out of all this. Note: I've gone for an extremely war-like AI. There's none of this diplomacy, scientific ***** victory stuff in World At War!

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:18.
Apolyton Time is 00:18.
    top of page
Rate This Thread:
archivepost
Forum Jump:
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
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0487 seconds (88.46% PHP - 11.54% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net