STEAM GROUP
Payday 2 Mechanics PD2mech
STEAM GROUP
Payday 2 Mechanics PD2mech
14
IN-GAME
95
ONLINE
Founded
27 September, 2015
Showing 11-20 of 105 entries
8
Question re: Yacht heist detection
5
Green Bridge info
8
Question re: Yacht heist detection
2
Chance to hit in NPC vs NPC combat
This is just me rambling. Maybe someone has an even better idea that I had not thought of. As you might have noticed, nowadays I don't have that much time, and when I find the time I am rather interested in exploring new gameplay mechanics instead of updating the knowledge on the already investigated mechanics (reading the same file over and over again is not fun if it gets more and more bugs over time).

I assume that you have read the Bots section in the guide.

Anyway, because NPCs aim at the detection point instead of the center of the head, they may miss even on successful shots; or they might hit the legs on a miss. And of course, single shot weapons do not use their accuracy stat at all.

I know that the head is a sphere with 20.15 cm radius and the body/torso is a capsule with 19.2 cm radius and a length of 110 cm. The capsule is angled but I don't know how to access that. It would change anyway depending on stance and animation. Similarly, the detection point is not just offset by a fixed amount, but may not change at all for some head animations.

So while I can run some simple simulations where I just assume that the detection point is 6 cm below the center of the head, where I feed in the head radius and body radius and so on, I think the results are still too optimistic because of various animations messing with the detection point offset.

In the end I decided that running heists and getting data directly is the more reliable approach.

Because more samples mean more reliable data I decided that whenever a bot shoots, I make 360 raycasts in the circle around the target for the different spread values and check how many times the head and body is hit. (I have confirmed that the randomness for spread is indeed fairly random.) I only considered situations where the bot actually shoots to make things a more realistic (with hurt animations and so on), and the (damageless) raycasts should give a good picture of what's going on. Only later have I realized that the model is flawed and tends to underestimate the chances: Say a bot fights two enemies. The first one is killed with one shot and the 360 raycasts all hit the enemy. The second one is protected by cover and is killed after 9 shots where only about 30 raycasts hit each time. The average chance to hit is then 360+9*30 / 3600 = 17.5%. So I assign a greater weight to enemies that are harder to hit.

Solution 1 is to leave out all the extra raycasts and only consider the actual raycasts that are shot. The problem is the small sample size and that I need to run different bot weapons to consider different spreads; before that, I had 360 raycasts for each of the 4 spreads, i.e. 1440 raycasts whenever a bot fired. So that's 1/1440th of the data. An advantage is that because I only consider the actual bot weapons, the hurt animations are perfectly represented (in contrast to bringing along the Brenner and then making raycasts with 25 spread to get sniper rifle spread; snipers are not as much affected by hurt animations because enemies usually die if hit).

Solution 2 is to keep the raycasts and just kill enemies immediately afterwards regardless of their cover. That way I could keep all the raycasts, but ignore hurt animations.

Solution 3 is probably the best of both worlds. Actually I do not need to kill the enemies immediately but could just stop counting. But if I were to do that, the results would be biased towards the first hit, before any hurt animation. I could randomly choose one result for that enemy, or better yet, take the average result. This fixes the false weights. Results might be slightly biased when I use Brenner bots for sniper spread, but that's still better than having 1/1440 of the sample size. Now to implement it...
69
Strings
1
Fire
5
Nightclub Coke Spawn Calculations
69
Strings
Showing 11-20 of 105 entries