Removing the randomness

i think we want the same results, just with the jump point discontinuities removed.
Would you suggest a method for doing this? There are two relatively simple approaches I can think of:

1) Make the damage have a random component, so that instead of being 6-59 points of damage/round, some percentage of the damage is randomized (10%?) Note that such a change would dramatically increase the time required to calculate exact odds, but it should decrease the discontinuities.

2) Revert to an older version of Civ IV, where the damage was always 20 points/round. Obviously, this would make some pretty major changes in the rest of the odds.
 
Ok, I defined a simple graph so we know what we are aiming at achieving in fixing the combat.

I bellieve we should be aiming at removing the jump points, while keeping the approximate combat ratios the same so not to change the balance of the game. this is all about fixing the jump point bug, not about game balce suggestions.

This is taken off the article on jump points. (this is a REALLY quick sketch to highlight our objectives, not looking at exact values)

The thin lines are calculations previously done on jump points.

The red line is the type of effect we get when increasing the number of combat rounds. A sharp skew in probabilities when in uneven battles, thus changing the game dynamics and balancing. Hence I believe we can not solve the combat problem with increasing the number of combat rounds, but should find another method of solving the problem.

The blue line is the type of results I believe we are aiming at.




There are probably many ways of doing this, it’s good we have a community that can help brainstorming.

I like the idea of adding a slight randomness in the damage, and also using floating point damage instrad of rounding the damage off to an integer. Then the strength ratio will always affect the floating point damage, and the jump lines between 5 and 6 hits would be blurred by the randomness. Eg ±Rand(0.2) damage. So if you’re exactly on the jump line you would have 50% chance you’d need 6 hits and 50% chance you’d need 5 hits, while if the floating point damage was 0.1 damage/hit under from the jump line then you’d have 75% chance you’d need 6 hits in that combat, and 25% chance you’d need 5 hits to win the combat. Naturally at the end of combat the floating point hp left could be rounded off to het integer hp left over.

Naturally changing the size of the random damage factor will change the blending across the jump line. I think that way we could approach the blue line.

i haven't had a chance to look at all the calculations and see what side effects occur.

If someone has some time could you try testing/simulating the effect of a floating point damage, with a different size random factor.

There are probably also many other simpler ways of doing this without changing the number of rounds. Any ideas?
 
Ok, I defined a simple graph so we know what we are aiming at achieving in fixing the combat.

I bellieve we should be aiming at removing the jump points, while keeping the approximate combat ratios the same so not to change the balance of the game. this is all about fixing the jump point bug, not about game balce suggestions.

The blue line is the type of results I believe we are aiming at.

There are probably many ways of doing this, it’s good we have a community that can help brainstorming.

I like the idea of adding a slight randomness in the damage, and also using floating point damage instrad of rounding the damage off to an integer. Then the strength ratio will always affect the floating point damage, and the jump lines between 5 and 6 hits would be blurred by the randomness. Eg ±Rand(0.2) damage. So if you’re exactly on the jump line you would have 50% chance you’d need 6 hits and 50% chance you’d need 5 hits, while if the floating point damage was 0.1 damage/hit under from the jump line then you’d have 75% chance you’d need 6 hits in that combat, and 25% chance you’d need 5 hits to win the combat. Naturally at the end of combat the floating point hp left could be rounded off to het integer hp left over.

Naturally changing the size of the random damage factor will change the blending across the jump line. I think that way we could approach the blue line.

i haven't had a chance to look at all the calculations and see what side effects occur.

If someone has some time could you try testing/simulating the effect of a floating point damage, with a different size random factor.

There are probably also many other simpler ways of doing this without changing the number of rounds. Any ideas?

To be clear, I think that Bringa has the change Bringa wants (heck, look at the title of this thread). Obviously, that's not what you're interested in.

My question is if you're suggesting:

+-0.2 points of damage (so 20 points base damage means 19.8-20.2, randomly determined once per encounter), and calculating everything in hundreths, or

+/- 20% of base damage (so 20 points base damage means 16-22, randomly determined once per encounter), and calculating everything in hundreths?

I have no objection to coding either one (although, as a warning, I'd be putting it into Smarter Orcs with XML hooks, and it may be a few weeks); I just need to know which one you'd like.
 
Well, this is quite OT to this thread now; I never cared about those jump points. What I really wanted is less randomness, and I have that now. I am fully aware that this is a large change, but I also still believe it's very valid (for the reasons I mentioned in the first post). I for one am happy with the way it is in smarter orcs/fair combat right now. If the team doesn't like this sort of change enough to implement it into the main game, I'll be happily maintaining my own version in parallel, even rebalancing things if necessary (that said, I haven't found any obviously abusable effects of this change; it's not like you suddenly walk all over your enemy the moment you reach the next tier. Do not forget that this change also means units will be wounded more reliably, and when you have a lot of weaker units you can always take down a few stronger units. I really think it doesn't throw the game off balance but of course much more multiplayer testing (by better players than me) would be necessary to establish that).
 
Well, this is quite OT to this thread now; I never cared about those jump points. What I really wanted is less randomness, and I have that now. I am fully aware that this is a large change, but I also still believe it's very valid (for the reasons I mentioned in the first post). I for one am happy with the way it is in smarter orcs/fair combat right now. If the team doesn't like this sort of change enough to implement it into the main game, I'll be happily maintaining my own version in parallel, even rebalancing things if necessary (that said, I haven't found any obviously abusable effects of this change; it's not like you suddenly walk all over your enemy the moment you reach the next tier. Do not forget that this change also means units will be wounded more reliably, and when you have a lot of weaker units you can always take down a few stronger units. I really think it doesn't throw the game off balance but of course much more multiplayer testing (by better players than me) would be necessary to establish that).

Bringa: yes, everyone can play the game they like.
Originally I thought you were interested in the jump points (especially as you kept stressing the 1.0001 ratios etc) so I figured that was what we were trying to fix. As the jump points has been one of the main topics of discussion. And I agree they should be fixed. I didn’t realize that what you wanted was the greater change in odds when a stronger unit fights a weaker unit (which will make your hero invincible, so you don’t need to wory about losing him). Obviously you have what you want, and that’s great. Enjoy it. :)



To be clear, I think that Bringa has the change Bringa wants (heck, look at the title of this thread). Obviously, that's not what you're interested in.

My question is if you're suggesting:

+-0.2 points of damage (so 20 points base damage means 19.8-20.2, randomly determined once per encounter), and calculating everything in hundreths, or

+/- 20% of base damage (so 20 points base damage means 16-22, randomly determined once per encounter), and calculating everything in hundreths?

I have no objection to coding either one (although, as a warning, I'd be putting it into Smarter Orcs with XML hooks, and it may be a few weeks); I just need to know which one you'd like.

That’s great you’re willing to give it a go testing in smarter orcs!
We could also do some tests and/or simulations to get the right values.

Random factor size: The random factor should be small enough to not be significant in overall combat odds, only causing a jump point blenging effect over the area near the jump points.

The first way wold cause a parabolic blend function, while the second would cause a linear jump point probability blend function across the jump point. I think the second option is better, as it’s easyer to control, easier to implement, and I think linear jump point blending would beapproptiate to get a close estimation of the blue line (actuallt it would be similar to the thin lines, and thenlinearly change across the blending ratio range.)

It also depends on if we use floating point/1-2 decimal place damage. Eg when calculating the ratios between two units you come up with a base damage of 19.7. so if you were using a random factor from -+0.5 then there would be %20 chance of needing 5 hits and 80% chance of needing 6 hits.

Increasing the damage ratio to 19.99 Vs 20.01 would mean you’d have 49% chance of needing 5 hits and 51% chance of needing 6 hits.

It’s still easy to calculate the probability of winning, calculate the probability of winning needing 5 hits and probability of winning needing 6 hits and then multiply them and add. So there is 0.49*0.4264+0.51*0.624=52% probability of winning

Hence the jump point vanishes. :)


Hence the floating point damage will still be significant as it dictates how close you are to the jump points, and so if it is close enough for the random factor to make a difference.

So the major jump points are
20damage vs 19 damage (ratio 1.000000001)
Defender damage drops from 17 to 16 R=1.38
Attackers damage reaches 25 so only 4 hits required for kill. R=1.57
Defenders damage drops from 15 to 14 R=1.8

The distance between the first and 2nd JP is 0.38, 2nd to 3rd is 0.19, 3rd to 4th is 0.23

so the smallest distance between consecutive jump points is 0.19 ratio this is equivalent of 1damage/blow. So we could take half on each side, ie +-0.5 damage being the rande of the random variable.

This would create a linear blend across the range from –rand to +rand on the graph. Looking at the graph I see evening out the probability over about a 0.1R would probably do the trick, a change in ratio of 0.1 is roughly equal to 1 extra damage per hit. So then setting the random to be from -0.5 to +0.5 would be a decent guess for a starting point.

I’ll have a bit more of a think about it at the end of the week (I want to get the FFHOTM map ready in the next few days). Then I could help with calculations to finally get rid of the pesky jump points.
 
I’ve been thinking about it a bit

I think the best way to implement this would be to have damage as a floating points to 2 decimal places, and multiply the damage by a small random factor.

Currently
Damage = floor(20*(3+R)/(3*R+1)) =floor(20*(3*A+D)/(3*D+A)).


Option1: simple to implement, much better then the old jump point system, but far from perfect (i'm a perfectionist).
So if we change it to


Int Damage

Damage = floor(20*(3*A+D)/(3*D+A)+Random)
Where: -0.5<=Random<=0.5


You get something like the black line in the following graph



now to calculate the probability of success

Success=prob of win with N hits*chance of N hits+Chance of win with N+1 hits*chance of needing N+1 hits

This is a linear relation actoss the affected area.

Option2: much better, works smoothly in central region

The best way to do it, (but would require floating points). Is not to round damage off and keep it as a floating point.

This would make a

float Damage

Damage = 20*(3*A+D)/(3*D+A)+Random
or
Where: -0.5<=Random<=0.5

end of combat:
Winner final HP= roundup(HP)




It must be rounded up, as if the winner just wins with 0.3hp leftover, it&#8217;ll cause mutual destruction if not rounded up.

One effect of this is that the graph will be more smooth, as the change in damage would be not descrete, and would be dependant on the exact ratio.

Eg the point currently at R=1.83 where damage changes from 17 to 16. in a floating point system this would occur at a more appropriate place, when damage=100/6=16.67. Thus it would slightly change the location of the jump point so that all jump points are evenly spaced out, giving a much smoother curve when rounded off. Hence the region of effect would be 16.67±0.5. the 14-15 jump point would be moved to 14.28, and have region of effect over 14.28 ±0.5

Naturally damage approaches 6.666 as r approaches infinite, meaning that R±0.5 is not a problem as approaching infinite R

Option 3: smoothest probability curve.
Alternatively the random aspect could be applied as a multiplyer. Eg damage*random. Hence making the random factor smaller when damage gets smaller.

Jump point 0: R=1
JP1: The point of 16.67 corresponds to R=1.4438, and
JP2: The point at 25 damage is then R=1.571
JP3: The point at 14.28 damage is when R=2.02

So ratio change from point 0-1 is 1.4438,
From JP 1-3 is 2.02/1.4438 is 1.4


Damage ratios between jump points:
25-33.33 (4 to 3 hits)=1.333
20-25 (5 to 4 hits)=1.25
16.67-20 (6 to 5 hits)=1.2
14.28-16.67 (7 to 6 hits)=1.167

The jump points become closer together are extremely high ratios, but the JP become less significant, e.g. from 99.8% jumping to 99.9% a reasonable choice would be looking at the range to JP3, choosing random equal to 0.2/2+1=1.1 and 1/1.1=0.91. this would mean that above this, (ratios of 3+) there will be a chance that the random factor can make a multiple jump point shift, but that is insignificant as the jump points are insignificant at ratios of 3+, the line from jp1 to 3 would be fairly smooth curve, and the line between jp0 and jp1 would be mostly smooth, except for a very very small ratio region around 1.2 where it would be temporarily changing linearly instead of asymptotically as it wouldn&#8217;t be affected by any random factor, this linear region is significantly smaller then the linear region that would be present in option 1 or 2, and overall the probabilities could be approximated by the blue line graph below.

if if you wanted to smooth it out you could chose 0.91<=Random<=1.1
thus at 50% ratio you do 18.4 <damage<22, (50% 5 hits, 50% 6 hits) at J1: D mean=16.67 R=1.4438 you do 15.15<damage<18.34 (50% 6 hits, 50% 7 hits) and at mean damage of 18.18 you do 16.9<damage<19.99 (100% chance of needing 6 hits).

Thus the end points of one probability blending region nearly touch the start of the next region, and hence creating a smoother transition curve as smooth as possible.

Removing the linearity by changing it to integers would change the resulting graph to make it more similar to the blue line (only slight variations).

this will perform more accuratly than option 2 at higher ratio rates as the random factor is scaled with the damage instead of a constant magnitude, but calculating the probability of requiring a certain number of hits and hence hand calculating probabilities of victories will be slightly more complicated then option 2.


Floating point Damage

Damage = 20*(3*A+D)/(3*D+A)*Random
Where: 0.91<=Random<=1.1

End of combat:
Winner final HP= roundup(HP)





Note: that HP left over after victory will be on average the same as before, but instead of having 13, 32, 51hp left over, you&#8217;ll probably have a random value in 5-21, 22-40 or 41-59hp left over after battle.
Thus as a side effect we also improved the increments in leftover hp. The probability of having an extra hp left over is directly related to the attacking probability.


xanaqui42, how easy is it to use floating point in the combat damage? Does this provide you with sufficient information to implement it? please feel free to ask any questions.
 
I've played with this change quite a few times, and I guess my main comment is that I like it, save for the early animal vs scout combats. Instead of wondering if my scouts will die the turn after they see most animals, I know they will.
 
I have just downloaded and installed the GlobalDefinesAlt.xml in the first page of this thread and ever since my game crashes (saves and new games, though new games take a few turn before they crash). Im running 023 with smarter orcs and patch e.

Does anyone knows whats wrong and could be able to help me run it with this modification ?
 
I have just downloaded and installed the GlobalDefinesAlt.xml in the first page of this thread and ever since my game crashes (saves and new games, though new games take a few turn before they crash). Im running 023 with smarter orcs and patch e.

Does anyone knows whats wrong and could be able to help me run it with this modification ?

I think that that file is for Vanilla FfH II. If you want Bringa's modification to Smarter Orcs, it's in the Database, here.
 
Thank you !

Do I need to put back my old GlobalDEfineAlt.xml ? It seems likely, but Im not positive.

I appreciate the help !

Edit: Check and theres a GlobalThingie, so I take it it will just overwrite it.
 
Yeah, if you install smarter orcs / fair combat over FFH 023c, you'll be good to go. Note, though, that this currently does not work in multiplayer (at least not with AIs or Barbs) due to an OOS. But if you're just playing single player, you should be fine.
 
Actually, this ditn make it. It keeps crashing after a few turns. Im waiting for 025 now anyways, so hoping there will be a ready-to-go or included version of this "modmod" shortly :)
 
Back
Top Bottom