Line 28: |
Line 28: |
| === [https://ryandwyer.gitlab.io/gepd-function-explorer/ge-global-0009.html Alarm guards] === | | === [https://ryandwyer.gitlab.io/gepd-function-explorer/ge-global-0009.html Alarm guards] === |
| Look around when alerted by a noise, a nearby shot or a hit on a guard that they can see. They then run to their assigned alarm and activate it on arrival, before becoming a normal guard and chasing bond (once). If they see Bond directly then they run to the alarm without looking around. | | Look around when alerted by a noise, a nearby shot or a hit on a guard that they can see. They then run to their assigned alarm and activate it on arrival, before becoming a normal guard and chasing bond (once). If they see Bond directly then they run to the alarm without looking around. |
| + | |
| + | == Guard Attack Scripts == |
| + | |
| + | This is an outline of the [[Scripts|AI Script]] the guard uses to attack. |
| + | |
| + | === Standard Attack Script === |
| + | |
| + | Most guards run this standard attack script<ref>{{cite web | url=https://ryandwyer.gitlab.io/gepd-function-explorer/ge-global-0006.html|title=Goldeneye/Perfect Dark function explorer|author=Ryan Dwyer|access-date=July 16, 2021}}</ref> to select an attack (there are still plenty of exceptions, i.e. spawn guards on S2, blue hat caverns guards to name a few). The randomness used to decide an attack is kinda clear if you can read these scripts, but there are requirements for most of the attacks which I've dug out of the assembly<ref>{{cite web | url=https://forums.the-elite.net/index.php?topic=18518.msg469573#msg469573|title=the-elite forum Goldeneye facts post on standard guard attack script|author=Whiteted|access-date=July 16, 2021}}</ref>. |
| + | |
| + | Note: all space related tests ignore other guards and even objects, they're just looking at 'level geometry'. |
| + | |
| + | Listing these in the order that they are potentially tried, and splitting them into 4 groups: |
| + | |
| + | Group 1 : grenade |
| + | |
| + | * [1A] Roll for grenade |
| + | ** Selects a random number 0-254 (255 possibilities) and this must be less than the guard's grenade probability. I've often said this was 0-255 (256 possibilities) before but I was wrong :p |
| + | |
| + | Group 2 - dodging |
| + | |
| + | * [13] Roll and fire |
| + | ** Requires 2m to the left / right of the guard looking at the guard from the player's point of view. Selects direction randomly, but will try the other direction if the first is blocked. |
| + | * [0F] Side hop |
| + | ** Similarly requires 2m to the left / right but from the guard's point of view. |
| + | ** Additionally the player must be in the front or rear quadrants of the guard. i.e. if ahead of the guard is north, the player must be between NW and NE or between SE and SW. |
| + | * [0E] Sidestep - identical to the hop, but only requires 1m of room. |
| + | * [10] Run sideways |
| + | ** Has a weird first test, which is something like "the guard hasn't begun anything in the last 3 seconds". |
| + | ** Then it uniformly selects a random distance between 2 and 4m. It requires this to the left / right of the guard looking at the guard from the player's point of view, as for Roll & fire. |
| + | |
| + | Group 3 : charging |
| + | |
| + | * [12,13] Walk / Run & Fire |
| + | ** Same 3s tests as for running sideways |
| + | ** The player must be more than 10m away from the guard (3D test) |
| + | |
| + | Group 4 : stationary attacks |
| + | |
| + | * [14, 15] Stand / Crouch & Shoot |
| + | ** These always succeed. |
| + | |
| + | With the probabilities, working backwards kinda makes sense. |
| + | In group 4 the guard has a 50% chance to crouch, and 50% to stand. Simple. |
| + | In group 3, if the guard started something in the last 3s, or is within 10m of Bond, then continue to group 4. Otherwise: |
| + | |
| + | * 25% chance to walk & fire |
| + | * 25% chance to run & fire |
| + | * 50% chance to continue to group 4 anyway |
| + | |
| + | |
| + | Group 2 is more complicated because some are from the player's POV, some from the guard's, and some care about which quadrant the player is in and others don't. So possibilities and odds will vary, but lets pick the simplest case where the guard is directly facing Bond, so left / right from the two POV's are just reversed which doesn't matter, and Bond is in the NW -> NE quadrant so that check passes. Further assuming that there's plenty of space either side of the guard, we have these odds: |
| + | |
| + | * 4.3% chance to roll & fire |
| + | * 4.1% chance to hop |
| + | * 9.3% chance to sidestep |
| + | * 16.4% chance to run sideways |
| + | * 65.9% chance to continue to group 3 |
| + | |
| + | So more than 1/3 chance of doing trollery basically. But note that if he doesn't have much space then he may only be able to side step, which would then have higher odds of 10.2% because the previous attacks would never prevent you rolling for a side step. |
| + | |
| + | Finally group 1 is very simple. It has an X/255 chance of pulling a grenade. If it fails to, continue to group 2. X varies depending on the guard. |
| | | |
| == Technical Details == | | == Technical Details == |