gothic-1-community-patch icon indicating copy to clipboard operation
gothic-1-community-patch copied to clipboard

Gorn runs off the main platform in the Free Mine

Open AmProsius opened this issue 4 years ago • 1 comments

Describe the bug When entering the Free Mine in chapter 4, Gorn first targets a guard with a crossbow on another platform. As a result, he runs off the main platform and falls down to the floor beneath the platform.

Expected behavior Gorn doesn't run off the main platform when the player enters the Free Mine with him in chapter 4.

Additional context

ScreenShot_2021_2_20_23_10_39

See also #151.

AmProsius avatar Feb 20 '21 22:02 AmProsius

Instead of relying on better pathfinding to be implemented, the following "hard-coded" fix may work:

Hook the end of STARTUP_FREEMINE and start a custom AI state for Gorn to draw his weapon and run across the bridge. The Startup-Function is called only the first time entering that world, such that Gorn will not do that when entering the Free Mine again.

Some safety checks to include:

  • Does Gorn exist in that world
  • Is it the forth chapter
  • Are there hostile NPCs around
  • Is Gorn at the entrance of the mine (check nearest waypoint)
  • Does the target waypoint exist
  • Check the distance between the two waypoints to make sure everything is as expected

Rough outline of the custom AI state.

func void G1CP_135_GornFmRunMainPlatform_State() {
    // Remove all perceptions (Gorn turns into a vegetable and does not react to any damage)
    // Draw weapon
    // Set walk mode to run
    // Go to waypoint on the other side of the bridge
};

That proposed fix is a bit dangerous, because Gorn will not react to anything until he has reached his waypoint. Thorough testing will be required.

If better pathfinding is eventually implemented or available by third-party patches, this fix may (or may not) be disabled.

PS: Check if this would be a session fix or gamesave fix, i.e.: Does the state remain in the gamesave and should be reset when saving?

szapp avatar May 14 '21 09:05 szapp