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

Battle of Italy 1943 - 1945 ToTPP 0.18.4 and Lua scenario, Updated to Patch 1.3

Again, I'm not an expert programmer in lua (at this stage of my development path perhaps an experienced beginner :)) but my first thoughts are that it's not simply a matter of the batch file.

Basically the complication is related to how I track the number of 'specific' units in the game, which is currently all based on the unit object names. This is not only done within the procurement file, which is already over 4400 lines, but at least 3 others as well such as onTurn, consolidatedEvents, onTribeTurnBegin. Trying to track different unit names for the same unit type might become overly complicated.
You're using the template, no? Meaning you're using an object file that associates object.uP51DMustang = civ.getUnitType(56)

It looks like you are, as in Procurement you have this line:

if unit.type == object.uP51DMustang then
totalP51DMustang = totalP51DMustang + 1
end

As long as you're pointing to civ.getUnitType in your object file, and not using the scheme in Napoleon (where you specifically IIRC searched for certain things like units by NAME) you ought to be able to simply change the name in the Rules file and change the art. The change to the rules file **shouldn't** make any difference to your code, at least here. It's one of the massive advantages of using the template over getunittypebyname or whatever the code was back in the day.

You might find that there are other hard compromises you have to make that can be sorted here.

The only reason why you'll see multiple lines in my object file in HoF was to make it easier on ME to write the events from scratch, but as you can see both objects refer to the same unit type. I could have just left one but then every US event after turn 37 would have referenced "GreekMountaineer" which just would have been annoying for me. Since your events are already written and ready and working you don't have to change anything in them, unless you've also referenced unit types by name rather than object somewhere else in the code.

object.uGreekMountaineer =civ.getUnitType(62)
object.uAmericanTankI =civ.getUnitType(62) -- Winter 1941 onward (turn 37)

But hey you've been working on this forever and who knows if it's worth the trouble if we're talking 2 units! Just thought I'd share how you could do it. Not exactly a game breaker :)
 
Thanks for the idea. Let me think about it.

In the meantime, I will let you continue to play first to see if you, or anyone else, has other suggestions to propose before I make a list of possible modifications.

So keep letting me know your thoughts and ideas.
 
As John has already said, this is a superb scenario, as is to be expected from Tootall. I've got one 'little-englander' gripe though; just wondering why the veteran 8th Army British, Indian and French colonial infantry are inferior to the US infantry? This campaign came right after Kasserine pass when the green US forces were routed by the same German troops who'd been booted all the way back from Libya to Tunisia by the Commonwealth forces. US performance in Sicily and Anzio wasn't that great either (not denigrating the Americans here; understandably they were fresh into the war and undergoing a period of adaptation against experienced German troops).

Also, shouldn't Mark Clark have a negative influence on the stats of nearby troops rather than a 10% attack bonus :lol:
 
The introduction of supply effects will be groundbreaking for those of us who want to build and play what are essentially wargames using ToT. IMO, it is the largest missing military element from vanilla ToT. Where can I find out more about Knighttime's supply module?
The supply module is Knighttime’s creation and as such he remains the authority on what are its limits and ultimate potential.

After playing John’s HoF which used the module, I reached out to Knighttime to see, if in addition to using a city improvement (in game “Supply Depot”) as a supply source, whether it was possible to also add a unit as a source, as I knew in advance that my scenario would have few actual cities in which to place Supply Depots and I needed a mechanism to be able to generate alternate supply sources that could keep the Allied troops in supply as they advanced up the front, hence the “Supply Hub”.

You can decide to apply different effects for units being out of supply. For example, whether their attack factors are reduced (even to zero), if their movement is affected or whether you can inflict damage on them.

In my scenario, supply only applies to the human player since the AI would have no clue as to how to work with it, therefore it’s not clear to me at least, how you could easily reproduce a Stalingrad type situation, where the AI units are cut off. I have implemented a sort of non-supply module effect in the game that allows you to cutoff the German Tenth Army and Gothic Line if you overrun a certain number of specific towns or cities.

In terms of my scenario, the following files where used to implement supply:
  • MechanicsFiles /supplyLinesCore.lua: is the core functionality which, as the designer you don’t need to modify
  • MechanicsFiles /supplyLines.lua: is the companion to the core file where you can set which improvements/units are to be sources, the length of the supply lines, which terrain prohibits supplies passing through and which units may be immune to supply
The following two files are where you can set the actual effects that you want to apply, depending if the effects are based on when the unit is being activated or whether it is entering a new tile:
  • EventsFiles /onActivateUnit.lua
  • EventsFiles /onEnterTile.lua
The following file is not directly related to the supply source but is the one that allows my DUKW units to add/remove supply hubs:
  • Root/consolidatedEvents.lua

I hope this gives you a preliminary overview of the supply module potentials.

Of course, if @Knighttime wishes to add to this discussion he's entirely feel free to do so.
 
As John has already said, this is a superb scenario, as is to be expected from Tootall. I've got one 'little-englander' gripe though; just wondering why the veteran 8th Army British, Indian and French colonial infantry are inferior to the US infantry? This campaign came right after Kasserine pass when the green US forces were routed by the same German troops who'd been booted all the way back from Libya to Tunisia by the Commonwealth forces. US performance in Sicily and Anzio wasn't that great either (not denigrating the Americans here; understandably they were fresh into the war and undergoing a period of adaptation against experienced German troops).
To give you an accurate answer as to why I did this would be overly long and complicated.

So for simplicity’s sake let me give you the short answer that, as I outlined in my ReadMe designer’s note, I used the games ‘Anzio’ and ‘No Retreat 4: Italian Front 1943-45’, as the fundamental research resources for my project. In both these games, the combat values of American units are higher than their British, CW or FF counterparts and therefore I reflected this in my game design.

I believe this difference is in part due to the high firepower that was typically prevalent in American units, more than specifically related to their combat proficiencies.

Also, shouldn't Mark Clark have a negative influence on the stats of nearby troops rather than a 10% attack bonus :lol:
Yes, in all the accounts I’ve read, General Clark’s generalship abilities are not particularly well viewed, hence his possessing the lowest bonus rating of all the Allied generals.
 
Last edited:
To give you an accurate answer as to why I did this would be overly long and complicated.

So for simplicity’s sake let me give you the short answer that, as I outlined in my ReadMe designer’s note, I used the games ‘Anzio’ and ‘No Retreat 4: Italian Front 1943-45’, as the fundamental research resources for my project. In both these games, the combat values of American units are higher than their British, CW or FF counterparts and therefore I reflected this in my game design.

I believe this difference is in part due to the high firepower that was typically prevalent in American units, more than specifically related to their combat proficiencies.


Yes, in all the accounts I’ve read, General Clark’s generalship abilities are not particularly well viewed, hence his possessing the lowest bonus rating of all the Allied generals.
:lol: As an old wargamer (and one very familiar with the excellent game 'Anzio'), I can tell you that one of my biggest beefs is that the American units are usually portrayed as just a little bit better. Years ago, there was a short lived Canadian wargame company and we and the Brits turned the tables, especially in their game of the War of 1812. It all depends on who controls the means of reproduction. :p
 
The introduction of supply effects will be groundbreaking for those of us who want to build and play what are essentially wargames using ToT. IMO, it is the largest missing military element from vanilla ToT. Where can I find out more about Knighttime's supply module?

The supply module is Knighttime’s creation and as such he remains the authority on what are its limits and ultimate potential.

After playing John’s HoF which used the module, I reached out to Knighttime to see, if in addition to using a city improvement (in game “Supply Depot”) as a supply source, whether it was possible to also add a unit as a source, as I knew in advance that my scenario would have few actual cities in which to place Supply Depots and I needed a mechanism to be able to generate alternate supply sources that could keep the Allied troops in supply as they advanced up the front, hence the “Supply Hub”.

You can decide to apply different effects for units being out of supply. For example, whether their attack factors are reduced (even to zero), if their movement is affected or whether you can inflict damage on them.
...
Of course, if @Knighttime wishes to add to this discussion he's entirely feel free to do so.
Hi @techumseh, I originally announced and released a Supply Lines module in this thread several years ago:
https://forums.civfanatics.com/threads/new-supply-lines-module-for-lua-events.640009/

Since then, I've never separately released an updated version with more features, but I've worked directly with multiple designers who reached out to me privately to explain their needs. The version of Supply Lines embedded within @tootall_2012 's scenario is more advanced than what can be downloaded in the original thread. So far it's seemed more efficient to help a few people out with customized modules, rather than try to create a "one size fits all" generic version with advanced features that may (or may not) ever be used. I'll do my best to answer questions about what's possible, though, either in that thread or via private message.

I should emphasize that at its core, Supply Lines is really just the concept of "pathfinding" with lots of parameters. As Tootall discussed, the purpose of the module is really to determine whether or not a given unit is supplied, based on the designer's very specific definition of that concept for their scenario. The module doesn't provide any special functionality as far as applying penalties or bonuses based on the result -- those are entirely up to the designer, and what's possible in that regard is determined by what TOTPP/Lua in general can support.
 
Hello Tootall_2012,
I've installed your scenario following the steps you've given but the ocean tiles are looking as following:
1697650727463.png


It seems that the game, at least the game version I'm using, has some problems with the terrain.bmp file.
My ToT is updated with the latest version and I'm currently using ToTPP v0.18.4 as you recommended.
 
Hi civ2units,

Hmm, no one else has reported having this issue. I just retested the download folder and it is working as expected on my side:

1697653224029.png


Normally, when this happens it's because the number of terrain type tiles in the @COSMIC2 section of the rules.txt file is not properly set for their in game equivalent which isn't the case here (i.e. I've set the maximum of 16 terrain types for each map):

Code:
@COSMIC2
...
NumberOfTerrainTypes, 16,16,11,11

Is your scenario folder named 'Battle of Italy' and do you have the following folders/files in it? Especially the Terrain folder? Do you have the ToTPP lua folder in the ToT root directory?

1697653744483.png
 
It looks like only shores tiles are having an issue.
Thus checking Terrain02.bmp's bottom and @OVERLAYS section in rules.txt to check if it matches well (mostly the last overlay in the bmp file) ?

(verifying you have the same files as everyone else)
 
Last edited:
Unfortunately, it’s always difficult to troubleshoot these kind of issues from a distance as you don’t have access to the other person‘s set up. But if there was a problem with the overlays, I believe everyone would be experiencing the same thing not just civ2units.
 
Thanks. Can it be applied to the AI? One of the key objectives of any general is to cut off his opponent's supply.
Technically, there is nothing about the capabilities of the Supply Lines module that is specific to the human player. All of the code could work equally well for human and AI tribes. But you, as the designer, have the flexibility to scope the implementation as you see fit. Tootall applied this in a limited fashion:

In my scenario, supply only applies to the human player since the AI would have no clue as to how to work with it, therefore it’s not clear to me at least, how you could easily reproduce a Stalingrad type situation, where the AI units are cut off. I have implemented a sort of non-supply module effect in the game that allows you to cutoff the German Tenth Army and Gothic Line if you overrun a certain number of specific towns or cities.
As he wrote, the problem is that the AI doesn't understand this as a strategy, either offensively or defensively. If the AI manages to cut off your supplies, it's not because they were attempting to do so -- it's simply a byproduct of their standard strategy. And similarly, the AI won't "worry" about you cutting off their supplies, so they won't make any special efforts to keep a supply line open. The module doesn't contain any enhanced logic for the AI that might allow it to utilize the concept of supply lines in its goals or planning, and I think this would be quite difficult to write.
 
Hello Tootall_2012,
I've installed your scenario following the steps you've given but the ocean tiles are looking as following:


It seems that the game, at least the game version I'm using, has some problems with the terrain.bmp file.
My ToT is updated with the latest version and I'm currently using ToTPP v0.18.4 as you recommended.

Terrain works fine for me - I couldn't see a problem with the terrain file's 'invisible' magenta RGB (128:80:128) which sometimes causes this sort of issue

Image2.png
 
.... It all depends on who controls the means of reproduction. :p
Nice :lol:


@tootall_2012 I think Brian's right, the wargame manufacturers were largely American and the default position is for the US to be magically superior to everyone else; I don't think it has anything to do with greater firepower for individual brigades or divisions ( a commonwealth 43-45 armoured division had far more tanks than an equivalent US division for example). There's definitely a case to be made for NZ or gurkha 'regular' units to have superior stats to anyone else, or for that matter the Poles who were the ones who finally cracked Cassino and by all accounts were especially well motivated and effective in their actions, for obvious reasons.

I'll stop harping on about this now and get back to enjoying a tremendous scenario!
 
Terrain works fine for me - I couldn't see a problem with the terrain file's 'invisible' magenta RGB (128:80:128) which sometimes causes this sort of issue
@civ2units, just trying some more trouble shooting. Is it possible you have another designer's mod installed that is asking you to point to another lua or graphics folder?
 
@tootall_2012 I think Brian's right, the wargame manufacturers were largely American and the default position is for the US to be magically superior to everyone else; I don't think it has anything to do with greater firepower for individual brigades or divisions ( a commonwealth 43-45 armoured division had far more tanks than an equivalent US division for example). There's definitely a case to be made for NZ or gurkha 'regular' units to have superior stats to anyone else, or for that matter the Poles who were the ones who finally cracked Cassino and by all accounts were especially well motivated and effective in their actions, for obvious reasons.

I'll stop harping on about this now and get back to enjoying a tremendous scenario!
I certainly respect the opinions of experienced CivFanatics members like yourself and others and often take them into consideration when making adjustments to subsequent versions of any of my given scenarios. Though I don’t wish to open a whole debate on the subject, I felt I should at least provide a little more explanation on how I went about determining the strength of all the units in the game.

I often relied in the past on the work of other designers to evaluate the combat strengths of units in my own scenarios, particularly WWII ones, but never truly found a common baseline amongst them which complicated matters for me.

As such, I’d been working for the last few years on a very personal system that would allow me to create a database of sorts that had predetermined combat strengths for all ground, air and naval unit types which would then allow me to recreate any WWII scenario without having to research this each time.

As such, I’ve been using a game called ‘Advanced Squad Leader’, which has an extensive repertoire of the ground forces of all the nations that fought in WWII, as my primary data source for establishing the unit base lines and used a very specific set of parameters and methodology for computing all my numbers. Many may argue, rightly or wrongly, that my concept, data source or the methodology I used as being flawed or in error but all I can say is that I applied it rigorously and consistently throughout my process.

Overall the relative strengths between the units of the different nations seemed consistent and logical with regards my overall experience in these matters and though it may be true that a few of the computational results may have surprised me (case in point the British Veteran unit), in the end, I tried to remain as faithful to my process as possible if it was to remain reliable.

In general, I believe that the results were born out during my play testing as the scenario and unit capabilities in the 'Battle of Italy' feel well balanced. At least, that is, in my personal opinion. :)

Again people may agree or not with my approach, but as the designer, I made a decision that I believe was consistent and logical (if perhaps, at times, imperfect) in helping me design my scenario. I hope this helps explain why things are the way they are.

Sincerely.
 
Last edited:
My computer is definitely the problem. I think maybe the bat file was not executed correctly.
Anyway, I will try to reinstall your scenario the following weekend. I'm sure, I will fix that 'bug' in one or another way.:)
 
Top Bottom