The unit iterator

a place to discuss it

Moderators: Deathifier, Sukayo

Grimly
Assasin
Posts: 158
Joined: Mon May 17, 2004 1:01 am
Location: Philadelphia, PA

The unit iterator

Postby Grimly » Thu Oct 26, 2006 4:14 pm

The unit iterator consists of 7 entries under that header in the EXE file. Normally, this section is set to force building of Garrison units (2xPTS, flak, AT, arty, militia, infantry). It can be edited to force building of any 7 units, although some are ignored and some cause issues (Symbiot units are controled in another section). In my mod, I have found the following to be useful:

00BB91C - 000BB934: Sets garrison units: all slots = 28 (Electors), 34 (Clergy), 35 (Engineers), 54 (Militia).

(Electors are unique to my mod and appear to be necessary to allow the AI to declare for Emperor.)

I've been trying to use the Iterator to make the AI build enough Engineers to build a robust economy, but not too many, to build enough Mililtia to defend itself, but not too many, etc. Basically, the game was not intended to last more than 45 turns and after that the AI goes crazy with any units it's forced to build---unless, perhaps, its resources are limited by swapping harvest.dats or changing to a new unit.dat with higher unit costs.

After having observed hundreds of robot games with different combinations of settings here and in the Unit.dat, I have some observations to report. The following slots affect EFS in the stated manner when they are turned on in the unit iterator.

(1) Militia: Aggressive, continuous, and intelligent building; planets full of cities and militia. Few declarations for Emperor. Few infantry built, slow tech acquisition. Aggressive action versus rebels and ruins. The Church builds too and becomes entrenched wherever it owns cities.

(2) Engineers: Aggressive, stupid overbuilding (such as suddenly covering half of Stigmata with electronics cities) but aggressive tech gathering; advanced units such as hovertanks, rangers, etc. appear within 20 turns. MUch of this is probably due to even more aggressive attacks on ruins. More declarations.

(3) Electors: Aggressive electioneering; frequent war on BS.


Putting all these together is a compromise solution. But changing the EXE file (making different versions and labeling them Early, Middle, Late or whatever) DOES work on the same saved game. That is, starting with the EXE with Militia turned on in the UI causes the AI to build Militia in every nonbuilding city. Saving that game and firing up a version with Engineers turned on causes the AI to stop building Militia and start building Engineers.

I can't observe whether all the secondary effects occur because that requires letting the game run, but I can tell these primary effects occur.
Grimly

domingo
Fighter pilot
Posts: 21
Joined: Tue Sep 06, 2005 1:01 am
Location: BA, SVK

Postby domingo » Thu Oct 26, 2006 4:26 pm

And what about clearing the unit iterator (for example filling it with units the AI ignores ...) ?
How does AI cope with this ?

Grimly
Assasin
Posts: 158
Joined: Mon May 17, 2004 1:01 am
Location: Philadelphia, PA

Postby Grimly » Fri Oct 27, 2006 6:30 am

Good question. The effects I've seen are basically <i>positive.</i> That is, when you subtract those units from the picture, you get no effects. When Engineers are off, Engineers are built at a decent rate (depending on many other factors of course) and building is fairly intelligent but not aggressive. It takes years and years to attract to nearby metal deposits, but Wells and Farms are built (with Engineers on, Wells are not built---the AI loves mines!). Tech is not actively pursued beyond Tracker or so. I should have also said that when the tech race is hot (Engineers ON), I see many, MANY more spaceships.

When Militia is off, infantry are built, depending on the tech available. [up to Trackers or Rangers, Assassins, PALS, etc.]

When Electors are off, the AI is not very interested in building Electors, but that is harder to read.

I tried using all together, but that was frustrating . . .

When other units are set, I haven't observed any great changes, but then I have focused only on the important ones. The AI will do light tanks, etc. with no trouble. I have a Clergy unit that might cause late-game crashes but nothing else.

Nobles and Peasants are never built.

The funny thing is that these variations seem to have nothing to do with the amount of resources spent. Although I should note that I use food input to control infantry production. But if Militia need 25 and Engineers need 50 food, then it is the latter that should interfere with infantry building, not the former.

I should also note that I have Militia and AI Engineers set at 99 for structure; Electors use Palace, Church, Shield and use 100 food. So the only direct competition is between the first two units.

[Somebody should try this in basic EFS!]
Grimly

Grimly
Assasin
Posts: 158
Joined: Mon May 17, 2004 1:01 am
Location: Philadelphia, PA

Postby Grimly » Tue Oct 31, 2006 9:18 pm

Domingo, I didn't really answer your question. When the iterator is cleared (all set to 00, since setting all to 99 or something seems to increase the risk of crashes), the game runs fine. Normally, Engineers are NOT set in the iterator, so they behave as usual. When the Garrison units are off, they simply aren't built at all, except for PTS units, which are built OK (they aren't foot units so they don't drop off the combat build table like militia do). This means planets are not crowded with militia and guns, all shuffling around like zombies. Rebel forces last longer when militia are not force-built, because all those militia stacks jostling around tend to scrub the map clean of any rebels.

That's about it, really.

You could make Militia and Guns into crawler units and they won't fall off the table.
Grimly


Return to “Fixing it ourself”

Who is online

Users browsing this forum: No registered users and 26 guests