path-finding

Why does A* path finding sometimes go in straight lines and sometimes diagonals? (Java)

I'm in the process of developing a simple 2d grid based sim game, and have fully functional path finding. I used the answer found in my previous question as my basis for implementing A* path finding. (http://stackoverflow.com/questions/735523/pathfinding-2d-java-game). To show you really what I'm asking, I need to show you this video s...

Storing a directed graph in google appengine datastore

I need to store a large and dynamic undirected graph in google appengine, what's the best way to do this? The graph representation must be able to support rapidly pulling out a set of vertices (for rendering on a page) and all the links from a specific vertex, and pathfinding across the graph (although the optimal path isn't really neede...

Question on Scheme with Best First Search algorithm

Okay this is a homework question, and I just don't have a clue how I suppose to start. Some help and hints will be much appreciated. I need to use a heuristic function to solve a maze type problem. Suppose I have a 5x5 grid, and a robot in position (1,5) and my goal is to move the robot to (5,1). Along the way there are few obstacles...

Pathfinding with weighted routes

Hi, I'm working on a project where I need to perform pathfinding to find the route which costs the least. I don't really care if it's the shortest route possible. So far it seems A* is out of the question and I honestly do not understand Prim's algorithm. Let me explain the kind of maps that I need to find routes on. This is an example...

Finding a path in a multidimensional array for a certain ID

I have an array that's stored like this: [0] => Array ( [id] => 1 [cat_name] => c1 ) [1] => Array ( [id] => 2 [cat_name] => c2 [copii] => Array ( [0] => Array ( [id] => 5 [cat_name] => c21 ...

Prolog routing routine

Hi, I am trying to write a routing function but I cannot seem to get the result needed. This is the code so far. Predecessor finds the node that is linked to N and returns it as P. traceroute(_,L) :- member((A,A),L). traceroute(N,L) :- predecessor(N,P), append(N,L,L1), traceroute(P,L1). When I run my traceroute(placeA, Y). it retur...

Anyone has implemented SMA* search algorithm?

I find the algorithm description in AIMA (Artificial Intelligence: A Modern Approach) is not correct at all. What does 'necessary' mean? What is the memory limit? The queue size or processed nodes? What if the current node has no children at all? I am wondering if this algorithm itself is correct or not. Because I searched the Internet ...

Algorithm to find most efficient moves to arrive at a given point

(This is not exactly the problem that I have, but it's isomorphic, and I think that this explanation will be easiest for others to understand.) Suppose that I have a set of points in an n-dimensional space. Using 3 dimensions for example: A : [1,2,3] B : [4,5,6] C : [7,8,9] I also have a set of vectors that describe possible movement...

Optimal Pathfinding

Background There is a square map with some obstacles on it. Obstacles are represented by polygons. I implemented following path finding algorithm: 1) Choose precision (it'll be denoted by k) 2) Divide map into k x k squares. 3) Make graph from those squares according to the following rules: - Every node represents one square - Two nodes ...

Driving directions using Postgis and pgRouting

I'm looking for a library based on Postgis and pgRouting that will provide driving directions as well as a route between any two given points. The second part works fine using pgRouting but can't seem to find anything that'll provide driving directions from the route output by pgRouting. Does anyone have any idea where I can find such a ...

Applet A* pathfinding using large byte[] arrays - heap space error

I've written a basic Java applet which works as a map viewer (like Google Maps) for a game fansite. In it, I've implemented an A* pathfinding algorithm on a 2D map with 16 different floors, "connected" on certain points. The floors are stored in PNG images which are downloaded when needed and converted to byte arrays. The node cost is ...

C# XNA: AI Engine?

I'm developing a game with zombie running around in a swamp. I want AIs to have functionality like "chase this target" or "run away". A major stumbling block is pathfinding. Is there a good pathfinding/AI engine in XNA, or should I roll my own? Does anyone have any experience with this: http://www.codeplex.com/simpleAI? ...

Box2dx: Cancel force on a body?

I'm doing pathfinding where I use force to push body to waypoints. However, once they get close enough to the waypoint, I want to cancel out the force. How can I do this? Do I need to maintain separately all the forces I've applied to the body in question? I'm using Box2dx (C#/XNA). Here is my attempt, but it doesn't work at all: i...

Pathfinding Algorithm For Pacman

Hi, I wanted to implement the game Pacman. For the AI, I was thinking of using the A* algorithm, having seen it on numerous forums. However, I implemented the Breadth First Search for some simple pathfinding (going from point a to point b with certain obstacles in between) and found it gave the optimum path always. I guess it might be be...

Silverlight - how to implement a map

Hi guys How would you go about implementing a map of this type in Silverlight? The map would be interactive and stations would be clickable. http://www.afn.org/~alplatt/tube.html Would you draw it in blend? Import a vector image? I guess the choice is very important because pathfinding algorithms need to be able to calculate distances...

A* (A-star) implementation in AS3

Hey, I am putting together a project for a class that requires me to put AI in a top down Tactical Strategy game in Flash AS3. I decided that I would use a node based path finding approach because the game is based on a circular movement scheme. When a player moves a unit he essentially draws a series of line segments that connect that...

AI navigation around a 2d map - avoiding obstacles.

Hey there, I know my question seems pretty vague, but I can't think of a better way to put it, so I'll start off by explaining what I'm trying to do. I'm currently working on a project whereby I've been given a map and I'm coding a 'Critter' that should be able to navigate its way around the map; the critter has various other functions...

how to find out if a shape is passable

I have a complex polygon (possibly concave) and a few of its edges marked as entry/exit points. there is a possibility that inside this polygon may lie one or more blockades of arbitrary shape. what approaches could I use to determine whether a path of certain width exists between a pair of entry/exit edges? having read through the ques...

Graphical sandbox for pathfinding

If you needed a clean and consistent sandbox for pathfinding what would you use? I want to experiment with different pathfinding algorithms by sending virtual units (robots) around obstacles on a geometric plane. But I don't need a feature overkill like a game engine or Flash might have, just an animated report and native collision de...

Algorithm for finding the best routes for food distribution in game

Hello, I'm designing a city building game and got into a problem. Imagine Sierra's Caesar III game mechanics: you have many city districts with one market each. There are several granaries over the distance connected with a directed weighted graph. The difference: people (here cars) are units that form traffic jams (here goes the graph...