[TOT] The Test Of Time Patch Project

Another crazy dreamer wishlist item that I don't expect to lead to anything but it can't hurt to ask and gauge interest. :)

I was wondering just how far fetched it would be for TheNamelessOne to implement large custom unit pictures in the ToT Civilopedia like it already does with it's buildings and wonders? I notice that ToT is similar to MGE in that it just has double sized pixely blown up versions of the regular unit sprites. It's interesting that Microprose chose to upgrade the other sections for optional large images but not also upgrade the units section with optional image displaying too.

upload_2022-2-23_5-37-15.png
.
upload_2022-2-23_5-37-26.png


I asked @Knighttime about this as I didn't want to accidentally request something that was already implemented, and while he confirmed it doesn't currently exist in ToT he also made a rather interesting point I'd completely forgotten about which was that oldschool pre-MGE Civ2 up to FW actually used extra large and high resolution unit sprite images in it's Civilopedia (the images were weirdly stored in its custom pedia files though so not very mod friendly) but that this was scrapped in MGE for the blown up regular unit sprite images which ToT continued to use as well. I wonder just how much it was scrapped and if there's left over functionality, or if the ToT implemented building and wonder images system could be transplanted over to the units as a option.

Artillery.png


Probably too messy and too much to ask for but I'm sure a few people here would admit the that creative immersion opportunities for their scenarios if ToT supported this would be pretty cool. Eg @Knighttime could use cool historical paintings for each of the units in his Medieval Millennium scenario, @JPetroski could use historical World War images for the units in his projects, Nicheal could have cool shots of Star Wars ships & characters for his up and coming multi world SW scenario, @CurtSibling 's created some stunning title gifs over the years for his scenarios using his cartoonist skills so I can only image what sort of stuff he could do for all his fantasy & scifi units if he wanted, and of course the wheels and cogs turn in my mind over what I could do in ToT versions of my mods and scenarios eg for my Heroes of Might and Magic 2 mod the original HoMM games had nice unit portraits that would have been nice to put in the pedia:

upload_2022-2-23_19-21-21.png
.
upload_2022-2-23_19-22-25.png


And the C&C and Red Alert games had nice pictures in their build menus albeit a bit small but I could enlarge and smooth out for my C&C Africa and Red Alert 2 mods.

upload_2022-2-23_19-24-17.png
 
Last edited:
They probably scrapped it for ease of compatibility, but I honestly miss the old Encarta-style pedia.
 
Seems CIV2 did have many elements that are really great, but were graphically tricky to mod. Perhaps ToTPP will give us new tools in this regard, going forward. But first, lets get that civ-faction limit cracked! :D
 
I find the settler flag feature to be very useful, and something I've been hoping for ever since I played Alpha Centauri which did have it. Thank you. Since you were able to separate those functions, I was wondering if you could do it with the submarine flag functions as well. If we could independently set flags for ships that can't attack units on land from the invisible until attacked feature, it would be much appreciated.

The second request is one that would be very useful for scenarios as well. Removing the stringent requirements for units affected by the pikeman flag would open up many opportunities for designers. If you could add another flag to designate which units the 'pikeman' was doubled against, instead limits on # of hits, 2 MF, etc., the flexibility would allow it to be used for things like anti-tank guns vs. tanks, machine guns vs. infantry and so on. A very valuable tool indeed.
 
If you could add another flag to designate which units the 'pikeman' was doubled against, instead limits on # of hits, 2 MF, etc., the flexibility would allow it to be used for things like anti-tank guns vs. tanks, machine guns vs. infantry and so on. A very valuable tool indeed.
One could already achieve this with onResolveCombat() function, and it seems even easier to do so with the onInitiateCombat() more recent one ?

Or maybe are you finding it lacking AI behaviour consequences and not enough readable by the player ?
 
One could already achieve this with onResolveCombat() function, and it seems even easier to do so with the onInitiateCombat() more recent one ?

Or maybe are you finding it lacking AI behaviour consequences and not enough readable by the player ?

I think it would be better to have it built in to the game functions than as a matter of event programming. For those of us who are still struggling with Lua events, having it built in would be much easier.
 
I think it would be better to have it built in to the game functions than as a matter of event programming. For those of us who are still struggling with Lua events, having it built in would be much easier.

The Lua Scenario Template sort of blurs the line between "built in game function" and event programming. I can write a simple interface for a particular problem if that is what is desired. I have tended to err a bit on the "flexibility" side of the simplicity-flexibility scale, but I can change that. Since we already have access to everything we need through Lua, I'm inclined to think this is something I can do rather than relying on TNO.

Would it be acceptable to add combat bonuses in a dedicated file using this kind of interface?

Code:
simpleCombatBonus({
attackMultiplier = 1.25,
defenseMultiplier = 1.5,
bonusFor = {object.u2Pounder, object.u88MMFlak},
bonusAgainst = {object.uChurchill, object.uPanzerIV},
})

Another option would be for you to design a custom @SECTION for the rules.txt. I already have a program to read and parse the rules file of the current scenario, and a quick test suggests that extra sections of the rules don't stop the game from loading.
 
The Lua Scenario Template sort of blurs the line between "built in game function" and event programming. I can write a simple interface for a particular problem if that is what is desired. I have tended to err a bit on the "flexibility" side of the simplicity-flexibility scale, but I can change that. Since we already have access to everything we need through Lua, I'm inclined to think this is something I can do rather than relying on TNO.

Would it be acceptable to add combat bonuses in a dedicated file using this kind of interface?

Code:
simpleCombatBonus({
attackMultiplier = 1.25,
defenseMultiplier = 1.5,
bonusFor = {object.u2Pounder, object.u88MMFlak},
bonusAgainst = {object.uChurchill, object.uPanzerIV},
})

Another option would be for you to design a custom @SECTION for the rules.txt. I already have a program to read and parse the rules file of the current scenario, and a quick test suggests that extra sections of the rules don't stop the game from loading.

Yes x 1000! :)
 
I have tended to err a bit on the "flexibility" side of the simplicity-flexibility scale, but I can change that.
...
Another option would be for you to design a custom @SECTION for the rules.txt. I already have a program to read and parse the rules file of the current scenario, and a quick test suggests that extra sections of the rules don't stop the game from loading.
I didn't realize you could add new custom sections to Rules.txt without this generating errors -- that's very interesting. If you want to increase the "simplicity" factor, I think that would be a great way to attract additional modders to begin leveraging the power of Lua. I suspect that quite a few people who are intimidated by the concept of "learning Lua" would be very comfortable adding new sections to a text file, as long as the format was clearly documented.
 
I didn't realize you could add new custom sections to Rules.txt without this generating errors -- that's very interesting. If you want to increase the "simplicity" factor, I think that would be a great way to attract additional modders to begin leveraging the power of Lua. I suspect that quite a few people who are intimidated by the concept of "learning Lua" would be very comfortable adding new sections to a text file, as long as the format was clearly documented.

That sounds like a possibility I suppose.

Could this approach be used in a broader way? For example, I've struggled with how to represent fighter-bombers in some scenarios. If you make a fighter with a big enough AF to take out ground units, it's too powerful against other air units. If a FB unit could be doubled (or tripled) against ground units only, it would make an air-capable attack aircraft. Or if a bomber could only attack naval units (in AND out of port), it would make a great torpedo bomber.
 
Could this approach be used in a broader way? For example, I've struggled with how to represent fighter-bombers in some scenarios. If you make a fighter with a big enough AF to take out ground units, it's too powerful against other air units. If a FB unit could be doubled (or tripled) against ground units only, it would make an air-capable attack aircraft. Or if a bomber could only attack naval units (in AND out of port), it would make a great torpedo bomber.

Lua (along with @Knighttime 's work creating a program to calculate the 'standard' combat power in a given situation) gives us the power to change the attack and defense of combatants (and their firepower) based on the current situation at the time of combat. Combat can be stopped part way through with both units surviving, or even before anything happens, if you'd prefer that combat not take place. We can also change the unit that gets chosen to defend a tile. The things you suggest can be done (though the AI might have trouble handling having a torpedo bomber's attack cancelled if there is no ship on tile), and I'd be happy to write the code for it if you have a scenario under construction that needs it.

I can't really think of anything that can't be done regarding combat. This has obvious advantages, but makes it hard for me to create a simplified specification/interface without some input.
 
Interesting. I sounds particularly valuable for representing tactical combat. The only unit fitting the fighter-bomber role in my current project is the P-61 Black Widow, which was primarily a night fighter, but also used for ground attack in China. Here are the current specs:
P-61 (US), nil, 1, 16.,2, 7a,4d, 4h,3f, 12,0, 0, U2, 000000000010000
Ideally, I'd like it to attack air units at 5 and ground units at 10. Or 6 and 12, depending on testing.
 
Interesting. I sounds particularly valuable for representing tactical combat. The only unit fitting the fighter-bomber role in my current project is the P-61 Black Widow, which was primarily a night fighter, but also used for ground attack in China. Here are the current specs:
P-61 (US), nil, 1, 16.,2, 7a,4d, 4h,3f, 12,0, 0, U2, 000000000010000
Ideally, I'd like it to attack air units at 5 and ground units at 10. Or 6 and 12, depending on testing.

Send me a PM with your scenario files, and I'll send back any files that I've changed (I expect it will just be one file, combatSettings.lua). I'll set it up so that the P-61 halves its attack when attacking domain 1 units, that way it will be encouraged to attack, and you can change the power easily in the rules.
 
I'd love to explore the possibilities of added sections to the Rules...A mind-blowing development.

A section that lists units that can confer bonuses to a stack would be something I'd love to see.
Also some way to swap around or change the bonuses given by city improvements and wonders too.
 
@TheNamelessOne

Is there any prospect for an "on unit entered tile" event? I could probably write one using onActivateUnit and keeping track of what unit was active, and where it was on the previous call, but if you have something like that planned already it might make sense to wait for that rather than trying to catch any corner cases (such as dealing with what happens when no more units are available to be activated automatically).

Since I've brought up features, I'd like to suggest a couple more:

1. A function to direct a unit to enter an adjacent tile, and attack if applicable. GOTO gets interrupted when there are foreign units nearby. This would be useful for controlling the AI, and that feature would be convenient for human ranged attacks when there is only one target nearby.

2. Can we get more control over city improvements and/or city processing. Like changing tax/science/luxury bonus for improvements, or controlling the number of content and happy citizens. Changing the effectiveness of city improvements or wonders does come up from time to time.

Also, can you give any insight into how the in game pathfinding algorithm works? In particular, how the game chooses the shortest path if there are several of them. Perhaps in your movement debug patch, you could indicate the order in which the tiles got their weight.

The main reason for my interest is that trade routes get a transportation bonus if the cities are connected by road or rail, but only if they are connected by what the game thinks is the "best" path. The idea is described here. This image shows the path from any particular square to the centre square, assuming there is no ocean.

trade-path.png


I could program this exact pathfinding, as odd as it is, but it wouldn't help determine the path if there is some ocean in the way. I'm also now just plain curious about the algorithm that produces this.
 
2. Can we get more control over city improvements and/or city processing. Like changing tax/science/luxury bonus for improvements, or controlling the number of content and happy citizens. Changing the effectiveness of city improvements or wonders does come up from time to time.
@TheNamelessOne I'd like to second this, on two fronts specifically:

1. onCalculateCityYield() is great and a huge step forward, but (besides food and shields) it only permits us to affect the trade generated by the city -- not the apportionment of that into tax, luxuries, and science, which is still handled by the national rates and all of the standard adjustments (provided by improvements, wonders, governments, etc.). If Lua could provide a way of directly adding/removing tax, luxury, and science quantities in the city, I think that would provide the flexibility we need to either adjust the effectiveness of the existing improvements/wonders that offer bonuses in these areas, or assigning those capabilities to other ones.

2. There currently isn't any way to adjust the calculations for happy/content/unhappy citizens in a city, and those fields in the city object (city.numHappy and city.numUnhappy) aren't writeable. So some ability to affect these calculated results within each city would be a very useful enhancement.

In both cases I'd really like to see something that's more flexible than adjusting the bonus of existing improvements/wonders on a one-at-a-time basis. For example, something like a new @ COSMIC2 key for "numContentCitizensTemple" would give us control over the degree of effectiveness of that particular improvement. But if we had the ability via Lua to alter happy/content/unhappy citizens directly, we could not only alter the effectiveness of a Temple, but could even provide this as a new effect to other improvements: for example, a Factory might continue to provide its normal shield bonus, but it could be given the undesirable side effect of making one content citizen unhappy (simulating harsh working conditions early in the Industrial Revolution).
 
Last edited:
@TheNamelessOne

I recently designed an event that depends on some Lua code being executed before the game can react. In this example, in order to control airlifts, pressing 'L' sometimes changes the domain of the active unit's type to 2 in order to stop an airlift. This calculation has to happen before the game checks whether the unit type is a ground unit or not. I'm wondering if this kind of mechanism will be reliable across computers with different specs. That is, if my computer executes the Lua code before the check, can I be confident that other computers will do so too?
 
Top Bottom