What happens when you run out of PW?
Announcement
Collapse
No announcement yet.
SAP2 AI V's other mods AI
Collapse
X
-
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
-
I think it won't be easy to balance where it hinders the human but not the AI.
I'm not convinced it will even the odds either, but it depends on the AI bonuses.
Also, it will probably cripple early-game warfare, and the barbarians will have a field day. I use almost all of my early-game PW in farms.
It'll certainly be interesting to see how it affects play.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
Well, if it's too crippling we'll have to moderate the costs, keeping the early game barb threat in mind. Hmm...seems like ancient and classical units might need proportionately less PW support (more self-sufficient, in other words). A legion can repair its own weapons and forage, an armored division is less able to do so.Originally posted by Immortal Wombat
I think it won't be easy to balance where it hinders the human but not the AI.
I'm not convinced it will even the odds either, but it depends on the AI bonuses.
"We" -- Easy for me to say, since I'm not a SLIC coder!
"...your Caravel has killed a Spanish Man-o-War."
Comment
-
Peter, Player1 wrote this.
What oyu think?
[code]
////////////////////////////////////////////////////////////////////////////
//Infrastructure SLIC v1.01
//
//This code fixes AI bug in which AI players, when trying
//to use Infrastructure or Capitalization, leave build queue empty.
//It detects cities with empty build queues and gives them
//15 per city pop PW and 10 per city pop gold bonus,
//lowered by PW tax percent value.
//
//Example:
// City size 28, PW tax 20%
// gives 28*15*(1-0.2)=336 PW and 28*10*(1-0.2)=224 gold bonus
//
// by player1
////////////////////////////////////////////////////////////////////////////
Code:HandleEvent(AIFinishBeginTurn) 'Infras' post { if(!IsHumanPlayer(player[0])) { // not human int_t i; int_t my_tax; //PW tax int_t my_pw; //toloal PW int_t my_capit; //gold from cities int_t my_infras; //PW from cities city_t my_city; player[0] = g.player; my_tax = player[0].publicworkstax; for(i = 0; i < player[0].cities; i = i + 1) { GetCityByIndex(player[0], i, my_city); if (!my_city.buildqueuelength && (HasAdvance(player[0], ID_ADVANCE_MASS_PRODUCTION) || HasAdvance(player[0], ID_ADVANCE_GLOBAL_ECONOMICS))) { my_infras = my_city.population * 15 * (100 - my_tax) / 100; my_pw = player[0].publicworkslevel; my_pw = my_pw + my_infras; SetPW(player[0], my_pw); //add pw my_capit = my_city.population * (100 - my_tax) / 10; AddGold(player[0], my_capit); //add gold } } } }"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Personally, I didn't mean for this to sound like its a problem on my part, because it is not. I've always looked at it as an AI civ's "strategy" more than a game flaw because every civ doesn't play that way. As Dale alluded to, it makes sense that the civs that have been at war (for a few thousand years sometimes) and sent huge stacks of troops all over the land mass pay the price in the end with poorly defended cities. And it makes sense that civs that are mostly peaceful are, as a rule, smaller but well defended. To me this is balanced. Plus I get a great deal of satisfaction from punishing aggressive civs in the end that tried to wipe me off the map at the start.
I'm not sure if a larger Army should be economically penalized. Large armies, especially at war, are actually good for the overall economy (the so called "War Time Economy"). And even in peace time where large armies directly drain government budget, the actual military personnel themselves put a great deal back into the country's coffers because of their unusual amounts of disposable income."Guess what? I got a fever! And the only prescription is ... more cow bell!"
Comment
-
Originally posted by TheArsenal
Personally, I didn't mean for this to sound like its a problem on my part, because it is not. I've always looked at it as an AI civ's "strategy" more than a game flaw because every civ doesn't play that way. As Dale alluded to, it makes sense that the civs that have been at war (for a few thousand years sometimes) and sent huge stacks of troops all over the land mass pay the price in the end with poorly defended cities. And it makes sense that civs that are mostly peaceful are, as a rule, smaller but well defended. To me this is balanced. Plus I get a great deal of satisfaction from punishing aggressive civs in the end that tried to wipe me off the map at the start.
I'm not sure if a larger Army should be economically penalized. Large armies, especially at war, are actually good for the overall economy (the so called "War Time Economy"). And even in peace time where large armies directly drain government budget, the actual military personnel themselves put a great deal back into the country's coffers because of their unusual amounts of disposable income.
Comment
-
Pedrunn,
I think that must be an early version. Here's the version from SAP:
This just gives each AI player a gold and PW bonus based on their population. Either player1 or Dale must have simplified it.Code:// // pw_cheat.slc // by player1 // ver 1.01 // // gives 5 gold per global pop evry turn, // gives 0-20 PW per global pop evry turn (depending of PW tax) // for AI players only // HandleEvent(BeginTurn) 'PW_Cheat' pre { int_t my_tax; int_t my_pop; int_t my_pw_level; int_t my_pw_points; int_t my_gold; if(!(IsHumanPlayer(player[0])) && (player[0] != 0)) { // not human my_tax = player[0].publicworkstax; my_pop = player[0].totalpopulation; my_pw_level = player[0].publicworkslevel; my_pw_points = my_pop * my_tax / 5; my_pw_level = my_pw_level + my_pw_points; SetPW(player[0], my_pw_level); //add pw my_gold = my_pop * 5; AddGold(player[0], my_gold); //add gold } }
I'm a bit dubious about the 'Infras' handler: I guess it works but I don't like the line "player[0] = g.player;" There's already a player[0] here, the AI player who's finishing his BeginTurn. I don't even know what that line does (if anything) in this context. I think you'd only want to do something like that in the very special circumstances where you're triggering on the UI: g.player will be the obviously human player who pressed the button and then when player[0] gets a value you can access the other members of the player array (like, player[0].militaryunits).
Another thing is that it doesn't actually solve the problem: there's a BuildListElement Infrastructure which you can find in some of the BuildListSequences but it doesn't seem to work. I say this because i) in Cheat mode I've never seen the AI civs using infrastructure, ii) if I put my cities under mayor control where they use those BuildListSequences, I've never noticed them go to Infrastructure, and iii) I can't construct a custom buildlist that contains Infrastructure.
So, when I said the AI doesn't use infrastructure, I should have said "yet". IMO, here's a better solution. Create a dummy building with a huge production cost and a BuildingBuildlist that contains only it:
Disappointingly, there's no way to access a city's production directly via SLIC, but:IMPROVE_QUEUE_INFRASTRUCTURE {
DefaultIcon ICON_IMPROVE_INFRASTRUCTURE
Description DESCRIPTION_IMPROVE_INFRASTRUCTURE
EnableAdvance ADVANCE_SLAVE_LABOR
ProductionCost 100000
Upkeep 0
}
BUILDING_BUILD_LIST_QUEUE_INFRASTRUCTURE {
Building IMPROVE_QUEUE_INFRASTRUCTURE
}
That is, if you divide the dummy building's production cost by the number of turns it will take the city to build it, you get how much the city is producing this turn. (This was Wombat's idea, neat eh!)Code:HandleEvent(CityBeginTurn)'InfrastructureWorkaround'pre { int_t cityPW; int_t playerPW; if (IsBuildingAtHead(city[0])== BuildingDB(IMPROVE_QUEUE_INFRASTRUCTURE)) { cityPW=100000/city[0].buildingtime; player[0]=city[0].owner; if (IsHumanPlayer(player[0])){ cityPW=(500*cityPW)/1000; } playerPW=player[0].publicworkslevel; SetPW(player[0], playerPW+cityPW); Event:ZeroProduction(city[0]); if(AtWarCount(player[0]) && !IsHumanPlayer(player[0]) ){ // if at war, stop AI queueing ClearBuildQueue(city[0]); } } }
And now you can use the above BuildingBuildlist in any of the BuildListSequences that you want. It allows a considerable simplification in them. For example, here's the Science BuildListSequence I'm currently using:
You'll get a chance to see more of this in my forthcoming mod, "Call to Bloodlust", which uses SAP as a base.BUILD_LIST_SEQUENCE_SCIENCE {//scientist: Top 0.3 ProductionCities, others Top 0.1 ProductionCities
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_SCIENCE }
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_PRODUCTION }
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_GOLD }
BuildListElement { WonderBuildList WONDER_BUILD_LIST_SCIENCE }
BuildListElement { GarrisonUnitBuildList }
BuildListElement { AllUnitBuildList }
BuildListElement { Freight }
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_GROWTH }
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_HAPPINESS }
BuildListElement { WonderBuildList WONDER_BUILD_LIST_GOLD}
BuildListElement { WonderBuildList WONDER_BUILD_LIST_HAPPINESS }
BuildListElement { BuildingBuildList BUILDING_BUILD_LIST_QUEUE_INFRASTRUCTURE }
}
As far as large armies go, I agree with The Arsenal, although not for the reasons he put forward. IMO, the AI needs LOTS of military units before it will do anything really interesting.
Comment
-
I fixed this in a different way. I just removed the Infrastructure and Capitilization from the AI builds list so they have now to build wonders, buildings and units. The mean goal was more units so that the AI send themto the slaughter at the front.Originally posted by Pedrunn
Peter, Player1 wrote this.
What oyu think?
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
-
I'd have usedCode:cityPW=(500*cityPW)/1000;
, but whateverCode:cityPW=cityPW/2;

Peter, any clues on when CtB will be out?Last edited by Immortal Wombat; August 3, 2002, 06:41.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
Actual these are two different scripts the one Pedrunn posted deals with the problem of empty build queues. This one should give the AI additional Gold and PW each turn per city if the AI has the according advance and the city has an empty build queue per city. The one you posted is the AI PW cheat, that gives the AI additional PW and Gold each turn. I don't use the infrastructure script, because I removed the infrastructure from the AI build list, so no need for me for this.Originally posted by Peter Triggs
Pedrunn,
I think that must be an early version. Here's the version from SAP:
This just gives each AI player a gold and PW bonus based on their population. Either player1 or Dale must have simplified it.
The player array, it was a pain in Dale's airunit script, with DebugSlic=Yes I got each time an airunit moved an array index 0 out of bounce error. I replaced the 0 by a 1 in that array and the error index out of bounce errors were reduced, in the end I was able to replace the player[] array entirely, and the problem was gone, just an occasional error in the DIP_EstabEmb is left, actual I would like to switch to your new DiploMod Peter, so is it now in a stage ready for use.Originally posted by Peter Triggs
I'm a bit dubious about the 'Infras' handler: I guess it works but I don't like the line "player[0] = g.player;" There's already a player[0] here, the AI player who's finishing his BeginTurn. I don't even know what that line does (if anything) in this context. I think you'd only want to do something like that in the very special circumstances where you're triggering on the UI: g.player will be the obviously human player who pressed the button and then when player[0] gets a value you can access the other members of the player array (like, player[0].militaryunits).
Yes Player1 actual gave back only the wasted work.Originally posted by Peter Triggs
Another thing is that it doesn't actually solve the problem: there's a BuildListElement Infrastructure which you can find in some of the BuildListSequences but it doesn't seem to work. I say this because i) in Cheat mode I've never seen the AI civs using infrastructure, ii) if I put my cities under mayor control where they use those BuildListSequences, I've never noticed them go to Infrastructure, and iii) I can't construct a custom buildlist that contains Infrastructure.
I hope you took a look on my GoodMod, so when it will be finished.Originally posted by Peter Triggs
You'll get a chance to see more of this in my forthcoming mod, "Call to Bloodlust", which uses SAP as a base.
I agree to this, if the AI doN#t attack you, you can build up an huge army in all the silence and suddenly attack and slaughter the enemy. That's the reason why I made this better AI slic file that groups the AI stacks and moves them into transports, you can see the results in the tournerment game, unfortunatly only in the late game, when the capacity of the transports increases, but I saaw a lot of AI cities that changed hands countiously. Unfortunatly the current public version of this slic file isn't totally bug free, only the version on my hard drive has no known problems with DebugSlic=Yes.Originally posted by Peter Triggs
As far as large armies go, I agree with The Arsenal, although not for the reasons he put forward. IMO, the AI needs LOTS of military units before it will do anything really interesting.
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
-
Natually, I've included GM1_Goods.slc: no mod can be without it. You know Martin, maybe you should consider renaming GoodMod because when people see 'GoodMod' they might be thinking 'I've got that already in Cradle (or MedMod)' and not realize that there's more to it than that.Originally posted by Martin:
I hope you took a look on my GoodMod
I haven't done any work on that side of diplomacy for some time. I'm not particularly happy with it: I want to tie the responses more into the AI player's current diplomatic state. But this means first sorting out what diplomatic states I want them to be in under which circumstances, and that's part of what I'm working on now.I would like to switch to your new DiploMod Peter, so is it now in a stage ready for use.
That's interesting, I've tried increasing the capacity of transports right from the beginning but still the AI won't use them. It looks like there's no way out except by doing it with SLIC.That's the reason why I made this better AI slic file that groups the AI stacks and moves them into transports, you can see the results in the tournerment game, unfortunatly only in the late game, when the capacity of the transports increases
That's a good question. I spent literally all day yesterday (till the wee small hours of the morning) tracking down a fault in it: more than half the time when I made contact with a nearby civ they would immediately go to war with me. I mean we want belligerency in the AI, but on turn 17? So I made some simple adjustments, and now they're a bit passive.Originally posted by IW:
Peter, any clues on when CtB will be out?
I'd really like to get it working in such a way that a human player isn't forced into a single strategy and if you make the AI too aggressive, that's what seems to happen.
Comment
-
I dunno. I've found the AI makes decent use of transports in WAW. The amount of times I've been naval invaded in WAW has surprised me. And I don't mean invaded by one unit. There was this one time at band camp......That's interesting, I've tried increasing the capacity of transports right from the beginning but still the AI won't use them. It looks like there's no way out except by doing it with SLIC.
Just kidding.
But seriously, one game I had an AI naval invade me using transports, escorts and landed infantry and tanks. FOUR TRANSPORTS FULL!
Comment
-
The question here is how big is the transport capacity of your transports, probably five units. The other question is what did you?Originally posted by Dale
I dunno. I've found the AI makes decent use of transports in WAW. The amount of times I've been naval invaded in WAW has surprised me. And I don't mean invaded by one unit. There was this one time at band camp......
Just kidding.
But seriously, one game I had an AI naval invade me using transports, escorts and landed infantry and tanks. FOUR TRANSPORTS FULL!
So far I thought it is possible to improve the AI just by modifying the text files. So I used slic to stack the AI units that hand an effect, it looked that the problem was that the AI didn't stack it's units. So I did this the next problem was that I found settlers in these stacks, so next stage sort the armies. Ok this was done then I discovered the AI would restack the settlers, so then they had to leave the stack. Another thing was that you shouldn't do it in a city. So I reduced the stack size in cities to allow the AI to produce new units. Then I didscovered that all the transports were empty, because the stack size was too big, so a ship loader was neccesary. So when ever now a ship comes to the cost and there is a huge stack then I will move all the units into the transport, but only if I can move into the transport more than four units or I can fill the transporter and the stack is on homeland. you can see the results in the tournerment thread were I posted a screenshot with an invasion, the AI used a stack of transporters no escorts, because it needed a deep water ships for the escorts and these one weren't available at that point.
For the better AI slic I recommend the version I posted in the tournerment thread. That is a debugged version with DebugSlic=Yes.
In the last tournerment with ApolytonPack I had more then 1000 years war with the Romans and all what I saw was some greek fires pillaging my cost, no invasion, even with one unit nothing.
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
Comment