Page 1 of 1
Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 2:01 pm
by Vincent(PDP)
Hi!
I am working on calculating a player's chance of survival (in real-time) in the Zombie Horde mod.
I realize that this is a broad subject, but I would like to have some suggestions or hints of some things I must think of when calculating the chance of survival for zombies.
A little info for those who haven't played ZH before:
- It's humans versus zombies.
- Zombies only attack is scratching (melee) a human, thus infecting them.
- Zombies can have up to 5000 health
- The most damage a human can do with one of the initial weapons is 375.
- Don't know if this matters, but a zombie runs a little faster (1.25x) than a human.
Let's have some example scenarios:
- 1 -
You're the only zombie against seven humans.
You have 283 HP, thus a little chance to survive as you can get killed with 1-2 shots.
- 2 -
You are one of three zombies against five humans.
You have 1357 HP, which means a higher chance of surviving.
- 3 -
You are one out of five zombies against one human.
You have 956 HP, and your chance of surviving is very high as one of you only need to scratch the last human to win.
Tell me if you need more info.
Big thanks in advance!

RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 2:10 pm
by Ivan
You'd probably need some data mining first. The chances of using the initial weapons, I'd say are not the same. Personal preference would kick in. For example, I'd not assume the chance of having sniper used is equal to chaingun. So, getting some data and figuring out their weights would be a better way. Then what you should do is figure out a formula based on health and the acquired weights and the player/zombie amount to calculate a percentage. How you'd do that I'm not sure, but there are some formulas for similar things which you can find by searching Google.
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 3:09 pm
by Vincent(PDP)
Ivan wrote:
You'd probably need some data mining first. The chances of using the initial weapons, I'd say are not the same. Personal preference would kick in. For example, I'd not assume the chance of having sniper used is equal to chaingun. So, getting some data and figuring out their weights would be a better way. Then what you should do is figure out a formula based on health and the acquired weights and the player/zombie amount to calculate a percentage. How you'd do that I'm not sure, but there are some formulas for similar things which you can find by searching Google.
Thank you very much!
Only one problem at the moment: I have no idea what to search for.
I have tried searching around but have not yet found anything useful.
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 3:19 pm
by Ivan
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 3:21 pm
by Vincent(PDP)
Well yes indeed! Thanks alot!
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 4:14 pm
by CloudFlash
You also might want to include campers in your calculations, as well as weapon knockback and map design / human's camping spot. So, for example, humans would have better chances of survival if they were all stacked on one rock that is tiny enough for zombies to fall down after being shot with sg once than if it was one quiet human hiding away in a dark corner where no zombie suspects him
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 4:47 pm
by Ænima
There are so many variables including things which vary based on the map and skill of the ingame players (which ACS obviously can't return except maybe if you save K/D in a database) that I don't think you could accurately calculate it.
Just make it print 33.3% ... repeating, of course.
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 5:47 pm
by Vincent(PDP)
Don't know how correct it is, but it's progress:
Code: Select all
SurvivalChance = ((GetActorProperty(0, APROP_Health) * 100) / (312 * (PlayerCount() - 1)));
The above is based on the snipers damage. 312 is inbetween the weapon's mid and max damage (which is 250 and 375).
There are quite many things I cannot access from ZH, due to that I'm writing this in a clientside script.
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 6:40 pm
by Ivan
In regards to map specific data I'd suggest you collect the ratio of human win vs zombie win on those maps as an additional factor to multiply with. That way you'd estimate even better.
RE: Calculating chance of survival - What do I need to think of?
Posted: Sat Sep 19, 2015 10:24 pm
by Vincent(PDP)
Ivan wrote:
In regards to map specific data I'd suggest you collect the ratio of human win vs zombie win on those maps as an additional factor to multiply with. That way you'd estimate even better.
Can be tricky... Especially since there's no official Zombie Horde host anymore (*ahem* GrandVoid *ahem*) that has a consistent map list.
I can access all the CVars by the mod and pretty much any data specific to the current player, but not any functions or variabels.
I wanted to have the "chance of survival" to include the ZM timer in it's calculations. But as that's a variable, it won't work. :)