path-finding

Pathfinding Algorithm For Pacman [closed]

自作多情 提交于 2019-11-28 04:35:00
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 because in a game like pacman which uses simple pathfinding, there is no notion of costs in the graph. So, will it be OK if I use BFS instead of A* for pathfinding in Pacman? Daniel G For path-finding, note the following BFS will look at a lot more nodes than A* will

how to find all the longest paths with cypher query?

可紊 提交于 2019-11-28 04:15:45
问题 I want to write a cypher query which finds all the longest paths among nodes which have relationship with STATUS="on" property with each other,this is what I have done so far: start n=node(*) match p = n-[r:INCLUDE*..]->m with n,MAX(length(p)) as l match p = n-[r:INCLUDE*..]->m WHERE all(rel in r where rel.status='on' AND (length(p) = l) ) return p,l It returns 3 paths with 1,2 and 3 length,not only the longest path,my query should find only the longest paths,I mean if there are 8 paths which

How to find where to cast a ray to avoid collision in Bullet?

旧巷老猫 提交于 2019-11-27 21:25:09
问题 Say we have an object at point A. It wants to find out if it can move to point B. It has limited velocity so it can only move step by step. It casts a ray at direction it is moving to. Ray collides with an object and we detect it. How to get a way to pass our ray safely (avoiding collision)? btw, is there a way to make such thing work in case of object cast, will it be as/nearly fast as with simple ray cast? Is there a way to find optimal in some vay path? 回答1: What you're asking about is

Pathfinding 2D Java game?

戏子无情 提交于 2019-11-27 20:29:28
问题 I'm currently writing a very basic Java game based on the idea of Theme Hospital . I'm quite new to Java and am currently studying at the university my first year. I have done Java for nearly two years now on and off, but I'm finally devoting my time to a decent project. I'm at the stage where I need to create a person (patient) to be admitted to the hospital. They need to go to the reception desk, then GP's office, and then back to their starting position. I have looked into A* path finding,

AI of spaceship's propulsion: land a 3D ship at position=0 and angle=0

对着背影说爱祢 提交于 2019-11-27 20:04:55
问题 This is a very difficult problem about how to maneuver a spaceship that can both translate and rotate in 3D, for a space game. The spaceship has n jets placing in various positions and directions. Transformation of i -th jet relative to the CM of spaceship is constant = Ti . Transformation is a tuple of position and orientation (quaternion or matrix 3x3 or, less preferable, Euler angles). A transformation can also be denoted by a single matrix 4x4. In other words, all jet are glued to the

Pathfinding (routing, trip planning, …) algorithms on graphs with time restrictions

蓝咒 提交于 2019-11-27 17:15:45
I have a database of bus/train/... stops and the arrival/departure times on each date and so on. I'm looking for a way to do a search for the fastest(shortest/cheapest/least transitions) trip between two locations. I would like to have arbitrary locations in the future, using OpenStreetMap data to do walking between stops and from stops to start/end, however for the time being I just want to find path between two stops in the database. The problem is I can't seem to find much info about this subject, for example this Wikipedia page has a lot of text with absolutely no useful information in it.

Pathfinding - A* with least turns

烈酒焚心 提交于 2019-11-27 15:16:50
Is it possible to modify A* to return the shortest path with the least number of turns ? One complication: Nodes can no longer be distinguished solely by their location, because their parent node is relevant in determining future turns, so they have to have a direction associated with them as well. But the main problem I'm having, is how to work number of turns into the partial path cost (g). If I multiply g by the number of turns taken (t), weird things are happening like: A longer path with N turns near the end is favored over a shorter path with N turns near the beginning. Another less

Implementation of A Star (A*) Algorithm in Java

独自空忆成欢 提交于 2019-11-27 13:57:38
问题 Disclaimer: I have little background in Java, since I am predominantly a C# developer. Would like to have the java implementation of A* algorithm. Yes, I saw many versions of the same online and I am unable to choose between them. I am looking for an A* algorithm implementation that uses all new features of java that makes the algorithm faster(even if a tad bit). The reason is that we are implementing that for path-finding on an MMO and so, performance is the top priority. Any pointers ( on

Optimizing pathfinding in Constraint Logic Programming with Prolog

吃可爱长大的小学妹 提交于 2019-11-27 05:54:34
问题 I am working on a small prolog application to solve the Skyscrapers and Fences puzzle. An unsolved puzzle: A solved puzzle: When I pass the program already solved puzzles it is quick, almost instantaneous, to validate it for me. When I pass the program really small puzzles (2x2, for example, with modified rules, of course), it is also quite fast to find a solution. The problem is on computing puzzles with the "native" size of 6x6. I've left it running for 5 or so hours before aborting it. Way

Pathfinding Algorithm For Pacman [closed]

旧巷老猫 提交于 2019-11-27 05:22:54
问题 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 because in a game like pacman which uses simple pathfinding, there is no notion of costs in the graph. So, will it be OK if I use BFS instead of A* for pathfinding