Over the Reich: Single Player - Development Thread

OK, I've got rid of the old stuff that I could detect, and placed the stuff that looked potentially useful into the "CodeFromOldVersion" folder. I duplicated the OTR folder on my machine anyway (in case I missed something), and I'd suggest that you do that too. (If all else fails, we can use Git to revert to an older version anyway.)

I've generated new object files and a setTraits file.

I'll look through our recent discussion and find out the things you need soon. I've written a few new "learn to program" lessons, and I'm currently proofreading them so that they can be released shortly (hopefully today).
 
I'll look through our recent discussion and find out the things you need soon.

From my perspective the most helpful thing would be to have first would be the strat bombing code implemented as that will enable me to finalize the rest of the map by putting the urban terrain squares down. To simply things, all base terrain types are reused for all four maps. As with the old version, building an improvement should place a unit in a certain tile and change the terrain of at least that tile (factory) and perhaps other tiles (urban).

Improvements object.iHousingDistrictI , object.iHousingDistrictII , and object.iHousingDistrictIII are connected to the unit object.uUrbanArea and the base terrain type object.bUrban (for when built) and object.bUrbanRubble (for when destroyed).

Improvements object.uEngineFactory , object.uAircraftFactory , and object.uAvionicsFactory are connected to the units object.iEngineFactory , object.iAircraftFactory , and object.iAvionicsFactory and the base terrain type object.bIndustry (for when built) and object.bRubble (for when destroyed).

Improvements object.iElectricPowerPlantI, object.iElectricPowerPlantII , and object.iElectricPowerPlantIII are connected to the unit object.uElectricPowerPlant and the base terrain type object.bRefinery (for when built) and object.bRubble (for when destroyed). NOTE: I did forget to change the name of this terrain since I forgot it's connected to the electric grid and not refineries but it'll still work fine and we can just swap them out later.


Improvement object.iHeavyFlakBattery is connected to the unit object.u128cmFlak40 but does NOT have a base terrain change. This one is tricky though because eventually if the improvement is disbanded (due to cost) the unit needs to be deleted as well, but I suppose we could use an AfterProduction check for that and it's not part of this actual strategic bombing module.

Improvement object.iUBoatPens is connected to the unit object.uUBoatPens but does NOT have a base terrain change.

Improvement object.iPortFacility is connected to the unit object.uPortFacility but does NOT have a base terrain change.

Improvement object.iVWeaponSite is connected to the unit object.uVWeaponsSite but does NOT have a base terrain change.

Improvement object.iFuelStorageSilos is connected to the unit object.uFuelStorageSilos but does NOT have a base terrain change.

Improvement object.iOilRefinery, object.iSyntheticFuelRefinery are connected to the units object.uOilRefinery and object.uSyntheticFuelRef but do NOT have a base terrain change.

Improvement object.iRailyards is connected to the unit object.uRailyards but I just need the RAILROAD removed from whatever terrain it happens to be on it when destroyed, and the RR restored when it is rebuilt.

Pretty sure that is about it for now.
 
I've pushed an update where the object.lua file entries specify whether the terrain types are day/night/high/low. On duplicate terrain names, I added the resource number to the end.

I haven't changed the refinery name, but I'd appreciate it if you would soon (I'm not sure what you'd want to call it). That way, we don't start off with "refinery" terrain references that either sticks around or we have to replace. FYI (if you haven't noticed) you can deselect files to commit/push, so you don't have to send other changes that aren't ready.

I'm currently intending to store data so that once a target is built on a tile, only that target can be built on the tile. If the target is destroyed, the tile is still reserved for that target. This could mean that cities without a lot of land can't "replace" one kind of industry with another. I think this makes sense. "destroying" an industry in this scenario doesn't necessarily mean razing it to the ground so it is just as easy to build something new. It also means that you'll be able to name certain factories on the map, if you want. Let me know if this is a problem.

For new targets, the code will give all eligible (i.e. not reserved) nearby tiles (low day map) a weight, and choose the tile (or tiles, if appropriate) with the highest weight. For the targets that change terrain, I'll give the "improved" terrain the highest weight, so if you want an improvement to go on a particular tile, you can just change the terrain ahead of time. How do you want to specify the start locations of improvements without a terrain change?

Also, which of the targets do you want to be in the city radius, and which do you want to be outside the radius (and how far away)? Do you have any guidance on how to "weigh" a tile for improvements?

How should the Railyards choose their location? If they'll all be there at the start of the game, I guess you could place railtrack only on those tiles, after which the tiles will be reserved and specified.

Improvement object.iHeavyFlakBattery is connected to the unit object.u128cmFlak40 but does NOT have a base terrain change. This one is tricky though because eventually if the improvement is disbanded (due to cost) the unit needs to be deleted as well, but I suppose we could use an AfterProduction check for that and it's not part of this actual strategic bombing module.
The strategic targets module already checks if improvements are sold, and removes corresponding units/terrain.
 
Also, which of the targets do you want to be in the city radius, and which do you want to be outside the radius (and how far away)? Do you have any guidance on how to "weigh" a tile for improvements?

The only targets that need to be in a city window are the urban ones (3x using the same unit) and the production ones (3x different units - avionics/engine/aircraft). I was kind of planning on having to go through the 145 cities and just provide coordinates for all of these manually to get the right look, so I don't really need "automatic decisions" for these--while it's going to take forever, I tend to think it's necessary to do it that way. Likewise the military port and U-Boat Pens will have a very specific place.

The electric power plants (one unit, three improvements) and fuel silos, oil refineries and synthetic fuel refiners (3 units with 3 improvements) however can be placed anywhere on the map, really. Here are some weighting ideas to make it look good (and serve a transport function with the silo) though:

Electric power plants don't need to be placed next to a road/railroad tile improvement, but they should only be placed on "grassland" or "highlands" terrain. These should all be outside city radius of cities that have the "City" (8) improvement (City walls), but I don't care if they're built near airfield cities.

The "object.iVWeaponSite / object.uVWeaponsSite" can follow the same procedure.

I do think every fuel type (silos, oil refineries and synthetic fuel refineries) should have to be built adjacent (side to side) to a tile that has a railroad tile improvement, and it would be helpful if when it is built, it also creates a railroad tile improvement on the tile it is placed on. This way, when we input the transportation network, fuel trains can leave the refineries and be directed towards the silos to deposit their cargo. These should not be in a city's limits but airfields are OK.

How should the Railyards choose their location? If they'll all be there at the start of the game, I guess you could place railtrack only on those tiles, after which the tiles will be reserved and specified.
They're all going to be there at the start of the location. I have the terrain "railtrack" so I can just go ahead and place that under them so you can search for that terrain and specify it. They aren't going to necessarily be anywhere near city limits though. Should I just go ahead and place these units manually or will that cause an issue? I think it's probably the best way to go about it.

I haven't changed the refinery name, but I'd appreciate it if you would soon (I'm not sure what you'd want to call it). That way, we don't start off with "refinery" terrain references that either sticks around or we have to replace. FYI (if you haven't noticed) you can deselect files to commit/push, so you don't have to send other changes that aren't ready.

I changed it to "PowerPlant" in object.lua and pushed this file (I haven't made the change to rules yet but figure you aren't really asking for that just yet anyway. I just wanted to get that up to you quickly.
 
Do you think it would be possible to write a helper function that would:

1.Take one point on the map as the origin.
2. Paint an extreme range "circle" on the map from that starting point with "pollution" (radar icon) for the "best" escort the Allies have available (possibly with a tier system so the Allied player can see at a glance how far the Spits, P-47s, P-38s, and P-51s can reach--perhaps a different circle for the "best" of each type of these aircraft).
3. Remove the markers after the end of the turn or when the player decides to remove them.

("Range") would be 50% of total movement allowance.

Edit - if it's possible, using the "fortress" icon would be great for this, if we can force it on ocean as well, given there's absolutely no need for that in the scenario, and no way to "game" it if it is removed at the end of the player's turn, anyway.

I think it would be helpful plotting for both the Allies (to figure out what they can properly escort) and the Germans (for figuring out where they can safely attack).

1699200193065.png

1
 
Last edited:
The only targets that need to be in a city window are the urban ones (3x using the same unit) and the production ones (3x different units - avionics/engine/aircraft). I was kind of planning on having to go through the 145 cities and just provide coordinates for all of these manually to get the right look, so I don't really need "automatic decisions" for these--while it's going to take forever, I tend to think it's necessary to do it that way. Likewise the military port and U-Boat Pens will have a very specific place.
OK, for anything that you want to specify a location for at the start of the game (even if the improvement won't exist at the start of the game) I'll let you place the corresponding units on the low daylight map, and I'll write a script that "reserves" tiles based on the unit and home city. For urban, do you care what tiles are associated with I/II/III, and also which tiles hold the target unit vs which ones are extra? If you do, I'll let you nominate extra unit types for placement.

The electric power plants (one unit, three improvements) and fuel silos, oil refineries and synthetic fuel refiners (3 units with 3 improvements) however can be placed anywhere on the map, really. Here are some weighting ideas to make it look good (and serve a transport function with the silo) though:
I'll have the game look for a suitable location within 6 squares of the city which is also closer to the city than to any other city (not airfield).

They're all going to be there at the start of the location. I have the terrain "railtrack" so I can just go ahead and place that under them so you can search for that terrain and specify it. They aren't going to necessarily be anywhere near city limits though. Should I just go ahead and place these units manually or will that cause an issue? I think it's probably the best way to go about it.
I'll just let you specify it by placing a target on the low map (unless you object to the system I proposed above, of course).

I changed it to "PowerPlant" in object.lua and pushed this file (I haven't made the change to rules yet but figure you aren't really asking for that just yet anyway. I just wanted to get that up to you quickly.
Thanks.

Do you think it would be possible to write a helper function that would:

1.Take one point on the map as the origin.
2. Paint an extreme range "circle" on the map from that starting point with "pollution" (radar icon) for the "best" escort the Allies have available (possibly with a tier system so the Allied player can see at a glance how far the Spits, P-47s, P-38s, and P-51s can reach--perhaps a different circle for the "best" of each type of these aircraft).
3. Remove the markers after the end of the turn or when the player decides to remove them.

I think it would be helpful plotting for both the Allies (to figure out what they can properly escort) and the Germans (for figuring out where they can safely attack).

[IMG alt="1699200193065.png"]https://forums.civfanatics.com/attachments/1699200193065-png.676835/[/IMG]
Yes, this can be done. The marker functions already do most of that work. There can be multiple kinds of marker to denote different ranges, if you want, but if you want lots of markers, you may have to limit the kinds of improvement "decorations" for maps. I know we have cloud cover as a terrain, but we might consider using a terrain improvement instead (since we can now change combat much more effectively).
 
OK, for anything that you want to specify a location for at the start of the game (even if the improvement won't exist at the start of the game) I'll let you place the corresponding units on the low daylight map, and I'll write a script that "reserves" tiles based on the unit and home city. For urban, do you care what tiles are associated with I/II/III, and also which tiles hold the target unit vs which ones are extra? If you do, I'll let you nominate extra unit types for placement.

So if I'm understanding this correctly, I should just place the units on the low map where I want the terrain to eventually change, make sure they have the correct home city, hand over the save to you, and that will populate the tables instead of me having to type them all in (and probably screw them up?) If so, I can definitely do this! And no, I don't care which urban terrain have the "real" unit and which are placeholders. Any will do.

Yes, this can be done. The marker functions already do most of that work. There can be multiple kinds of marker to denote different ranges, if you want, but if you want lots of markers, you may have to limit the kinds of improvement "decorations" for maps. I know we have cloud cover as a terrain, but we might consider using a terrain improvement instead (since we can now change combat much more effectively).
I'm kind of using roads right now as well as railroads. The railroads are more or less where the major arteries where and I'm using the roads just as an offshoot to go to the airbases/fill in the map a little. I don't know that all 4 (or whatever) ranges have to show up at once. I'm just thinking the Allies "best" fighter might not be the most numerous, so having the ability to check ranges for a few different aircraft (spit, p-47, p-38, p-51) would be preferable, but they can all use the same marker (which honestly I'd probably just have as a white/yellow "dot" that shows up and isn't too obnoxious.

I'll just let you specify it by placing a target on the low map (unless you object to the system I proposed above, of course).
Ok. Just as a reminder:

-Railyard unit will always be on the low map.
-Urban and Power Plant units will always be on the night map.

Also, since all three of these will be "fully active" from the start, it would be helpful to have a script eventually that places them where they go on the night/day map and places the improvements in the cities (so I don't have to city by city "building" them). I'll manually delete the urban units from the French/occupied cities so there is nothing for the AI to attack there--that's not much work. I don't think that will break anything if they are never present. The AI should still be allowed to attack electric power connected to these cities.
 
So if I'm understanding this correctly, I should just place the units on the low map where I want the terrain to eventually change, make sure they have the correct home city, hand over the save to you, and that will populate the tables instead of me having to type them all in (and probably screw them up?) If so, I can definitely do this! And no, I don't care which urban terrain have the "real" unit and which are placeholders. Any will do.
That's correct. It's where you want the terrain to change, or the unit to be placed (in cases where there is no terrain change).
I'll manually delete the urban units from the French/occupied cities so there is nothing for the AI to attack there--that's not much work. I don't think that will break anything if they are never present.
Thanks for pointing out that there shouldn't be urban targets for the AI to attack in the occupied countries. I'll have to set that up. Easiest way to do that is to make it so even if the human is playing the Allies, there aren't targets to attack.

Also, since all three of these will be "fully active" from the start, it would be helpful to have a script eventually that places them where they go on the night/day map and places the improvements in the cities (so I don't have to city by city "building" them).
Sure, I'll do that. I should probably add a Template function to "artificially" produce something (with onCityProductionEvent) in a city anyway, since that could probably be useful in other contexts. I'll add another thing to do when placing target units, then. If you're reserving a spot for an item that you don't want to be placed at the start of the scenario, make it either veteran or damaged (whatever you prefer). That way, my script will know that the unit shouldn't be "converted" to a cityImprovement/target/alteredTerrain .

I'm kind of using roads right now as well as railroads. The railroads are more or less where the major arteries where and I'm using the roads just as an offshoot to go to the airbases/fill in the map a little. I don't know that all 4 (or whatever) ranges have to show up at once. I'm just thinking the Allies "best" fighter might not be the most numerous, so having the ability to check ranges for a few different aircraft (spit, p-47, p-38, p-51) would be preferable, but they can all use the same marker (which honestly I'd probably just have as a white/yellow "dot" that shows up and isn't too obnoxious.
It's probably best to just have a few different ranges, for the shortest range aircraft in a "class." So, for example, the Spitfire range would be, say, 20 (I don't remember), but if the more advanced version is 22, the player can just know that the modern version has an extra tile or two.
 
@Prof. Garfield can I "have" the objects file, or are you using it? I want to utilize the recycling center as the medium flak choice and make it available to airbases to build/destroy if a player wants to invest in that.

Light flak - always at airfield unless killed and it will regenerate depending on how many armaments factories exist.
Medium flak - can be invested in to defend key airfields. Should populate randomly up to 2 spaces away from airfield (I don't need a specific location) that is available to the tribe.
88mm (German) - Will have so many at the start of the game. These are flak that can move around by being teleported.
Heavy flak - can be invested in to defend key cities. I'm currently setting their location as per the agreed above.

BTW Improvement object.iArmamentsFactory is connected to the unit object.uArmamentsFactory but does NOT have a base terrain change. If you could please just also have these pop up within 6 tiles (or whatever, really) of a city that would be appreciated. One will be available for every city at the start.
 
@Prof. Garfield can I "have" the objects file, or are you using it? I want to utilize the recycling center as the medium flak choice and make it available to airbases to build/destroy if a player wants to invest in that.
I'm not using it, so go ahead. The only file I've modified but haven't pushed is targetSettings.lua.
 
I pushed the save file as well as objects and some art /rules changes. You can have the save until you tell me you're done with it. I won't be at the building computer too much until next week and if I get a chance, I'm probably going to just work on the rules/tech tree.

I did make all the changes to the map for now so if you don't mind just scripting the railroads/special resources/terrain improvements to go to the 4 maps on the save.

As a reminder, the railyards are going to be all there at the start of the scenario so you might as well leave the unit. Further, all the urban terrain should be there too. I'll manually place the other improvements (that are currently on the map) on a city by city basis.

Any questions please let me know! Thanks.
 
Some large cities, like London, have more than 6 urban units placed, and some outside the city radius. For those cities, do you want extra tiles tied to the strategic target, or just place some extra "urban" terrain not tied to any target?
 
Some large cities, like London, have more than 6 urban units placed, and some outside the city radius. For those cities, do you want extra tiles tied to the strategic target, or just place some extra "urban" terrain not tied to any target?
I tried to make them have urban in multiples of 3, but I'm OK with not all of them being destroyed. I would like that to be urban terrain though. Mostly an aesthetic thing.
 
I tried to make them have urban in multiples of 3, but I'm OK with not all of them being destroyed. I would like that to be urban terrain though. Mostly an aesthetic thing.
Oh, that makes sense, and is not a problem. I'll make anything more than 9, or outside the city radius just be permanent.
 
I've pushed the changes that place targets and copy the terrain from map 0.

I had to change the terrain around Penemunde so that all 3 urban tiles would be within the city radius. (If you really want, I can change the code so that urban areas can be within or without the city radius.)

Have a look at the saved files to make sure that I've understood everything correctly.

If you want to try out the scripts on earlier saved games after making changes, they are activated with
Code:
console.copyMapScript()
console.initialTargetScript()

I noticed that you didn't designate any (or at least many if you used Veteran instead of damage) targets as just "reserved" as opposed to existing at the start of the game. I added a keypress event so that when you press backspace, the unit on the tile gets damaged. It won't work with urban units.

The "targetSpecs" table is filled starting at line 357 of targetSettings.lua, though the definition of a targetSpec is documented starting at line 37.

Let me know if you need me to fix anything, or if you need more information.
 
Today I finally shook off the holidays (a little late eh?) and got cracking on the Tech tree. The Allied tech tree is more or less done. Time to work on the Germans. There may or may be industrial tie ins to some of this stuff eventually, but I think there's so many paths you could potentially go down, with so much stuff to research, that it really might not be necessary.

For what it's worth, the P-38s will give you immediate long-range escorts but you'll be limited in how many you can build of them.

Spoiler :


1705353612482.png

1705353635706.png

1705353668993.png

 
Plugging away at the tech tree. Subject to change of course but here's the general flow for the German fighters and jet fighters. Grey is only researchable by Germany. Cream by both. Red is via events.

The goal is to have the German player have to make a choice. They can bee line for expensive jets, but there will be at least eleven techs (not including some industry techs that Advanced Piston Engines and Jet Engine Development will share as prereqs) to reach the 262 vs. six techs to get to the Ta 152, which will be a very capable fighter. I still need to input some of these to rules but at least I have the flow out. I still need to do German bombers, jabo, and vengeance weapons (the latter of which might be a diversionary tech race further needed to finally get 262s, if 11 vs. 6 isn't bad enough). Then, a common industrial tree and flak tree and I think the techs will more or less be done.

Spoiler :

1705984802056.png

 
Attached is a publisher document for the tech tree which is completed. I figure it's OK for the Allies to have a shorter overall journey to get jets given that they're not going to be terribly useful for the Allies.

I gave the Germans a "shortcut" to a jet (the He 162) that can only be had if they get "catastrophic losses" (which means things aren't going well at all). It won't be nearly as good as the Me 262, but at least if the Germans are getting hammered they'll have a chance. This will also give them a chance at the Me163, V1, and V2.

Now I intend to go through the techs and try to assign AI values for it since we're shooting for a single player game. I'll also try and get the attack/defense etc. for everything set up. Once this is done I'll push the rules.
 

Attachments

  • Tech Tree.zip
    32 KB · Views: 4
Now I intend to go through the techs and try to assign AI values for it since we're shooting for a single player game.
I wouldn't necessarily put too much effort into this part, since we might want to change the values via Lua so the AI goes on different paths in different playthroughs.
 
@Prof. Garfield would there be an issue with my placing units on the map at this point? I know I had placed the strategic targets so you could do some sort of lua wizardry and build out the strategic bombing mechanism, and not all of the strats that are currently on the map at present will be built at game's start. I just have the next two days off and figure finishing the rules and placing the units are reasonable goals for this week, but I don't want to place them if it'll mess something up for you.
 
Top Bottom