This application provides a
pathfinding method, apparatus, medium, and
computer device for AI characters. The
pathfinding method includes: obtaining a starting position and an ending position of a
pathfinding task, and loading a game map corresponding to the pathfinding task, wherein the game map is divided into a predetermined number of regions, including covered regions and uncovered regions; obtaining a set of cover segments corresponding to each uncovered region, wherein each cover segment is a boundary among the boundaries of the predetermined number of regions that satisfies a predetermined
occlusion condition; and determining the optimal path for the AI character to move from the starting position to the ending position on the game map based on the player character's position and the set of cover segments corresponding to the uncovered region where the player character's position is located.