• Civilization 7 has been announced. For more info please check the forum here .

[TOT] The Test Of Time Patch Project

TheNamelessOne

Warlord
Joined
Dec 18, 2013
Messages
227
Update: A new version of TOTPP has been released: v0.18.4!

I'd like to introduce this project I've been working on lately, called the Test Of Time Patch Project (TOTPP). Its main goals were to increase the city and unit limits of that game. Since I feel that these goals have been met, the project has recently produced its first release. As I've been lurking here occasionally in the past, I decided to share it here.

Project information
Currently, TOTPP contains the following patches (more information in the program itself):
  • City and unit limits: New, configurable limits up to 32,000. Fixes the home cities of all units to handle things like support, trade routes, etc.
  • Edit control fix: Fixes a crash on 64-bit operating systems when an edit control is created.
  • Enable throne room: Enables building of throne room improvements. This feature was never removed from TOT, just disabled.
  • City/unit overview: Displays the number of cities and units for the player's tribe in the empire overview window.

Technical Information
TOTPP consists of a launcher and a DLL. The launcher has a GUI that allows the user to select which patches to apply (see screenshot). After patch selection, it launches TOT and injects the DLL into the process. The DLL then proceeds to patch TOT in memory.



Requirements
TOTPP requires at least Test Of Time v1.1 to run. It does not check your version, so if you can't get it to run correctly, try a vanilla v1.1 executable. TOTPP is compatible with many user-supplied patches. It is however not compatible with Mastermind's patch, so if you patched your game with it, be sure to disable the Edit control patch in the launcher.

Installation
Extract TOTLauncher.exe and TOTPP.dll to the Test Of Time installation folder (containing civ2.exe) and run TOTLauncher.exe. Adding /q on the command line will make it go straight to the game with your previous settings.

This software is provided as-is, without warranty of any kind. You may redistribute it as long as you give credit. Because of some of the techniques used in TOTPP (DLL injection and in-memory patching), you may get alerts from your anti-virus software. These are false positives. However, running random executables from the internet is always a bad idea, so be careful and test it in a virtual machine until you're sure it does what it advertises!

Since this is the first release, there's bound to be bugs and issues. Please feel free to post them here. I'd also welcome any feedback on the project. In the meantime, enjoy!
 

Attachments

  • launcher.png
    launcher.png
    20 KB · Views: 33,871
Last edited:
Does the ToT Set Up patch work with this? I have ToT 1.1 running on several computers, none of them require the game disk. I have around 30 copies of the disc because I give them away to people who express an interest in trying the game. Would like to try this patch, but I worry about having to keep the game disc in the computer at all times. jonel1111
 
jonel1111 said:
Does the ToT Set Up patch work with this?

TOTPP is compatible with many other patches, because it modifies the game in memory instead of modifying the executable on disk. I'm not sure what specific patch you're talking about, but you can safely try it in combination with TOTPP since the changes are not permanent.
 
A new version of TOTPP is ready, and contains some exciting modifications:

  • Custom resources: Play on maps with manually placed resources. See also this thread.
  • Transform requires tech: Associate a technology to the transformation of different terrain types.
  • Decrease CPU Use: Decrease CPU use of the game by changing the event loop.
  • No Limits: Increases the limits on money, population and map size.
For more information, see the included README.txt.

I decided to consolidate some of the features found in existing modifications into TOTPP by adding the CPU and No Limits patch. They are inspired by Tim's CPU patch and Julius Brenzaida's No Limits patch. Thanks guys, for writing them!

If there's anything you'd like to see changed in Test Of Time, I could still use some ideas for v0.3, so let me know. Some things would still be downright impossible of course (like more than 8 tribes in a game), but they may be feasible, like the custom resources patch. Or if everyone's still playing MGE, maybe we could do something there... ;)
 

Attachments

  • TOTPPv02.zip
    81.9 KB · Views: 1,195
How about some trade facilitation? Adjusting worker allocation before and after trades would be unnecessary if the trade formula used the maximum arrows (at least for user-owned cities) rather than the current.
 
How about some trade facilitation? Adjusting worker allocation before and after trades would be unnecessary if the trade formula used the maximum arrows (at least for user-owned cities) rather than the current.

Using the max possible trade output would lead to even more profit in what is already a pretty generous algorithm. Also, it feels a bit like cheating, since these tiles are not actually being worked by the city. Maybe use the net trade from the start of the turn instead? That would remove the need to micro-manage worker allocation at least.
 
If there's anything you'd like to see changed in Test Of Time, I could still use some ideas for v0.3, so let me know.
OK.

ToTPP Bugs
  • Multiplayer Build World phase + CPU fix hangs the game; same as Timbatron's fix.

ToT Bugs
  • Fix the rule 2 restrictions in @LEADERS2 so that forbidden technologies cannot be stolen. See here. This is a major bug that affects the Fantasy, Midgard and Sci-Fi games, as well as custom scenarios.
  • 'International Date Line' bug. Affects all versions of Civ2. On round world maps, units can't cross 0 on the x-axis using the 'go to' command. They would rather circumnavigate the globe.
  • Fix the looping terrain animation bug so that the final frame doesn't display after animations have been disabled under Graphics Options. Example: the oil resource. See here.
  • Fix the animation lockout options so they work as described in the 1.1 patch readme file. See here.
  • Fix the Count parameter (CheckFlag events) in events scripting so that it works as described in macro.txt. Currently, it's the same as the Threshold parameter.
  • Fix the map parameter bug in events scripting. Map parameter values from event actions (ChangeTerrain & CreateUnit) are sometimes (don't recall the exact conditions) not cleared following execution and contaminate the map parameters in the UnitKilled triggers of other events.
  • Fix the movement rate listed for units in the Civilopedia so that it does not adjust with the Road Movement Multiplier from @COSMIC in rules.txt.
  • The details of units that possess the "invisible until attack" flag under @UNITS_ADVANCED are visible in the status bar if you right-click the terrain. They're also visible within the city radius. Should be like submarines.
  • When you disable sound effects under Game Options, the game also disables AVI video. I guess that's the lazy way to do it.
  • The ModifyReputation event action modifier only accepts positive values in contrast to what's stated in the macro.txt document.
  • When a map is imported into an existing game (Ctrl+Shift+2), the tile ownership bits are reset. This messes with Zones of Control and is responsible for the disappearing cities bug. This can be fixed by turning goody huts on and off (under Scenario Parameters). Shouldn't be necessary.
  • Non-transformable terrain (examples can be found in the Fantasy, Midgard & Sci-Fi games) can be transformed into a weird, undefined terrain type using the O-key. See here. This shouldn't be possible.
  • AI units fortify immediately after using map transport sites. This is cleared in the following turn, but it's an exploit for the human player.
  • A unit prohibited from entering a secondary map via @UNITS_ADVANCED settings can enter the map using the Teleporter city improvement. Some people may prefer this bug remain in place.

Feature Requests
  • No CD check.
  • More benign AI diplomacy model, as per classic Civ2.
  • No stack kills. There've already been a few attempts at this, but they're buggy (including game crashes). Need separate rule for dealing with ships with holds, so that the cargo isn't left stranded in the ocean.
  • Set the tribe colour in the unit key so it matches the colour in cities.bmp, not half the RGB value. See here.
  • Extend events memory limit beyond 104 kB.
  • Extend unit type limit beyond 80. May run into problems over 180. Note that the 81st graphic slot in units.bmp is the Barbarian leader (diplomat).
  • Extend the technologies limit beyond 100. Definitely will break saved game format.
  • Unit carrying ability (holds) for land and air units.
  • A "location" parameter for the UnitKilled trigger in events scripting.
  • Option to hide health/shield bars for specific unit types. We have a clunky method now; it has problems at high zoom levels and high screen resolutions. See here.
  • Option to make air units subject to impassable terrain. That's the way it should've been. There's an impassable terrain override in @UNITS_ADVANCED that can be applied to any unit.
  • A ModifyAttitude event action, much like the existing ModifyReputation event.
  • Support for PNG graphics. Probably a bit optimistic.

Haven't played this game in many years, so I've forgotten much. Would've had a list twice as long in half the time 6+ years ago.
 
A unit prohibited from entering a secondary map via @UNITS_ADVANCED settings can enter the map using the Teleporter city improvement. Some people may prefer this bug remain in place.

Just love being able to teleport ships that cannot self teleport.
 
Thanks for the input, Catfish, much appreciated. That'll also keep me busy for a while... Let me quickly comment on some of the points:

Catfish said:
Multiplayer Build World phase + CPU fix hangs the game; same as Timbatron's fix.

Confirmed, will look into it.

Catfish said:
The ModifyReputation event action modifier only accepts positive values in contrast to what's stated in the macro.txt document.

Indeed, when parsing it only accepts strings starting with 0..9. Should be an easy fix.

Catfish said:
No CD check.

This one's interesting. Removing the check is trivial, but because of a technical issue the CD check may run before TOTPP.dll is injected. So you may or may not still see the 'CD not found' dialog. After pressing 'Repeat search' it will have been patched, but I'm holding it back until I've properly fixed it.

Catfish said:
More benign AI diplomacy model, as per classic Civ2.

I've recently looked into it, and it seems that a variable is not initialized in every branch of the start-of-turn attitude modification function. So it'll use some random value from the stack. Initializing it to 0 at the start of the function seems to work.

Catfish said:
Extend events memory limit beyond 104 kB.

Since this is dynamically allocated, it's pretty easy to change.

Catfish said:
  • Extend unit type limit beyond 80. May run into problems over 180. Note that the 81st graphic slot in units.bmp is the Barbarian leader (diplomat).
  • Extend the technologies limit beyond 100. Definitely will break saved game format.

Since these are mostly statically allocated they will be much more difficult to change. It will also increase the size of many structures used in ToT.

I'll look into these lists some more. Some of these bugs are definitely fixable.
 
Where have you been all these years? In the Depths with all the other Old Gods, hoarding your fathomless powers (or does your name come from Planescape: Torment? Fine pedigree either way :p)? I'm particularly stoked for the resource fix, obviously. I've finished mapping the rivers on my Finland map, and can't wait to place the rapids in them! :)

(Sorry for not posting any actual technical stuff, but I figure there's so few posts on these forums that a simple slap on the back is not misplaced here. :D As soon as my ToT disc arrives, I'm sure I'll start spotting various issues.)
 
I should be more clear in what I want for a trade helper. For a caravan trading between two size 6 cities, the current "best practice" is to rearrange workers in both cities to the highest trade producing tiles just before the delivery, then immediately change them back to their previous locations. What I'm hoping to do is bypass that micromanagement while still getting the best value for the caravan, not unfairly get the value of a size 21 trading partner.

It would also be nice to see the value of a van/freight. Maybe when a van is selected and the mouse/cursor is on a city, a price could be added to the display? "Freight: Hides (worth 140 in Moscow)" though it would have to be calculated by the last known or best guess method for unscouted foreign cities, to avoid revealing information the player shouldn't know.
 
I'd rather you nerfed Caravan trade/science value by something like 85 %. Right now the game is almost literally all about Caravans, and you can launch your space ship in 200 A.D. by exploiting them. I suppose many players might disagree though; and in any case this falls outside the scope of your mod, since the aim is to fix bugs/limitations and not make any drastic changes (even if they'd be for the better). If it's easy to do, though, then I'd really like this as an option. I find Caravan management to be extremely tedious, and would welcome any limitation to it. Maybe make it so that you can't hop from ship to ship with units, so you must actually take the Caravan from port to port onboard the same vessel, and not hop across the Pacific Ocean in one turn, which... Doesn't make... *Any* sense at all. :crazyeye:
 
Right now the game is almost literally all about Caravans, and you can launch your space ship in 200 A.D. by exploiting them.
200? What level are you playing at? Warlord?
If you can launch a spaceship in 200 you should take the difficulty up not one but two levels.
I find Caravan management to be extremely tedious
It is definitely a tedious aspect of the game. Mackerel pointed out a case earlier in this thread but it can get even more complicated than that. But then again, many aspects of the game are tedious and require insane amounts of micro management. That is the main reason I love to play OCC.

Number of cities is the biggest contributing factor to the tedium. Unfortunately it has been shown, time after time, that building as many cities as possible is as powerful, if not more powerful, than trade.

Playing on small maps or maps with lots of ocean helps a little bit but not much. Game generated maps of small size (2000 tiles and below) give you very rough terrain (plenty of mountains) and specifying archipelago and small land mass during the starting sequence of the game have very little effect. That is one reason I love to play on custom maps. (The other is that game generated maps all follow a certain pattern and you can get much more exciting situations with custom maps.)

... so that you can't hop from ship to ship with units, so you must actually take the Caravan from port to port on board the same vessel, and not hop across the Pacific Ocean in one turn, which... Doesn't make... *Any* sense at all. :crazyeye:
Indeed. Ship chaining is a very unnatural yet very powerful exploit. So is, in my opinion, movement on railroads with no movement cost. It is completely ridiculous to go from one end of the world to another arriving fresh with all your movement points intact. Airport to airport movement at least uses up your movement points for the turn.
 
200? What level are you playing at? Warlord?
If you can launch a spaceship in 200 you should take the difficulty up not one but two levels.
It's actually faster on Deity, since the AIs have bigger cities and more techs that you can steal/trade for. Iirc the record launch is @ 16 A.D. I haven't really even tried an optimized Caravan strategy; I've built a dozen or so around the Renaissance in a regular game and seen their ridiculous power. I'm sure if I read the Power Democracy guide, etc, that I could learn to do it fast enough after a while. I'd rather learn things that I find more meaningful though.
It is definitely a tedious aspect of the game. Mackerel pointed out a case earlier in this thread but it can get even more complicated than that. But then again, many aspects of the game are tedious and require insane amounts of micro management. That is the main reason I love to play OCC.
It's strange. I try to tell myself, 'since I'm only playing by myself here, why not take it slow and play to simulate history, instead of a mad 'optimal' rush through the game?'. Yet that feels unsatisfying, because I *know* I could be more *optimal* if I micromanaged. I'd rather it not be possible to use these gamey exploits, so I wouldn't have to be tempted by them. :p
Number of cities is the biggest contributing factor to the tedium. Unfortunately it has been shown, time after time, that building as many cities as possible is as powerful, if not more powerful, than trade.
Trade is more powerful at the highest levels (of difficulty and micromanagement). You only need a dozen or less cities to launch in the early A.D.s. I agree though that the number of cities can get out of hand in more regular games. In Civ V (which I played until I got bored) it's the other extreme, though, and I'm not sure I like that either. I'd rather have 30-40 cities in the end-game, not 5 or 100.
Playing on small maps or maps with lots of ocean helps a little bit but not much. Game generated maps of small size (2000 tiles and below) give you very rough terrain (plenty of mountains) and specifying archipelago and small land mass during the starting sequence of the game have very little effect. That is one reason I love to play on custom maps. (The other is that game generated maps all follow a certain pattern and you can get much more exciting situations with custom maps.)
Oh yeah, I can't stand the game-generated, random crap continents myself. :vomit: Have you tried my world map by any chance? The link's in my sig. ;) I've recently played a few test-games on it; it works best if you alter the civ colors in Rules.txt, so that you can have an even spread of civs throughout the map. The map distortion due to an enlarged Europe does take away some of the realistic edge... And the continents are just a little bit smaller than I intended. Perhaps I'll make a new version some day, but for now I will focus on my Finland map/scenario.
Indeed. Ship chaining is a very unnatural yet very powerful exploit. So is, in my opinion, movement on railroads with no movement cost. It is completely ridiculous to go from one end of the world to another arriving fresh with all your movement points intact. Airport to airport movement at least uses up your movement points for the turn.
Oh yeah, the railroads... Granted that you need off-shore travel for the real big trade bonus, so it's not *that* big of a deal, but still. FWIW, in my scenario, I will make the trade units into ships, so that you can't hurry them along in any way (well, except by building wonders). Ofc this means that inland cities will miss out on trade, but hey, historically they've not been as bustling as coastal ones, so it's ok enough. Besides, my map will have many navigable rivers, meaning that most cities will be able to trade if you found them in the right places. It remains to be seen how the AI will adapt to water-bound trade units... I'm not very confident, given its general state, heh.
 
It's actually faster on Deity, since the AIs have bigger cities and more techs that you can steal/trade for. Iirc the record launch is @ 16 A.D. I haven't really even tried an optimized Caravan strategy; I've built a dozen or so around the Renaissance in a regular game and seen their ridiculous power. I'm sure if I read the Power Democracy guide, etc, that I could learn to do it fast enough after a while. I'd rather learn things that I find more meaningful though.

It is harder to land at AD 200 on Deity because you get fewer turns in the early part of the game. Based on your comments, you seem to be taking the best results from some of the best players, and assuming that they are results that an average player can always achieve just by using caravans and a little micromanagement. By your own admission, you haven't even played a full game using caravans. The Renaissance is when you have a lot of demanded caravans from large cities; pretty soon you use up those caravans and have to start delivering caravans of lower quality.

For reference, This is Samson's AD 16 landing. If you look at the log, he had fantastic luck. He was also playing on a small map, which lowers research costs, increases caravan payouts, and allowed him to meet civs that (very luckily) had techs he needed. He also managed to find a very good capital site.

I can certainly understand not finding the idea of micromanaging cities and running a global freight company to be particularly appealing. On the other hand, can you tell me of a game where playing really well doesn't involve careful optimization of everything that you are doing?

I think you will enjoy scenarios more than the standard game, because they can force you to stay closer to history. Besides, if you are complaining about AD 200 spaceships, the big offender is the fundamental premise of the game: that an entire civilization can be coordinated to pursue a goal that is thousands of years in the making, and can predict the necessary technology that they will need. Not to mention that a civilization can never lose technology and regress. In any case, the game year is just a number attached to a turn.

FWIW, in my scenario, I will make the trade units into ships, so that you can't hurry them along in any way (well, except by building wonders).

When I tried to do that (in MGE), I couldn't get the caravans to actually deliver their goods. Try it, of course, but this warning will dampen the disappointment if it doesn't work out.

------------------

On the topic of ship chains, I view them as a sort of representation of a full fledged trade route. I might be against the practice if ships had been given a bigger movement allowance.
 
200 A.D, 1,000 A.D., it's all the same. The point is that the game as it stands is *about* Caravans if you want to play optimally. Everything else exists to enable you to spam Caravans as quickly and profitably as possible. The ideal solution in my mind would be if I could drastically reduce the gold income from Caravans, and remove the Science component. Then they'd mostly be used for establishing trade routes, as I suspect was the intent of the developers.

Thanks for the heads up regarding the ships btw. If it doesn't work then I guess I'll just remove them. My map has a lot of navigable rivers though, and it would be a shame if they went to waste. I could also make Freight unavailable and give every civ Invention, Navigation and Flight at the start to nerf the gold/science values of Caravans. Btw do you happen to know if there are also techs that *increase* the trade value? I could then opt to leave those out of the game, since my tech tree contains only about 40 odd techs. And another quesion: do you know if it counts as 'overseas trade' when as island it connected to the mainland by its corner only, diagonally? I suppose I could test this easily enough, but I figured I'd ask anyway (and altering the map in-game might glitch the value somehow, giving misleading results).

EDIT: @TheNamelessOne: I apologize for having this debate in your patch thread; I only realized now which thread this was. I'm sure Prof. Garfield can respond by pm if he wants to.
 
(My apology too for contributing to the unintentional hijacking of this thread.)

Thanks for posting the link Professor. I have heard of this game but have never seen the log. I had no idea it was on Deity. I thought it must have been on Prince (extra 50 turns by +1 or warlord (extra 100 turns by +1). I remember we played a warlord GOTM long ago and a few players launched on +1. (Others won by conquest in BC years.)
If you look at the log, he had fantastic luck....
I read it early this morning and he did indeed have fantastic luck. From the techs his neighbors traded him to hut luck. Had he been allowed to choose his hut outcomes the great majority would have been the same! Nevertheless the result is impressive.
I think you will enjoy scenarios more than the standard game, because ...
Indeed. Scenarios are great fun, and an area I have unfortunately not explored. A lesser alternative, which I have invested a great deal of time in, is custom maps. They are far easier and far less time consuming to set up and the game play is a lot closer to normal game play. Yet, you can achieve amazing variety and experience areas of the game you would not under typical circumstances.

The point is that the game as it stands is *about* Caravans if you want to play optimally. Everything else exists to enable you to spam Caravans as quickly and profitably as possible. The ideal solution in my mind would be if I could drastically reduce the gold income from Caravans, and remove the Science component. Then they'd mostly be used for establishing trade routes, as I suspect was the intent of the developers.
Custom maps allow you to reduce the effect. Check out GOTM 150 which is still active (though not for very logn). The world is one continent and has very few water tiles. Caravan payouts are so dismal you get better returns from disbanding them for shields! We have played a number of interesting custom maps in GOTMs. You should check them out. From memory I can recall the Gauntlet, Haft Jazireh (7 isles), Haft aab (7 rivers), 7 walls, Sherwood forest, Dreyna (very recent), Global warming, Butterfly, Rivered Straits (GOTM 150), Pentagon, Ice hopper (very recent), the grid (square 4 tile islands laid out in a grid), 256-2x2isles (scenario), Discovery-of-America (scenario), Naval-warfare (scenario by Prof. Garfield), 2000-year-war-of-Levitius, the labyrinth, Ideal OCC (recent), ...

do you know if it counts as 'overseas trade' when as island it connected to the mainland by its corner only, diagonally?
Even a diagonal connection counts as the same land mass. The rule is this: if a land unit can get there without the aid of a ship, it is the same continent. Two far away peninsulas connected to the north pole are the same continent.
 
Even a diagonal connection counts as the same land mass. The rule is this: if a land unit can get there without the aid of a ship, it is the same continent. Two far away peninsulas connected to the north pole are the same continent.
Thank you for the info, and especially this bit. It has implications for my world map as well as the new map I'm making. Right now on my world map England and the Americas are on the same land-mass as Asia and Africa... :crazyeye: I think I'll keep them that way, though, since I want to reduce the impact of trade. I should mention this in the map description though. On my Finland map there are very few 'real' islands, so if the trade ships won't work out, then I'll just disable Freight, give everyone Navigation and Invention and hope that takes care of it.

Last off-topic post in this thread, I sware. :blush: My ToT disc still hasn't arrived, but when it will, the first thing I'll do is test ToTPP! :goodjob:
 
What are the original limit on max cities and units in TOT?

What does it mean that the patch is converting the home cities of all units?

I've got regular Civ2 v2.42. Is TOT a free to download somewhere since I already own a copy of Civ2, or are they separate games that both needs to be purchased?
 
What are the original limit on max cities and units in TOT?
255 cities and 2048 units globally. The max number of units for one tribe is slightly less.

What does it mean that the patch is converting the home cities of all units?
That has a technical reason, and if the following explanation doesn't make sense to you, you can safely ignore it. ;)
It has to do with how a home city of NONE is stored. This is normally stored as a byte, with value -1, which is the same as an unsigned value of 255. To support more than 255 cities, I've changed the home city field to a word, a 2-byte value. But without conversion, all units without a home city would suddenly become supported by city #255! Therefore this is done transparently when loading a game.

I've got regular Civ2 v2.42. Is TOT a free to download somewhere since I already own a copy of Civ2, or are they separate games that both needs to be purchased?
It's a separate game I'm afraid. But it has some nice additions, such as multiple maps. Very much worth it, IMHO!
 
Top Bottom