Hacker News AI· sammatilda·· 3 hr agoAI score22
Enemy AI: chasing a player without Navigation2D or A* pathfinding (2020)
Enemy AI: chasing a player without Navigation2D or A* pathfinding (2020)
AI summary
This tutorial describes a Godot approach for enemy chasing that avoids Navigation2D and A* by having the player drop a "scent trail" of past positions on a timer, which enemies follow when a RayCast2D shows the player is blocked. Enemies raycast to the player first and, if obstructed, check the scent trail in order until one is visible, then move toward it. It assumes KinematicBody2D enemies managed by a state machine and requires Physics Layers configured so the ray detects blocking objects.
Source: Hacker News AI · abitawake.com