Calculating approximate chance of being killed by a weapon. (ACS)
- Vincent(PDP)
- Forum Regular
- Posts: 527
- Joined: Thu Mar 14, 2013 7:35 pm
- Location: Sweden
- Clan: My DOOM site
- Clan Tag: <MDS>
- Contact:
Calculating approximate chance of being killed by a weapon. (ACS)
Ok so this is the case, I need to calculate the approximate chance of being killed by a weapon with one shot. The maximum amount of damage done when you're hit is around 350HP. The player can have far over that in health. Since I want to calculate the approximate chance (in percent) that the player would die from one shot, health above 350 will return 0% and the higher amount of health the player has, will return a lower amount of percent. (For example: > 350HP = 0%, 350HP = 23%, 240 = 89%, < 70 = 100% or something like that.)
In the DECORATE, the bullet is fired with A_FireBullets. It fires one bullet with damage set to 125.
Sorry if this question is hard to understand...
I am only able to use built-in functions and pow, min and max.
Thanks!
In the DECORATE, the bullet is fired with A_FireBullets. It fires one bullet with damage set to 125.
Sorry if this question is hard to understand...
I am only able to use built-in functions and pow, min and max.
Thanks!
Last edited by Vincent(PDP) on Tue Jul 01, 2014 8:07 pm, edited 1 time in total.
-
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Calculating approximate chance of being killed by a weapon. (ACS)
yeah uh I don't think anyone here is going to teach you half of statistics 101 to answer this
because that's what answering this question requires
edit: actually, since it's only one bullet, it's a 33% chance to oneshot at 350 hp (out of the possibilities [125, 250, 375], all are equally likely, and only 1/3 are above 350)
never mind this doesn't require stats 101
more complex examples *will* though
because that's what answering this question requires
edit: actually, since it's only one bullet, it's a 33% chance to oneshot at 350 hp (out of the possibilities [125, 250, 375], all are equally likely, and only 1/3 are above 350)
never mind this doesn't require stats 101
more complex examples *will* though
Last edited by Ijon Tichy on Tue Jul 01, 2014 8:27 pm, edited 1 time in total.
- Vincent(PDP)
- Forum Regular
- Posts: 527
- Joined: Thu Mar 14, 2013 7:35 pm
- Location: Sweden
- Clan: My DOOM site
- Clan Tag: <MDS>
- Contact:
RE: Calculating approximate chance of being killed by a weapon. (ACS)
Oh okay. Thanks. But can you look at if I'm going in the right direction here, please? :)Ijon Tichy wrote: yeah uh I don't think anyone here is going to teach you half of statistics 101 to answer this
because that's what answering this question requires
edit: actually, since it's only one bullet, it's a 33% chance to oneshot at 350 hp (out of the possibilities [125, 250, 375], all are equally likely, and only 1/3 are above 350)
never mind this doesn't require stats 101
more complex examples *will* though
Code: Select all
Int Health = GetActorProperty(0, APROP_Health);
Int SniperMax = 375;
Int FirstSection;
Int Output;
If(Health > 375)
{
Output = 0;
}
Else
{
FirstSection = SniperMax - Health;
Output = FirstSection / (SniperMax / Health);
}
SniperDeathChance = Output;
Because if I use a calculator I will get this:
375 - 270 = 105
375 / 270 = 1,388888888888889
105 / 1,388888888888889 = ~75,6
But in Doom it doesn't seem to calculate using the decimals too. It only divides 105 with 1.
EDIT:
Aha ok, so the maximum damage is calculated by taking the damage times 3? (Damage * 3)
And the hitscan can NEVER hurt less than 125?
Last edited by Vincent(PDP) on Tue Jul 01, 2014 8:56 pm, edited 1 time in total.
-
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Calculating approximate chance of being killed by a weapon. (ACS)
the bullet only has three possible damage values - 125, 250, or 375
bullet damage is, unless FBF_NORANDOM is specified, (damage * random(1, 3))
the only allowable probabilities for it killing you in one shot are 0%, 33%, 67%, and 100% (0/3, 1/3, 2/3, 3/3).
that's like doom bullets 101
you are going very definitely in the wrong direction
bullet damage is, unless FBF_NORANDOM is specified, (damage * random(1, 3))
the only allowable probabilities for it killing you in one shot are 0%, 33%, 67%, and 100% (0/3, 1/3, 2/3, 3/3).
that's like doom bullets 101
you are going very definitely in the wrong direction
- Vincent(PDP)
- Forum Regular
- Posts: 527
- Joined: Thu Mar 14, 2013 7:35 pm
- Location: Sweden
- Clan: My DOOM site
- Clan Tag: <MDS>
- Contact:
RE: Calculating approximate chance of being killed by a weapon. (ACS)
So of I understand this right, this is what it should be like:
1-125 = 100%
126-250 = 67%
251-375 = 33%
> 375 = 0%.
About calculating for multiple bullets, is this what you were talking about? http://www.statistics101.net/
Or is it another Website?
1-125 = 100%
126-250 = 67%
251-375 = 33%
> 375 = 0%.
About calculating for multiple bullets, is this what you were talking about? http://www.statistics101.net/
Or is it another Website?
-
- Frequent Poster Miles card holder
- Posts: 901
- Joined: Mon Jun 04, 2012 5:07 am
RE: Calculating approximate chance of being killed by a weapon. (ACS)
yesVincent(PDP) wrote: So of I understand this right, this is what it should be like:
1-125 = 100%
126-250 = 67%
251-375 = 33%
> 375 = 0%.
er, it's a class that serves as an introduction to statisticsAbout calculating for multiple bullets, is this what you were talking about? http://www.statistics101.net/
Or is it another Website?
khan academy /might/ have some stuff for it, I dunno
- Vincent(PDP)
- Forum Regular
- Posts: 527
- Joined: Thu Mar 14, 2013 7:35 pm
- Location: Sweden
- Clan: My DOOM site
- Clan Tag: <MDS>
- Contact:
RE: Calculating approximate chance of being killed by a weapon. (ACS)
Okay, thank you so much for you help! 
