CIVMAP21 revisited

Dack

Terra Form
Moderator
Joined
Nov 26, 2003
Messages
534
Location
civ dos 474.05
A little background, last winter my pc’s motherboard failed. Rather than buy a new computer I purchased a used mother board, not an exact replacement. The down side of this was that my DOS world turned into a unknown landscape. My only reason for remaining in that world is CIV and my SVE file editor/modifier/cheat program CIV$. I use Visual Basic For DOS to develop and maintain it. Unfortunately the high memory offered by XP on this PC did not have enough memory to hold all the source code modules at once. So I tried the DOSbox version I was using at the time – no luck. Then moved on to Virtual PC 2004 SP1 and got DOS 6 running still not enough memory. Then I wrote a windows program to remove all the comments, sort of worked but I had to stub out some of the functions and subroutines to debug other section of the program, what a pain!

Something made me upgrade to DOSbox 0.73 to run CIV. I don’t think I had ever look through all the documentation before. Anyway this new version has better support for EMS and XMS memory. After getting CIV to run nicely (read much faster than before) I tried running Visual Basic for MS-DOS it mostly worked, with a little tweaking it loaded the CIV$ source files. The only problem CTRL-Break didn’t work. Searching the online information about DOSbox I found information about how DOSbox could not trap CTRL-Break but how VB dos could be controlled with CTRL-Scroll Lock. (see note 1)

So I was now in vb dos programming nirvana. Then came Gowron thread “Modding Civilization I - Patterns for Huts and Special Resources”. It had such a feel of familiarity about it, what sprung to my mind was “Civilization Map Changer Version 2.1 (6/20/93) written by Holger Eichmann”

I remembered that out side of real ms-dos environment I was unable to get it CIVMAP21 to run. See Sixty Three
Does DOSbox support TSR’s? my mind raced … I quickly search the web for a dos TSR finding one that trapped key strokes. It ran but didn’t work on certain keys. Could one of them be the one used by CIVMAP21? I knew from looking at this code over the years that it was written in Turbo Pascal and assembler. What did I know about Turbo Pascal? Zero! Short version - I rounded up Turbo Pascal and MASM. Coming up with the asm object modules was easy. Digging into what makes a Pascal TSR was somewhat more difficult. Thanks to the WaybackMachine (http://web.archive.org) I was able to find a number a TSR examples. It seems that CIVMAP21 used the Print Screen key to trigger the on/off function. I was determined to replace it with a key not used by CIV dos and supported by DOSbox. After finding some sample code and attempting to make a little key trapping TSR of my own. Figuring out some on the strange error messages (odd to me anyway, in hind sight maybe not). I now have a version of CIVMAP that runs within DOSbox.

note 1: Breaking Without Killing DOSBox
 
October 31, 2009
How to run CIVMAP version 3.0

1) Install DOSbox 0.73 (I have not tested this with any other version of DOSbox).

I assume that DOSbos is located in C:\Program Files\DOSBox-0.73

In the configuration file for DOSBox 0.73 the only setting I needed to change was cycles=11000. Your machine is certainly different so adjust accordingly
Ctrl-F11 set cycles lower, Ctrl-F12 set cycles higher when you get the cycles to a level that your happy with you can edit the configuration file.


2) make a folder / directory with the name C:\MPS\CIVMAP
3) Copy all the files that make up CIV dos into this folder.

Download CIVMAP30 runtime.zip and unzip.
Now copy
CIVMAP30.EXE
PCM.EXE
CIVMAP.BAT

Into C:\MPS\CIVMAP


Also copy
runCIVmap.bat into C:\MPS
4) You will now run the PCM.EXE (Patch CIV Map) program.

Using My Computer open folder / directory C:\MPS\CIVMAP
Locate PCM.EXE and double click on it. A Command Prompt box will open up displaying

This program identifies the version of CIV.EXE
and patches it for use with CIVMAP
where is CIV.EXE [C:\MPS\CIVMAP]:


If you followed the instructions CIV and the Civ map program should be in the default folder.
Hit the Enter key

The following should appear, hit Enter again to close

This program identifies the version of CIV.EXE
and patches it for use with CIVMAP
where is CIV.EXE [C:\MPS\CIVMAP]:
Buffer count = 74 of 74
New file created >> C:\MPS\CIVMAP\CIVEXE.PCM
File size is Version 5
interrupt $F2 insertion point is OK
interrupt $F1 insertion point is OK
done - ok
Hit Enter to exit



PCM.EXE will patch any English language version of CIV DOS (.01 to .05).

5) Once again using My Computer open folder / directory C:\MPS\CIVMAP
At this point you should have a file C:\MPS\CIVMAP\CIVEXE.PCM
Rename the CIV.EXE file to anything you like.
Rename C:\MPS\CIVMAP\CIVEXE.PCM to C:\MPS\CIVMAP\CIV.EXE

6) Now with My Computer open folder / directory C:\MPS
Find runCIVmap.bat double click on it. This will start DOSbox and run CIVMAP30 and CIV

The map changer can be turned on/off with the ~ or ` (tilde or back quote, grave accent, back tic) key. In the on mode a right mouse click will present the map changer screen

Code:
Civilization Map Changer Version 3.0       written by Holger Eichmann
(C) 1993 by Sirius Cybernetics Corporation, Sirius Star System I-III
                                    modified to run in DOSbox by Dack 26Oct09 
Position: row: 14,  column: 28
Landscape:   (0) ocean                 Attributes:    (f) irrigation
             (1) forest                               (g) mines
             (2) swamp                              * (h) roads
           * (3) plain                                (i) railroad
             (4) tundra                               (j) fortification
             (5) river                                (k) pollution
             (6) grassland
             (7) jungle                 (l) make this place unknown
             (8) hill                   (m) make whole map known
             (9) mountain               (n) make whole map unknown
             (a) desert
             (b) arctic                 (o) create improvement
                                        (p) clear improvement list
(c) load whole map                      (q) load list
(d) save whole map                      (r) save list
                                            list length: 45

                            (x) exit


The asterisk indicates the landscape type and attributes. Typing the character that corresponds with a given command to alter the terrain or its improvements, and tp read or write the map or list of Special Resources.

Special Resources (herein called improvement) can be implemented on any square that supports one using the (o) command. I have lengthen the list to allow 1000 changes.

I have not fixed any of the known bugs:
It is up to the user to coordinate (h) roads and (i) railroad. A railroad without a road leaves a square that a settler can’t build a road upon.
If you combine two islands they will not be considered as one for the purpose of wonders. New land may not belong to the island that it is connected too.



Note: the following were used to compile and link
Turbo Pascal 7.0
MASM 6.11
 

Attachments

  • CIVMAP30_init.png
    CIVMAP30_init.png
    6.2 KB · Views: 482
  • CIVMAP30_on.png
    CIVMAP30_on.png
    6.2 KB · Views: 1,816
  • CIVMAP30 runtime.zip
    48.8 KB · Views: 642
  • test files civmap30.zip
    21.2 KB · Views: 423
  • Civmap30 source.zip
    9.2 KB · Views: 341
For a further test of CIVMAP download test files civmap30.zip
Unzip and copy the three files into C:\MPS\CIVMAP
63.DAT civil1.map civil1.sve​

In C:\MPS run runCIVmap.bat
after CIV starts load King 42, English/1060 AD

Locate Reading
move the mouse pointer to one of the desert squares and right click.



Enter q
Filename: will appear in the lower left of the screen. type 63.dat then enter

 

Attachments

  • Reading.png
    Reading.png
    4.1 KB · Views: 1,918
  • Reading after.png
    Reading after.png
    3.9 KB · Views: 1,715
If you have already patched civ.exe to work with civmap22.exe, you don't need to run pcm.exe. Just place civmap30.exe in your civ directory, and change your batch file to load civmap30 instead of civmap22.
 
If you have already patched civ.exe to work with civmap22.exe, you don't need to run pcm.exe. Just place civmap30.exe in your civ directory, and change your batch file to load civmap30 instead of civmap22.
Until your post I was unaware of the existence of CIVMAP22. It adds something called macro 1 and macro 2. Doing a web search for CIVMAP22.ZIP reminds me of the Library of Alexandra titles of files but no content to be found.

Extracted from CIVMAP22.TXT
What I have changed (version 2.2):- Now you can create macros of keys. They aren't tested intensively and I hope, you can use them without description.

This version CIVMAP30 does not include any of the CIVMAP22 updates.

The purpose of PCM.EXE is to patch any English language version of CIV DOS (.01 to .05) to allow CIV to run with CIVMAP30. The patches can be added manually and PCM can be skipped.
 
Thanks for breathing more life into Civ, Dack. The abillity to now revisit some of those old saved games (I have 100s now) and throw in a random new continent, a defensive continent around my island to protect it, etc...

One day I hope somebody figures out CivWin's decompression and recompression. :(
 
XDrake said:
One day I hope somebody figures out CivWin's decompression and recompression. :(

I've successfully decompressed and recompressed a CivWin .sav file. It doesn't recompress exactly as how CivWin does it, but CivWin seemed to read it without any problems. (Hope it stays that way) With this big hurdle out of the way, I'll be expanding the program to modify the save file in beneficial ways :) Assuming nothing drastic happens, I should have a basic editor out in a week.
 
If you combine two islands they will not be considered as one for the purpose of wonders. New land may not belong to the island that it is connected too.

Is that true even when wonder has been build after connection was made ?
 
Originally Posted by Dack
If you combine two islands they will not be considered as one for the purpose of wonders. New land may not belong to the island that it is connected too.
Is that true even when wonder has been build after connection was made ?
This program (CIVMAP) only changes the terrain type and some of the bits that control Attributes, such as roads, railroad, etc. Among other things, it overlooks the method that CIV uses to determine what island an individual square belongs to.

A square has an data value that indicates what island the square is on. A city on that square belongs to that Island and by default so does any wonders that belong to that city.

Islands are numbered 1 to 15, Seas are numbered 1 to 15 from largest to smallest. When you change a ocean square to a land square the sea number becomes the island number for that square. Assuming that the land bridge your are making goes across the largest sea, the newly created land becomes part of Island One (1). All other squares remain unchanged …
 
Doesn't work for me. Pressing ` makes the screen look like on the screen attached, and RMB still makes the terrain description appear.

http://img72.imageshack.us/i/clipboard01ri.jpg/

I have a 475.01. I have run the PCM before launching civmap.

There does seem to be some anomaly when you press the ~ or ` character. A left mouser click on the black unknown area seem to cause the normal view to reappear. It then seemed to work are advertised.
 
Pressing ` under DOS after running civmap30 makes the screen clear, and the character ` displayed in the upper left corner. When I press enter then, I just get "illegal command" message, and I go back to the DOS prompt.

While playing, pressing LMB or RMB after ` makes things go back to normal, indeed. But still the civmap menu doesn't appear.
 
... DOS after running civmap30 ...
After reading your above post, my impression is that you did not follow exactly the steps in post 2. Or I maybe confused. You said ”…under DOS … “ Are you actually running DOS? MS/DOS
This exercise is meant to be run under DOSbox 0.73 on a windows PC (XP or the like). I have run thru the steps with version .01 on a XP machine and it seems to run ok.
More exact detailed info please.
 
Yes, I used DOSbox 0.73. "Under DOS" was just an abbreviation for a DOSbox prompt. I know how to use civmap, because I had been using it many years ago on a real MS DOS system. At some point I even wanted to do what you did, that is to modify the civmap so as to use it with dosbox, but I had given it up when I found that it won't be as easy as modifying the keycode somewhere in the exe file.

Sorry, I've found in a hex editor that my civ.exe wasn't modified at all. I thought that it'll be modified, and civexe.pcm would be a backup file. This happens if have to read too much from the screen ;p

WORKS GREAT! THANK YOU! I missed it for so many years!
 
It’s funny I must have had the same problem when I tried to test version .01 the other day. It didn’t work until I realized that I had to rename the civexe.pcm file. CIVMAP21 certainly is an interesting program. Years ago I attempted to use it as a base for a program to do massive changes to the map and to import the changes using CIVMAP21, but I had dismal results.
 
Dack,

Wow, a big thanks for working this out.

This version CIVMAP30 does not include any of the CIVMAP22 updates.

I found the macros in civmap22 to be very useful so have merged the code from civmap22.pas into civmap30.pas. Now you can turn each fish into a palm tree desert island with a right click and the leter t or u. :)
macro t as "afhix"
macro u as "0hix"


civmap31_runtime.zip

civmap31_source.zip

Cheers

Awie
 
is there som sort of free maps which are already created avaliable somewhere???, or I just need to create them
 
It doesn't seem to remember everything if I save and re-load. Special resources (deer, oasis, oil, etc.) disappear when I reload if they're ones I've created using CivMap.
 
hey dack,

I have been using CIVMAP30 under dosbox 0.74 and think I may have found a bug.

I am using version 1 of civ.exe which was previously working OK and has helped me fix some terrain issues (I run dosbox via an EEEPC, so Terraform may not work, I havent tried yet...)

Now my spaceship has landed, the game keeps complaining that the civ.exe is an unknown version and it refuses to modify terrain. However, starting my "backup" save of the same game works fine, as does starting a new game.

What infomation or files would help you to diagnoise this issue...?

Thanks,
ScottyBoy
 
Top Bottom