Tag Info

New answers tagged

2

In theory, you dont need to modify anything. Just remember the closest point you ever been to. The A* will attempt to find the path and will fail for you example, but that doesnt mean it will not first establish the path you drawn, you only have to remember path to the closest point the A* ever been to.


0

What you're looking for might be more of a steering technique than a path finding technique. There is a simple steering technique that you can use when there are no dynamic obstacles. Since you already use A* you have the skeleton of a path (regions connected by straight lines). By having your agent move directly towards the furtherst point on the path it ...


0

Based on your picture and your other questions you are using the Arongranberg A* Pathfinding Project. First, be sure that in your Grid, the layer of the Playground is selected in your Mask. In your example this means that the Playground is in the layer Ground. Second, use Update-Graph over every generated area (that means you create area, then you update ...


3

Your pathfinding should return a list of way points to reach your objective for each unit. Since you are making a turn based game, I am assuming that the unit movement is like a chess piece. It is either on "this" tile or "that tile, and not in between. If this is the case you might end up with the scenario where a units movements runs out in the middle of ...


3

Unless you're dealing with a very large grid, A* is overkill. You're probably better off with Dijkstra's Shortest Path, which has the advantage of being far easier to implement, to boot. A* matters when you have an enormous number of possible paths, like when searching a large game grid. However it also relies on datastructures, particularly the priority ...


1

Any A* implementation will do the trick. Look on Wikipedia for example. A* even allows you to add weight to your connections, resulting in not the route with the fewest hops, but the route with the shortest travel time beeing selected. Example: Frankfurt→NYC There is a connection Frankfurt→Moskau→NYC. This one has 2 hops, but the cost is high. Then there ...


1

My approach is similar to @Anko's, but based on the work by Millington and Funge from Artificial Intelligence for Games. This is what a Separation behavior would look like, but you need to take into consideration that this velocity should be computed with the agent's speed in its Update function. public Vector3 GetSeparationVel (float threshold, float ...


14

Give your agents a weak "electrostatic charge" to make them repel each other, along the lines of Coulomb's law. Assuming for simplicity that mobs should push each other away with equivalent strength, it should be enough to apply a force between every pair of mobs with a magnitude some_constant / distance^2, where some_constant is a configurable repulsion ...


0

The behavior I've seen in the video you attached could be mimicked like so: When the characters are spawned, the current leader's position (2d point) is saved and is currently the only element in an array (or Vector) representing the movement path coordinates or path-array. All flowers have a goal member that points to that element as the position they ...


1

I guess you want some ant like behavior (at least as far as comic ants are concerned)? http://www.youtube.com/watch?v=HccgCeVo-4c If so, I'd try the following: Pick the entity closest to the target as the "head" and mark it so it won't look for another entity to follow. For each remaining entity, find the next closest entity that doesn't have a follower ...


0

The A* Algorithm works with paths on a graph. The graph does not have to be a grid. If you look at the paths you want, they go through the corners of the square tiles. Specifically, they go through the corners where three tiles are walkable and one tile is a wall. Instead of giving A* a graph with the tile centers, you can build a graph with only these ...


3

As other option, you could split the path into straight parts. Then you only need to find the points where your original path leave a path part (no need to compute, just switch by direction of the next part). Only what remains it is connect points of your new smooth path! EDIT: if you insist on the path you drawn, just compare the two extreme ...


2

One option for path-smoothing is casting rays from the current position to the farthest visible node and go there. You could either do it in real time or just build a new path from the one you already have, so the navigation algorithm stays the same. Starting from the current position, cast rays to each node in the path. When there is a node that cannot be ...


3

A* is defined on a graph structure, which consists of nodes (cells) and edges between the nodes (i.e. the walls between cells, or corners). When you make an entire cell not walkable, you remove an entire node from the graph. When you place something between two cells, you effectively remove the edge which is normally there. Most of the time the neighbors of ...



Top 50 recent answers are included