1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Over the Reich - Creation Thread

Discussion in 'Civ2 - Scenario League' started by JPetroski, Feb 4, 2011.

  1. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    Bugfix for clouds.lua

    Placing and removing clouds erased the 'defender' flag for the tile. This made the formation code fail to 'catch' some units (if a cloud moved onto their square), and may have caused small bugs elsewhere, that I didn't notice.
     

    Attached Files:

  2. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    I went through your latest readme file, here are some things I noticed. Let me know if you want any fixes, and I'll make them along with the convoy/occupation message. (I don't have the events at the moment, if you want to change any parameters, or anything else.)

    It isn't true anymore that the file has to be named OTR. However, maybe we should leave it like that, so that we don't have to troubleshoot a problem caused by a strange name or something.

    You might want to make it clear that we've cut the defensive bonus on the railtrack terrain to compensate, and that it is only railtrack on other terrain that gives a bonus. Otherwise, a player might try to set up a defensive line along a railtrack, and be disappointed.


    At the moment, you can merge more than 2 at a time, and it is advantageous to do so, since you lose only 1 depleted battle group, and the rest are full strength. I can change the code to make it so that only 2 merge into 1, if you like.

    Might want to mention that they must have full movement, too, so the player knows they can't just fly in a full health plane, and swap out the vet status on the same turn.

    Might want to mention that the base cost is the minimum (except for Politz effect), even if operating very close to an airfield.

    At the moment, military ports, critical industry, and railyards ARE killed in the firestorm, do you want this changed?

    You should mention that killing a night urban is a guaranteed kill for the firefighters improvement.

    You should probably make it clear that this can happen to the Allies and in Germany proper, just at a reduced likelihood. Perhaps also mention the chance.

    specialNumbers.alliedSabotageChance = .02 -- chance an allied industrial building will burn down on a given turn if no firefighters improvement
    specialNumbers.occupiedSabotageChance = 0.05 -- chance an industrial building in an 'occupied' German city will burn down on a given turn if no firefighters improvement
    specialNumbers.germanSabotageChance = 0.02 -- chance an industrial building in Germany proper will burn down on a given turn if no firefighters improvement


    You should probably mention that the respawn chance is increased with the number of German military ports, and decreases with the number of Allied military ports. IIRC, the chance is GermanMilitaryPorts/totalMilitaryPorts.

    You should probably mention that it allows deployment to a random square in the Atlantic from a city with a military port.

    Is there enough stuff for the Germans to kill, to reach the higher points threshold? If the Germans are winning the Battle of the Atlantic, the Allies won't be getting that many convoys anyway.

    Maybe we should mention that they can only take 3 damage per munition attack (unless you'd like that feature removed). That way, it is clear that a larger aircraft attack force might be needed compared to other targets with similar defensive value.

    Allied battle groups can re-group as depleted battle groups also. Should probably also mention that Allied losses will be replaced in Plymouth 10 turns after the loss, but there will be a permanent convoy penalty.

    specialNumbers.alliedReinforcementGermanPortPenalty = 0.5 -- Every time a depleted battle group is sent to Europe to reinforce Allied losses, this number is added to the number of German ports for the purposes of Battle of the Atlantic calculations. 1 port is roughly 1/2 train per turn

    Make clear that this is only when an urban target is killed by the rocket, and the target must be in England.
    Should add that they can restore normal point achieving operations if they kill a launch site.

    Also, it occurs to me that V1 and V2 launch sites can be 60 squares away from a target, but the best low altitude attack from the allies is 50 squares, I think (using tempests). This could be a situation where there is an un-counterable advantage to Germany, at least until D-Day (which the Allies can't accumulate troops for without gaining points). Perhaps this is a legit way for the Germans to try to win, but we should think about it a bit.

    Might be worth mentioning that the 'a' key can be used to activate the flak from the map, and get the trigger.

    Do you want this fixed? Not creating ground units over water is a feature of civlua.createUnit, since it is supposed to mimic the restrictions of the createUnit effect in the macro language. civ.createUnit doesn't have this restriction.

    The unit can be disbanded after the veteran crew has been swapped out. Maybe this should say something along the lines of "remember to swap out your veteran crew before disbanding the damaged B17."
    Gun batteries can still react on other terrain, so they can still be quite useful even without being placed on installation terrain. Do you want this changed?
    Is this true with the Politz industry active?
    A number of entries towards the bottom can be removed.
     
    Last edited: Feb 1, 2020
  3. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    I've made most of the changes you suggested but had a few questions/comments:

    I left this one just in case.

    I just misread the effect and have changed the readme to reflect what it does currently.


    No - I misread again and have changed the readme. We're good.

    I mean, we "could" add industry etc. for German points, but we could also just bump the number of points they get per attack if we're that concerned. And the Allies always get at least some convoys, which you figure are more than likely doomed if Germany is really winning the Battle of the Atlantic.


    I've just bumped the tactical bombers to a range of 4 from 2. Remember how you remarked there was no reason to build them? Voila, now there is :)

    Yes, please fix this. I've removed the warning from the readme.

    Yes - we probably should fix this too. I'm OK with them reacting on terrains 0, 4, and 7 (along with whatever the multiplier is for when these terrains have a river on them).
     

    Attached Files:

  4. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    As an aside, I think I've found something "new" that you can do in Civ2... Apparently you can add additional lines to describe under the concepts section, so I could reproduce the entire readme, in theory, if I really wished to. I don't think anyone has ever had cause to do this before, but I should be able to add most of the important stuff right into the describe.txt too for people who don't want to alt+tab (the horror, I know :) ).
     
  5. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    The Regensburg bonus does not appear to work. End the Allied turn and check out Nelligand AF (kind of near Frankfurt). It builds a 109, but only one of them:
     

    Attached Files:

    • A2.zip
      File size:
      146.4 KB
      Views:
      15
  6. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    In this save, Regensburg doesn't have the critical industry building. I checked, and it seems to be absent from both versions of the scenario (although the target unit is there).

    The Allies start with 50 urban targets, at 15 points each, that is 750 points. The baseline for Allied Convoys (unless troops have been defeated) is 3 every 3 turns, or 1 per turn. To get to 1300 points, that is 550 points for convoys, or 37 turns of possible stalemate -- except that the Allies can disband convoys to prevent the point loss. (rebuilt Allied Urban and bomber kills will reduce this a little bit) The Germans could probably mount an invasion before that, if they were in that position, but it means that the later parts of the schedule are there, but basically unobtainable.

    The easiest solution is to double the points the Germans get for killing an urban. That would basically mean that dehousing most of England would get them all their reinforcements, which doesn't seem too unreasonable. It would also force the British not to neglect night defenses in the way that the Germans might choose to do towards the end of the war.

    However, it might be more appropriate to allow the Germans to gain points through other avenues instead, such as adding the daylight targets to the list. Perhaps the Germans could get ~100 points for defeating Allied battle groups, though I have this vague feeling that this particular idea isn't all that good, but can't articulate why.

    Maybe we keep a counter of the number of turns since the Allies have last docked a convoy, and give the Germans points each turn based on how long it has been since the last convoy docked.

    A couple other things:

    With Aircraft carriers and Task forces re-balanced, we have to look again at the combat stats of convoys, wolf packs, and torpedoes. At the moment, a convoy is almost as strong as a task force offensively, and defensively would win outright. These units will probably also need the defense bonus versus air and munitions.

    This raises an interesting point about what should happen if the German task force reaches the Atlantic. I'm inclined to think that the German player should be able to sacrifice it for like 10 wolfpacks or something, rather than be forced to hunt down convoys one by one until the Allied task forces converge and kill. If a task force were put to commerce raiding, I don't think it would stay in one big group. What do you think?

    I'll work on the list of fixes tomorrow.

    Also, I noticed this on page 12
    The current effect of Blohm & Voss is to create a Wolf Pack in Hamburg, and allow deployment of wolfpacks into the Atlantic from Military Ports using backspace if the Wolfpack is at full health and movement.
     
  7. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    Yep, I'm an idiot.

    Speaking of which, should I see anything other than this in the console when I try to set the sp flag? I haven't seen any of the SP events fire so far, so I wasn't sure if I did it right.

    > console.setFlagTrue("PlayingVersusSelf")

    I agree, let's just double the points.

    What was your rationale for giving task forces an attack rating? I had them at 0 with the barrage munition which was pretty powerful. I didn't envision them being direct attack units. My rationale for giving the convoy a slight attack was because a convoy ought to be able to fight off U-Boats. In testing I found that if they attempted this they would invariably take some damage, which slowed their arrival in England, balancing it from my perspective.

    I'd rather make the German task force a more powerful unit "Sink the Bismarck" type deal given it starts far from the Atlantic and has no great way to reach it. Maybe it needs a large attack rating?
     
  8. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    I have the events.

    No, it shouldn't show anything else. The only single player events are a chance of munitions doing no damage, and a chance that planes won't fly. If you want to verify that the events are working, change the probability in the special numbers (I believe I put the single player modifiers at the top of the list) to something high like 1/2 or even 1.

    I think it's necessary for the task force to be able to force an engagement with an enemy task force. Otherwise, you can have a situation where an invasion is being mounted, there is a task force in place to intercept it, but the intercepting unit only does moderate damage through bombardment, and the invasion happens anyway. This sort of contradicts the idea of a task force, if an amphibious landing can take place in the face of roughly equal opposing naval force.

    Also, at the moment, a barrage will only do 3 damage, but I can (and probably should) fix that. However, the more damage the barrage unit can do, the larger the 'first strike' advantage will be in naval combat, if there is no regular attack value. The problem is that leaving attack and defence at 35 means direct shore bombardment, or that we have to give the units the submarine flag. This would create a problem for the Germans spotting the allied task force.

    That reminds me, the readme should probably explain why German planes have the sub flag, and allied day planes can spot subs.

    I was thinking of trading it once it reaches the Atlantic, but I suppose just letting it roam around would be good enough. With the limited munition damage, it would take quite a few Hurricanes or Sunderlands to bring it down, or the Allied task forces would have to corner it somehow.
     
  9. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    Events are available.

    Changelog

    MossiePR can now generate primary 'munition' on terrain type 10

    Ju188PR can now generate primary 'munition' on terrain type 10

    Exception for photos unit in primary attack code, so that the unit will be created over water (that unit is produced using civ.createUnit instead of civlua.createUnit)

    New parameter for entries in table canReact, which governs if a unit will react at all.
    Currently, only the gun battery has this restriction (maybe flak should have this as well).

    -- .allowedTerrainTypes
    -- If allowedTerrainTypesTable[n]==true, then the unit can react while on that terrain type,
    -- if false or nil, it can't.
    -- No table means it will react on all terrain types


    specialNumbers.germanScoreIncrementKillAlliedUrban = 30

    This was always here, but I made a couple changes. I got rid of text (just empty string) for can spot submarines, since all allied planes have it, and it isn't noteworthy.
    -- help.helpKey tables and definitions
    -- This table changes the text displayed when the help key is pressed
    -- for units that have the corresponding attribute.
    local OTRFlagTextTable ={
    [1] = "Two space visibility",
    [2] = "Ignore zones of control",
    [3] = "Can make amphibious assaults",
    [4] = "Hard to spot at night",--"Submarine advantages/disadvantages",
    [5]= "Can attack air units (fighter)",
    [6]= "Ship must stay near land (trireme)",
    [7]= "Negates city walls (howitzer)",
    [8]= "Can carry air units (carrier)",
    [9]= "Can make paradrops",
    [10]= "Alpine (treats all squares as road)",
    [11]= "x2 on defense versus horse (pikemen)",
    [12]= "Free support for fundamentalism (fanatics)",
    [13]= "Destroyed after attacking (missiles)",
    [14]= "x5 on defense versus munitions",--"x2 on defense versus air (AEGIS)",
    [15]= "",--"Unit can spot submarines",
    }

    Message added to the score box (1-key) telling how many trains the allies and Germans can expect to get.

    Task forces and carriers (or any other unit added to the limited damage table) are not protected from barrage units; they will take the full allotment of damage.

    Let me know if you think there is anything that I've missed (feel free to double check on things that you're not sure about). I think we might have to double check that the D-Day city capture messages reflect the current design of the game.

    I think we're pretty much at the point that we should release the scenario. I'm sure we could make a lot of small refinements, but it is probably best to finish up and release. After all, we can still update later. I'm pretty much at the point where making this scenario has stopped being 'art,' so further work is mostly for the enjoyment of others, not my own satisfaction. On that basis, we should let people play, and make it known that we'll help them modify the events (and/or release an update) should the scenario be found deficient in some way. Maybe we'll start a special thread and link to it in the readme. This scenario is probably good for at least 2 or 3 games before any balance issues will be more apparent than the learning curve, so I think waiting for feedback is appropriate.

    On that note, I would suggest eliminating the munition defense bonus for the task forces and aircraft carrier, and restore them to 35 and 20 defence points respectively, with no attack value. The problem of not forcing an engagement didn't turn out to be an issue in our playtest, and if it does for someone else, the rules are easy enough to change for that particular problem. This way, however, we don't have to fix the submarines and convoys for an issue that might never be run into in our small audience.
     

    Attached Files:

  10. Knighttime

    Knighttime Warlord

    Joined:
    Sep 20, 2002
    Messages:
    148
    Hi @Prof. Garfield , kind of a random question for you. In Getting Started With Lua Events, Lesson 4, there is a section with examples for Specifying a region. This looks generally pretty close to the way I wrote regions to work in Napoleon: the syntax is a little different (actually I like your table approach a little better than what I did) but at its core the idea is the same: a region is defined as a series of rectangles which may or may not overlap, and these are checked sequentially to see if they contain the location at hand.

    In OTR, though (at least the version I have from 2019-12-18) the concept of regions seems quite a bit different. I'm not sure I'm grasping it completely, but I see things like PolygonScript.lua which is apparently a helper for defining polygons, and then gen.inPolygon() to test whether a location is within a polygon. That general library function seems to take an entirely different (and quite a bit more complicated) approach related to line segments and intersections. So I'm curious, why the difference? What problem were you trying to solve in OTR and/or in the General Library that the Lesson 4 approach didn't handle as well as you wanted?

    EDIT: Also, is the terminology of "polygon" vs. "region" significant? It seems to me that a region could consist of disconnected rectangles, if you wanted it to, whereas a polygon would seem to imply a single (contiguous) shape. But that seems more restrictive, rather than more flexible, so I'm puzzled to see you shift in that direction.

    I'm asking because I came up with a "pattern" (it's not really a module, but more of an syntactical approach) that I'd like to post, which demonstrates how to define a region once but then be able to use it in two ways: either to check if a point exists in it (like Lesson 4 and Napoleon), but then also to be able to call a loop that iterates over every tile in that region -- all with the single region definition. My goal was to put something together that is both efficient to write and reference, for the sake of just-getting-started programmers, but also efficient in how it runs. I think it does those things reasonably well, but seeing that you moved away from that approach for OTR made me wonder if there's a use case or problem I haven't considered, that would make my pattern less than ideal.
     
    Last edited: Feb 3, 2020
  11. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    "Polygons" aren't necessarily meant to be regions in and of themselves. You could have a function that checks a tile against 2 or 3 polygons, returning true if it is in any of them.

    To me, it seems natural as a human to specify a region by drawing a line around it, and specifying the corners of a polygon (in order) is a relatively easy way to do that programmatically, especially with a tool like PolygonScript. However, it is not trivial to determine if a point is inside or outside of the polygon.

    I don't remember how well I documented the polygon code (or the exact details at the moment), but the basic idea is to take the point we want to classify as inside or outside the polygon, and connect it with a line to a point known to be outside the polygon (in this case, a point off the map). If the "connecting path" crosses the polygon boundary an odd number of times, then the point we're asking about must be inside the polygon, and if it crosses an even number of times, the point is outside the polygon.

    Basically, I check every line segment that defines the edge of the polygon, and determine if it intersects the "connecting path" within the segment. I used a slightly offset point from the center of the tile, so that I don't have to worry about the connecting path overlapping with an edge.

    This sounds really useful, especially being able to efficiently loop over the tiles in the region, which my polygon code can't do. There was nothing special about OTR that made me write the polygon code. I think I took my first stab at writing an inPolygon function in 2018 (since it seemed useful then), but ran into some problems, and shelved it. So, writing the polygon code was partly just re-visiting an old problem. If nothing else, I'm interested to see what you have come up with.
     
  12. Knighttime

    Knighttime Warlord

    Joined:
    Sep 20, 2002
    Messages:
    148
    Ah, I see. Since any polygon could be described as a collection of rectangles, I was imagining that it replaced a region, which is also a collection of rectangles. But what you said makes sense: a polygon doesn't replace a region, rather it should be viewed as an upgrade to a rectangle. The concept of a region is unchanged, it's just that a region could then consist of 1 or more polygons, instead of 1 or more rectangles.

    OK, I'll work on packaging it up with an explanation and some examples, and post it in a new thread.

    My pattern and examples are just going to use a region of rectangles, since that's the simpler implementation, but I think it would be possible to revise/upgrade it to handle a region of polygons, if that was important.
     
  13. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    I'm not against this in principle, however while I've noticed that you rarely make mistakes, I'm sure you've noticed that I make them all the time! I need to play this through once prior to releasing it. Just need to find the darn time (January and February can be pretty busy months - lots of performance reviews, etc. to handle). Hopefully we can release it in a few short weeks.
     
  14. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    The stuff I do is more easily tested than the stuff you do, so the reason I may seem to have fewer errors is that I can do some basic tests before giving back the events.

    Let me know when you want to start the next playtest. I should probably play Germany this time.
     
  15. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    I was just going to play against myself real quick to check for stupid errors - I dont think we need a full 90 day game to release the scenario.
     
  16. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    I've uploaded the scenario to the resources tab here. I need to figure out how to edit the scenario league wiki page to direct it to the resources (rather than uploading it there too). Anyone who is interested in playing, here is the latest version. Note that it does offer single player support (in hotseat mode) if you are hesitant to strike up a match with someone else, though we would encourage you to play and think you would enjoy this.

    I'll just throw out there that I'm willing to play someone if they would like, and they can pick their side of choice.

    https://forums.civfanatics.com/resources/over-the-reich.27172/
     
  17. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    We still have a last fix to make.

    At the moment, the combat stats of aircraft carriers and task forces has been reduced, and the x2 vs Air has been granted. This fix reverses that modification. (The events are needed, since the carrier's flags change in the events, so they must be specified there.)

    [Attachment deleted]
     
    Last edited: Feb 9, 2020
  18. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    Also, perhaps we should start a new thread for discussing OTR (support, bugfixes, etc.), and make a link in the readme. I'm inclined to think that a 43 page development thread is not the best place for a post-release discussion.
     
  19. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,493
    I uploaded the changes. Do you have your password and everything for the wiki? I have no idea what mine is and am wondering if it is a quick thing to just go into the page for OTR and send them to the correct resource?

    Well I didn't remember to add a link in the readme but yes a thread from 2011 is only going to confuse everyone. I'll start one more thread and maybe after a few weeks we can lock this one?
     
  20. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,648
    Location:
    Ontario
    Just found out that the Germans get the 'Baltic City' message if they capture a town. That'll have to be fixed.

    Try the password for the forums. If that doesn't work, I'll make the change.
     

Share This Page