 |
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
First I'm sorry that I have never finished any announced projects in the past (I remember proposing 'Random Map Generator', 'Incremental Buying Automation', 'Oedo Year Alert', etc.) But this time I'm serious since I really see a good way for it to work!
First, I'm going to write a unitility program to KEEP AI FROM CHANGING YOUR CITY PRODUCTION.
Here's how it works: your city names can be as long as 15 characters, but you seldomly use all of them. Now, suppose you restrict your city name length to 10, then you have 4 positions to 'flag' your city information (the 11th place needs to be 00 so you only have 4 positions 12-15). The computer never bothers to clear the city names after a 00 so it is safe to do so. The program will copy the current production item of each city to the 15th position. Then, when your next turn comes, the production item recorded at the 15th position will be copied back to the city production byte. A flag will be set so this action will only take place once at the beginning of your turn.
Next, I'm going to expand the program to EFFECTIVELY GROUP YOUR CITIES TO PERFORM FUNCTIONS IN BATCHES.
Here's how it works: you go to the city screens and rename your cities to the 14th position, then rename them back if necessary (since some events depend on city names) so that the flags at positions 12-14 will be set. The Utility program then checks the flags to perform certain tasks for you. For example, suppose you want to hire all citizens as scientists in Moscow, Stalingrad, and 10 other cities. You go to each city and rename them so a flag 'a' is set at position 14. (Rename Moscow as Moscowaaaaaaaa, then rename it back to Moscow). Then run the utility program, and all the above cities will change all citizens to scientists (if city size >16 then the rest will be entertainers). Then you can do some adjustment of your own in each city. Similarly a flag 'b' at position 14 will hire all citizens as tax collectors; a flab '1' in position 13 will incremental buy a red guard for 100 golds automatically, and so on.
Last edited by Xin Yu on 09-12-2001 at 09:55
|
|
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
This utility is solely for keeping AI from messing up with your production. Works under WinME, civ2 MPE version. Should work under other Windows platforms. Does not work for TOT or FW.
Copy this file to your hard drive and make a shortcut for it on your desktop. Then, after MPE is running, click on the shortcut to run lazyciv.exe. You don't need to worry about AI changing your production in PBEM.
Very Important: If it is your first turn, launch Lazyciv AFTER you take control of your civ; however if you have already played a turn, then launch Lazyciv AFTER MPE IS RUNNING BUT BEFORE YOU TAKE CONTROL OF YOUR CIV (i.e., launch Lazyciv when you select your civ).
This is because the program saves your building queue in certain places, and before your first turn those places consist nothing but garbage. If you launch too early then your city productions will be replaced by those garbage. However if you launch too late in subsequent turns then the program will not have a chance to recover your building queue before you take control of your civ.
Any of your cities with names longer than 12 characters will be truncated for storing building queue and shield progress information. To make sure the program works, change your first city and last city in your F1 or F4 screen to long names (>12), if the names immediately get truncated then the program does work; if not, then you need to restart MPE and Lazyciv -- the starting position for city info block sometimes change, however if you try a couple of times it will come back to its normal starting position then the program should work.
Attachment: lazyciv.zip
This has been downloaded 25 time(s).
|
|
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
Only one download so far. Come on guys, I need your help! Please download it and test it in your next PBEM game. Thanks!
Next step: I'm going to create a micro-manager, and the layout is like this:
CityName Size_ Improvements Food__ Trade__ Science_ Tax____ Production_ Rush
Location_ H/C/U Cost, Maintain Cur/Tot Net/Tot _______ _______ Progress__ Cost
[Kalinin]_ 10___ (church)_____ 70____ 20____ 10_____ 10_____ (Red Guard)
25,35___ 5/2/3_ 40,1 [Sell]___ 100___ 30____ [Xinning] [Xinning] 20/30____ [25]
() -- pull down list
[] -- button, click on it trigger action: Go to city, sell improvement, Xinning (means changing all citizens to scientists or tax men), and rush-buying incrementally.
Also, a color schema will be used to indicate different status of the city:
City name: red=riot, yellow=content, blue=celebrating
Size (indicating status of the next turn):red=riot, yellow=content, blue=celebrating
H/C/U (happy, content, unhappy citizens): different colors indicating wonders/improvements for happy/content effect, and units for unhappy effect. (Green color for H means one citizen made happy by wonders/improvements, etc.)
food: current: grey=none, blue=harbor, yellow=supermarket, red=both; total: grey=none, red=granary.
trade: net: Colossus and superhighways will be indicated; total: airport will be indicated.
science, tax: grey: none, blue: +50% (Library), yellow: +100%, red: +150%, Gold: +200% or up.
Production: grey: none=vet, red=vet (indicating the city has barracks, airport, etc. for corresponding types of units).
Progress: current: grey: none, blue: +50% (factory), yellow: +100%, red: +150%. Total: KRC, offshore platform will be indicated.
Last edited by Xin Yu on 12-12-2001 at 00:11
|
|
|  |
 |
|
Marko
|
|
Tartu, Estonia
Sep 1999 time: 05:16
|
|
Hi Xin! Do you have any idea why AI sometimes changes production orders in ALL cities and moves some units in PBEM even when player has ended his turn with Ctrl+N and no cities are taken? That has happened at least in two PBEM games and is really annoying.
With your utility it is hopefully possible to easily change the production orders back but what to do with side-problem reported by FMK (only +1 shield between turns)?
|
|
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
Marko,
AI is more likely to change production when you lose a city. However when one of your cities is under siege and you lose a unit inside the city, production change may also happen. The AI cannot move units out of the city since it does not have control of your civ once you hit Ctr-N. The only situation this could happen is probably caused by the 'turn 1 effect': the starting civ of the scenario is not the white civ, so strange things happen when the white (or other civs before the starting civ) starts to play.
AI usually wants 3 or more defense units (i.e., units with AI role = 2 (?)) in a city. So if you have too few defense units the change will be likely. If you don't have any defense units in a city the AI may even rush buy for you.
My utility was a trial version. Since nobody gave any feedbacks I have already forgot about it. I'll look into it and see what happened. Besides FMK who else uses this program? Do they counter the same problem? If it's only him then maybe it's system related.
The program starts with a flag set to 1. Then it checks if the human player is currently playing. If yes, the information stored in the last 3 bytes of city names is copied to city production bytes and the flag is changed to 0. Once the flag is zeroed, information flow is reversed, i.e., city production items and shield productions are written to the last 3 byes of city names. When the human civ is not playing the flag is set to 1 again.
So the program should be loaded after civ2 is running but before the human civ takes control of his civ. If the human has already gained control (i.e., he has gone through reports and now can move units), then at this time loading the utility program will cause a turn's production to be lost. Or, if the system is superfast then civ2 may process city productions faster than the utility program, in this case production will also be lost.
Last edited by Xin Yu on 30-01-2002 at 02:53
|
|
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
Update: after days of searching, finally found the address which stores unit stats info. Each unit occupies 20 bytes, in the following order:
1-2: 16 flags (see 2, etc.)
3-4:00, can change but no effect
5: expiration tech number (FF=none)
6: domain
7: move times road modifier
8: range (number of turns in air)
9: attack
10: defense
11: health time 10
12: fire power
13: cost (number of rows)
14: carry
15: AI role
16: prerequisite (FF=none)
17-18: encyclopedia entry address
19-20: 00 (change will cause crash)
Except the last two bytes, all number can be changed. Including: change move to a number which is not a multiple of the road modifier; change health to a number which is not a multiple of 10;
Last edited by Xin Yu on 31-01-2002 at 20:53
|
|
|  |
 |
|
Xin Yu
|
 |
Emeryville, CA, USA
Jan 1970 time: 21:16
|
|
I downloaded the saved files and opened them using a hex editor. I found that none of the production information were recorded. Did you use Lazyciv on turn 1? You must use it on turn 1 in order for the information to be recorded, then on turn 2 you can retrieve them.
Last edited by Xin Yu on 29-03-2002 at 05:46
|
|
|  |
 |
|
SlowThinker
|
|
homeless, Praha, Czech Republic
Jan 2000 time: 06:16
|
|
I consider the game beginning (where you have to go through many menus) tedious enough. Especially with PBEM repeated Enters are not very entertaining.
I imagine a tool that would be registered under Windows as the program that opens files with .sav, .hot, .net extensions. Then you could launch Civ2 files directly from the Explorer/WindowsCommander etc. by pressing the Enter key.
The Civ2 program writes the default menu choices (they are highlighted after the Civ2 launch) in the file Civ2.dat . The tool could remember appropriate Civ2.dat file for every savefile extension (.sav, .hot and .net). If asked to open a savefile it would rewrite the Civ2.dat file to the appropriate one, then send to the Civ2 program a necessary number of "Enter" keys and the full path of the savefile into the load file dialog.
I suppose the job is relatively easy: to start the Civ2.exe file as my subthread, to send "Enters" to the Civ2's message queue and to send the full filename into the open dialog (as individual characters or by the clipboard).
The problem is I am a poor programmer and besides I know almost nothing about Windows programming and so I would work on that a month. Xin, don't you want to do it?
Last edited by SlowThinker on 26-05-2002 at 05:11
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:16. Apolyton Time is 00:16. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|