How "chance to not consume ammo" works (Explanation)

I did some tests in-game with the SDMG. The results from 3 rounds of 1 minute each of bullets gave results just between the expected from Alaron's calculations and the expected of my own calculations. The results were a little but noticeably more leaned towards those expected from Alaron, but I promised that whatever the results were, I wouldn't claim they had any total validity because it's 3 AM and I need to sleep.

I did make sure to put every factor into account for my experiment, though. I did the experiment correctly.

Edit: Both of our methods don't seem to match what an edit on the wiki's article on the ammo box claims to be the maximum percentage of reduction for the vortex beater. I don't know who edited that value in, though.
 
One problem I see with Samrux's method is that the order matters, which doesn't seem right.
0.5 + (0.5 * 0.2) + (0.5 * 0.2 * 0.2) = 0.62
0.2 + (0.2 * 0.2) + (0.2 * 0.2 * 0.5) = 0.26
Where as:
1 - (1 - 0.5) * (1 - 0.2) * (1 - 0.2) = 0.68
1 - (1 - 0.2) * (1 - 0.2) * (1 - 0.5) = 0.68

I have no doubt that something similar to the top method could work, though. I'm just not sure exactly what change is needed.
 
One problem I see with Samrux's method is that the order matters, which doesn't seem right.
0.5 + (0.5 * 0.2) + (0.5 * 0.2 * 0.2) = 0.62
0.2 + (0.2 * 0.2) + (0.2 * 0.2 * 0.5) = 0.26
Where as:
1 - (1 - 0.5) * (1 - 0.2) * (1 - 0.2) = 0.68
1 - (1 - 0.2) * (1 - 0.2) * (1 - 0.5) = 0.68

I have no doubt that something similar to the top method could work, though. I'm just not sure exactly what change is needed.
Thank you. I'm now convinced that I am wrong. Knowing that flipping something around doesn't yield the same results in my calculations simply break it all down for me.
I am incredibly curious as to what the change would need to be to make what I wrote work. For now, I'll change the post, at least.

Thanks everyone, for the help! I hope that at no point I was stubborn or condescending; I merely held faith to my own results until I found something that completely disproved them.
 
Thanks everyone, for the help! I hope that at no point I was stubborn or condescending; I merely held faith to my own results until I found something that completely disproved them.
No need to apologize. You were perfectly gentlemanly about the whole thing. And being skeptical of countering arguments isn't closed-minded. It's actually QUITE scientific.

What is science, if not the process of questioning the nature and validity of things?
 
I suspect that what threw you off is that for 50%, your method appears to work for the first step, since 50% is its own opposite, so to speak.

0.5 + (0.5 * 0.2) = 0.6, which is the right answer.
But really it should be:
0.5 + ((1 - 0.5) * 0.2), which of course is also 0.6

So you could do it this way:
0.5 + ((1 - 0.5) * 0.2) + ((1 - 0.5) * (1 - 0.2) * 0.2) = 0.68
But what Alaron said is an easier way to get at the same thing.
 
Well, now I'm glad the thread is correct. But since the conclusion completely changed, I hope I didn't give the wrong advice to too many people.
index.php
 
Well, now I'm glad the thread is correct. But since the conclusion completely changed, I hope I didn't give the wrong advice to too many people.
index.php

Actually, I'd be amazed (minorly amazed... probably just surprised really) if your claim that multiple random numbers are generated every time ammo consumption chance is calculated is correct; it would be wasteful in terms of resources and utterly unnecessary.
 
Actually, I'd be amazed (minorly amazed... probably just surprised really) if your claim that multiple random numbers are generated every time ammo consumption chance is calculated is correct; it would be wasteful in terms of resources and utterly unnecessary.
You'd be surprised with the sheer amount of things a computer is processing every instant. Terraria already generates thousands of random numbers to decide if to spawn a mob, where, and which one. Wether to grow grass or expand the corruption or create a flower, at every possible location.

Terraria does have ways to handle this, but RNG is definitely all over the place.
 
Although I knew how the game decides when not to spend a bullet, seeing someone giving all these numbers makes my head explode. :D

If I were you I'd ask for this topic to be moved to the guides section. This question gets asked a lot so it'd be great if people would be able to find your explanation/mini guide there, Samrux. :)

Actually, I'd be amazed (minorly amazed... probably just surprised really) if your claim that multiple random numbers are generated every time ammo consumption chance is calculated is correct; it would be wasteful in terms of resources and utterly unnecessary.
Calculating something minor like this is peanuts for a computer, even when firing a ridiculously fast gun like the SDMG. :)
 
@Gotcha! I think it technically belongs there, but I posted it here so that as many people as possible would see and maybe spread the knowledge. Crossroads must easily be the most transited subforum, I believe.

When and if a mod deems it appropiate to move the thread there, it would make me a little sad at first. I hope it doesn't happen too soon, at least. Knowledge is power.
 
@Gotcha! I think it technically belongs there, but I posted it here so that as many people as possible would see and maybe spread the knowledge. Crossroads must easily be the most transited subforum, I believe.

A mod will move it if they deem appropiate, even though it'd make me a little sad.

Plus it's not guiding to do anything :p
Hey, I was just saying. Your topic, your choice. ;)
 
Just pointing this out here:

50% is 1/2 but also 100/50

Do you know what I mean? If you take a random from 1 to 2, there's a PURE 50% chance.. But if you take a random between 1 and 100... There's so many chances to get either <50 or >50 (51 all the way to 100 would be a NO, and 1 to 50 would be a yes) .. 1/2 Would feel more 'fair'
Am I right that you have better chances not consuming ammo when using 1-2 than using 1-100 ?
 
Created an account simply for this mathematical conversation. I wanted to educate you all on how to simplify this but it has already been said already :(:(.

I just checked the gamepedia and calculating the tip (from gamepedia information ) gives an 1 - 0.34*0.8*0.75*0.8 = 83,68% chance to not consumme ammo, without the box, and 86.944 % with the box.

Simplifing the matters through calculating the chance to actually use ammo instead of not using ammo is the way to go, but that has already been said so, yeh.

If somebody is interested in putting it in more graphical words: For every item there is, the game rolls a number and ONLY if EVERY roll fails than ammo gets consumed.


If someone is interested in that kind of game problems Sacred 2 is the game to grab. Its pure math and calculating for every littel tiny bit there is, but other games have the same problems and mechanics as well. 30% + 30% evasion in dota translates into 1-0.7*0.7 = 51 % not to get hit.

Random facts:

1 Magic Quiver = 20 %
+ Potion = 34 %
+ Box = 48.8 %

Vortex Beater = 66% ( actually i wondering if they mean 2/3 instead of .66 and the tooltip is mismatched )
+ Potion = 72.8 %
+ Box = 78.24%
+ Breastplate = 83.68 %
+ Headgear = 86.944 %

As you can see 20% chance to not consume ammo later effectively translates into an 3% increase, which is not that big.
This can get even more obvious when stacking higher numbers. A shield with 70 % chance to block melee attacks and the buff to block melee attacks with a 70 % makes in total 1-0.3*0.3 = 91%. So the Mega big buff of 70 % of blocking an attack effectively translates into an 21% increase ( Like, would you ever equip an item which says it increases your block chance by 21 % if you already have 70 % ??? )
My advice: Stick to a single high % and leave it at that because "Slots" and "Buffs" and "Inventory Space" and "Gear you wear Space" are created all equally and are limited.

Here is the ultimate example:

-All slots are equal
-Your Dps is 50dmg/sec
-1 Bullet per second
-Enemy has 500 health ( lets ignore armor for now)
- For simplicity we say every bullet hits the target ( Clorophyte Bullets, Positioning, etc )

Case 1: - 50 % not to consume ammo
- 50 % not to consume ammo
= average of 2.5 bullets used ( 10 bullets in 10 second and 2.5 of them getting actually used up )

Case 2 : - 50 % not to consume ammo
- add 25 dps ( doesnt matter how we do it )
= 3.333 bullets used per enemy ( 75 dps kills an 500 hp enemy in 6.666 seconds and uses 6.666 bullets from which 50%, so 3.333 actually get used up.) ( to be ingame correct it needs 7 bullets and 7 seconds and uses an average of 3.5 bullets)

Difference: 3.333 (3.5) seconds of time, 1.3 (1.5) more bullets used

So in the above case the same % to not consume ammo is better than the % of increased dps if you want to preserve the bullets. The % in increased dps has to be 1.333 (1.4) times higher than the same % of not consumming ammo perk, buffs,slots, etc ... .
Example: 25% increase in dps is better than an 18% to not consume ammo, but worse than 19% ( the breaking even point is 18.7546% ).

Unlucky enough the armor reduction is flat number ( its an SUBSTRACTION not an DIVISON) which means we do different amount of dps versus different enemies with different armor, which means we need to evaluate our dps against different enemies first and than look if it actually worth it to get the % dps increase or the % of not consumming ammo.


You cant achieve 100% btw, like never. All chances are handled pretty much the same except 0% and 100 %

All the above only works if there is an INDEPENDENT roll for every chance slot, buff, reforge ( there is no ammo reforge but dps reforge). If things get ADDED or SUBSTRACTED it gets messier because as we all know that changing the order in an only * operation doesnt matter but it starts to matter when there are *+,*- or */ operations.

It all comes down to how the game is coded.

[DOUBLEPOST=1437907717,1437907175][/DOUBLEPOST]
Just pointing this out here:

50% is 1/2 but also 100/50

Do you know what I mean? If you take a random from 1 to 2, there's a PURE 50% chance.. But if you take a random between 1 and 100... There's so many chances to get either <50 or >50 (51 all the way to 100 would be a NO, and 1 to 50 would be a yes) .. 1/2 Would feel more 'fair'
Am I right that you have better chances not consuming ammo when using 1-2 than using 1-100 ?

Nope, for the game its all the same. A 500/1000 is the same as 1/2.
And its 50/100 not 100/50.
 
Last edited:
Back
Top Bottom