The Cold War II - Development Diary Thread

This looks like a good system. IMO, you should probably still change combat so that battleships can't kill land forces outright, but only weaken them a bit.

I believe you made Canada European instead of Pro-West to maintain the European player in the case of Soviet invasion. I'd suggest tying this to an event, transferring control from Pro-West to Europe only after direct confrontation between Europe and the USSR.
 
IMO, you should probably still change combat so that battleships can't kill land forces outright, but only weaken them a bit.

Yes, the battleships were definitely a problem in the last game. I was building as many as I could and I don't think you had much that could kill them. There are some new tools available to me now though that I didn't have (or didn't understand) before. I was thinking about having an event come in the 1950s tied to a tech "The End of the Battleship" where they become obsolete and any city building them changes over to something else. Also, I think it makes sense to significantly upgun all jabo units so they eat these slow moving ships for breakfast.

Having naval vessels only weaken but not destroy ground forces is another option. But if these units were realistically limited (maybe only 5-6 cities on earth can build them) and they're cut off early game (1955 was when the last battleship was launched), and they're no longer impervious as any jabo/bomber can easily take them out, then I don't know if they'll be as unbalancing?
 
Actually @Prof. Garfield I did have a conceptual question for you - can "canBuildSettings" be used to overrule a technology requirement for a unit?

So, basically the civ doesn't need to have a certain technology to build a unit so long as other parameters are true?

I was thinking of having the Non-Aligned and Chinese be able to research "licensing" of certain units, and if they got the license tech they could build the unit even though they don't have access to the underlying technology.
 
Having naval vessels only weaken but not destroy ground forces is another option. But if these units were realistically limited (maybe only 5-6 cities on earth can build them) and they're cut off early game (1955 was when the last battleship was launched), and they're no longer impervious as any jabo/bomber can easily take them out, then I don't know if they'll be as unbalancing?
I think both preventing battleships from killing outright and improving tactical bombers are important limitations. The former means that you can't replace a large ground army with a couple battleships, and the latter actually makes them vulnerable. I think battleships were vulnerable to strategic bombers rather than tactical bombers in the last version, which, IMO, doesn't make much sense from either a "modelling the world" perspective, or a balance perspective.

Perhaps you could make aircraft defend cities against ships with their attack value rather than their defensive value. That was another issue. I'd buy bombers to attack the US navy, but the combined might of the attack destroyed them before they could be used.

Actually @Prof. Garfield I did have a conceptual question for you - can "canBuildSettings" be used to overrule a technology requirement for a unit?

So, basically the civ doesn't need to have a certain technology to build a unit so long as other parameters are true?

I was thinking of having the Non-Aligned and Chinese be able to research "licensing" of certain units, and if they got the license tech they could build the unit even though they don't have access to the underlying technology.
There is a parameter, "overrideDefaultBuildFunction" which can be set to true in the canBuildSettings, and that will ignore all the game's standard requirements for building a unit. The autoCanBuild.html code generator has a checkbox for that setting.
 
I managed to have a good day of civing, which was my mother's Christmas present to me (she watched the kids fight over their toys all day). I managed to get the ENTIRE tech tree done. The only thing left to do in the rules is to finalize a few improvements, then I'll make my object file and get cracking on the scenario events.
 
I believe you made Canada European instead of Pro-West to maintain the European player in the case of Soviet invasion. I'd suggest tying this to an event, transferring control from Pro-West to Europe only after direct confrontation between Europe and the USSR.

Thinking this through, maybe one of the "pluses" is as Europe, once there is a direct confrontation with the Soviets, Canada, Australia, New Zealand, and South Africa*, all of these "pro-West" lands revert to European control, making Europe pretty darned hard to completely destroy.

*If prior to 1961 when they withdrew from the Commonwealth.
 
@Prof. Garfield if you have a moment can you help me out with one example of CanBuildSettings?

Basically, I want this to be the situation for the U.S.S.R. (object.pSoviets) to build the MiG-29 - this is easy enough:

Code:
unitTypeBuild[object.uMiG29Fulcrum.id]={location=sovietHomeCities,allImprovements={object.iFactory}}

But I also want the Non-Aligned (object.pNonAligned) to be able to build it with these conditions:

Code:
unitTypeBuild[object.uMiG29Fulcrum.id]={location=nonAlignedHomeCities,allTechs ={object.aNASecuresMiG29License},allImprovements={object.iFactory,object.iLicensingPlant}}

And I want the Chinese (object.pChinese) to be able to build it with these conditions:

Code:
 unitTypeBuild[object.uMiG29Fulcrum.id]={location=chineseHomeCities,allTechs ={object.aCNSecuresMiG29License},allImprovements={object.iFactory,object.iLicensingPlant}}

How would I combine all three to make them work? In the rules, the USSR is the only one allowed to build this unit, period (in @UnitsAdvanced).

If you can give me a hand with this one I should be able to copy and paste all the rest of them and get them firing. I appreciate it!
 
Have you tried using the code generator (autoCanBuild.html, open it in your browser) in the scripts folder? There is a makeObjectJS.lua file there too, which works like makeObject.lua, but for autoCanBuild.html. The addBuildConditions function means you don't have to nest conditions in the alternate conditions key (I forget the exact name).

I'm being called away now, but I can offer more help later if autoCanBuild.html doesn't do what you want.
 
Have you tried using the code generator (autoCanBuild.html, open it in your browser) in the scripts folder? There is a makeObjectJS.lua file there too, which works like makeObject.lua, but for autoCanBuild.html. The addBuildConditions function means you don't have to nest conditions in the alternate conditions key (I forget the exact name).

Very cool tool. Playing around with it, I think I've overcomplicated matters by adding in a different building requirement for the Non-Aligned and Chinese to build it, which is pretty irrelevant. If I just move it to "require at least 1 of these techs" and all 3 can only research one of each of those, that should work just fine then without much fuss.

One suggestion is under the cities tabs where you can add them one by one, consider having a button that selects/adds ALL cities from any of the lists (for example, "All Soviet Cities." I'll just select a few for now and edit it manually in the editor but it would be time consuming to add each one by one).

99% sure this solves my problem so thanks for pointing it out! I can't keep up with what you're doing these days I swear lol
 
It worked like a peach - sometimes I just need to approach problems a different way. Appreciate it!
 
One suggestion is under the cities tabs where you can add them one by one, consider having a button that selects/adds ALL cities from any of the lists (for example, "All Soviet Cities." I'll just select a few for now and edit it manually in the editor but it would be time consuming to add each one by one).

The attached file makes that happen (at the bottom of the dropdown). Just place it in the scripts folder, replacing the existing file. (The template is updated with this.)
 

Attachments

  • autoCanBuild.js.zip
    11.1 KB · Views: 18
Well, the lua template has once more proven its worth... The whole "rebel Spawn" mechanism that took me what seemed like weeks last time (and was buggy as all heck) has been accomplished in about 3 hours of work. Granted, I've simplified things significantly using "nearbyRecruitmentTiles" and "scatter," but this should be **much** easier for the human player than sifting through countless menus. So, I guess what is best for the designer is also best for the player?

The way it now works is the human needs to bring either a Spy or Special Forces unit to an area of the map they want to fund a rebellion in. They then press "k," a menu pops up, and for a price (set in parameters), you can fund a small, large, or huge rebellion (also set in parameters). The types of units that will spawn are according to region (Latin America, the Middle East, Africa, South Asia, Southeast Asia, Northern Asia, and Europe).

I decided to allow this to happen in Europe (and the Soviet Union as well) for the time being since there were certainly rebellions against the Soviets that were crushed at various times (Hungary, Czechoslovakia), and there were great fears that Italy would go Communist early in the scenario's timeframe. This is also one more reason for everyone to have to have a good defensive system in place rather than counting on the other player not to attack, which was another issue with the earlier version...

(As an aside, canBuildSettings and munitionsSettings are also complete). It's so crazy that three modules were completed in a few hours today compared to how many ages it took me in the past. If you haven't tried @Prof. Garfield 's template, you really owe it to yourself.
 
Any idea why the parameter file isn't working for setting this as a parameter?

Code:
param.RebelSpawnChance = math.random(1, 3) == 3

If I just use "math.random(1,3) == 3 in the actual line of code I want:
Code:
(if city.owner ~= object.pProWest and math.random(1,3) == 3 then)
, it works as intended (and there are 15 chances each turn - I'm getting it to fire about 3-7 consistently which is about where it should be).

However, if I use:

Code:
if city.owner ~= object.pProWest and param.RebelSpawnChance then

Anything with 1,3 == 3 will never fire

If, in parameters, I change
Code:
param.RebelSpawnChance = math.random(1, 3) == 3
to

Code:
param.RebelSpawnChance = 1/3

Then the event simply fires all 15 times, which it shouldn't.

I can go about it the old fashioned way but there's going to be a lot of places to change if I decide 1/3 (or whatever) isn't right, so I thought I'd try and see if anyone had some idea what is going on.
 
Code:
param.RebelSpawnChance = math.random(1, 3) == 3
This code means
1. Evaluate math.random(1,3) --> result
2. Evaluate result == 3,
3. Assign true or false to param.rebelSpawnChance based on how 2 was evaluated.

This means when you load the game, there is a 1/3 chance param.RebelSpawnChance will be true, and 2/3 chance it will be false. (Note: the Lua random number seed is set somewhere during the initialization); if it is after this, then one of the answers will always be assigned.)

This is the code you should use:
Code:
param.RebelSpawnChance = 1/3
Code:
if city.owner ~= object.pProWest and math.random() < param.RebelSpawnChance then
math.random() returns a number between 0 and 1.
 
I'm certainly favoring breaking the scenario events into manageable, bite-size chunks spread over many files than my old way of having one massive one.

Completed
-munitionSettings (ranged units)
-canBuildSettings (where what can be built)
-rebelEvents (AI rebellions)
-keyPressSettings(for some reason I had trouble putting key press events elsewhere, but will eventually figure this out and bring rebelSpawn into rebelEvents).
-part of armsRace (governs the "gatekeeper techs" that you only get after you spread research out fairly evenly. Also handles the licensing mechanism.

Next Up
-Finish up armsRace (need to add an event that pays the Soviets, Americans, and Europeans when the Non-Aligned or Chinese license their weapons... Probably will give a small cash bonus (maybe 100-200?) when a licensed unit is built by one of those tribes.
 
I picked up the original version when Civ2 fell finally back into my old game rotation (or roTOTion) and I’m looking forward to this. Not trying to push up the old development schedule here, but I just wanted to offer help in any capacity that I could. :)
 
I picked up the original version when Civ2 fell finally back into my old game rotation (or roTOTion) and I’m looking forward to this. Not trying to push up the old development schedule here, but I just wanted to offer help in any capacity that I could. :)

I'm past most of the "boring" (as a designer) stuff so it's really just writing the events now. I've finished armsRace and am starting with China. As I've mentioned earlier, the template (as well as my growing skillset a few years later) is helping me get through the coding much faster.

Probably the biggest help is just if you'd be willing to take a shot at it single player before it's released, that would be helpful. I'll do my own alpha testing to try and get rid of bugs but after that it's tough to play through 5 civs in a timely manner so if you're willing to tackle any of them, that would be awesome.

The first MP match too probably should be with folks who understand it's a beta, and are OK with things changing mid-game, if you'd like to eventually join. Looking back through time at the old threads, that's how most MP games were released. The first playthrough needed tweaks here and there. All the same, with some more SP playtests first maybe it won't be as necessary.
 
JPetroski, it is the first time I have noticed the blue sign "SLeague Staff" under your avatar. May be, here I am very late, but nevertheless: Congratulations. :)
 
Last edited:
If you are planning to play a multiplayer game in future I would be interested. I've enjoyed playing your scenario, it has shown me some good inspirations and mechanics which I'm currently using in my Reformation scenario.
 
Top Bottom