Reactive Past module

Galacticat42

Drifting through space, lost
Joined
May 8, 2008
Messages
1,234
Location
CA, USA
If someone walks into a bar holding a knife to try and kill someone in that bar, who turns out to have a gun, would the one with the knife not try to gain some sort of advantage? Of course he would. If he so happened to think quick enough, he would try to toss the knife into a vital part of the man with a gun. Is this the original intent of use on this combat knife? No, they're designed for melee and not ranged. This man adapted its use to counter a bigger threat that he noticed. So, why not apply such logic into C2C? If a country uses a nuke, would not all others try to defend themselves with whatever they have? Of course they would. So the one with artillery would re-purpose and redesign it to aim up and try to shoot a missile out of the sky. Sure it may appear illogical at first, but since when were men logical in the face of certain death? This is why I propose a new module I'm calling Reactive Past.

Reactive Past will try to simulate such deviations from the normal use of units to try and compensate for bigger threats that a nation's current equipment just wasn't designed for. There are no new technologies and no new unit graphics - it's just making new units to simulate re-purposed ones to counter something that it wasn't designed for originally.

For example, Nation A has spearmen, but nation B has early tanks. Logic dictates that tanks win by making road-kill of them and shooting them from a distance. Now if nation A was smart, they would re-purpose the spearmen for guerrilla warfare and ambush the tanks, thrust their long pointy sticks through the tank peepholes, killing the squad inside the metal box on wheels. This anti-early tank spearmen unit will be specialized in killing that type of tank unit, but nothing else - they will no longer be specialized in killing mounted units simply because their fighting tactics dictate so.

In this spearman vs tanks case, it would best be handled by a promotion. This promotion cannot stack with other Reactive Past promotions and cannot be applied by a building. It can only be unlocked if this early tank unit was discovered before hand.

I realize this can turn out to be quite a large project simply because of the amount of units already in-game, but be assured that the Reactive Past initiative will only apply to units that has the means to defeat another yet was not originally intended to. Another example would be a Mobile Sam re-purposed to intercept nukes instead of planes.

This is, of course, only a concept outline. Please discuss your thoughts and concerns - keep in mind this is not to give power to technologically-backwards civs, but rather to give them a way to keep their sorry behinds alive long enough to keep the late-game interesting.
 
hmm Funny to bring the old Civ 3 joke up :spear: I do like your idea though
 
Good idea

I dont think that we news new promotions to achive this
Simply unlock vs tanks vs mechanized va wheeled and vs.robots promos at some conditions for meele units
and teach AI to use it. Effect will be the same
 
@So thanks

@Thunderbrd
There are a few ways to unlock said promotion. The one I had in mind would be that a nation automatically gets it unlocked when they first spot a tank. Of course there would need to be something in the DLL to handle what units a nation has or has not seen from other countries.
 
@Thunderbrd
There are a few ways to unlock said promotion. The one I had in mind would be that a nation automatically gets it unlocked when they first spot a tank. Of course there would need to be something in the DLL to handle what units a nation has or has not seen from other countries.
I was thinking something like that too but I wanted to know what you had in mind there.

It might be easier to do it based on having ever been in battle with a given unit class. And I take it we're unlocking in the sense that the unlock opens up the promo's prereq, not just auto assigns the promo right?

I'm also wondering if it should be a combat class identifier in use for this rather than a unit class. There are tons of unit types and fewer unit categories and now that we can add multiple combat classes, we may be able to work this in a bit easier via a combat class issue. And that would be from both a prerequisite combat class of a unit (for example: Polearm unit (a sub-combat class of some melee units like spearmen) would be able to take a special (and powerful enough to motivate the ai to grab for it right away) anti-tracked unit promo (anti-tank as it were) provided that any of the nation's units has been in battle with any tracked unit.)

So the setup for the prereq condition would mean tracking an array boolean in CvPlayer, hasBattledUnitCombat, and setup a count where positive = true and 0 or less = false and each time a battle takes place it logs the type of unit the battle is with and changes the value of the count. Easy peasy and a mere blip on the processing spectrum. A spot mechanism would be a bit tougher and I think it might make more sense if the nation should have to at least test the mettle of that strange new weaponry first.

That'd be very easy on my end to set up the dll aspect. Then it'd be back to you for the promotion designs. Fair 'nuff?
 
Actually, first fight was my initial idea, but when it comes to something like anti-missile artillery, you can't fight a missile - it just blows up. So I'm thinking first fight is one type of unlock, and yes - it's just unlocking the prereq of a promotion. But we'll have to come up with something for the units that never fight i.e. nukes.

But yea, that sounds like a solid plan to start off with.
 
Actually, first fight was my initial idea, but when it comes to something like anti-missile artillery, you can't fight a missile - it just blows up. So I'm thinking first fight is one type of unlock, and yes - it's just unlocking the prereq of a promotion. But we'll have to come up with something for the units that never fight i.e. nukes.

But yea, that sounds like a solid plan to start off with.

Oh. I was thinking maybe like this. You have a stack of troops and they encounter an advanced army. Such as spearmen vs tanks. Every time a spearman dies to a tank the units in the same stack get a small percentage that it learns an anti-tank promotion. Thus over time if you loose a lot of troops to the tank you are more likely to eventually learn how to combat the tanks.

Note that these promotions would not be possible to take normally. But once you got the first one it could possibly lead to other promotions. In addition if you are the advanced civ then it will get harder to fight an army even if you are winning because they will eventually learn how to combat your units.

This in turn could be used for units on any scale. Thus if you always use say Horse Units against another civs they will eventually learn to combat horse units better than they normally would.

In short surviving armies will eventually adapt to whatever is thrown at them given enough time and enough of the same type of unit.
 
Oh. I was thinking maybe like this. You have a stack of troops and they encounter an advanced army. Such as spearmen vs tanks. Every time a spearman dies to a tank the units in the same stack get a small percentage that it learns an anti-tank promotion. Thus over time if you loose a lot of troops to the tank you are more likely to eventually learn how to combat the tanks.

Note that these promotions would not be possible to take normally. But once you got the first one it could possibly lead to other promotions. In addition if you are the advanced civ then it will get harder to fight an army even if you are winning because they will eventually learn how to combat your units.

This in turn could be used for units on any scale. Thus if you always use say Horse Units against another civs they will eventually learn to combat horse units better than they normally would.

In short surviving armies will eventually adapt to whatever is thrown at them given enough time and enough of the same type of unit.

We have a system for automatic assignment of promos when you win in a fight but that wouldn't be useful here as your units would likely never survive in the scenarios we're talking about. This approach would also reduce the frequency of witnessing such promos in use throughout the game. However, something like that COULD be designed so I'm open to changing 'the plan' on this.

It could be done by checking the combat class you've entered battle with every time you do (including being included in collateral damage, air strikes and by bombardment) and randomizing a quick check to see if your unit gets the promo before the fight actually starts. You'd have to have no way to train any units of said combat class. Promotions would have to be tagged with a bool to indicate that they fall into this type of reactive category. Run through a check of all the promos to find ones that may apply then keep a count of how often those have been applicably checked against... make that count the % chance of the unit being auto-assigned the antithises promotion and if you've ever been assigned it you now have qualified for the prereq on that reactive type... yeah, I can see it being done but it would be a bit more processing heavy. No more than most of the similar projects I have in mind along similar lines though (support promos, overcrowded tile promos, morale effects etc...)

One element of the combat mod would be very interesting with these reactive promos too. Retraining could be used to repurpose units once you have unlocked these reactive promotions. Could make the game quite interesting to have an opponent suddenly rearming the majority of his army with promos designed to combat your technological superiority.

Unfortunately, where nukes are concerned, a proper nuclear strike will destroy ALL units and opposition in the first round of attack. The AI doesn't usually play this lethally but if it ever comes to nuclear war with me as the aggressor, none stand after the blasts go off and no city has enough production to muster any resistance (save from some small ability to possibly draft but with the commando units going in and claiming almost all cities within the first two rounds of the war, its usually a wrap that fast) so the anti-nuke applications of this project would be less than a perfect solution.
 
We have a system for automatic assignment of promos when you win in a fight but that wouldn't be useful here as your units would likely never survive in the scenarios we're talking about. This approach would also reduce the frequency of witnessing such promos in use throughout the game. However, something like that COULD be designed so I'm open to changing 'the plan' on this.

That's why I said units in the same stack. This would be learning from the units that died. Rather than the current system where you can get random promotions from victory. Both systems could co-exist since the winner would get xp and a possible promotion from defeating a unit and then the other units in the stack the other just killed would learn too (through promotions and not XP).

It could be done by checking the combat class you've entered battle with every time you do (including being included in collateral damage, air strikes and by bombardment) and randomizing a quick check to see if your unit gets the promo before the fight actually starts. You'd have to have no way to train any units of said combat class. Promotions would have to be tagged with a bool to indicate that they fall into this type of reactive category. Run through a check of all the promos to find ones that may apply then keep a count of how often those have been applicably checked against... make that count the % chance of the unit being auto-assigned the antithises promotion and if you've ever been assigned it you now have qualified for the prereq on that reactive type... yeah, I can see it being done but it would be a bit more processing heavy. No more than most of the similar projects I have in mind along similar lines though (support promos, overcrowded tile promos, morale effects etc...)

I think such promotions should be defensive at first. Such as units learning how to defend against whatever type of unit, but not necessarily know how to attack the unit better. Through either XP or witnessing the deaths of other units to that type of unit could lead to a more aggressive approach. Note that starting out with a defense bonus first would help cities if they survived the first wave of attacks. And thus each successive attack would be harder for the attacker to succeed at since they would learn how to defend against their attacks. This would also promote a more diverse army than say all Swordman attacking a city. Because over time the defenders would get better at defending against them.

One element of the combat mod would be very interesting with these reactive promos too. Retraining could be used to repurpose units once you have unlocked these reactive promotions. Could make the game quite interesting to have an opponent suddenly rearming the majority of his army with promos designed to combat your technological superiority.

Indeed. Also if we used more sub-classes such as Swords, Polearms, etc. We could have say a unit get better at defending against Swordsmen but not Pikemen even though they are both melee units.

Unfortunately, where nukes are concerned, a proper nuclear strike will destroy ALL units and opposition in the first round of attack. The AI doesn't usually play this lethally but if it ever comes to nuclear war with me as the aggressor, none stand after the blasts go off and no city has enough production to muster any resistance (save from some small ability to possibly draft but with the commando units going in and claiming almost all cities within the first two rounds of the war, its usually a wrap that fast) so the anti-nuke applications of this project would be less than a perfect solution.

Hmm that is a bit harder. But then again nukes are unlike any other weapon.
 
@Hydro
Erm, that is a possibility, but I prefer to keep in mind that information is commonly shared throughout the nation and any unit can take up a promotion once it's unlocked.

As for missiles, it would be best if you can check if one has been used within your visual range, or within borders if that won't work out - or if one has been used at all if the prior two don't work out.
 
@Hydro
Erm, that is a possibility, but I prefer to keep in mind that information is commonly shared throughout the nation and any unit can take up a promotion once it's unlocked.

As for missiles, it would be best if you can check if one has been used within your visual range, or within borders if that won't work out - or if one has been used at all if the prior two don't work out.

So are you saying that if I attack a city with a Tank that all units in that nation will get anti-tank promotions? Or is it only new units?
 
That's why I said units in the same stack. This would be learning from the units that died. Rather than the current system where you can get random promotions from victory. Both systems could co-exist since the winner would get xp and a possible promotion from defeating a unit and then the other units in the stack the other just killed would learn too (through promotions and not XP).
Hmm... thinking of the processing here on checking through every unit on the stack whenever an attack is made (checking the stack the unit attacked from) or a defense is held (checking through the stack the unit was in when attacked)... I'm not against heavy processing for things like this but it would probably create a noteworthy turn delay as this would happen on ALL battles, even ones the player isn't involved in. And would it be worth the delay for this depth for the feature?

Certainly both systems could co-exist... no problems there at all. But it could be much simpler and I personally don't think the difference between the simpler method and this more complex method would be worth any noticeable delays.

By checking for the unit in battle with the advanced enemy to have a sudden surge of inspiration on how to go to battle with the advanced unit just as the combat begins, not only would the unit make a better effort of it during the battle, but we'd only have to make a processed check for the combatant alone, which would save a lot of processing (some stacks are quite large but more importantly, to select units in the stack for making a check requires you cycle through ALL units owned by the player to identify the units in the same plot first... When that happens on every combat... whew!). Once the unit has figured out the trick, then the promo is opened up and available for others to select.


H said:
I think such promotions should be defensive at first. Such as units learning how to defend against whatever type of unit, but not necessarily know how to attack the unit better. Through either XP or witnessing the deaths of other units to that type of unit could lead to a more aggressive approach. Note that starting out with a defense bonus first would help cities if they survived the first wave of attacks. And thus each successive attack would be harder for the attacker to succeed at since they would learn how to defend against their attacks. This would also promote a more diverse army than say all Swordman attacking a city. Because over time the defenders would get better at defending against them.
A check if the unit is attacking or being attacked could determine the difference between what they could unlock. But if we want, these promos could be setup on promotionlines with the first stage being defensive, then progressing into offensive, then progressing into an improvement on both.

Each stage could be unlocked on a ladder of increasing access. In this system, it would be the PromotionLine that would be checked for potential unlocking, and that would save on some processing as well since it would streamline the cycling through of all promos by cycling through promotionlines instead. Such a method would designate the PromotionLine rather than the promotions themselves, as falling under this new 'reactive' category, thus all promos on the line would inherit that status. And we'd track the stages of access by how often the promotionline has been successfully unlocked.

But even doing it this way suggests that all stages of the line should be equally offensive and defensive because it would make it easier to define that the battle that unlocks a stage of the promo line can be either attack or defense either way. Fortune favors the bold in such a method, so if you really want to unlock these potential power counters you can go out of your way to go ahead and launch attacks you know aren't going to be successful so that you can learn from the battles.

As for the percentage chance to unlock a stage of the promotionline, does 1% cumulative per battle sound appropriate or is that not strong enough... or should it be a flat rate like 10% or something?



Indeed. Also if we used more sub-classes such as Swords, Polearms, etc. We could have say a unit get better at defending against Swordsmen but not Pikemen even though they are both melee units.
True, the whole full application of the combat mod would work very nicely all in all with this project!


Hmm that is a bit harder. But then again nukes are unlike any other weapon.
Perhaps it should be spies that gain a mission to learn about this strange nuclear tech (and this may apply to so many other ways to go about this too...) enough to bring back information that could allow for some kind of defense to be enabled.

@Hydro
Erm, that is a possibility, but I prefer to keep in mind that information is commonly shared throughout the nation and any unit can take up a promotion once it's unlocked.
I don't think the system would be successful otherwise. It's like learning a trick to deal with the enemy that uses tech you don't currently have yourself and I think its a good idea to make it possible to then teach this trick once learned. It's like the monkeys learning to wash potatoes thing...

I've also long thought that when defeating a unit you can't build due to tech requirements, it should give you some science bonus towards that tech (back engineering!)

As for missiles, it would be best if you can check if one has been used within your visual range, or within borders if that won't work out - or if one has been used at all if the prior two don't work out.
Meh... I'm not sure that would be appropriate enough and the processing to evaluate such an event would be somewhat ugly I think. Perhaps the spy solution is the way to go here. I also don't think it would be ultimately problematic for units to learn tricks when targeted - Nukes are the only ones that make that kind of pointless but for other sorts of WMD weaponry, I recall a story from WWI where a unit facing nerve gas for the first time was immediately ordered by a clever commander to urinate on their shirts and then wrap the shirts over their nose and mouth so that the urine would negate the lion's share of the toxin enough to allow them to charge into the gas cloud ahead of them and surprise the enemy with a last stand attack that worked out rather successfully. The soldiers didn't ultimately survive I don't think but they did a lot of damage to the enemy in their deaths as a result of this clever quick thinking.
 
Back
Top Bottom