Thread Tools
Old December 2, 2000, 06:31   #1
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
Help needed! Adding unit categories.
Here are a few of the lines in strategies.txt that set the percentages of unit types that the AIs build. The problem is that there are only five of them, these three below for land units, and one each for sea and air units.
I think this explains why I never saw the AI build anything other than Submarines and Bombers in my beta games. (No Battleships or Destroyers, no Intercepters).
There are another set of categories for building a set number of settlers, transports and other special units, so that is why you see those units.

// Unit Percents must total to 1 (100%)
DefensiveUnitsPercent 0.15
OffensiveUnitsPercent 0.10
RangedUnitsPercent----0.15

Anyway, I tried adding new categories, but these "tokens" are hard-coded into the executable file, and if the game finds one in strategies.txt that doesn't match one in the exe file, then it crashes.
This was not how it was in Ctp1. Five categories for all conventional units is totally inadequate, unless the game looks at something else in deciding what to build.

What I need are instructions on how to add new categories to the game, either by modifying the exe file, or maybe something in slic.
Or, if an Activisioner could explain how the five categories are sufficient to provide a well-balanced AI force, I would be very interested to hear that as well.
[This message has been edited by WesW (edited December 02, 2000).]
WesW is offline  
Old December 4, 2000, 16:07   #2
Azmel2
Settler
 
Local Time: 09:42
Local Date: October 31, 2010
Join Date: Aug 2000
Location: Santa Monica, CA USA
Posts: 9

WesW,

Each category has a corresponding build list. You can specify as many different build lists as you want by adding new entries to the UnitBuildLists.txt file.
If you wanted the AI to adopt a strategy inwhich it focused on submarines, you could create a trigger to load a new strategic state that redefined the SeaUnitList from UNIT_BUILD_LIST_SEA (the generic sea unit list) to UNIT_BUILD_LIST_SEA_SUBMARINES.

The default build lists we use provide a good mix of units, but obviously a human player will be able to discern much more subtle distinctions of unit category. If as a mod maker you wish the AI to use more categories than the ones provided, you will have to do it by detecting when a situation exists that requires a special purpose build list and triggering
a new strategic state to load it.

In CTP1 you really had no categories at all. It was just a bunch of unit build lists with priorities. The AI would try to build off the highest priority build lists first, but interleave them with lower priority build lists as it became satisfied.

Using the CTP1 system you had to practically graph out the build lists and priorities to get it to interleave units properly. Do you really prefer that system over the current one? I think few people did and that our new system will make it possible for more people to customize the AI.

You also had to use the .fli system to load in different AIP files to adjust the priorities of unit build lists. This is equivalent to the loading of new strategic states in CTP2 using SLIC as I described above.

I hope this helps clarify how to use the CTP2 build lists system.

Best wishes,

-- Richard


quote:

Originally posted by WesW on 12-02-2000 05:31 AM
Here are a few of the lines in strategies.txt that set the percentages of unit types that the AIs build. The problem is that there are only five of them, these three below for land units, and one each for sea and air units.
I think this explains why I never saw the AI build anything other than Submarines and Bombers in my beta games. (No Battleships or Destroyers, no Intercepters).
There are another set of categories for building a set number of settlers, transports and other special units, so that is why you see those units.

// Unit Percents must total to 1 (100%)
DefensiveUnitsPercent 0.15
OffensiveUnitsPercent 0.10
RangedUnitsPercent----0.15

Anyway, I tried adding new categories, but these "tokens" are hard-coded into the executable file, and if the game finds one in strategies.txt that doesn't match one in the exe file, then it crashes.
This was not how it was in Ctp1. Five categories for all conventional units is totally inadequate, unless the game looks at something else in deciding what to build.

What I need are instructions on how to add new categories to the game, either by modifying the exe file, or maybe something in slic.
Or, if an Activisioner could explain how the five categories are sufficient to provide a well-balanced AI force, I would be very interested to hear that as well.


Azmel2 is offline  
Old December 5, 2000, 00:29   #3
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:42
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
Thanks for your reply, Richard, though it is disappointing to hear that slic will be required to do what was a simple addition to the aips in Ctp1.
Am I interpreting your comments corretly to mean that there can never be more than five categories active at any one time?

Yes, I do prefer the Ctp1 system. The priorities in Ctp1 were like the goals in Ctp2. You could set whether an AI built offensive or defensive units first, and more importantly what supporting and special units were built before others. You based the numbers of each type upon the number of cities, so all I had to do was ask myself "About how many Battleships do I usually have when I have about 15 cities?" Divide this number by 15, and there you have it. You didn't have to figure out how many offensive units you had compared to flanking units, and all other types, and making this sum to 100% like in Ctp2. (I ended up with specifying 01% Paratroopers in my proposed Ctp2 model.) And again, you could specify as many unit categories as you wanted.
Whomever designed the flis and aips tried to construct a very elaborate and elegant system. With the flis, they bit off more than they could chew, so to speak, but I found that the aips worked very well once you understood them, and that the elegance was largely achieved.

One thing I do like about the new system is the unit count token, where you can specify an exact number of certain units to build. This was sorely needed in Ctp1 for settlers.
WesW is offline  
Old December 5, 2000, 08:23   #4
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:42
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Well, I for one like the new system better. I agree it would have been nicer to have more than 5 build lists active at the same time, but linking the AI files to SLIC probably made it much more powerful. One example is being able to specify the exact number of units: if it wasn't possible already, you could have used SLIC to make it possible, which wasn't the case in CtPI. Though I agree that the CtPI system was very good and could have been even better if it had been more worked out and refined, I think the CtPII system will be even more powerful.

The thing is that in CtPI you could improve the AI by just experimenting a lot, more or less randomly try different values for different settings and see how it affects the AI in the game. With the CtPII system, you'll much more have to *design* the AI. First, carefully think about how you want the AI to behave under certain circumstances and then program it in (with SLIC). In the end, this gives you much more control over what you're doing and over your results.

The only problem with this is of course that it will require more thinking and (relatively) less experimenting and that you'll have to either learn SLIC yourself or 'hire' someone to do the dirty work for you

------------------
"The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents." - Nathaniel Borenstein
Locutus 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 05:42.


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