Over the Reich: Single Player - Development Thread

Was there a suggested city name? I'm guessing that city.name is the name that is suggested by city.txt, not the name you type into the name box. Let me see what I can do.
Correct - there was none. It did work perfectly in the old version as I recall. Also, a weird, but not insurmountable bug - the city icon doesn't actually show up until you go into the city status window and access it that way, though it will have the name (in this case though just "N") show up. Doesn't really matter if new cities can't be built but an odd one I thought I'd better report.
 
@Prof. Garfield I was able to get this working to build a city and add an airfield improvement/SDI defense to it but it doesn't actually create a city on the night map with the correct name. For example, if I found a city and name it "Test" it only comes up as "(N)" on the night map instead of "Test (N)". I tried moving the quotation mark around but that didn't seem to help. Any thoughts?
Try this. You'll have to require it somewhere, and add the lines to change terrain and add an improvement, but I've briefly tested with the name. Let me know if you have any more problems.
 

Attachments

  • foundNightCity.lua.zip
    489 bytes · Views: 7
Correct - there was none. It did work perfectly in the old version as I recall. Also, a weird, but not insurmountable bug - the city icon doesn't actually show up until you go into the city status window and access it that way, though it will have the name (in this case though just "N") show up. Doesn't really matter if new cities can't be built but an odd one I thought I'd better report.
If we're still going to have the players build airfields themselves, I'll revisit the above code to make it more robust. I thought that for now, this is just to make your life a bit easier.
 
If we're still going to have the players build airfields themselves, I'll revisit the above code to make it more robust. I thought that for now, this is just to make your life a bit easier.
I don't think we'll need to have cities being founded in this scenario with how many there are. It also will probably be easier to work on the transportation network without new cities thrown in as well. I just didn't know if it was something you'd ever offer to others though I really struggle to think of any other type of scenario that would need this functionality. Thanks for the help - it worked like a charm.
 
OK, so all the cities and airfields are placed. There's a lot of them.

The Allies have 50 industrial cities and 100 airfields (50 day, 50 night of course).
The Germans have 95 industrial cities and 210 airfields (105, 105).

I think I will balance the airfield inequity by having all Allied airfields have a special resource on them that basically doubles their production compared to the Germans. Also, Allied planes will be less expensive in general.

This is a good thing and a challenge. Good, because in most of our playtests of the old version, @Prof. Garfield , there were quite a few luls in combat that would require a buildup. I don't think that is as likely to happen here. There should be a fair amount of units produced each turn to be destroyed.

Making A Giant Scenario Feel Small

I do however think a system like I alluded to a few posts higher is definitely going to be necessary. These are far more cities than even the British have at the start of the Imperialism scenario. But I do think if we break continental Europe into 8-10 "zones" where one can set the production specialization at a few button presses, it's not so bad. Figure every zone has 20-30 airfields. Your first step as a player would be to set the generalization of each region and then if you wanted to change an airfield by airfield, you could do that for a little nuance without having to go into each place individually. Likewise, you could choose which areas of Germany to concentrate various types of industry improvements or freight on. If you figure roughly 10 cities per zone, you could set your entire nation up with 16-20 choices, 50/50 airfields and industry.

I'm also interested in your thoughts on specialists. If there's a way to change these en masse so that someone doesn't feel compelled to go into every city to min/max, or fall behind? Again, probably with the regional set up. If one can't change the specialists all at once for a region, should we prohibit their use, period? I tend to get rid of incremental rush building in scenarios (especially MP scenarios, which this might be occasionally) because my thought "if you can do it you're going to feel like you must do it to stand a chance, but if you can't do it, you simply don't have to bother."

Basically for all these situations I'd envision a system where the button press overrides all decisions made prior for the cities, so you do it FIRST. But it wouldn't keep checking turn by turn, so you could go and change a few cities/airfields in whatever region to whatever you want to specialize a bit. I'm just looking for a way to save time for everyone and still get a pretty good result.

Making the Transport Network Make Sense and Be Hands Off

In a similar thought, I do think you're right that we should just endeavor not to actually have the player move trains at all, though they might decide to focus on building them. I was thinking something like this with basically three units that come into play:

The Train
A Supply Depot
A Railyard

The train is built in a city. It immediately is basically teleported along an uninterrupted rail line towards the closet supply depot it can reach. When it gets to the supply depot, the train disbands, and the airfields that are within a certain range of it all get a number of shields deposited into them.

The Allies would have three ways of stopping or at least slowing this.

1. Destroy the train while it is on the tracks;
2. Destroy the railyard which would put a gap into the rail line meaning the train would need to redirect;
3. Destroy the supply depot meaning the train now needs to search for another one, which may be farther, and in any event, the airfields near the supply depot no longer will be in supply.

No idea if this is possible or feasible, but given all three of these would be on the low altitude map, I think it would give the tactical arm real meaning, and it's also intuitive and makes sense.

My next question though is do we tie either the railyard or supply depot unit to a building? I really don't know, because if the AI decides not to build it, the Allies really might wreck the transportation industry. I think that tweaking the civ to "perfectionist" makes it more likely to build improvements, so maybe that would work?

My Next Steps
I'll try and square away the improvements soon. I'm with the kids tomorrow and won't be able to do much. Since fuel isn't tied to gold right now I'm not sure that the fuel units will be tied to improvements. I might rename money "resources" and spread those out between a few other things like the raw materials perhaps. Once that's done I think the necessary names will be in the rules so we can recreate an object file.

Also, I'll push this in a few days when everything is built but I'm just attaching it now so I don't lose 5 hours work :)
 

Attachments

  • CitiesPlaced.zip
    1.4 MB · Views: 7
Making A Giant Scenario Feel Small

I do however think a system like I alluded to a few posts higher is definitely going to be necessary. These are far more cities than even the British have at the start of the Imperialism scenario. But I do think if we break continental Europe into 8-10 "zones" where one can set the production specialization at a few button presses, it's not so bad. Figure every zone has 20-30 airfields. Your first step as a player would be to set the generalization of each region and then if you wanted to change an airfield by airfield, you could do that for a little nuance without having to go into each place individually. Likewise, you could choose which areas of Germany to concentrate various types of industry improvements or freight on. If you figure roughly 10 cities per zone, you could set your entire nation up with 16-20 choices, 50/50 airfields and industry.

I'm also interested in your thoughts on specialists. If there's a way to change these en masse so that someone doesn't feel compelled to go into every city to min/max, or fall behind? Again, probably with the regional set up. If one can't change the specialists all at once for a region, should we prohibit their use, period? I tend to get rid of incremental rush building in scenarios (especially MP scenarios, which this might be occasionally) because my thought "if you can do it you're going to feel like you must do it to stand a chance, but if you can't do it, you simply don't have to bother."

Basically for all these situations I'd envision a system where the button press overrides all decisions made prior for the cities, so you do it FIRST. But it wouldn't keep checking turn by turn, so you could go and change a few cities/airfields in whatever region to whatever you want to specialize a bit. I'm just looking for a way to save time for everyone and still get a pretty good result.
If there are so many airfields, I don't think that most of them should actually be building aircraft. Either some should have aircraft factories and those ones can build aircraft, or cities build aircraft, and they are teleported to an airfield upon completion.

Rather than choosing production by region, I'd suggest having the player specify an overall force ratio. For example, they could specify (by a 0-10 menu in each category) a ratio of 6 fighters : 3 jabo : 4 bombers and production orders would be altered automatically to try to replace the unit type that has fallen most short of the desired ratio. We could experiment with the Automatic Production setting of cities. If the AI is not too aggressive at changing production orders, most cities could be set to auto-build, which code can detect and adjust to meet player defined goals. If the player really wants to control a particular city's production order, they can turn off auto-build.

Your regional grouping of airfields could still be a good idea. Each region could be assigned an aircraft ratio, and newly built aircraft could be teleported to a random airfield in the region most in deficit of that kind of aircraft.

Based on the documentation, specialist assignments can be changed via Lua, though I haven't done that yet. It should be pretty easy to change specialists en mass, perhaps in groups based on the presence of tax/science improvements (so you don't trade a 7 or 8 tax man for a 3 scientist). This scenario could be a reason to start building "player aid" tools on a fairly large scale.

Making the Transport Network Make Sense and Be Hands Off

In a similar thought, I do think you're right that we should just endeavor not to actually have the player move trains at all, though they might decide to focus on building them. I was thinking something like this with basically three units that come into play:

The Train
A Supply Depot
A Railyard

The train is built in a city. It immediately is basically teleported along an uninterrupted rail line towards the closet supply depot it can reach. When it gets to the supply depot, the train disbands, and the airfields that are within a certain range of it all get a number of shields deposited into them.

The Allies would have three ways of stopping or at least slowing this.

1. Destroy the train while it is on the tracks;
2. Destroy the railyard which would put a gap into the rail line meaning the train would need to redirect;
3. Destroy the supply depot meaning the train now needs to search for another one, which may be farther, and in any event, the airfields near the supply depot no longer will be in supply.

No idea if this is possible or feasible, but given all three of these would be on the low altitude map, I think it would give the tactical arm real meaning, and it's also intuitive and makes sense.

My next question though is do we tie either the railyard or supply depot unit to a building? I really don't know, because if the AI decides not to build it, the Allies really might wreck the transportation industry. I think that tweaking the civ to "perfectionist" makes it more likely to build improvements, so maybe that would work?
All of this seems feasible, and a decent way to run the "transport economy" assuming we keep aircraft production in airfields. We should be able to force the AI to build important structures through code, and if we can't, we can always cheat and give it back important infrastructure from time to time.
 
If there are so many airfields, I don't think that most of them should actually be building aircraft. Either some should have aircraft factories and those ones can build aircraft, or cities build aircraft, and they are teleported to an airfield upon completion.

Well, the best way to not have to worry about managing 210 airfields is to simply ensure nothing is built in them. I did give them all the SDI defense improvement since we don't need it for anything else and I figured it would make it easy to do things like this with canBuildSettings.

I think a good rule might be "All cities in Germany and Austria can build aircraft and cities in occupied territories can only build them if they have an aircraft factory." I'm pretty sure canBuildSettings allows this sort of flexibility.

That would also bring parity much closer at the start figuring the Gerrmans might have closer to 60 or so cities to the Allies' 50 (rather than the 95 Germany technically has).

Rather than choosing production by region, I'd suggest having the player specify an overall force ratio. For example, they could specify (by a 0-10 menu in each category) a ratio of 6 fighters : 3 jabo : 4 bombers and production orders would be altered automatically to try to replace the unit type that has fallen most short of the desired ratio. We could experiment with the Automatic Production setting of cities. If the AI is not too aggressive at changing production orders, most cities could be set to auto-build, which code can detect and adjust to meet player defined goals. If the player really wants to control a particular city's production order, they can turn off auto-build.

I didn't know that was an option with the auto-build, so that works well, and saves even more buttons. I think Auto Build will allow a military and domestic advisor so maybe we can also figure out a weight to the buildings.

Your regional grouping of airfields could still be a good idea. Each region could be assigned an aircraft ratio, and newly built aircraft could be teleported to a random airfield in the region most in deficit of that kind of aircraft.

That works for me. Throughout the war the Luftwaffe had a number of organizational structures and I'd probably just create one that's semi-historical that makes sense. I could draw little markers on one of the maps at least. I don't know that it's needed on all of them.

Based on the documentation, specialist assignments can be changed via Lua, though I haven't done that yet. It should be pretty easy to change specialists en mass, perhaps in groups based on the presence of tax/science improvements (so you don't trade a 7 or 8 tax man for a 3 scientist). This scenario could be a reason to start building "player aid" tools on a fairly large scale.

I would entirely leave it up to you how it's done because you're the Civ2 professor who understands all that magic :) I do think it's important for something on this scale though because you know you're the exact sort of person who would want to optimize, and how long might that take? If the problem can be solved by us I think it makes the game a lot less tedious.

All of this seems feasible, and a decent way to run the "transport economy" assuming we keep aircraft production in airfields. We should be able to force the AI to build important structures through code, and if we can't, we can always cheat and give it back important infrastructure from time to time.
Well, if we go with "cities build aircraft" then cities don't need to build "freight trains" so maybe the earlier idea I had about how to move fuel around the map could also move "replacement parts" or anything else really. Maybe German aircraft and flak repair very quickly when trains reach a depot. We have units and 1 more terrain slot so however you think it's best to achieve this I'm up for.

I do think we should go to some length to get a working transport system in place. First, they were absolutely major targets and at the very least should have a big impact, eventually, on if the advance moves historically, faster than historically, or slower than historically. But also, it gives some reason for the tactical force.

The scenario is at a high level a zero sum game between two players which is hard to balance. But if we can at least create three distinct forces within it we might achieve that balance.

Having all urban and probably the electrical targets on night maps (since the Allies really didn't target them too much, and the more famous attempts were the dam busters and such that the RAF did anyway) means that if the Allies exclusively targeted this, they "could" win because it's basically the lowest block on the food chain and can wipe out everything else. But, if they do exclusively rely on this, then the factories which build the aircraft are unencumbered which might allow Germany to thwart the night raids, and the German fighters are going to be hard to knock out because they'll repair quickly since the tactical group hasn't damaged the transportation network, so fuel, supplies, pilots, whatever, are all reaching them timely.

On the other hand, if you only targeted the transport network, well, everything else would be humming and there might be so many new fighters that it wouldn't matter they weren't being healed.

Likewise, if you only targeted the daylight strategic targets, everything would restore much more quickly because you haven't impacted the workforce nor the means of getting supplies around.

It would be good to have a situation where the "best" approach is probably some weighted combo between the three, perhaps with forays more heavily into one at strategic moments to try and break your foe or serve a distinct purpose.
 
I did give them all the SDI defense improvement since we don't need it for anything else
Do any air units in this scenario have the, "missile," flag (destroyed after attacking)? Because SDI Defense gives a +100% bonus in defense vs. those, as well anulling attacking nuclear weapons.
 
Do any air units in this scenario have the, "missile," flag (destroyed after attacking)? Because SDI Defense gives a +100% bonus in defense vs. those, as well anulling attacking nuclear weapons.
We're planning to have fighters and bombers attack directly in this scenario, so we're not generating bomb/bullet units. I guess V1s and V2s would still be missiles, but they shouldn't be attacking airfields anyway.

That said, the current version of TOTPP Lua and the Scenario Template allow us to remove that combat bonus without too much trouble if we need to (though I suppose the "defense increased" message would still be shown).
 
We're planning to have fighters and bombers attack directly in this scenario, so we're not generating bomb/bullet units. I guess V1s and V2s would still be missiles, but they shouldn't be attacking airfields anyway.

I did throw a few bombs in just in case we needed them, but as long as we can still have payload be a thing for the bombers, I'd much prefer direct attacks for all like you mentioned.
 
@Prof. Garfield a (hopefully) quick question to help me allot time this weekend:

I assume but am not sure that there's a quick code we could do to copy the special resources from one map (0) to another (2)? Can you also copy things like railroads or mines etc? The reason I ask is it would be tremendously helpful to not have to manually add them to both and just work off of one map and then paste it all where it belongs after.
 
I assume but am not sure that there's a quick code we could do to copy the special resources from one map (0) to another (2)? Can you also copy things like railroads or mines etc? The reason I ask is it would be tremendously helpful to not have to manually add them to both and just work off of one map and then paste it all where it belongs after.
Sure, I can write code to copy that stuff over to another map.
 
@Prof. Garfield a (hopefully) quick question to help me allot time this weekend:

I assume but am not sure that there's a quick code we could do to copy the special resources from one map (0) to another (2)? Can you also copy things like railroads or mines etc? The reason I ask is it would be tremendously helpful to not have to manually add them to both and just work off of one map and then paste it all where it belongs after.
Here's the script. I only tested it once, so let me know if you run into problems. Use CTRL+F8 to change the maps to custom resources.

At the top of the script, here are things to change based on what you want to copy or not copy.

Code:
local sourceMap = 0 -- Map to copy info from
local destMap = 1 -- Map to copy info to

local copyResources = true
local copyImprovements = true
 

Attachments

  • copyBetweenMaps.lua.zip
    566 bytes · Views: 8
@Prof. Garfield any idea why this isn't working in the console? I'm trying to add an air defense unit (167) to every Allied (1) city that has an airfield (17) improvement, but it doesn't seem to fire (or throw any error for that matter).

for city in civ.iterateCities() do if (city.owner == civ.getTribe(1) and civ.hasImprovement(city, (civ.getImprovement(17)))) then civ.createUnit(civ.getUnitType(167), civ.getTribe(1), (civ.getTile(city.tile.x,city.tile.y,city.tile.z))) end

I also tried city.location instead of city.tile but that too didn't work.

I figure it's way easier to do it this way and I believe this means these units will come out with "none" for a home city which is also ideal.
 
@Prof. Garfield any idea why this isn't working in the console? I'm trying to add an air defense unit (167) to every Allied (1) city that has an airfield (17) improvement, but it doesn't seem to fire (or throw any error for that matter).

for city in civ.iterateCities() do if (city.owner == civ.getTribe(1) and civ.hasImprovement(city, (civ.getImprovement(17)))) then civ.createUnit(civ.getUnitType(167), civ.getTribe(1), (civ.getTile(city.tile.x,city.tile.y,city.tile.z))) end

I also tried city.location instead of city.tile but that too didn't work.

I figure it's way easier to do it this way and I believe this means these units will come out with "none" for a home city which is also ideal.
You forgot an 'end' for the 'for' loop. I bet if you typed it in, then on the next line, typed end, it would probably work. That said, I think that civ.createUnit will, by default, create the unit homed to the nearest city. Try this:

Code:
for city in civ.iterateCities() do if (city.owner == civ.getTribe(1) and civ.hasImprovement(city, (civ.getImprovement(17)))) then civ.createUnit(civ.getUnitType(167), civ.getTribe(1), (civ.getTile(city.tile.x,city.tile.y,city.tile.z))).homeCity = nil end end
If it doesn't work, I'd suggest writing it in your editor, and using Load Script to get this done.

But, yes, this kind of scripting is way easier.
 
Worked absolutely perfectly - thank you! I just had to change tile back to location since it was giving a nil error. Well that's about an hour's worth of work done in 5 seconds :)
 
@Prof. Garfield I attempted to push multiple files and on the desktop it's saying it was accomplished though in the browser it is not updated. Are you able to see what I did today? This should have enough in the rules to create the object file and get cracking.

In the meanwhile I'm placing the units that are "evergreen" and not connected to any city improvement. I may need to move the location of a few of these slightly in areas like the Ruhr, but I came up with 40 of these based on roughly historic location (allowing some leeway so the font isn't crazy and also so the regular city improvements have a place to go).

I'll now place the radar as it has the same situation - persistent units that aren't built.

I don't think it will be possible for the AI to avoid attacking these just because they are low on hitpoints so I do think we need some system where they are "killed" but regenerate after a few turns, probably tied into how many electrical and urban targets there are available (which bomber command will hit). I assume we can do a delayed reaction where they show up after so many turns at the same spot and maybe at the time of their regeneration the check is to see how much damage has been done to urban/electricity to determine how much health these all start with?

1699120262583.png
 
Top Bottom