Tag Info

New answers tagged

0

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 ...


4

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 .... .... .... .... ...


4

I think what Valve does is using a Navigation Mesh (source) together with a Visibility Graph. The navigation mesh covers all of the walkable space in (usually) convex regions. A* or Dijkstra's is used to plan paths between regions, while local movement techniques are used for moving agents inside regions. (This is very easy since regions are convex you can ...


3

One thing you can do is not let the character travel diagonally when the path crosses the corner of a wall. The character is free to travel diagonally out on the open, but not next to a wall. This is done in your a* algorithm.


3

Yes you should factor the size of the character into the A* calculation. There are basically two ways you can either make your character larger, which complicates the computation. Alternatively you can make the wall wider and pretend your character has 0 width.


1

This took some figuring out for myself, but I've got one for you. Note that in the if statement we have no changes to path (since nothing is removed from it). Now edge2 is changed it it's next every iteration, removing the need of the else statement. I added nextEdge1Spot to avoid checking whether an edge has been deleted or not. public static ...



Top 50 recent answers are included