Questions tagged [path-finding]

Methods used to map out a path of travel from one point to another, typically avoiding obstacles in the way.

Filter by
Sorted by
Tagged with
1 vote
1 answer
58 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 ...
Valeriy's user avatar
  • 13
0 votes
1 answer
65 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,...
Chuan Littlefat's user avatar
6 votes
4 answers
501 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 ...
graveyard's user avatar
0 votes
1 answer
44 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 ...
WestMansionHero's user avatar
0 votes
0 answers
68 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 ...
Weikai Wu's user avatar
1 vote
1 answer
136 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....
DisturbedBerry's user avatar
0 votes
1 answer
50 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 ...
Ezequile's user avatar
0 votes
2 answers
142 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 ...
Hao Hao's user avatar
0 votes
0 answers
128 views

Obstacle avoidance via steering behaviour when near gaps

I'm trying to implement RTS-like character control on C++/SDL2 for a character with a rectangular hitbox. I have a path-finding algorithm ready and I want to implement obstacle avoidance steering ...
SavedowW's user avatar
1 vote
1 answer
557 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 ...
beyarkay's user avatar
  • 127
0 votes
0 answers
93 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, ...
Ilya's user avatar
  • 11
0 votes
0 answers
57 views

How to apply avoidance to path following with root motion?

My Character Blueprint uses Root Motion to control locomotion (taking location and turning it into a direction to move). However, root motion is not compatible with avoidance pathfinding such as ...
Candle's user avatar
  • 141
0 votes
0 answers
352 views

Navigation in a TileMap with 2 types of tile in 1 cell in Godot4

I'm stuck with the navigation in a TileMap based scenario in Godot 4. My intention is to make the enemy (boats) to chase the player while avoiding procedurally ...
Alex CB's user avatar
  • 376
0 votes
1 answer
660 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 ...
KZulfazriawan's user avatar
1 vote
1 answer
863 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 ...
jasmine zhao's user avatar
0 votes
1 answer
72 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 ...
AND4011002849's user avatar
0 votes
2 answers
167 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 ...
user1566228's user avatar
0 votes
3 answers
412 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 ...
Robin's user avatar
  • 3
1 vote
0 answers
102 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 ...
genfy's user avatar
  • 43
0 votes
1 answer
83 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 ...
bux's user avatar
  • 147
0 votes
1 answer
178 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 ...
mathsymaths's user avatar
0 votes
2 answers
493 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 ...
user294957's user avatar
1 vote
1 answer
2k 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 ...
Zoler1337's user avatar
0 votes
0 answers
77 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 ...
Zoler1337's user avatar
0 votes
1 answer
522 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 ...
Javier Villanueva's user avatar
0 votes
1 answer
654 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 ...
Crystalline787's user avatar
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, ...
Kyle34562345's user avatar
0 votes
0 answers
163 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 ...
Sir Gaelence's user avatar
1 vote
2 answers
109 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 ...
Confused Merlin's user avatar
9 votes
3 answers
2k 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 ...
GauthierBee's user avatar
2 votes
0 answers
343 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 ...
Austin Capobianco's user avatar
0 votes
1 answer
400 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 ...
Aldo's user avatar
  • 309
0 votes
0 answers
176 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 ...
Hallteon's user avatar
0 votes
1 answer
278 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 ...
cwahlfeldt's user avatar
1 vote
2 answers
144 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 ...
Eskimo Joe's user avatar
0 votes
0 answers
156 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 ...
Alessandro Tagliani's user avatar
0 votes
0 answers
219 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 ...
Ryan's user avatar
  • 153
0 votes
0 answers
301 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.
Sploky's user avatar
  • 1
0 votes
1 answer
180 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 ...
Dmitrii Naumov's user avatar
2 votes
0 answers
50 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 ...
AngryTriangleCola's user avatar
1 vote
0 answers
246 views

A* Pathfinding with 2x2 player or larger [duplicate]

I am very familiar with A* and is able to make it work well. However I am looking for resources describing how to do find a path with a player size of 2x2 instead of the usual 1x1 on a 2d map. So for ...
foRei's user avatar
  • 11
2 votes
2 answers
1k views

How would I actually implement A* pathfinding in a 3D world?

I have been trying to implement pathfinding in Minecraft for a while. Everything is in blocks, so this shouldn't be too difficult. I have gone through a lot of different posts and articles but I haven'...
Day Trip's user avatar
0 votes
1 answer
30 views

How to handle collisions for short obstacles across a range of scales?

A naive collision system in 3D RPGs can lead to mobs getting stuck on geometry that they would realistically step over and can be a major nuisance to many players. For most games, the solution is ...
smallobsession's user avatar
1 vote
3 answers
493 views

Which AI should I use so as to avoid monsters AND chase bonus pills at the same time?

I'm trying to program an AI for a Pac-Man-like game, where I would be the Pac-Man and move according to two simple rules: move towards bonuses avoid monsters and being killed I read that one can ...
Carmellose's user avatar
1 vote
1 answer
3k views

Java Simple 2D Grid Pathfinding

I want to code some basic pathfinding for my bot in Java. Below is a 2D grid representation of the 3D world. 0s being the places you can go, and 1s being the places that you cannot go. ...
Day Trip's user avatar
0 votes
1 answer
146 views

Find Largest Room in 2d World

I'm currently working on a generated(Perlin Noise) 2D Cave System with Unity. The Caves currently look like this: What I want to do is spawn the Player (and other stuff) in the big Part of the Cave ...
Jonas Re's user avatar
0 votes
1 answer
496 views

How would I incorporate gravity and gravity affecting obstacles into A* pathfinding in a 2d side-scrolling game?

I want to be able to modify the A* pathfinding in a way that I can get my NPC from his current position to any point that's within reach. The tricky part is that this takes place in a side-scrolling ...
ggg's user avatar
  • 1
2 votes
0 answers
38 views

Finding a path to a circular zone in continuous space [duplicate]

I need to find the shortest path for an agent that wants to use a ranged attack against the specified target. This means that the path's ending point should be inside the range of the attack and have ...
MaxEd's user avatar
  • 121
1 vote
1 answer
180 views

How to create the slow random movement effect you see in shmup enemy idles?

I’ve noticed in a lot 2D shmups, after enemies accelerate onto screen and arrive at their arrival point, they don’t simply sit static at their arrival position, but rather begin to gently move in ...
DyingIsFun's user avatar
  • 1,307
0 votes
0 answers
174 views

How to make the enemy only start pathfinding when player is within certian distance [duplicate]

Im using A* pathfinding and unity 2d. Also im very new and dont really know how to code well so if you can tell me the code it would be much appreciated. I figured out how to use A* but i dont want ...
Henry's user avatar
  • 1

1
2 3 4 5
15