You can know more about editing the articles in the wiki by reading guidelines.
Guards
This is a description of NPC guards within GoldenEye 007
Facts
Guards (General)
- Guards who dual-wield any weapon can never pull grenades. [1]
- Guards have a 1 in 128 chance to do an idle animation per frame.[2]
- For idle animations, guards have a 5 / 256 chance (~1.95%) to sneeze.[2]
- Targeting guards that do a sharp angle change can become frozen, but it is unclear why. This only occurs on NTSC-U, and not PAL or NTSC-J. They must lose health to become unfrozen, but can later become re-frozen. All dual-wielding Moonraker guards and third Baron can also become similarly frozen with a rolling animation under more unknown specifics, but this can occur on all versions. [1]
Types of Guards
0002 Guard
The most common guard. Stays idle, runs to you/fires at you when he sees/hears you. Afterwards continues chasing your former positions until seeing you again or 10s passes, if the latter, becomes idle again.
Patrolling Guard
Normal guard but will initially be moving along a path
Targeting Guard
Aims at you and updates their angle continuously.
Cloner Guard
Normal guard, but capable of cloning if you haven't looked at him yet. They clone themselves and send off the clone instead, while staying in place and being otherwise idle. [3]
Spawn Guard
Guards who spawn after an event.
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.
Technical Details
Ghost Doors
Conditions for a guard to open a door:
- The guard is walking along a path or chasing Bond
- The guard is within 2m of it (3D test, door considered as a point)
- The guard's chase timer is a multiple of 10
- The door is the 1st one that the line from the guard to his local target point intersects
All doors opened by guards are opened by this mechanic. It's worth noting that all double doors / gates / glass are actually just individual doors which are linked. Aztec glass consists of 3 doors.
- The chase timer
When a guard starts chasing Bond, the chase timer is set to a random value from 0 to 99, chosen uniformly. It increases by 1 every time the guard updates, which is every drawn frame I think (unlike PD). So for 'frame perfect' tricks like ghost doors (see below), you effectively have a 1 in 10 chance of passing the chase timer test. And strats like mainframe glass get their consistency from having a large number of consecutive frames for which the guard passes the other tests.
- The local target
The intended purpose of the local target is to avoid dynamic objects like other guards and to navigate using the clipping tiles when they get close to their target. The standard way we manipulate these into / behind doors is by placing a second guard by the door, and the 1st guard sets their local target inside the door, trying to avoid the 2nd guard. But when a guard unloads, the local target doesn't get updated. And in fact the local target doesn't get updated until the 2nd frame that the guard is loaded. This will give rise to ghost doors.
- Example
- Aztec Glass
Video: Behind the mainframe strat curtain.
Key:
- The 2m circle around the doors
- The guard's normal target
- The guard's local target
The conditions are monitored in the top left. Condition 4 is True the whole time that the guard's local target is inside the door.
The magic of the mainframe strat is that
- because the 1st guard arrives unloaded, the 2nd guard's local target is always inside the glass
- the 2nd guard spends a long period in range of the door that he'll open
Note that you mustn't be too far behind the crack when you do the lures, else the guard will only be able to open the middle glass "door". This completely loses this 2nd great advantage and the consistency will plummet.
- Example
- Archives
This is a general mechanic, so can be applied to any level but we'll deal with the classic archives one. As Henrik showed, it's the patrolling guard who opens it on the 1st frame that he loads, as he heads away from it.
On Archives, Miskin is in the path of this guard, and the patrolling guard can spend a long time circling him, staying loaded. When I set up this ghost door myself, he was loaded when I lured him, and stayed loaded for a little while, even opening the door to Miskin's room. This put his local target directly behind the ghost door, before he then unloaded.
He goes through the door unloaded and starts going along the corridor. When I loaded him then the line mentioned in condition (4) goes straight through the middle of the door. Conditions (1) and (2) are trivially true. And (3) is essentially a 10% chance.
- Limitations
Local targets persist after resetting the level. But when guards first start chasing Bond (when the 28 command succeeds for the guard script boffins) they always set a flag invalidating the current local target.
This restriction is worse though because it means that the guards must set their local target then unload and move to the front of the door in a single movement. They can't arrive somewhere and then hear you again or even chase you because they were alerted recently.
References
- ↑ 1.0 1.1 Icy. "the-elite Goldeneye facts topic post on miscellaneous function explorer facts". Retrieved July 16, 2021.
- ↑ 2.0 2.1 https://ryandwyer.gitlab.io/gepd-function-explorer/ge-global-0003.html
- ↑ Icy. "the-elite forum Goldeneye facts post on guard AI". Retrieved July 16, 2021.