path-finding

Unity 2d A* pathfinding project: how to make ai object patrol to random points?

妖精的绣舞 提交于 2019-12-11 10:51:20
问题 As the title states this question refers to the Unity A* pathfinding project. I downloaded this package for my maze game so that the enemy's ai could navigate through the maze. So far I have followed a tutorial ( link will be provided below ) and everything is set up. However, I don't seem to know how to implement ray casting or another method to make the enemy patrol to a random point in a continuous loop. A* Tutorial Link Note: There is a problem with my current set up though, which I have

Where is a good place to start with programing a random path on a grid?

非 Y 不嫁゛ 提交于 2019-12-11 08:56:46
问题 Im not sure where to start with this, Im not asking for someone else to do it for me but im not sure how to do it so if anyone can point me in the right direction that would be great, i cant find anything using google, here is what i need: I need to create a path from one side of the grid to the other, but not in the shortest in a random way, i need to make sure that if the path is parallel to another part of the path that it is atleast 2 units apart. thanks in advance 回答1: I wrote a maze

What are the procedures that should be taken when there is a line of sight between two points in Theta star algorithm?

牧云@^-^@ 提交于 2019-12-11 05:21:20
问题 I'm working on Theta star algorithm and I need to implement in Python. As you all know, theta star depends on line-of-sight in its work. When there is a line-of-sight between two points, what will be the procedure here after discovering the line-of-sight?. I know, if there is no line-of-sight, it will work as Astar algorithm, but what about the procedure after discovering there is a line-of-sight, what the algorithm will do here? 来源: https://stackoverflow.com/questions/57565748/what-are-the

Find key of nested object and return its path

筅森魡賤 提交于 2019-12-11 05:10:01
问题 Does anyone know a good javascript npm package (or have some good function) to find a JSON key and return its path (or paths if key exists more than once in nested JSON) for example: var person={ "name":myName, "address":{ "city", "location":{ "long":123, "lat":456 } "long" I want to use a function that will return the path to this key, in above example the key "long" exist twice: console.log(getKeyPath(person,"long"); //address.long , long 回答1: Using obj-flatten you can make that a flat

How to structure an adjacency list for this A* program

白昼怎懂夜的黑 提交于 2019-12-11 03:17:35
问题 I'm trying to understand the A* path finding algorithm, and how to implement it in a python program. I found this website which does a pretty good job explaining how the algorithm itself works, as well as providing some example code. Here is where I get stuck: def make_graph(mapinfo): nodes = [[AStarGridNode(x, y) for y in range(mapinfo.height)] for x in range(mapinfo.width)] graph = {} for x, y in product(range(mapinfo.width), range(mapinfo.height)): node = nodes[x][y] graph[node] = [] for i

All possible paths

≯℡__Kan透↙ 提交于 2019-12-11 00:58:33
问题 I am currently working on an AI for playing the game Dots (link). The objective is to remove as many dots as possible by connecting similarly colored dots with a line. I've gone through the board and grouped each set of neighboring dots with the same color. The groups all currently share the same highlight color (black). So, for example, the four red dots in the top left form a single group, as do the three yellow dots on the top right. I need to calculate every possible path through one of

A* pathfinding not taking shortest path

允我心安 提交于 2019-12-10 22:20:49
问题 My A* pathfinding function always gets to its intended destination, but it almost always goes a bit out of the way. Here's an example: [I made a nice image to show my issue, but apparently it won't post until my reputation reaches 10; sorry, I'm new. :P] Essentially, it pulls left or up as much as possible without actually adding more tiles to the path. It sounds like an issue with calculating the gScore or possibly the part where a tile's parent can be reassigned based on neighboring tiles'

Is best first search optimal and complete?

自作多情 提交于 2019-12-10 18:09:48
问题 I have some doubts regarding best first search algorithm. The pseudocode that I have is the following: best first search pseudocode First doubt: is it complete? I have read that it is not because it can enter in a dead end, but I don't know when can happen, because if the algorithm chooses a node that has not more neighbours it does not get stucked in it because this node is remove from the open list and in the next iteration the following node of the open list is treated and the search

How to check if a possible path exist?

孤街醉人 提交于 2019-12-10 15:45:16
问题 I'm working on an experimental javascript-based game. Player has to travel to exit on a 2-dimensional tiled map. Feel free to check this fiddle and play I'm just randomly placing obstacles, but sometimes obstacles block the way between player and exit, and level becomes impossible to beat. The code below which showing how obstacles being placed in the map is not a part of actual code, I've just simplified and translated this part to English to improve intelligibility: var arrayCoordinates;

Approaches to a Dynamic Pathfinding Algorithm

时光总嘲笑我的痴心妄想 提交于 2019-12-10 14:45:45
问题 My A* implementation works well for my static environment. If I would now like to work with a dynamic environment, i.e. certain costs between my nodes change while we are traversing from the start to the finish. From my reading so far I have found the LPA*, D* and D* Lite algorithm that could help me. Well my worst case scenario would be to implement all and see what works best. Is there any research done on comparing the capabilities of these algorithms? The papers that I have read so far