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,825
    Location:
    Ontario
    Get rid of the flak specification that I was testing with.

    You got rid of reactionGroups.strategicBombers, but the flak reaction that I provided still uses it. That means that a targetTypes key has a nil value, which the canReact function doesn't like, since it is expecting a table. I should probably write a function to verify that the reaction information table is correct, but I won't get to that before Friday (and maybe later still).
     
  2. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    I'm going to pause and ask for an accommodation but I trust you'll see why it's vital:

    Write now, I am copying and pasting this into what will become thousands of lines of code. This is fine for the first go, but if we decide that ({[0]=3,[.25]=4,[.5]=5,[.75]=6}) is too much, or too little, I'm going to have to re-copy and paste all of that with significant chance that I miss something. What I'd like to do is define these earlier in the code so instead of:

    Code:
    
    {
                targetTypes = reactionGroups.heavyBombers,
                maxDistance = 2,
                hitChance = .7,
                hitChanceCloud = .35,
                damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),    --Weak attack   - bomber attacked by Escort, or day fighter flying at night,
            },--reactionDetail 1
    
    
    I could write

    Code:
    
    {
                targetTypes = reactionGroups.heavyBombers,
                maxDistance = 2,
                hitChance = .7,
                hitChanceCloud = .35,
                damageSchedule = damageType.WeakFightervsFighterAttack
            },--reactionDetail 1
    
    
    And have "damageType.WeakFightervsFighterAttack" defined earlier as:

    Code:
    --damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),    --Weak attack   - unit out of element vs. foe in its element (includes day fighter vs. nightfighter at night)
    

    I think doing it this way would make a lot of sense. The system I'm setting up standardizes the damage output because most units have 20 hit points. I'm using the hitChance to differentiate "better" units. This should let us better balance how many units would need to intercept something to destroy it on the reaction phase.

    I have all of the values set and am attaching preferred names. I'm not sure if I've coded this right or if it isn't possible to have two "=" in the same sequence.

    Code:
    --STANDARD FIGHTER VS. FIGHTER
    damageSchedule = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6}), = damageType.StrongFightervsFighterAttack
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}), = damageType.MediumFightervsFighterAttack
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}), = damageType.WeakFightervsFighterAttack
    
    --JET FIGHTERS VS. FIGHTERS
    damageSchedule = gen.makeThresholdTable({[0]=6,[.25]=7,[.5]=8,[.75]=9}),  =  damageType.StrongJetFightervsFighterAttack
    damageSchedule = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6}),  =  damageType.MediumJetFightervsFighterAttack
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}),  =  damageType.WeakJetFightervsFighterAttack
    
    --JET FIGHTERS VS. BOMBERS
    damageSchedule = gen.makeThresholdTable({[0]=7,[.25]=8,[.5]=9,[.75]=10}),   =  damageType.StrongJetFightervsBomberAttack
    damageSchedule = gen.makeThresholdTable({[0]=6,[.25]=7,[.5]=8,[.75]=9}),    =  damageType.MediumJetFightervsBomberAttack
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=4,[.5]=6,[.75]=8}),    =  damageType.WeakJetFightervsBomberAttack
    
    --BOMBER DEFENSIVE GUNS
    damageSchedule = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6}),    =  damageType.StrongBomberDefense
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}),    =  damageType.MediumBomberDefense
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),    =  damageType.WeakBomberDefense
    
    --FIGHTER VS. BOMBER
    damageSchedule = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6}),  =  damageType.StrongInterceptorAttack
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}),  =  damageType.MediumInterceptorAttack
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),  =  damageType.WeakInterceptorAttack
    
    --FLAK VS. AIRCRAFT
    damageSchedule = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6}),  =  damageType.StrongFlakAttack
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}),  =  damageType.MediumFlakAttack
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),  =  damageType.WeakFlakAttack
    
    --TASK FORCE VS. Attackers (Sunderland shares Strong Attack).
    damageSchedule = gen.makeThresholdTable({[0]=0,[.25]=5,[.5]=15,[.75]=20}),  =  damageType.StrongSeaDefense
    damageSchedule = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5}),      =  damageType.MediumSeaDefense
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),      =  damageType.WeakSeaDefense
    
    --DIVE BONUS
    damageSchedule = gen.makeThresholdTable({[0]=8,[.25]=9,[.5]=10,[.75]=11}),  =  damageType.StrongDiveAttack
    damageSchedule = gen.makeThresholdTable({[0]=4,[.25]=5,[.5]=6,[.75]=7}),      =  damageType.MediumDiveAttack
    damageSchedule = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4}),      = damageType.WeakDiveAttack
    
     
  3. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    I absolutely agree that you should give names to these threshold tables instead of re-writing them every time.

    What you want is

    Code:
    damageType = {}
    --STANDARD FIGHTER VS. FIGHTER
    damageType.StrongFightervsFighterAttack = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6})
    damageType.MediumFightervsFighterAttack = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5})
    damageType.WeakFightervsFighterAttack = gen.makeThresholdTable({[0]=1,[.25]=2,[.5]=3,[.75]=4})
    
    --JET FIGHTERS VS. FIGHTERS
    damageType.StrongJetFightervsFighterAttack = gen.makeThresholdTable({[0]=6,[.25]=7,[.5]=8,[.75]=9})
    damageType.MediumJetFightervsFighterAttack = gen.makeThresholdTable({[0]=3,[.25]=4,[.5]=5,[.75]=6})
    damageType.WeakJetFightervsFighterAttack = gen.makeThresholdTable({[0]=2,[.25]=3,[.5]=4,[.75]=5})
    
    
    etc.

    Then, at the appropriate place in the specification table write

    Code:
    damageSchedule = damageType.StrongJetFightervsFighterAttack
    
     
    JPetroski likes this.
  4. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    Can you please confirm that I'm understanding this correctly? What I take this to mean is that this unit will normally have a 30% chance to hit a heavy bomber at night if it isn't in cloud cover, but if they research Advanced Radar I, that will be 40%, Advanced Radar II makes it 50%, and advanced radar III makes it 60%. Is that accurate? I assume they stack?

    Code:
    night = {
           
            {
                targetTypes = reactionGroups.heavyBombers,
                maxDistance = 1,
                hitChance = .3,
                hitChanceCloud = .15,
                shooterTechMod = {{techAliases.AdvancedRadarI,.1},{techAliases.AdvancedRadarII,.1},{techAliases.AdvancedRadarIII,.1},},
                shooterTechCloud = {{techAliases.AdvancedRadarI,.05},{techAliases.AdvancedRadarII,.05},{techAliases.AdvancedRadarIII,.05},},
                damageSchedule = damageType.WeakFightervsBomberAttack 
            },--reactionDetail 1
           
    
        },
    
     
  5. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    You are correct. And the hit chance for a target within clouds is 15%, then 20%, 25%, and finally 30% when all three radar techs are discovered.
     
  6. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    This version of the generalLibrary has a function that might help you track down errors more easily.

    gen.errorForNilKey(table,tableName)

    This will generate an error at the moment Lua tries to access a key value that is nil, and will create an error on that line. This should let you catch things like spelling errors or trying to access values to keys you've deleted. Don't use it on tables where accessing nil values is expected and has meaning (like the ri table).

    Code:
    local reactionGroups = {}
    gen.errorForNilKey(reactionGroups,"reactionGroups")
    
     

    Attached Files:

  7. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    Do you think it's worthwhile to have a verification function for this table? If you're cutting and pasting, errors are fairly unlikely, and we didn't have that sort of thing in the other tables. It shouldn't be especially hard to make a checker, but it could be a bit tedious. In any case, I won't get to it today.
     
  8. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    If it's tedious dont do it as I can check this relatively easily in game with maybe 5 or 10 minutes to set up the test.
     
  9. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    So I just realized that the units in the reaction groups will react regardless of if it is friend or foe. Is this a relatively easy thing for you to fix? If not, I can go back through and split reactionGroups.highAltFighters into reactionGroups.germanHighAltFighters and reactionGroups.alliedHighAltFighters. I thought in the old one we were able to squash friendly fire so I'm not sure if it is something that is simple for you (there are 9,000 lines of code in this).

    Attached is the updated file.

    upload_2020-7-12_14-8-41.png
     

    Attached Files:

  10. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    Oops! Here is the fix. I forgot to make the check for friend or foe in canReact.
     

    Attached Files:

  11. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    Does anything else have to be done before the next playtests?
     
  12. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    Hi Prof. Garfield - I took care of the reactions and think most of the stuff is built in game but haven't had much time this week. The house went up for sale Thursday and we've had showings all weekend. The good news is we are done with showings after today and will have an offer and acceptance by tomorrow. Then, I'll be able to plug away.

    The only things I need to do are on the map - I need to change the text (though I suppose that doesn't matter for a play test) and also double check those coordinates you sent me.

    Are you up for reprising a game in another week or two?
     
  13. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    Please help me out with a few things as I can't keep track of what we're doing now. I thought these were still accurate?

    upload_2020-7-19_14-7-24.png

    upload_2020-7-19_14-8-14.png
     
  14. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    I'm actually happy to have had a little break from this, I just wanted to make sure that there wasn't anything major that I had to do that I was forgetting.

    I'm up for another game when you are ready, though my schedule is looking like it will be a 1 turn per day kind of rate. I'm not currently scheduled to work the first 4 days of August (1st and 2nd are a Weekend), so that might be a good time to start if we don't get to it sooner (if, of course, you are available).

    You should add to the map that the convoy fuel bonus increases with the number of refineries at the unload port. For the German occupation, change it so the number of troops determines the maximum number of trains that can be extracted, but that extracting more trains will result in more resistance spying in France.
     
  15. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    Would you mind if we waited until mid-August to start? I'm closing on my new house August 7 and will be closing the sale of my old house August 14 (so we did give ourselves a little time like you suggested). While I'm hoping to have the game ready for a playtest before then, if I'm going to get everything done that I need to that week, I actually need to pack a lot prior so I'm not going to have a ton of time.
     
  16. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    No problem. Let me know when you are ready. OTR is a pretty big time sink, and I do have other projects.
     
  17. JPetroski

    JPetroski Deity

    Joined:
    Jan 24, 2011
    Messages:
    2,844
    -Changed Dunfries to Dumfries
    -Changed text on map for Atlantic and germany
    -Gave Allies the Jabo I tech at start
    -Increased defenses of airfields in Pas de Calais and SE England
    -Increased number of Spitfires Allies start with
    -Decreased cost of many Allied units
    -Added installation terrain for radar units at start
    -added a radar near Le Havre for Germans to get rid of initial gap Allies could exploit
    -modified all reactions
    -Gave Allies 2x Typhoon at start (but will need to research to build more) - Germans have 2x Fw190F, so figured it's fair
    -Decided to make beaufighter inexpensive (20 shields) compared to Mosquito (40) and have beaufighter not go obsolete, so Allies have a reasonable way to conduct intruder missions into Germany, but not with great aircraft. Tests have pretty conclusively shown there is a need for Allied fighters to be able to damage Luftwaffe fighters and prior to this the cost was exorbitant. Should balance considering Wilde Sau lets anything and everything fly at night for Germany.
    -Changed 358,66 to installation from refinery - wasn't linked to a city and was just sitting there for no reason
    -Changed 274,82 to urban from factory
    -Changed 277,81 to urban from factory
    -Changed 279,81 to urban from factory
    -Minor change to describe.txt

    Things I did *not* do:

    -Did not change the SP hotseat/save a scenario as that. Completely forgot how to do it. Will need to find it in this thread (the next time we build something together, I'm starting a OneNote and using it early and often).
    -Did not change the readme or help text (though the tab text should mostly be correct still because I didn't mess with those values -- only the reactions which weren't really discussed there).

    Here are the files. I will probably try and spend at least a little bit of time playing against myself just to make sure nothing is horribly broken before we start our next playtest.
     

    Attached Files:

    Prof. Garfield likes this.
  18. Prof. Garfield

    Prof. Garfield Deity Supporter

    Joined:
    Mar 6, 2004
    Messages:
    2,825
    Location:
    Ontario
    In the console, put in the line

    Code:
    console.setFlagTrue("PlayingVersusSelf")
    
     

Share This Page