Civ2 MGE several fixes and additions with support for music tracks

duplj

Chieftain
Joined
Jul 11, 2022
Messages
86
Location
Россия
This Civ2 executive file for version 5.4.0f MGE has been modified by adding additional code. What features have been added:
1. Applied NOCD patch and Civ2x64EditboxPatcher patch to fix crashes on 64-bit systems
2. This executive file contains the ability to listen to tracks from the MUSIC folder. Playable format WAV 44100/22050khz 8/16bit stereo/mono. Tracks are checked for a name in the form TRACK**, so it is advisable to start the initial track with 01 with the possibility of increasing to 99 pieces. Sound playback uses the standard game procedure sndPlaySoundA in asynchronous mode. A new track is played when the previous one ends, provided that a new player turn begins or any left mouse click on the map occurs. To play music, additional RAM is required in the size of the WAV file being played. The number of played tracks is specified in the rules.txt file using the @Cosmic parameter. There are currently 18 tracks in the archive. To use the music playback added in the FoxHead 1.21 patch, instead of this one, set the parameter to 0
3. The font used by the game has been replaced with a thin, condensed Arial, the names of cities and some other game elements remain the same as Times. If the system does not have a Arial Narrow font, the game will use the Times font
4. The number of autosaves has been increased from two to five (**_auto, **_auto0, **_auto1, **_auto2, **_auto3)
5. Fixed a bug when deleting water units in one cell (previously, disbanding a water unit in a cell in which another water unit was present led to the removal of both)
6. Unlocked the ability to set the parameter value in the rules.txt file "Tech paradigm (higher # slows research)" above 10. Expanded the ability to set pays support values for different types of governments from 8 to 100
7. Added variable initialization that corrects constantly bad relations with AI (taken from FoxAHead)
8. The limit of text lines in the LABEL.txt file has been expanded to 900 lines (also on the file civ2map.exe)
9. Now, when a unit of another race enters the city zone of another player with whom there is a peaceful or allied relationship, the worker processing that cell in the city will not be reset
10. Speed up the movement of units when the option is inactive "Fast piece slide"
11. Now the player will be able to see all units of other players in the stack if they are in sight, except for units in the city
12. In single-player games, it is now possible to change the government type of AI players through the cheat-editor
13. Fixed the removal of several air units located in the fortress when they are attacked by another air unit. Now, when one unit is defeated, all others will also be deleted
14. Added the ability to edit the terrain cell under the city
15. An air base located inside a city area will no longer provide maximum resources to the city. The city will receive only the basic resources of the cell with the airbase. The road will still provide commerce
16. Added the ability to lay out riverbeds and install/remove cities through the cheat-editor SHIFT-F8 (to install a city, there must be any unit in the cell to determine the identity of the new city)
17. Two resources have been unlocked in the grassland, named Village and Settlement. You can set resources in the rules.txt file. Corrected pictures in the TERRAIN1.GIF file. Corrected the Civilopedia help to account for these resources correctly. Added the ability to display new resources using the map editor Civ2Map.exe
18. The defensive bonus that terrain gives to units has been fixed. Flying units will no longer receive the terrain bonus. For water and flying units it will be equal to the base value of 2 (100%). The river gives ground units an additional bonus of +50%
19. The defense bonus and movement bonus on resource tiles are now taken into account regardless of the base terrain in the Rules.txt file
20. Now, when you click on a cell that is not open by the player, if there is a unit or city of another player there, the map will still be centered. In open map mode, double-clicking on any open cell that was previously not visible will bring up the terrain information panel. In normal map mode, if a city or a troop stands on a previously opened area of the map, but they are not visible to the player, double-clicking on the cell will bring up the landscape information panel
21. The mechanism for moving units using the GOTO command has been fixed at the gluing point where the X coordinate changes to 0 in a round world. Now units will not move in the opposite direction
22. Added the ability to build a Harbor and an Oil Platform for cities if the city has access to at least one water cell in the coverage area. If there is not a single suitable area for the Super Highway in the city's coverage area (desert, plain, grassland), it will not be possible to build it
23.The check for AI capitalization by players has been changed; if there are few units left in the city, the capitalization mode will be reset
24. Fixed the display of the text string in windows called from the 'Advisers' menu (F1-F6). The word Republic will no longer be displayed when using the Democracy government system
25. In the rules.txt file, a parameter has been added to the @Cosmic category that allows you to set the possibility of technology theft by spies when capturing cities or when interacting with them. If prohibited, instead of stealing technology, spies and diplomats of other states will inspect the city during peaceful relations and possibly sabotage during hostile ones
26. The music will stop when the diplomacy screen opens, when the window for calling council consuls opens, when the game is exited from the menu and when a video about a completed great project starts playing. Added an additional trigger for calling a new music when pressing any unit order button or just an action. Since the musical procedure used in the game cannot load each new track after the completion of the previous one, triggers for calling a new track upon completion of the previous one have been added (clicking the left mouse button on the map, pressing any order or action button, as well as at the beginning of a new player turn)
27. Added when you click on the button located near the zoom buttons (top left) of the map, random change of music track
28. The resource value of grassland has been changed, now by default it does not provide production in @TERRAIN, however, if there is a mark in the form of a shield on grasslands, the cell will receive an additional one production. If the shield coincides with a resource on a grassland tile (Village or Settlement) it will give them one more production, if not, then the production will be the base one, which is indicated for the Village and Settlement in @TERRAIN
29. The diplomatic background has been corrected when there is contact with another race that has a government type of communism or anarchy (file mk.dll)
30. Added alternative terrain and units to the ALT folder, as well as an option using portraits of leaders Stalin and Hitler when playing for the USSR or Germany (may be useful in World War II scenarios). These options are optional, if you want to use them, copy the contents of the folders to the game folder or ignore it
31. Added a message about the completion of construction of any city unit, not just non-military units. Depends on the active option "Show completion of construction of all units"
32. The number of displayed units in city support has been increased from 8 to 18 units (three rows of 6 units each). The number of selectable units from one cell has been increased from 9 to 18 units
33. The maximum size of a city in which all specialists can be managed manually has been increased from 36 to 52. At the same time, the 37th specialist will work together with 21, the 38th in tandem with 22, etc. This had to be done due to limited address space
34. A variable has been added to the rules.txt file, which allows you to set a limit after which global warming will begin or disable it completely
35. Added a variable to the rules.txt file that allows or prohibits you from building nukes in cities
36. Added the ability to set the minimum distance between an existing and a new city in the form of specifying variables in the rules.txt file of the @Cosmic parameter
Spoiler Details :

value of 8 represents the distance of one square from an existing city
value of 20 represents a distance of two cells except the two outermost cells on the sides and a cell above and below (similar to the size of the territory that a city can handle)
value 24 represents a full-fledged diamond in the form of two cells from the existing city
value of 44 is the same as a value of 20, but three tiles away from an existing city
value 48 represents the same as the value 24, but three squares away
value of 76 is the same as a value of 44, but four tiles away from an existing city
value of 80 represents the same as a value of 48, but four squares away

37. Added the ability to create very large maps (up to 65535 cells in size) both in the map editor (Civ2Map.exe) and through the new game menu. Two templates for creating maps have been added to the menu when creating a map: very large and huge. Slightly increased the amount of land when choosing to create maps with a lot of land
Although large maps work, the AI on such maps may play worse due to the large number of objects and large distances
This addition may break compatibility with the CivUIA patch, so the file in the folder (Without_very_large_maps) containing all positions except 37 and 41 is saved separately
38. Added a variable to the rules.txt file that allows or prohibits destroying units in stacks one at a time outside key points (such as a city, fortress, airbase)
39. The minimum value of the "Communism is equivalent of this palace distance" item in the rules.txt file that can be set has been changed from 1 to 0, so that communism can be completely corruption-free
40. The display of the launch file icon in the upper left corner when registering the main window has been corrected. Now loading the first ICON image from the program resources is explicitly set in the program (this applies to the civ2 and civ2map exe files)
41. Added an optional unit window by right-clicking on the map, instead of the previous right-click handler. This processing occurs according to the cell coordinate, if there is a unit in the cell, a procedure with different options is called, while the unit itself does not immediately become active. If there is no unit, it simply moves around the map. Several options have been added to this window in addition to the usual ones, this is sending a unit to the home city (flying units use a game exploit that bypasses the check for flights and fuel if you do not make the last move, so they can be sent without thinking whether they will fly or not), moving a unit in a group to the very top. In the open map (cheat) mode, through this menu you can heal damaged units, remove the assignment of units to the city, create units, send units without a limit on moves and reactivate already departed units by resetting moves (folder Right_mouse_click saved separately)
42. Added support for images that will be displayed in the Civilopedia when viewing buildings, wonders, units and technologies. Images are in the Pictures folder. Supported format is GIF 256 colors
43. The window used in Civilopedia has been slightly increased vertically from 640x400 to 640x480. Display parameters for text line names have been adapted to new window sizes to accommodate 12 lines
44. Added Improvements.gif file to the Pictures folder from which small images will be taken in the Civilopedia, and sometimes in the game itself during certain events or actions. When using this file, the window in the Civilopedia will be increased to 700x600 in order to better accommodate the new images. If you delete this file, the game will use miniature images only from the ICONS.GIF file with a window size of 640x480, so the player can choose between the old look and the new one
45. The ability to delete your cities in the normal game mode has been activated (by default, this ability became active after activating the cheat mode). Deleting a city occurs when moving the active frame to the target city and pressing the Shift-D keys. If there are units in the city, you will first be prompted to delete them and only then the city

The Civ2.exe file (version 17) is most likely compatible with the CivUIA patch (includes all described positions except 41) and also compatible with version (Without_very_large_maps includes all described positions except 37 and 41) and has limited compatibility with version (Right_mouse_click without selecting the Unit Limit option includes all described positions)

Installation
Copy all files to the game folder with file replacement

Download
update 08/12/24 ver17
 
Last edited:
This is great work mate. Similar to what the guys did with Test of Time your patch now allows for truly portable CD free copies of Civ2 MGE to be used which was the final big technical hurdle for portability discussed over in the getting Civ2 back into digital stores thread.

I'm slightly concerned that the site owners might not like a cracked exe and game music being offered on the forums however it's stored offsite and we've already been doing the same thing for years here on the forums with our big Civ2UIA, ToTPP, and ToT mp3 music addon projects that collectively remove the cd check from the exe's and host music files, so this shoooooould hopefully be all fine :) , which is good as we really need this these days as so many people are having problems with the music due to CD drives being phased out. Should there be any issues though I'd recommend you start posting your work over on the Civ2 Discord as well juuuust to be safe mate.

Being able to change terrain beneath cities is a REALLY good addition too as that one has always been a nightmare for Civ2 scenario makers. Being able to place rivers in MGE without the map editor like people can do in ToT is another great addition too. :)

One question that comes to mind is how do your changes go with the old scenario start music request system in Civ2? For example when you start the Aliens scenario it plays the aliens song off the CD, when you start the Apocalypse scenario it plays the Apocalypse song, WW1 is the WW1 song etc.. although it's been a while since I last had music turned on so I half suspect that was already broken even with the CD and was playing the wrong songs anyway due to all the track changes between the different versions of Civ2 lol.

Oh and speaking of ToT features not in MGE, another question which I posted in the Civ2UIA thread a while back was if it's possible to somehow unlock the 7th city style slot in in Cities.gif similar to what they did in ToT? I don't think I ever heard back from FoxAhead on that one so presumably it's probably too difficult and messy to do, but thought I'd check again anyway since you're clearly a guru with MGE modding too.
.
 
Last edited:
Oh and speaking of ToT features not in MGE, another question which I posted in the Civ2UIA thread a while back was if it's possible to somehow unlock the 7th city style slot in in Cities.gif similar to what they did in ToT? I don't think I ever heard back from FoxAhead on that one so presumably it's probably too difficult and messy to do, but thought I'd check again anyway since you're clearly a guru with MGE modding too.
Hi
In this game, each game function has its own address space and it is often located sequentially, so expanding it or inserting something is not so easy if you edit the EXE file
It’s easier to implement this as FoxAhead does through a patch, binding to the desired address and allocating the necessary address space to it. I think this is not a matter of complexity, but of expediency and availability of free time, these cosmetic changes will not change the gameplay in any way and are only needed to please the eye
In this case, in the Cities file, this seventh line is clearly not included as an additional line, but simply so that anyone can use the editor to copy pictures of cities and paste them instead of other pictures of cities. There is no space allocated for them in the game code and you won’t be able to add them by editing EXE without expanding the address space
As for the music of the scenario, I think there is no connection left now; for communication you need a working CD. Because when a game scenario is created, you can specify in the rules the track from the CD you need to play
 
Hi duplj, wonderful work, is there any chance you can remove the AI cheats about the use of nuclear weapons? Civ2 strategy litterally get destroyed as the AI can magically make appear a nuclear missle anywhere in the map and hits cities that would otherwise normally be out of range.
 
Hi duplj, wonderful work, is there any chance you can remove the AI cheats about the use of nuclear weapons? Civ2 strategy litterally get destroyed as the AI can magically make appear a nuclear missle anywhere in the map and hits cities that would otherwise normally be out of range.
Hi
To be honest, I’ve never encountered this before, if you send me a save file where this happens, I’ll take a closer look
 
Hi
To be honest, I’ve never encountered this before, if you send me a save file where this happens, I’ll take a closer look
There's not a specific save, but you can read a previous discussion here https://forums.civfanatics.com/threads/ai-cheats.684867/ and also if you dig on the internet you will find AI cheats discussions over the years for example here
I am pretty surprised you guys never noticed this or maybe you guys do not care about AI cheats?

Would be great if we can fix this.
 
I am pretty surprised you guys never noticed this or maybe you guys do not care about AI cheats?
The AI has a lot of cheats that I know about and wrote about in some topics, for example, that the AI does not pay for the maintenance of buildings, it does not have pollution due to cities and the amount of money in the treasury is converted into a production boost, these are especially noticeable, there are others, but specifically I haven’t encountered the creation of nuclear weapons out of nowhere, I’ll certainly look into it, but it would be better if you still added a game save on the turn when this happens, then it will be easier to deal with it
 
The AI has a lot of cheats that I know about and wrote about in some topics, for example, that the AI does not pay for the maintenance of buildings, it does not have pollution due to cities and the amount of money in the treasury is converted into a production boost, these are especially noticeable, there are others, but specifically I haven’t encountered the creation of nuclear weapons out of nowhere, I’ll certainly look into it, but it would be better if you still added a game save on the turn when this happens, then it will be easier to deal with it
I haven't been playing for a while now so I do not have any save to upload at the moment.

I do not think the AI is making nuclear weapons from nowehere, as other explained they are able to move them from city to city in the same turn or something like that.

I remember last time I played, one of my most remote city was suddenty nuked and I could not explain how this nuke could reach it due to the distance and isolation in the center of my empire.

So I took possession of the AI and reloaded the turn before to check where this nuke come from, there were no subs or even cities that could host a nuke and reach my city respecting the allowed moments points.

If you play a regular game, you will notice at same points how the AI nukes you from nowhere.
 
I remember last time I played, one of my most remote city was suddenty nuked and I could not explain how this nuke could reach it due to the distance and isolation in the center of my empire.
at the moment it is clear that any AI missiles can move between cities without spending moves, however, to transfer between AI cities, the missile must have moves no less than the distance between cities. It turns out that if you see that nuclear weapons are located somewhere in the player’s capital, and your city is within 16 turns from any nearby AI city, you can expect a nuclear weapons strike. Yes, it's a cheat, but it's not that scary, you just need to keep it in mind
 
Last edited:
This is brilliant. I've been waiting for this thing since the 90's. :)
The one small issue I'm having is that now the music continues playing while consulting the council, meeting diplomats, etc.
Is there a chance of pausing it during these events?
 
This is brilliant. I've been waiting for this thing since the 90's. :)
The one small issue I'm having is that now the music continues playing while consulting the council, meeting diplomats, etc.
Is there a chance of pausing it during these events?
I was about to report the same issues with council, diplomacy, and wonders.. I think the music also continued playing when I exited the gameplay to the main menu and so it was competing with the main menu music too.
Another thing I noticed was volume level in the music wav files is very loud and drowns out the other game sounds. I'd convert/encode the files at almost half the current volume to ensure all regular game sounds are still heard.
 
Last edited:
This is brilliant. I've been waiting for this thing since the 90's. :)
The one small issue I'm having is that now the music continues playing while consulting the council, meeting diplomats, etc.
Is there a chance of pausing it during these events?
Hi
I'll see how I can change this

I just noticed that if you press the keyboard letter buttons in the civilopedia of technologies, units, etc., the cursor will move to those names that begin with the pressed alphabet letter, curious
 
Last edited:
updated, added positions 26

Seems to be working fine so far. I'll continue to explore.
Another idea - Would it be possible to implement the non-aggressive AI mandatory fix from Civ2UIA straight into the game exe?
Thereby leaving Civ2UIA for those of us who really want to customize the game & having a launcher while having the option for a clean non-aggressive AI to be played straight from the main exe.
Thanks for your amazing work! :)
 
Top Bottom