Civilization II Unlimited

Elys

Chieftain
Joined
Oct 15, 2006
Messages
33
EDITED:

In current dev for both Civ 2 MGE and Civ 2 ToT:

- Increase the global max units from 2048 to 32000.
- Increase the max gold from 30,000 to 2,000,000,000.
- Increase the max map surface from 10,000 to 32,767.
- Increase the max population from 320,000,000 to 2.000,000,000.
- Increase time limit from 2020 to 9999
- Increase the Events memory to 212,960
- Remove the CD check.



Check recent post of this topic if you wanna try last dev. files ;)
 
Cool! Great work!

Now does this also remove the 255 total cities limit? That would indeed be very helpful in the Fantasy and Sci-Fi games.
 
This is a big help! :goodjob:

The 255 city limit is a huge limitation, but can it be overcome?

Is this compatible with Timbatron's patch that reduces the load on your CPU (http://forums.civfanatics.com/showthread.php?t=112086 and http://tim.strafenet.com/civ2.html)? Unless/until I come up with a unsurmountable bug using his modification, that will remain the version that I use.

Any chance that you can issue this as a patch instead of an executable? It'd be helpful to pack a patch in zips with scenarios.
 
I will look at first to make a version based on the Timbatron's patch and then eventually a patcher once I have little time.

The global max units work normally above 2048 however I have not tested up to the new "theorical" 64000 :crazyeye:. It is possible there is problem at some higher count somewhere in the civ2 code. If you encounter such bug past a certain global max units, please post the count or the save so I can have a look at it ;)

About the 255 cities limit, I have never looked for that. If someone has a save with the cities limit reached (MTG or TOT), I will be happy to have a look at it ^^
 
Doesn't one of those (number of units or number of cities) run up against a reserved space issue in the SAV file? If you go over it, I thought it overwrote other reserved areas of the SAV.
 
Doesn't one of those (number of units or number of cities) run up against a reserved space issue in the SAV file? If you go over it, I thought it overwrote other reserved areas of the SAV.

To be exact I'm porting these modifications that I made for CIV2:MGE.
The MTG and TOT has lot of code in common.

I've played with MGE with more than 2048 units and have not encountered a problem with save. For TOT I have simply ported the modification from MGE because the related code is the same.

Below is a MGE screenshot of loading successfully a save where i just added units with the cheats menu before precedently saving it.

TOTAL without including barbarians: 2439


ElephantU, do u have link from where you got this units/save problem information ? I'm interested to read them. If there is problem I may eventually look at the save code.

EDIT: OOPS, i've just noticed your link Boco, I gonna have a look there, thank you :)
 
I've packed a new version which includes the CPU heavy usage fix made by Tim, and updated the download link and infos in the first post.
 
I don't think there should be any problem with the number of units up till 32,767 at least. Not in the savegame anyway. It could cause problems with the limited amount of game memory available for the units. Is that something you've taken care of?

In case you have, could you perhaps also look at increasing the amount of event space available? It should be possible to increase that too without any problems, apart from memory limitations.

Excellent work, by the way!
 
....
Any chance that you can issue this as a patch instead of an executable? It'd be helpful to pack a patch in zips with scenarios.

I've done that. But instead of a Patcher, I've made a Loader. I think it's more flexible because people does not have to modify the civ2.exe on the disk

Then you can use the Loader which will launch civ2.exe and modify it directly in memory, while still being able another time to play the original game by just starting civ2.exe if you wish. It's also smaller, about 100KB.

However it does not work in Windows 95/98, I will see if I can change that later.
I'm also looking at stuff for the Mercator's suggestion.

....
In case you have, could you perhaps also look at increasing the amount of event space available? It should be possible to increase that too without any problems, apart from memory limitations. ...

I guess you are referring to the script events from events.txt. I've never worked with them.

Do you have an events.txt that you know for being beyond the normal Civ2 ToT capacity and that I could test ?

EDIT: I'm also working the Global Max Units modification because at some point it crashes.
 
Excellent Elys!

Yes I am referring to the Events.txt. And in fact, MGE people would probably be more happy with this than ToT people.

I attached a silly events file that displays the same text pop-up for the first 160 turns of your game.

I can also tell you that ToT has a maximum of 106,480 bytes for the events in its memory. I don't know about MGE. I think that's around 32K.

If you remove the first 6 events in my dummy events file (up to the event for turn 154), you will reach exactly that maximum of 106,480 bytes.


Would that loader work for both MGE and ToT? Since you said they are similar. Or aren't they that similar?

And I'm afraid I'm on Windows98, so I hope you can make something work for that too.
 

Attachments

  • Events.zip
    1.1 KB · Views: 361
Good stuff, Elys. :goodjob: An expansion of the available memory for events is the one that appeals to me the most. The events for my War of the Ring scenario are packed in like sardines.
Mercator said:
Yes I am referring to the Events.txt. And in fact, MGE people would probably be more happy with this than ToT people.
Never mind them. If they were genuinely bothered by this kind of thing, they'd have upgraded. ;)
 
Yes, Mercator I found the same 106480 size last night while debugging ToT. It corresponds to the maximum heap size allocated for the events.
If the heap is full, civ2 will refuse to load next events. I know how to change that heap size. After that, there is need to check if this change will not induce a bug somewhere else.
I will work on that soon. For now I'm busy on the Max Units stuff.

By the way i've also changed the way I manage civ2.exe in memory, so it should work as well in Windows 95 and 98.

Concerning the Max Units, I have made progress. The memory allocated for all the units is staticly reserved in the Civ2.exe, which of course make crash if you have too many units and then not enough memory. (I would have hope the memory allocation was dynamic to make things simple but unfortunatly not :aargh: )
However I've managed (at least in a part, i'm still testing) to relocate and increase the memory for the Units, but that means also changing all the reference in the code that access these memory zones, which is the hard part because of course I only see ASM code with no name or any idea what part of memory store what datas (until I would completly trace and debug civ2.exe to know exactly what it does, but it would be faster to code a civ2.exe from scratch then :p )

Concering MGE, in facts i'm doing most of my debug test on MGE and then porting working modification to ToT. ( I personally prefer the MGE Interface).

So once i have something working in either ToT or MGE, I just need to convert from one to the other.
I have already planned to make a version for both, and even one unique loader for both.
 
Ok I've attached in this post a current in dev version of the loader for ToT.

It has the event memory size doubled and all what is specified in the first post of this topic, excepted the Global Max Units and CPU fix is not included.

Mercator: It allows to load your events.txt (thx for the file BTW :) ) file without error. Also please tell me if it works under Windows 98 ?
 
Elys said:
Concering MGE, in facts i'm doing most of my debug test on MGE and then porting working modification to ToT. ( I personally prefer the MGE Interface).
In what way do you prefer the MGE interface? With some graphical modifications and menu options you can get ToT to look very similar to MGE.
Elys said:
It has the event memory size doubled and all what is specified in the first post of this topic, excepted the Global Max Units and CPU fix is not included.
It might be an idea to try to contact Timbatron before bundling his CPU patch with yours - if that's what you choose to do. I'm using your loader with his CPU-fixed executable. Will that cause any conflicts?
Code:
remaining heap space: 212960 bytes
I'm liking the look of this. :D I've done a little events testing (with and without Timbatron's patch). The increased memory allocation for events works fine when I'm beginning a new scenario or loading a clean SAV file (with the larger events file present in the directory). However, if I load a SAV file with embedded events that exceed the original 104 kB maximum, I get a CTD, as I would if I were using an unpatched executable.
 
That's correct, you couldn't load a save, that's because loading use another heap allocation and this is what I was fixing along other things in the new version.

For the CPU fix, unlike the full civ2.exe file I released, I won't use Tim's one because I'm only releasing a Loader now and I will have to get my on way to do it. And that's not on top of my civilization II priority ;)

Also you can use the loader with Tim's civ2.exe it should work.

Attached to this post is the new DEV version for both MGE and ToT that includes :

- Increase the global max units from 2048 to 32000. Need testing :mischief:
- Increase the max gold from 30,000 to 2,000,000,000.
- Increase the max map surface from 10,000 to 32,767.
- Increase the max population from 320,000,000 to 1.000,000,000.
- Increase time limit from 2020 to 9999
- Increase the Events memory to 212,960
- Remove the CD check.
 
In what way do you prefer the MGE interface? With some graphical modifications and menu options you can get ToT to look very similar to MGE.

The two first things I hate about the ToT look is: No close button on the city window, and I don't like the new bar stuff (too small letter) on the units, I prefer the old good big shield :p

Now does this also remove the 255 total cities limit? That would indeed be very helpful in the Fantasy and Sci-Fi games.
The 255 city limit is a huge limitation, but can it be overcome?

I may have a try at it :)
 
Did you test the version that doesn't max out the event space by loading an Scn in ToT, Merc? :mischief:

No. :p

Mercator: It allows to load your events.txt (thx for the file BTW :) ) file without error. Also please tell me if it works under Windows 98 ?

It doesn't work in Win98. :( As soon as the ToT background comes up, a fatal error pops up as well and Civ2 crashes.
 
Elys said:
No close button on the city window,...
I take it you mean the extra one in the top left corner? Try View menu → City Layout.
Elys said:
...and I don't like the new bar stuff (too small letter) on the units, I prefer the old good big shield :p
Nothing you can do about that, I'm afraid.
 
Top Bottom