path-finding

Pathfinding on large map

放肆的年华 提交于 2019-12-04 08:59:10
问题 I'm creating a game with a 10,000 by 10,000 map. I would like for a user to be able to set a location and have the computer instantly find the best path. However, since the map is 10,000 by 10,000, there are 100,000,000 nodes, and to find this path through a conventional method such as A* or Dijkstra's would require a large amount of memory and a long time. So my question is: How can I find the best path? The algorithm I'm considering would divide the world into 100 sections, each with 1,000

How to avoid two NavMeshAgent push away each other in Unity?

末鹿安然 提交于 2019-12-04 07:12:40
In my game, all player and monster characters have a NavMeshAgent component, when one character moves to another, it will push away the second one. I read the unity docs of NavMeshAgent, found the problem is affected by Obstacle Avoidance Type and Avoidance Priority , I have tried this, but still cannot have a perfect solution, I need the characters DO NOT push each other away and still take others as obstacles. Please give me some advice how to use NavMeshAgent well and resolve this problem. thanks in advance. Give this article a try, it helped me, should help you too: Pathfinding and Local

A* Start path finding in HTML5 Canvas

大城市里の小女人 提交于 2019-12-04 07:06:14
I'm trying implement A* Start path finding in my games(which are written with JavaScript, HTML5 Canvas). Library for A* Start found this - http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html and now I'm using this library for path finding. And with this library, I'm trying write a simple test, but stuck with one problem. I'm now done when in HTML5 canvas screen click with mouse show path until my mouse.x and mouse.y. Here is a screenshot: (Pink square: Player, Orange squares: path until my mouse.x/mouse.y) Code how I'm drawing the orange squares until my mouse.x

AI: Fastest algorithm to find if path exists?

老子叫甜甜 提交于 2019-12-04 02:58:31
I am looking for a pathfinding algorithm to use for an AI controlling an entity in a 2D grid that needs to find a path from A to B. It does not have to be the shortest path but it needs to be calculated very fast. The grid is static (never changes) and some grid cells are occupied by obstacles. I'm currently using A* but it is too slow for my purposes because it always tries to calculate the fastest path. The main performance problem occurs when the path does not exist, in which case A* will try to explore too many cells. Is there a different algorithm I could use that could find a path faster

how to get the last node in path in neo4j?

佐手、 提交于 2019-12-04 02:38:54
In this cypher query,the longest path/paths between nodes which have relationship with STATUS="on" property with each other,will be returned,but I want to get also the last node of the path/paths. query: START n=node(*) MATCH p=n-[rels:INCLUDE*]->m WHERE ALL (rel IN rels WHERE rel.status='on') WITH COLLECT(p) AS paths, MAX(length(p)) AS maxLength RETURN FILTER(path IN paths WHERE length(path)= maxLength) AS longestPaths how should I add it to the query? thanks. This would give two arrays. The first array is the last item in each path, the second is each path: START n=node(*) MATCH p=n-[rels

A* Pathfinding in a hexagonal grid

 ̄綄美尐妖づ 提交于 2019-12-03 22:39:56
Can anyone point me to a simple example that implements A* path-finding algorithm on a hexagonal grid (in JS). I have made it working on a square grid, however all my attempts to make it work on a hexagonal grid have failed. This is how my grid looks like: I'm using the same technique to both draw the grid and generate coordinates as seen in this topic . Here's the grid coords data along with the start, end coords: [0, 0] , [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [1, 3], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [3, 0], [3, 1], [3, 2], [3, 3], [4, 0], [4, 1], [4, 2] start_point: [0,2] end_point:

Storing a directed graph in google appengine datastore

*爱你&永不变心* 提交于 2019-12-03 12:42:06
问题 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 needed, just a fairly good one) My thoughts on the subject: The most obvious way is to have a vertex model, and an edge model which references two vertices,

How to store public-transportation data

浪子不回头ぞ 提交于 2019-12-03 10:19:31
问题 I am currently trying to implement my own public transportation path-finder to find connections by tram/bus etc. with given timetables. All the data is generated by me (by simply adding stops coordinates from google map). Thanks to it, I am free to choose my own way of storing data and processing them. The whole transportation network is represented by a weighted graph. So here comes the question: how to store public transportation data in standard SQL database so that it could be easily

Path finding for games

三世轮回 提交于 2019-12-03 09:06:32
What are some path finding algorithms used in games of all types? (Of all types where characters move, anyway) Is Dijkstra's ever used? I'm not really looking to code anything; just doing some research, though if you paste pseudocode or something, that would be fine (I can understand Java and C++). I know A* is like THE algorithm to use in 2D games. That's great and all, but what about 2D games that are not grid-based? Things like Age of Empires, or Link's Awakening. There aren't distinct square spaces to navigate to, so what do they do? What do 3D games do? I've read this thingy http://www.ai

Copy path/file name in Eclipse to clipboard

时间秒杀一切 提交于 2019-12-03 08:12:34
问题 Is there a shortcut to copy the current path/file to the clipboard? 回答1: There is Copy Qualified Name function in Eclipse, it will copy the full name of the element you select (or element on cursor). For example : /MyProject/src/app/Application.java : when you select Application.java in Package Explorer java.util.HashSet<String> : when you copy while cursor at HashSet<String> However, it required you to select the element you want. So, here is what I do. Make your Package Explorer link with