This paper describes a computer simulated artificial intelligence (AI) agent moving in 2D and 3D environments. In the presented algorithm, the agent can take two operating modes: Manual Mode and Map or Autopilot mode. The user can control the agent fully in a manual mode by moving it in all possible directions depending on the environment. Obstacles are sensed by the agent from a certain distance and are avoided accordingly. Another important mode is the Map mode. In this mode the user create a custom map where initial position and a goal position are set. The user is able also to assign sudden and predefined obstacles. By finding the shortest path, the agent moves to the goal position avoiding any obstacles on its path. The paper documents a set of algorithms that can help the agent to find the shortest path to a predefined target location in a complex 3D environment, such as cities and mountains, avoiding all predefined and sudden obstacles. These obstacles are avoided also in manual mode and the agent moves automatically to a safe location. The implementation is based on the Hill Climbing algorithm (descent version), where the agent finds its path to the global minimum (target goal). The Map generation algorithm, which is used to assign costs to every location in the map, avoids a lot of the limitations of Hill Climbing.