台地结界
The Great Plateau barrier 台地结界是游戏里阻止林克在拿到滑翔伞前就离开初始台地的机制。
实作
台地结界一共有两层:第一层是围绕台地的雾,林克只要碰到雾就会被抓回来。第二层是林克的角色模组里埋了一个检查林克位置的机关,只要检查失败就抓回来。
林克拿到滑翔伞后,这两层结界会同时消失。这是因为 IsGet_PlayerStole2
这个 flag 被设成 true 了
雾
这个雾的原理跟游戏里其他的雾一样,都是储存在 map unit 里的同一种物件(碰到就会触发事情的物件)。如果 IsGet_PlayerStole2 是 false,那游戏就会生成雾,否则不生成。
模组里的机关
很多玩家注意到,即使有办法避开抓人的雾(静止器击飞等等),林克还是会在离台地不远处被游戏抓回来。
后来我们发现 executable (游戏的执行档)会直接去看 IsGet_PlayerStole2 的值,而且总共有五个地方在看。其中一个最要命的地方是 AIDef:AI/PlayerNormal,这段 code 负责处理跟林克本人有关的事情。
这个 AI function 非常长,其中有一段很刺眼的 code 如下:
if ( !sForceEnableGlidingAndSurfingAndGiveRupees && !sIsDungeon )
{
if ( !getFlag_IsGet_PlayerStole2(false) &&
(x < -1600.0 || x > -350.0 || z < 1400.0 || z > 2400.0) )
{
player->respawn_pos.x = -1021.7286376953125;
player->respawn_pos.y = 253.31527709960938;
player->respawn_pos.z = 1792.6009521484375;
AI_AIBase::changeState(this, "奈落開始待ち", 0);
return;
}
...
}
解释:
- 奈落开始待ち means (roughly) 'wait for abyss start' (深渊、开始、等待). It is the name of the AIDef:Action/PlayerHellStartWait action for the Player_Link aiprog.
- sIsDungeon is set when GameScene generates a stage. It is false if and only if:
- the map type isn't any of the following type: MarioClubTestDungeon (蛤?), CDungeon 神庙里, MainFieldDungeon 神兽里
- and (the map type isn't GameTestDungeon) or the map name is ActorViewer or in debug mode[check].
- 总地来说,游戏在满足下列条件时会把林克抓到 (-1021, 253, 1792):一除错模式没开、二林克没有滑翔伞、三林克出现在这个长方形外:
On the MainField (Hyrule) and AocField (Trial of the Sword) maps, Link is effectively surrounded by an infinitely high box that he is not allowed to leave until he has the paraglider.
It is a simple, hardcoded, coordinate-based check, and it is embedded in the core Player actor code, so glitching past it is impossible barring major bugs that would likely leave the game broken and unplayable.
Given that events can be delayed and that the actual voidout is done by a demo/cutscene, it is possible to get Link stuck in the PlayerHellStartWait state indefinitely and technically leave the authorized area without being voided out immediately. However, doing any kind of useful action (walking, gliding, riding a horse, etc.) is still impossible, as the paraglider check is done before handling any other regular state. As soon as Link leaves the waiting state, he will be voided out.