Thread Tools
Old March 26, 2002, 01:46   #1
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 06:12
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
Help wanted - Engineer AI and batch files
Hi all,

I've been playing around with the idea of a scenario based around the HG Wells classic "The War of the Worlds" for ToT and I've run into a stumbling block.
This was intended for play as the humans (ie: British) defending against the Martian invaders in the year 1898.
One aspect I very much want to model is the spread of the Martian "Red Weed" as it was known and I've pretty much decided on making grassland/plain terrain transformable into this by the Martian engineer unit (Humans will not have engineers so will not be able to do this. Furthermore as it was extremely toxic to humans, no human city will be able to use red weed terrain for resources - house rule. Too hard to implement otherwise).
I did think of using flags to randomly change the terrains around Martian-held cities but this is rather inimical to any human/martian units on said terrain at the time.

Has anybody done anything similar with engineers before, "transforming" grassland/plain? Is it just a matter of making grs/pln less attractive than the red weed or do I have to exchange the positions of the grs/pln terrains for desert/jungle or somesuch for it to work. As this would involve fairly major work to the map its something I want to resolve before beginning placing cities, etc.


The second part involves whether or not it is possible to use batch files or similar to alter my rules.txt file at certain times in a non-linear fashion. For example: If the British research "heat resistant armour" to counter the martian heat rays, could a batch file be used to open rules.txt, search for the particular unit string, "armoured track layer" a/d/m = x/y/z and save it again as a/d/m ---> x/y+1/z?
This could then be followed at a later time by researching "enhanced powder" ---> x+1/y+1/z
or "ablative armour" ---> x/y+2/z. ie consecutive advances "build up" your forces abilities as you wish?
And similarly of course for the Martians when they aquired certain breakthroughs.

Input greatly appreciated
ravagon is offline  
Old March 26, 2002, 02:03   #2
hardjoy
Scenario League / Civ2-Creation
Prince
 
hardjoy's Avatar
 
Local Time: 23:12
Local Date: October 31, 2010
Join Date: May 2001
Location: Odense, Denmark
Posts: 305
Re: Help wanted - Engineer AI and batch files
Quote:
Originally posted by ravagon
One aspect I very much want to model is the spread of the Martian "Red Weed" as it was known and I've pretty much decided on making grassland/plain terrain transformable into this by the Martian engineer unit (Humans will not have engineers so will not be able to do this. Furthermore as it was extremely toxic to humans, no human city will be able to use red weed terrain for resources - house rule. Too hard to implement otherwise).
I did think of using flags to randomly change the terrains around Martian-held cities but this is rather inimical to any human/martian units on said terrain at the time.

Has anybody done anything similar with engineers before, "transforming" grassland/plain? Is it just a matter of making grs/pln less attractive than the red weed or do I have to exchange the positions of the grs/pln terrains for desert/jungle or somesuch for it to work. As this would involve fairly major work to the map its something I want to resolve before beginning placing cities, etc.
My guess would be that the "desirable terrains" are hardcoded to some extent. But if relying on the AI changing the terrain doesn't work, you could put in the desired terrain, when the AI wishes to do irrigation or mining (this it usually will always do when/if possible) -say, grassland will change to red weed before one can do irrigation. This will affect settlertype units too, but you can easily make the time needed totally unreasonable for settler type units, so that in reality only engineers will be able to do it without getting killed.
__________________
The Slim End Of The Long Tail -
Kaplak Stream
hardjoy is offline  
Old March 26, 2002, 02:24   #3
Case
Civilization II PBEMCivilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Emperor
 
Case's Avatar
 
Local Time: 08:12
Local Date: November 1, 2010
Join Date: Feb 2000
Posts: 3,057
You could use global warming to change the terrain
Case is offline  
Old March 26, 2002, 02:50   #4
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:12
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Here's something to consider. You can set a minimum government level for the AI to perform irrigation. Suppose you make the Martians a Fundamentalist civ. For a selected type of terrain, say desert, set the level for irrigation/mining at 4. Change 'yes' to the type of terrain you've selected to represent Red Weed (I'm sure I tried some of that back in the sixties ), say Tundra. Now only Martian units will be able to irrigate desert squares, and when they do, the terrain will be transformed to Red Weed.

; ai = Minimum govt level necessary for
; computer player to want to perform irrigate/mine
; 0 Never
; 1 Despotism
; 2 Monarchy
; 3 Communism
; 4 Fundamentalism
; 5 Republic
; 6 Democracy
;
@TERRAIN
Desert, 1,2, 0,1,0, Tun, 1, 5, 4, yes, 1, 5, 3, Pln, no, ; Drt

Obviously, the human civs will need to be restricted to gov't levels of communism or lower. You can't prevent human civs from taking advantage of the food provided by RW. But you can give it a low food value and then make the supermarket improvement available to the Martians only. They will then be able to expand as more and more terrain gets converted, while human civs decline. You'd have to tinker to find the right factors.
techumseh is offline  
Old March 26, 2002, 03:18   #5
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:12
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Re: Help wanted - Engineer AI and batch files
Quote:
Originally posted by ravagon

The second part involves whether or not it is possible to use batch files or similar to alter my rules.txt file at certain times in a non-linear fashion. For example: If the British research "heat resistant armour" to counter the martian heat rays, could a batch file be used to open rules.txt, search for the particular unit string, "armoured track layer" a/d/m = x/y/z and save it again as a/d/m ---> x/y+1/z?
This could then be followed at a later time by researching "enhanced powder" ---> x+1/y+1/z
or "ablative armour" ---> x/y+2/z. ie consecutive advances "build up" your forces abilities as you wish?
And similarly of course for the Martians when they aquired certain breakthroughs.

Input greatly appreciated
I'm not sure I follow this exactly. Do you mean changing the characteristics of EXISTING units as new techs become available, rather than making them obsolete? There's no reason why you couldn't do as you suggest using Batch files, it's just that you'd have to save, run the BAT file and reload manually each time.

Of course, you can do this for one (only) civ easily enough, by using Leonard's Workshop to automatically upgrade units.

Another idea is to see if you can speed up the disbanding of obsolete units by the AI by using the TakeTechnology event, eg:

@IF
Received Technology
receiver=English
technology=32(ablative armour)
@THEN
TakeTechnology
whom=English
technology=31(heat resistant armour)
@ENDIF

I really don't know if taking the pre-req tech accelerates the disbanding of units beyond just making them obsolete, but it might be worth experimenting with.

I hope this helps.
techumseh is offline  
Old March 26, 2002, 05:09   #6
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 06:12
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
Thanks for the responses so far.
To clarify a bit.

My concern re: the terrain is mainly based on whether or not the AI would actually do anything (other than irrigate which it seems to have no problem doing - even when there's no water nearby and it doesn't have any units to irrigate with ) to grs/pln-type terrains.
As these occupy the only 2 particular terrain slots upon which AI's build cities I don't know whether it is intrinsically capable of doing anything other than irrigating them regardless of how favourable I make it.
I didn't want to use the irrigate option as this would prevent the British from irrigating/farming the same terrain.
Mine would be another option instead of transform but again, as the AI in the standard game doesn't perform this operation on pln/grs terrain, I don't know if it would here either (plus then the player-controlled British would technically be able to ignore my nice house rules and start red weed farming all over the place. Human players = )

There would be only two civs, the AI Martians and the player-controlled British (So no other human civs that spread red weed around). The Martians are going to be in Fundy (good call tec ) and the British in either Monarchy or (Renamed) Communism.
The transform would be set at a low enough level that the Fundy govt would definately be able to perform it.
Map is basically just the UK so no desert/jungle terrains. I didn't really want them "weeding" the forests/hills as the British wouldn't be able to change these back to the original types if they retook a city.


Re: The batch files. I did want to change the characteristics of existing units rather than upgrading as otherwise I could very quickly run out of unit slots and I did want to do the same for both the Brits and the Martians. Techs would only be discovered every 5-10 turns so the reload thing shouldn't be too much of a bother.
Didn't really explain it very well but what I wanted to do was to run a script to find the lines of one (or several) units, find a particular column representing a parameter and add something to the number (or reduce it if it happened to be the humans defense value and the Martians discovered armour penetrating heat rays ) whatever the (variable) number was and re-save. This would become enormously (exponentially) complicated if done with set rules.txt files with even just 2 civs and a few units affected on each side by a few different techs.
I've never seen it done before and I'm not sure its possible using normal tools...

[Damn, have to go as we're having a server shutdown. Back tomorrow. cheers ]
ravagon is offline  
Old March 27, 2002, 03:09   #7
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:12
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Re: the transform issue. I'm not sure what factors influence the AI to transform terrain, if any. Sorry.

Re: the BAT file issue. One possiblity is Angelo Scotto's CSPL program. It has never to my knowledge been used in a scenario, but it's potential is enormous. It's a program which does hex editing to the game file, WHILE THE GAME IS GOING ON. It's programmable in the same general way as events are.

Here's the description:

CSPL is a C++ library used to access Test of Time memory while ToT is running. You can see CSPL as a new events language very powerful (and complex...) to realize new scenarios, anyway, since CSPL simply modifies Tot memory you can also use it to realize in-game utilities or mod-packs which drastically changes civ game rules. As you can imagine the only drawback is that you need to know a bit of C language to code CSPL programs. (CSPL should be used with Borland C++ 5.5 compiler which can be downloaded for free from borland web site)

You can download it from the Cradle of Civ site, here: http://coc.apolyton.net/utilities/index.shtml
techumseh 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 18:12.


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