Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Turning Combat deterministic

Krill already mentioned that he wants a new game option that turns the combat deterministic at least when defending against the barbarians. I already started work on it and this is how deterministic combat works.

Standard combat
1. Compare the odds of Attacker winning and loosing (as shown in-game)
2. If AttackerWinning is higher, attacker wins
3. If AttackerLoosing is lower or same, attacker looses

With withdrawal it gets a little bit more complicated

1. Compare the odds of Attacker winning and loosing (as shown in-game)
2. If AttackerWinning is higher, attacker wins
3. If AttackerLoosing is lower or same add up withdrawal odds with Winning Odds aka survive odds

4. If SurviveOdds are higher then LoosingOdds, then withdrawal is triggered
5. If SurviveOdds are lower or same as LoosingOdds, then attacker looses

The winning unit is still damaged. For the damage you can expect the most likely outcome as shown by the BUG combat odds feature. In case of a draw the result with the higher HP amount is used.
The unit still receives XP like in standard BtS.


Now while implementing this I had a different thought. What about if I could turn all the combat in Civ4 deterministic in another game option. The single unit combat is already been taken of by the explanation above. This leaves only these combat aspects with random elements:

- Collateral damage
- Flanking damage
- Air unit interception
- Air bombing
- Nuke interception

As for how it could work:

Collateral damage: Here we generate a random number between 0 and 10000 and multiply it with the current HP of each unit being damaged. In general units with higher HP are damaged more likely and this could be made deterministic. The problem though is that if you have enough immune units the will be choosen everytime once every other unit is damaged once.

Flanking damage: Here we generate a random number against the defending unit odds (not the unit being flanked). If the number is higher the unit is damaged. One way to make this deterministic is to just inverse the defending units odds and damage that many units. eg. The defender has 60% odds of defending therefore we would damage 40% of the units or the flanking maximum.

Air unit interception works similar to standard single combat aka combat over multiple rounds with a change to hit the other. Like above I could just calculate the most likely outcome and damage the units accordingly.

Air bombing is hard as here we just make a random number from 0 to airBombRate and compare it to a random number from 0 to airBombDefense. The main problem here is that there is no way for the player to manipulate this by promotions or anything.

Nuke interception probably can't be made deterministic as it's a single dice roll (D100) against the interception value.


I'm really struggling in coming up with good easy rules to make these aspects deterministic and this is why I'm turning to the community in hopes that somebody comes up with a good idea.
Mods: RtR    CtH

Pitboss: PB39, PB40PB52, PB59 Useful Collections: Pickmethods, Mapmaking, Curious Civplayer

Buy me a coffee
Reply

Suggestion: air bombing a tile is no different than bombarding city defenses and should always work unless something specific stops it.

Nuke interception is probably going to have to be an exception to the model because they are not combat units per se. If the nuke model were rebuilt like previous RtR versions, and hence the nukes were military units they could be tweaked to fold in (as one shot collateral units) but I doubt anyone wants that.
Current games (All): RtR: PB80 Civ 6: PBEM23

Ended games (Selection): BTS games: PB1, PB3, PBEM2, PBEM4, PBEM5B, PBEM50. RB mod games: PB5, PB15, PB27, PB37, PB42, PB46, PB71. FFH games: PBEMVII, PBEMXII. Civ 6:  PBEM22 Games ded lurked: PB18
Reply

As a general approach: convert every damaged-or-not-damaged random check into always applying damage, with the value of the damage being the expected value going in. Like if the defender has 60% odds of defending in your example, instead of either 0 damage or full damage, they always take 40% of full damage.

I'd even apply that to single unit combats, round by round. Instead of winning or losing each round, both units take damage, in the amount of their expected value. Like if the attacker has 60% odds for each round, then the attacker always takes 40% of the usual damage value and the defender always takes 60%. So first strikes (immune to damage for that round) and withdrawals (at whatever health threshold triggers it) still work just about the same.

You could enhance the UI enough to display that - it could always be able to calculate that the combat will last N rounds and the attacker will take N*X damage and the defender will take N*Y damage.

Air bombing and nuke interception can't quite work that way since there's no rounds. One approach could go like this: a player has a hidden (or shown) total of "air bombing equity". If you do a bombing a with 70% chance, add 70 to that value. On any bombing where that rolls over 100, the bombing succeeds. So you get exactly the cumulative expected value over time. This does become gamey, that you'd plan out your bombing runs when you know which ones will fail. But maybe that's OK or else this suggestion inspires you towards something that would work better.
Reply

Just in general do people really want this? Just a question to save work if its not actually needed.

I'm not one of the people who plays in the random games, but it seems like those people like well randomness.
Reply

Even in random games, id rather the combat "dice" work more accurately. The amount of times where a great general dies to a 95%+ fight, is far above the 5% that "should" be the case. Id rather stuff just get damaged until its low enough. And combats where you pit 100 warriors vs a tank? Yeah, it should never die. What happens though? Eventually they do enough damage...
"Superdeath seems to have acquired a rep for aggression somehow. [Image: noidea.gif] In this game that's going to help us because he's going to go to the negotiating table with twitchy eyes and slightly too wide a grin and terrify the neighbors into favorable border agreements, one-sided tech deals and staggered NAPs."
-Old Harry. PB48.
Reply

(March 29th, 2023, 16:53)superdeath Wrote: Even in random games, id rather the combat "dice" work more accurately. The amount of times where a great general dies to a 95%+ fight, is far above the 5% that "should" be the case. Id rather stuff just get damaged until its low enough. And combats where you pit 100 warriors vs a tank? Yeah, it should never die. What happens though? Eventually they do enough damage...

I'm happy to be corrected, but I'm relatively certain that someone (maybe at CFC) did a fairly extensive test on the combat rng in Civ4 and found that it did actually work as intended, without any streaky behavour. In contrast, I believe Civ 3 was found to actually have a streaky rng for combats. My undertanding is that it feels otherwise because we (humans) are better at remembering unlucky outcomes than lucky ones.

FWIW, while an interesting exercise, I am relatively confident that games would be less interesting with deterministic combat.
Past Games: PB51  -  PB55  -  PB56  -  PB58 (Tarkeel's game)  - PB59  -  PB60  -  PB64  -  PB66  -  PB68 (Miguelito's game)     Current Games: None (for now...)
Reply

Civ 3's RNG isn't streaky either. I tested firsthand, observing 1000 combat rolls at equal strength, and recording that hits in either direction were followed by hits in either direction at exactly the same rate (like 502 out of the 1000.) It just looks streaky since the sample sizes are so small. 1/8 of 4-hit sequences will all flip in the same direction, and you can easily get that once per turn or more. Perception bias takes care of the rest, you only notice the outliers and not the common cases.

There is an asymmetry - we do remember unlucky outcomes more than lucky ones, but in Civ we do cause more unlucky outcomes than lucky ones. We'll lose a 90% attack ten percent of the time... but we won't win a corresponding number of 10% attacks because we won't make them.
Reply



Forum Jump: