Tag Info

New answers tagged

0

By far the most common algorithm to find a path is A* (pronounced A-star). As the algorithm runs, you keep track of two lists: tiles you have visited and discarded (the closed list), and tiles you could consider next (the open list). You start with a single tile in your open list, the source position. Each iteration you pick the tile from the open list ...


0

Paths in its most basic form is a series of vertices connected by edges. The important part is the edge connections, as without it you may run into situations where you don't know where the next step in the path is. For this reason, if you do want to generate the path from the tiled map, you need to be careful and ask yourself: Are there branches in the ...


0

Once your terrain is built start by manually turning down booleans for unwalkable nodes to walkable, You may think this as a forced method, but you need to assign bool isWalkable(node){if isRight || isLeft ==NULL{ //# manual declaration of boundary nodes to unwalkable nodes, and when script starts, //have start and end on boundary reinitialized to ...


0

What you're describing sounds like Obstacle Avoidance (as pointed out by @nathan). The easiest way to implement it is modeling both the characters and the obstacles as circles. In order to avoid the obstacle, we increase its radius by the radius of the character, so we can treat the character as a point. The angle θ to both sides of the obstacle can be ...


1

At first blush, I'd try to use Hierarchical Pathfinding for what you describe. The main reason why is that it seems that you're talking about Landmarks as the main element that represents the map at a high-level, and that should map well to a hierarchy of two levels. So you'd have two maps. For the high-level map, each node is a Landmark, and you have a web ...


6

Complete vs. incomplete information What you are looking to do is path finding without complete information. The conceptually sound way to do this would require you to keep track of all of your non-playing character's information state (i.e., the parts of the map they already have discovered). Local information A more workable solution in your case might ...


0

using UnityEngine; using System.Collections; public class PathUtils : MonoBehaviour { private NavMeshAgent agent; private Color c = Color.white; public void Start() { agent = gameObject.GetComponent (); } public void Update() { DrawPath (agent.path); } void DrawPath(NavMeshPath path) { if (path.corners.Length < 2) ...


2

First of all, a warning. The problem you're trying to solve is complex enough that most professional games don't even bother unless it's a key part of the gameplay. So my advice would be to cheat as much as possible. For vehicle radius, I would try to use the worst case (the largest dimension) and then treat the vehicle as a cylinder (or a circle, in 2D) ...


1

Size and fit can be taken care of the heuristic that declares whether a move is valid during the path finding. Once the path itself is generated it's then up to a localized movement function to handle not bumping into things on the way, called path smoothing. Maybe paths with smoothing will help generate some ideas that work for you. The last time I did ...


3

Well according to the rules of the game, the AI is doing the right thing - moving towards the player every time! It's only due to a quirky situation that the player can "trap" the AI in a loop: Start Player AI Player AI moves moves moves moves .... .... .... .... ...



Top 50 recent answers are included