Questions tagged [path-finding]
Methods used to map out a path of travel from one point to another, typically avoiding obstacles in the way.
732 questions
0
votes
0
answers
53
views
How to optimally transfer between nodes when each connection can only handle a certain number of things at a time?
Let's begin with a picture:
I am currently making a turn-based strategy game set in space where you can settle colonies and have to transfer minerals from the colonies ("foo", "bar&...
0
votes
0
answers
40
views
How can the A* algorithm revisit the same node twice in multi-agent pathfinding(MAPF)?
I am attempting to solve a MAPF-like problem using the Conflict-Based Search (CBS) algorithm. My specific problem is based on a grid graph where some edges are not connected.
For example, in the ...
0
votes
1
answer
41
views
path-finding question of 2d game server
I'm trying to create a game server. The game I want to create has a following feature.
2d (isometric view)
~300 users can play so a map will be not that small
all units can move in any angle (not ...
2
votes
2
answers
57
views
Improving local collision avoidance to navigate around large obstacles
For my collision system I’m using a boids-like method that works fine for "small" obstacles (like other characters) where the character can turn slightly left or right to avoid the obstacle ...
5
votes
5
answers
2k
views
Grid-based pathfinding for a lot of agents: how to implement "Tight-Following"?
Note: the main problem has nothing to do with the TYPE of pathfinding algorithm (A*, flow-field etc), allow me to explain:
I have a 2d grid and a lot of agents moving around, I want it so that ...
0
votes
1
answer
113
views
Setting up AI Pathing in Godot 4.3, NPC not moving but it is updating the pathing correctly
I am making a project in Godot 4.3 I am using a gridmap for the map and I have the NavMesh set up correctly, when I am in game I can get it to show me its pathing and it will update correctly ...
2
votes
1
answer
419
views
2D Pathfinding with rope constraint
I have a character linked by a rope to a fixed point, in an environment with obstacles.
I want to do a pathfind that take into account the rope.
Here, if the character followed my current pathfind in ...
1
vote
0
answers
81
views
Get a obstacle avoidance path base on a grid-based map and non-grid based movement
black line is grid-based path got from A* algorithm, and red one is smoothed path by use Funnel algorithm.
when B move through T or stop at T, it will overlap with A, My problem is how to get a path ...
0
votes
0
answers
64
views
How to optimize random path generation with checkpoints and collision detection
I'm looking for a way to generate a random path based on midi note onsets (timing points) for a simulation/game.
I will briefly explain how it works for context:
I'm working on a simulation type game ...
2
votes
0
answers
72
views
How to make enemies navigate around each other in a grid-based game?
I am making a 2D top-down grid-based game where the movement is similar to older Pokémon games so it's locked to a grid. I implemented A* pathfinding for my enemies with a bool[,] that indicates ...
3
votes
2
answers
572
views
Recreating StarCraft 2 pathfinding – no navmesh method seems fitting
As a hobby project I am trying to re-create pathfinding similar to StarCraft 2 based on the presentation from GDC 2011: https://www.gdcvault.com/play/1014514/AI-Navigation-It-s-Not
(Image source)
The ...
1
vote
2
answers
175
views
A*, what to do about duplicate items in the min-heap, if anything?
I'm trying to implement A*.
I'm storing the queue of nodes to visit in a min-heap, and I'm seeing the same node being added more than once to it (with different priority). Wikipedia's pseudocode ...
1
vote
0
answers
28
views
How do I get a Unity Job to update external data?
I'm relatively new to Unity, and I wanted to use the Job system for a complex pathfinding algorithm, since it will likely be used alongside multiple instances of NPCs attempting to find a valid route. ...
1
vote
1
answer
112
views
A-star algorithm after 2D tilemap 90-degree rotation
I am learing Unity and for now trying to implement a simply pathfinding alogorithm in a simply 2D isometric diamond-shaped tilemap.
Recently I learned a way how to rotate tilemap and I already have a ...
0
votes
1
answer
72
views
How to delete unnecessary points given a jointed path
I'm writing code for client-side pathfinding, the player can setup more than one point and then pathfinding in segments finally get a concatenated path.(actually it's for the long distance pathfinding,...
6
votes
4
answers
576
views
In a tile based game, with units that can move a specific amount per turn, how do i make my pathfinding avoid damage unless it is the only valid path?
i am making a 3d tactics game, visually similar to something like final fantasy tactics. it's tile based, with units able to move up and down the level onto buildings and up staircases and what have ...
0
votes
1
answer
58
views
I'm trying to find a way to iterate through a list of game objects to find furthest object in the list. Then re iterate if path is blocked
I've got the first part of the code working. It iterates and does a check through the gameobjects to find the furthest nav point to hit. Then it calculates path to see if its valid or not. Now I'm ...
0
votes
0
answers
80
views
Find the best attack position
I'm doing what this thread is doing except that it's not very satisfactory. What this does is finding the "closest" attacking position. But typically you want the attacker to attack from as ...
1
vote
1
answer
192
views
Funnel algorithm : not possible with all convex polygons?
Disclaimer : yes, the whole map is not convex. But all of its subdivisions are ! (And that's what matters)
Hi ! I got A* working with nav mesh. Now I need to find the tightest path along the mesh path....
0
votes
1
answer
90
views
Grid-Based pathfinding with object size. Avoid colliding into big-enough spaces
I already implemented a Grid-Based pathfinding algorithm and I works. I also updated it so it takes into account the objects size and ignores paths where the object wont fit. However, I ran into a ...
0
votes
2
answers
195
views
How to make ranged RTS units move to their firing range from an opponent using flow fields?
I am trying to make a simple real-time strategy game (only the battle system of units fighting each other; no building, no economy, only battles and victory). I am using flow fields to make the units ...
1
vote
1
answer
925
views
Generate a fully 3D NavigationRegion/pathfinding in Godot 4
I'm making a spaceship game where the enemies and the player have the full 6 degrees of freedom, so can move forward/backwards, left/right, up/down and can also rotate in all three axes. I'm wanting ...
0
votes
0
answers
103
views
A* implementation does not work correctly
I'm trying to implement a 3D pathfinding system based on the A* algorithm. This tutorial served as the starting point for my implementation. I tried to remake it for pathfinding in three dimensions, ...
0
votes
1
answer
1k
views
CharacterBody3D gravity isn't working, and player won't touch the floor
I'm trying to create an isometric game with Diablo-like control, but gravity isn't working. The CharacterBody3D won't touch the floor, the print(is_on_floor()) always results false.
Here's my code for ...
1
vote
1
answer
2k
views
How to deal with large number of Navmesh Agents?
I have more than 200 units in a single scene, all of them use Unity's NavmeshAgent to set their destinations to the main target. The problem I'm facing is that some ...
0
votes
1
answer
75
views
A*Pathfinding generating wrong path
I'm building a maze game where there's an enemy ready to pursuit the player if the player gets in his range, I'm using A*Pathfinding algorithm to do so, and I build the maze in a procedural way, where ...
0
votes
2
answers
231
views
Weighting navigation mesh nodes for A*
I'm trying to implement path finding for my game using a navigation mesh and A* search. While I believe I got this working correctly I'm having trouble getting desired results because I don't know how ...
0
votes
3
answers
651
views
How to prevent the player from completely blocking the enemy paths in a tower defence game like Fieldrunners?
I am new to Unity and want to create a tower defence game like Fieldrunners.
I need help to create the grid placement area for the towers so that there is always a path for enemies to travel. I mean ...
1
vote
0
answers
148
views
What's the best way to store irregular areas of my map? (hierarchical pathfinding and grid segmentation)
This is for the development of a roguelike/management game.
I'm trying to implement HPA (hierarchical pathfinding with A*), and I've found a few good resources (suggestions appreciated) in the forms ...
0
votes
1
answer
110
views
AStar taking care of collisions for a rectangle
How can I explore a path with A* (or another) by taking care of a rectangle collision ?
I have a 2d map, where I know for each coordinate if it is an obstacle :
For example, dark tiles are not ...
0
votes
1
answer
233
views
Implementing a bot to find the player in a grid
I have a 2d array with ground represented by 0s and the walls represented by 1s.
Player can use a LOOK command or a MOVE command. Look command returns a 5x5 array centered around the player and the ...
0
votes
2
answers
627
views
Defining path for tower defense game
I'm currently developing a tower defense game as a part of a group project in school. This game will be programmed in C++ using SFML. We are having trouble with finding a good way to define the path ...
1
vote
1
answer
4k
views
Creating a nav mesh
I'm coding a custom engine using Python and Pygame. It's a top down 2D isometric RTS and I wan't to implement pathfinding for my units.
My research has lead me to using a Navigation mesh which seems ...
0
votes
0
answers
102
views
Connecting nodes for A* algorithm
I am currently working on implementing a pathfinding module for my 2D game engine that I am writing in Python using Pygame.
Currently there are objects such as trees or buildings which can be placed ...
0
votes
1
answer
708
views
Player overshoots path using NavigationAgent2D and NavigationPolygonInstance in Godot 3.5
I'm trying to add a click to move feature in my game using the new NavigationAgent2D and NavigationPolygonInstance but sometimes when the player reaches the end of the navigation path or changes ...
0
votes
1
answer
819
views
Making Multiple NavMesh agents go to different destinations in unity
I am trying to make an Rts game in unity and am trying to make it so that units can go to different destinations, I have a selection system that deactivates their Navmesh agents and the script that ...
10
votes
3
answers
4k
views
How can I shorten the length of time spent on finding a path using my A* pathfinding code?
I am working on a game where the player and enemies move between discreet tiles, with only orthagonal movement (like pokemon). The game also runs on a turn system, so the player makes a move input, ...
0
votes
0
answers
217
views
How do buildings in (Tile based) city builders/colony sims keep track of each other? [duplicate]
Like, how does a building in these games know if they're being powered? Or if they're within range of influence of a hospital or fire station, etc.
How would they know where to send an NPC or ...
1
vote
2
answers
149
views
Dynamically generating and modifying non-Euclidean/Tardis houses while maintaining AI navigability
General Description
I want to build a tech demo about a game concept I am carrying around for quite some time now. A lot of influences from different sources shaped this, and I will try to hint on its ...
10
votes
3
answers
3k
views
Maintaining unit formation while following path
I'm currently working on a 2D Age of Empires style RTS game.
Here's my problem:
I'm currently using the A* algorithm (via Path finding package) to move my units.
When you select a "group" of ...
2
votes
0
answers
429
views
What's the best strategy for incorporating jumps into a 3D AI navigation algorithm?
I'm trying to make a game centered around chase sequences in a 3D level with a high degree of verticality and movement options for the player. Basically think Breath of the Wild in an urban landscape ...
0
votes
1
answer
521
views
Pathfinding over network and local avoidance
I'm trying to build a little MOBA game (max 10 players) in Unity and i'm really stuck with the pathfinding / local avoidance.
Here is what i'm doing when user click to move on the map:
Client send a ...
0
votes
0
answers
186
views
Pathfinding sprite disappears when approaching the player in Unity
I'm trying to make AI for enemies in my game. I applied a pathfinding (A*) script to my enemy sprite, after which the sprite began to follow the player. But when the enemy approaches the player, the ...
0
votes
1
answer
329
views
Struggling with breadth first search for hex grid
I cant seem to get breadth first search right. Ive gone through redblobs implementation guides of hex grids and have that all figured out but pathfinding is proving to be difficult.
So I have a search ...
1
vote
2
answers
191
views
How to identify if entrace to HPA* cluster is faulty?
I have been working on my simple game where enemy would hunt me with A* algo. But it was a bit slow so I found this thing called HPA*. Someone who would decide to help me will probably know how it ...
0
votes
0
answers
211
views
Best Pathfinding solution for 2D action-platformer
I'm developing a 2D action RPG with heavy platforming. The combat system and movement take inspiration from Hollow Knight and the Smash Bros saga.
I would like to have some type of enemies with really ...
0
votes
0
answers
238
views
Generating a tilemap and A* grid in unity but they aren't updating correctly
So question is: Why is the unity editor behaving this way (not updating the tilemaps until I go though the scene and click on them) and why is A* not generating the proper grid when Scan() is called ...
0
votes
0
answers
358
views
Pathfinding on the surface with Marching cubes
I'm making a game where the world is made of 3D density field of Voxels.
And I use Marching Cubes to create a mesh using the Voxels.
It needs to be fast because You can modify terrain a lot.
0
votes
1
answer
209
views
How to calculate distance for A* when searching a path on navmesh?
I've read a couple of articles on Navmesh+A* navigation.
So, I'm trying to implement a pathfinding for an RTS type of game. However, it seems I don't understand how to calculate a distance for A* when ...
2
votes
0
answers
72
views
Help with Flight Path Modeling
I am looking for some input on how to realize a feature I would like to build into my game. (Not technical implementation, just what kind of mathematical models or algorithms would fit my situation ...