Please join our Discord server! https://discord.gg/XCazaEVNzT

User:IGaming-SEO3450

From Speedrunwiki.com
Revision as of 12:03, 7 July 2021 by TxR (talk | contribs) (Including NPC behaviour for Frigate as separate article because it is too large)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Context

This article concerns the Loading and Unloading of the first two 'Agent' Hostages in the Frigate stage of Goldeneye 007. This reflects the research from this post by Wyst3r.

Description

Did some attempts yesterday to figure out why the odds of hostages escaping on Frigate Agent are (seemingly) so bad. In theory, it should be ~1/41 plus death animation luck, but "good enough" death animations seem to be very common. So how come the odds are more like 1/(x * 100)?

Most of you are probably thinking:

Chair.png

But despite all the times you've seen the hostage get stuck on the chair, this isn't what's causing the bad hostage odds. In fact, unless you get screwed over by other factors, the hostage should be walking straight through the chair. So what are these "other factors"?

First of all, you need to understand how guards pathfinding works. And especially how it works when the guard is unloaded. An unloaded guard will move along predetermined paths stored in the level's navigation graph. It will always move in straight lines and will completely disregard any objects found in the room (e.g. the chair). For Frigate Agent hostages, the paths look like this:

FrigateAgentDone.png

I'll refer to the red lines between the green circles as segments.

Guards traverse these segments by storing two variables in memory:

1. Current segment length 2. Distance travelled along current segment

Each frame, #2 is updated, and whenever #2 becomes greater than #1, a new segment is loaded. This process is repeated until the goal position has been reached. (Note that this is only true when the guard is unloaded, as soon as it is loaded, the guard start moving like normal, avoiding obstacles etc...)

So why is this important? Because if the hostages are unloaded, they can't get stuck. They'll run straight to the escape point and should escape more than fast enough to complete a 23 (unless you got a really slow death animation). Also, if a guard is loaded at some point during his path, he'll almost certainly be much slower than if he'd stayed unloaded for the whole path. So what determines if a guard is loaded/unloaded?

The first factor is obvious: If you can directly see a guard, he's definately loaded. However, what actually determines it is if the room is loaded. A room is loaded if:

1. Bond is inside the room. 2. A portal to the room is visible on screen.

What is a portal you ask? Well, portals are a common technique used in video games to avoid drawing unnecessary geometry. If you can't see a room, there's no need to draw it. A portal in Goldeneye is usually a door. So if the door to a room is open, and you can see the doorway on screen, the room will be loaded and drawn. See this picture:

RoomLoaded.png

However, the guard can still get loaded even if the room is unloaded. How you ask? Well, the reason for this is very subtle and took me a while to figure out. It turns out that if two guards are unloaded and travelling through the same room/segment/preset (i'm not sure of the exact requirements, but two guards travelling along the same segment will certainly cause one of the guards to load), then one of these guards will be loaded.

For Frigate Agent, the first factor is usually not an issue (room being loaded due to portal being visible), since the time it takes for us to pause + throw bug + move backwards enough for doorway to become visible is usually longer than what it takes for the first hostage to leave that room (at least with any decent death animation). After that, there's no risk of any room along their path to become loaded.

The second factor however, is far more difficult to avoid. The biggest reason for this is this guard:

Culprit.png

When you kill the second hostage taker, this guard gets alerted and runs into the room with the first hostage. He and the first hostage will both be unloaded at this point, and the timing of this strat makes it so that there's a *very* high chance of the hostage being loaded. If an unloaded guard gets loaded during a segment, he spawns at the beginning of this segment. Thus, if the hostage gets loaded during his first segment (the one running through the chair), he will spawn BEFORE the chair, lose all progress made so far, and most likely get stuck on the chair. The second segment is much shorter and not quite as bad (23 might be possible even if guard gets loaded there?) but it'll still slow the hostage down significantly.

It's also very possible for the two hostages cause each other to load, since they might be running through the second hostage's room at the same time.

So now that we know what the problem is, how do we solve it? As far as i have been able to tell, we can't. First problem is that the hostages can interfere with each other, and since we need to release both of them, this will always be a factor. Only ways to avoid it is to either get a slow death on the first hostage taker, so the second hostage gets a head start over the first, or reverse the order in which we kill the hostages. (and yes, there's still enough time for the slow hostage to escape, assuming a good death animation and him not being loaded during his escape). I tried the latter method today but with very little success due to it being very hard to kill both hostages consistently and fast enough for 23. Also with this method you need to look straight up while moving backwards after bug throw to avoid loading the first room while the hostage is still in there.

The guard who runs into the first room can't really be avoided either, since he'll always see the hostage taker being killed. I tried luring him away with noise but that lures a bunch of other guards as well, ruining everything. Can't really change the timing of when we kill the hostage takers either, since we need to go very fast for 23.

So in the end, the normal strat is probably the best. At least now we know what's going on.

External Links

the-elite.com post by Wyst3r