INI files: "defend"

Good work Spacer (Finn Ive already thanked) its nice to see My vision of a new age in modding supported in ways like this.

I wonder what Fireaxix programmers would think of your work
"" Hmm its about time they unlocked that one" *nudge to coworker*" say, when do ya think they will ducover the rest " :rolleyes:

Ya I guess the last patch was meant to be a challenge to the community : You want a better game? its all in there,:yup: go ahead and find how to do it yourself, were on vaka :nya:
 
Bjornlo, I dont understand option 2, but it seems to be a "please dont kill me" attack

the standard attack follows, if the attacking unit has HP left...so it doesnt always "kill" the attacking unit...

[edit] on reread I think its a "duck behind the shield" type...but it does do damage...

also, in a few more tests(actually the same tests that were saved in the previous test BIQ) I notice that the "defend" animation always does damage to the attacker, and always the defender does not lose HP on the defend animation...I may run the test a few more times as is, to see what else I notice...
 
Any chance that its got a relation to a unit getting a flag to indicate its eligable for auto-promotion.

I.E. Units that win two combats on a turn automatically get a promotion; ergo, a unit that has already won one combat gets a flag to show that, and when it is attacked for a second time, a win means that if it survives the combat, it will get promoted at the end of it. This could just be a .flc that is played when the flag is set.
 
Spacer One said:
Not front page yet(please)...lemme narrow down the reasons why it happens for a day or two first...but I agree...New animation is front page news...

also, I believe that Finn should get credit(maybe I am supporting cast?) for the discovery...I mean it was his, even if I did all the work...


The real congratulations goes to you, Spacer One, for doing all the work. I just performed a thought experiment and stuck files into the ini slot on a whim. Figgered, why not?

(Although I like to think I started mixing up the animations on my own. Didn't see it before, and wondered, "why don't people make wildly different anis for their units?")

Good to see that they might now. Yippee!
 
From the info that is there, it seems that a good way to increase the possibility that defend triggers is to give it to units that have:

-severely less starting HP (so that they are less likely to ever be faced with an attacker that has less HP than them)
-have stronger stats (So that they can survive despite the large negative HP bonus; only in the case that the actual stats do not factor into the overall probability that defend is triggered, which is something that has to be tested)
-tend to fortify a lot (not sure how this can be assured; perhaps an immobile unit, or units that are preplaced deep inside enemy territory)

Although its up to unit makers to make a defend animation or not, it should be an item in the tutorials forum, or a sticky in the unit creation forum, that explains how you can ensure that the probability it is triggered will become greater (so that people can adjust the stats for the units they want to use it ingame) ;)



Re the actual odds:
when there is more info i will try to actually calculate to a degree what they are. But keep in mind that probabilities are not something which you can see instantly materialise in reality. The example with the coin is one thing, but in abstact environments (eg the game) this means that even if the equation was such that the probability ALWAYS was 1 in x, this would not mean that if you run a test an x amount of times you would definately see it happening once. You could run the test 10x times and do not see it happening at all, or run the test 2 times and see it happening twice. A probability of 1 in x means that if you had run the test for a number of times that nears an infinite number of times, the probability would tend to be 1 in x.

But computer games do not seem to use pure probabilities, due to this problem. Instead they use probability variators, so that they can ensure that 1 in x happens ussually almost once in an x number of attempts. This is why you see the spearman defeating the tank; it is a balance program for the probability (at least i think so). So the actual equation that computes the probability most probably has such a variator, that would probably factor some elements of the rest of the equation so as to create a balancing effect.

Im not sure how trainer programs (that are meant to calculate the probabvle outcome of a battle) are built. PErhaps someone who has built one for civ3 can share some info? :)
 
Hm, i checked bomberescort's thread about how he calculated the probability for retreat (found here: http://forums.civfanatics.com/showthread.php?s=&threadid=64755) and at least froma quick look i do not see how this is probability theory at all. He had a series of tests (up to 500) and wrote the numbers that came up from them. This is not anything to go by :confused:

The easiest way would be to have quotes from Firaxis, as in the case (i think) of defensive bonuses for terrain (they are in the civilopedia). If you do not have quotes then you cannot really calculate the probability without knowing the factors. You can run 5 million tests, it still is not a calculation.

(i will read the thread more carefully later)
 
varwnos said:
...But computer games do not seem to use pure probabilities, due to this problem. Instead they use probability variators, so that they can ensure that 1 in x happens ussually almost once in an x number of attempts. This is why you see the spearman defeating the tank; it is a balance program for the probability (at least i think so). So the actual equation that computes the probability most probably has such a variator, that would probably factor some elements of the rest of the equation so as to create a balancing effect.

Im not sure how trainer programs (that are meant to calculate the probabvle outcome of a battle) are built. PErhaps someone who has built one for civ3 can share some info? :)


varwnos obviously has a firm grasp of probability theory, but if he is correct that computer games use a "probability variator" (which I assume to be a subroutine that compares deviance from the median in past outcomes? to adjust the probability of future outcomes? have you ever heard of "Skewe's Number???) if he is correct and if that is what he means by a variator, I have officially become non-plussed.

By the way, for anyone trying to see this
happen, I assume that "Preserve Random Seed" is OFF. I always play with it off, and it's possible this might affect the outcome as well...
 
FinnMcCool said:
varwnos obviously has a firm grasp of probability theory, but if he is correct that computer games use a "probability variator" (which I assume to be a subroutine that compares deviance from the median in past outcomes? to adjust the probability of future outcomes? have you ever heard of "Skewe's Number???) if he is correct and if that is what he means by a variator, I have officially become non-plussed.

By the way, for anyone trying to see this
happen, I assume that "Preserve Random Seed" is OFF. I always play with it off, and it's possible this might affect the outcome as well...

Yes, i suspect that such a subroutine is used; although there are many ways to make one without needing to be too intellectual about it: for example in old basic programs there was the very simple line that checked whether or not x=a for an y number of times. Basically if x did not equal a for a y-1 number of times then the line demanded that it did for the yth number of times x was asked to recieve a value. Of course this is the most basic way, and as such it meant that x would always equal y the yth time (if it did not already come to equal y in a previous time), which i do not think is at all the case in most programs, but in some it still is :)
 
Ok, i saw bombardescort's formula. But how did he arrive at the conclusion that it is correct? There is only the formula itself in that page.

The formula follows:

bomberescort said:
This formula will give you the probability of the attacker winning the battle with a certain number of HP remaining...

{[(A/(A+D))^dhp] * [(1 - A/(A+D))^hpl]} * [n!/(hpl! * (n-hpl)!)]

A = Attacker Strength + All Applicable Bonuses (i.e.- Radar Tower)
D = Defender Strength + All Applicable Bonuses
hpl = Hit Points the Attacker Loses [<= (Attackers Total HP -1)]
dhp = Defenders Total Hit Points (e.g. 3 for a Regular unit)
n = [(dhp - 1) + hpl]

Also i trust that "^" stands for "power of" and that "!" is a paragog (sorry, dont know its name in english, but it is n!= 1 times (...) times (n-1) times n, for n being a natural number).

So it is quite a complicated formula to arrive at, which is what makes me wonder how exactly he arrived at it.
 
varwnos said:
Are you Isaac Newton? No credit at all to me, thief! :lol: :)

Im not sure I understand the question...but this is my retort...sorry in advance if Im out of line here...

A) No, I am not isaac newton...I believe he has been dead a LONG time...never met the guy

B) not trying to be rude, but Varwnos, all you did was try to disuade me from the testing...almost everytime I posted new results, you would tell me that it was all but futile(which it obviously wasnt)...the only credit I see you getting, is making me think that it was a small probability, and causing me to keep testing. I didnt use any of your suggestions, and mostly ignored your negativity

C) DONT ever call me a thief...even as a joke...
 
ainwood said:
Any chance that its got a relation to a unit getting a flag to indicate its eligable for auto-promotion.

I.E. Units that win two combats on a turn automatically get a promotion; ergo, a unit that has already won one combat gets a flag to show that, and when it is attacked for a second time, a win means that if it survives the combat, it will get promoted at the end of it. This could just be a .flc that is played when the flag is set.
I think you're on to something here. The flag is already there, so why create a similar flag for the defend?
 
Spacer One said:
C) DONT ever call me a thief...even as a joke...

Sorry, the Newton joke was obviously lost:

I was reffering to the Newton vs Leibniz calculus controversy (and also other stuff that it is suspected that Newton stole from other scientists of his time and presented as his own). So the 'thief' part was linked to the Newton part, and not to you ;)

http://en.wikipedia.org/wiki/Newton_v._Leibniz_calculus_controversy

edit: regarding the credit; ok, this is not the calculus anyway. Good work Spacer One and i didnt mean to offend you.
 
varwnos said:
Ok, i saw bombardescort's formula. But how did he arrive at the conclusion that it is correct? There is only the formula itself in that page.

So it is quite a complicated formula to arrive at, which is what makes me wonder how exactly he arrived at it.


It's called a "factorial" in english. But your term sounds better.

The formula you posted above, varwnos, makes me nervous. Not because it's complex (though it is) but because it isn't what lots of modder-techies have been claiming "the formula" is. That is exactly what I was afraid of in very old arguments in old threads; if you claim to "know" what the formula is, you could very easily be WRONG. The only way to KNOW what the formula is, is to get right down into the sourcecode (unhacked) and hold it in your sweaty hand, or see it with your own googlers. Any attempt to "replicate" the formula to achieve identical probabilities is futile and misleading.

But that said, if this IS actually "the formula" then it raises another question: why should the lost hit points and existing hit points have any effect on the outcome? (Well, it might in real life, but why consider it?) If you decide to consider the remaining hit points, it might explain why combat outcomes become so strange after a while...
 
ainwood said:
Any chance that its got a relation to a unit getting a flag to indicate its eligable for auto-promotion.

I.E. Units that win two combats on a turn automatically get a promotion; ergo, a unit that has already won one combat gets a flag to show that, and when it is attacked for a second time, a win means that if it survives the combat, it will get promoted at the end of it. This could just be a .flc that is played when the flag is set.
CAn someone please disprove this :) , otherwise I'll be thinking it is the reason behind it! everying sounds so logical!. :scan:
 
FinnMcCool said:
But that said, if this IS actually "the formula" then it raises another question: why should the lost hit points and existing hit points have any effect on the outcome? (Well, it might in real life, but why consider it?) If you decide to consider the remaining hit points, it might explain why combat outcomes become so strange after a while...
The forumla calculated a percentage chance of victory (like the Civ4 combat calculator) - it isn't the actual combat formula, although it does include elements of it, and its these elements that make it so complicated.

I think the actual combat formula is the A / (A + D) bit (IIRC). Eg. a unit with a modified attack of 2 vs a defender with a modified attack of 1 has a 2/3 chance of winning each combat round.

The rest of the stuff as posted (the bit with the hit points lost) is a reflection of how many combat rounds there needs to be.
 
Back
Top Bottom