Calculating chance of survival - What do I need to think of?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
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 chance of survival - What do I need to think of?

#1

Post by Vincent(PDP) » Sat Sep 19, 2015 2:01 pm

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! :smile:
Last edited by Vincent(PDP) on Sat Sep 19, 2015 2:03 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Calculating chance of survival - What do I need to think of?

#2

Post by Ivan » Sat Sep 19, 2015 2:10 pm

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.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
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 chance of survival - What do I need to think of?

#3

Post by Vincent(PDP) » Sat Sep 19, 2015 3:09 pm

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. :lol:
I have tried searching around but have not yet found anything useful.
Last edited by Vincent(PDP) on Sat Sep 19, 2015 3:16 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Calculating chance of survival - What do I need to think of?

#4

Post by Ivan » Sat Sep 19, 2015 3:19 pm

=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
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 chance of survival - What do I need to think of?

#5

Post by Vincent(PDP) » Sat Sep 19, 2015 3:21 pm

Ivan wrote: I think this should be helpful: https://en.wikipedia.org/wiki/Law_of_total_probability
Well yes indeed! Thanks alot!
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
CloudFlash
Zandrone
Posts: 1074
Joined: Mon Jun 04, 2012 5:35 pm
Location: Wonderland (except not really)

RE: Calculating chance of survival - What do I need to think of?

#6

Post by CloudFlash » Sat Sep 19, 2015 4:14 pm

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
https://i.imgflip.com/i5tpe.jpg
*Hey, who wants to hear my solution to the modern world's problems? ^Me! %Me! @Me! #Me! *WELL TOO BAD @Did he just stab himself with this butcher knife? %Looks like it ^Hey, the pizza guy arrived! %Pizza! Yey

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: Calculating chance of survival - What do I need to think of?

#7

Post by Ænima » Sat Sep 19, 2015 4:47 pm

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.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
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 chance of survival - What do I need to think of?

#8

Post by Vincent(PDP) » Sat Sep 19, 2015 5:47 pm

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.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Calculating chance of survival - What do I need to think of?

#9

Post by Ivan » Sat Sep 19, 2015 6:40 pm

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.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
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 chance of survival - What do I need to think of?

#10

Post by Vincent(PDP) » Sat Sep 19, 2015 10:24 pm

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. :)
Last edited by Vincent(PDP) on Sat Sep 19, 2015 10:27 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

Post Reply