_id
int64
0
49
text
stringlengths
71
4.19k
16
In what instances would you want to use path finding algorithms other than A ? I am familiar with how the common ones technically work (BFS, DFS, Dijkstra, A ) but as far as their realistic benefits I don't quite see the need for them. Considering that, given the right heuristics, A is more performant then why bother with any others?
16
How should I store a city map on disk? I'm working on a game where players travel in a city. This city is defined by streets (names, positions...), points of interest (cinemas, restaurants...) and different zones (high criminality zones, rich zones, poor zones...). I still don't know if this city will be based on a real one (using OpenStreet map data) or made by game designers. In either case, I need to be able to modify the map data (add a cinema here, move a restaurant there...). I also want to be able to search it for stuff like "Where is the closest restaurant?" or "How long would it take to travel to that street?". How should I best store such information on disk, to be loaded or modified later? (I'm working with Unity, but this isn't a Unity specific question.)
16
A in 2D game. corner pathfinding issue the issue I'm having will be best described with pictures more so than with code, so lets have a look if you will. So all the mobs followed the player and started attacking him, but as soon as 4 spots to the E, S, W, N were taken, mobs 1 and 2 are no longer able to find the path. When mob from E S W N spot dies they can of course find a way to the player. My question therefore is what is the way to implement this so that mobs can get to the player when only corners are free? Diagonal movement is not allowed and i'm using Euclidean distance. I've read this How do I avoid pathfinding characters getting stuck in corners? and other questions, but they dont quite cover what I need here. I'm sorry if this isnt specific enough, happy to clarify.
16
How can I navigate to a target between bodies moving along fixed paths? The problem An autonomous ship starts at the outskirts of a solar system, and wants to move to a moving target, which is one of the planets. There are also many other planets moving at the same time, and these should be considered the only obstacles. I want to find the optimal path to the target. To keep it simple, the world is 2D, and the planets are moving in uniform circular motion around the sun as opposed to how planets actually behave. Also, assume the ship knows pretty much everything about the world. Most importantly, the location, speed, and orbit radius of every planet. With complete knowledge, this seems conceptually simple. For any planet and any time, you can find its location by doing some fairly simple math. But how would you apply this to pathfinding? Would it be just to pathfind in 3 dimensions x, y, and t? In theory this makes sense, but I think working that out to an actual solution would involve a lot of complications. Is it really as simple as 'setup a on a grid with x,y,t values'?
16
Ponderate dijkstra relative to previous position I use dijkstra in my rust game to find path to a destination. My game is in a square grid like this There is, for illustration, the Rust code which use dijkstra use crate map Map use crate physics GridPoint use pathfinding prelude dijkstra pub fn find path(map amp Map, from amp GridPoint, to amp GridPoint) gt Option lt Vec lt GridPoint gt gt match dijkstra(from, p map.successors(p), p p to) None gt None, Some(path) gt Some(path.0), ... pub fn successors( amp self, from amp GridPoint) gt Vec lt (GridPoint, i32) gt let mut successors vec! for (mod x, mod y) in ( 1, 1), (0, 1), (1, 1), ( 1, 0), (0, 0), (1, 0), ( 1, 1), (0, 1), (1, 1), .iter() let new x from.x mod x let new y from.y mod y if new x lt 0 new y lt 0 continue if let Some(next tile) self.terrain.tiles.get( amp (new x as u32, new y as u32)) successors.push((GridPoint new(new x, new y), next tile.pedestrian cost)) successors ... And visualization of found path (white is found path, pink is goal) The found path is not a direct line. I'm not surprised, because the weight of diagonal is the same as lateral. With what I understand with dijkstra is I can return successor with weight for a coordinate. But I can't increase weight of diagonal lateral according to previous position (ex comming from West gt moving to Est will be less weight maybe it is not the solution ...). How can I achieve that ? With another algorithm than dijkstra ?
16
How can I implement platformer pathfinding? I've gone through A pathfinding but could find anything on this. What I'm looking for is pathfinding for something kind of like a super smash bros level with different platforms. Can anyone point me in the right direction?
16
Dijkstra's algorithm null hypothesis pathfinding without navmesh I am having trouble understanding how to implement dijkstra's algorithm for a path finding assignment, here's what the layout looks like Each node has a List of neighbours which are found using raycasting. Now the issue i am having is how to weight each node.... I understand Dijkstras maintains a list of visited nodes and an open list. I just don't understand how to weight them individually based on where i want to go. Right now i'm weighting them all by a distance of 1. But this seems to be incredibly redundant and is going to take an extremely long time to find the shortest path because it's going to check every possibility of a paths to the endNode.... Can someone help me understand the logic of how to implement dijkstra's algorithm in this environment?
16
Detecting if an object is following a path I am attempting to take GPS data and track it on a map and see if it follows a given path. I have the path as a set of points and the GPS data streams in as a similar set of points. I am attempting to track the progression of the current position across the path and I am wondering if there are any well known algorithms for this. I have come up with my own that works ok but it is a complex enough problem that I would like to minimize the amount of re inventing of the wheel that I do. What approach or algorithm would you recommend taking for this problem?
16
Which algorithm for controlling cars on a race track? I think A is a good place to start, but since cars cannot move in all directions (they move like cars do, trying to move forward and steer), I was wondering if someone could point me at other approaches they've used. Also, I was wondering about the "Racing Line". Should one just precompute the optimal paths, and then use the A to select the path that isn't blocked by other cars ? EDIT My question is different from Driver AI in racing game because that question is about approaches. I am interested in learning about specific tried and trusted algorithms like A .
16
A pathfinding question I'm trying to get a grasp on the A pathfinding algorithm. Using the image I attached. If the green square represents the start, and red represents the end. wouldn't the algorithm bring me up towards the top of the grid, and then circle me back around, because of the wall? It would seem the algorithm would never start by moving downward first because the F cost would initially appear more expensive? Is this a problem with the basic manhattan heuristic? Or am I just missing something?
16
In A star, do I use the sum or the edge cost? When you add a new node to the closed list, you need to check all the adjacent nodes. If you find any adjacent nodes on the open list, you have to check if G would be lower if you went through the current node to get there. My questions is, when checking if the G would be lower if you went through the current node, do you add up from the last node or start from 0? Say you're using G 14 for diagonal and G 10 for horizontal. Last one on the closed list's G was 20. Your current node is one block lower from the last one on the closed list, and has an adjacent one that's on the open list with G 34. Are you supposed to check if the G would be lower if you went through your current node by doing 20 10 14 44, 44 ! lt 34. Or, are you supposed to start from 0, so 0 10 14 24, 24 lt 34? I'm pretty sure it's the latter as with the former, the number is never going to be lower. But if it's the latter, wouldn't the number be lower every single time after a certain point?
16
How to get NPC to Find and Follow Path to other NPC? Problem I am using Skyrim Creation Kit to create a very simple mod. I want the mod to make one NPC follow another NPC. My first problem is that I am not really 100 sure where to start. The second problem is which functions I should use. I have been reading the documentation at www.creationkit.com. In other words LOOP move Bob to Mike's current position with speed of 0.5 (npc Bob.moveToPosition( npc Mike.getPos(), 0.5 ) end loop My Attempt I tried making a quest but to no avail. So then I made 2 custom actors (member and leader) and I put this script in member Scriptname NpcFollowNpc extends ObjectReference put a loop once you get this part working moves member to leader with speed of 0.5 member.PathToReference(leader, 0.5) but it didn't compile. I don't really know if this is the right way to implement what I want. I know how to code and make algorithms and a bunch of that computer science stuff, but I don't know how to move the actor member to the location of actor leader in Skyrim and loop it while the actor leader is alive. Any ideas how I could go about doing this? thanks for any help feedback!
16
Traversing an acyclic binary tree to construct paths from a given starting node, but the paths come out wrong The tree is an acyclic binary tree. It's composed of node objects that have a list of connections to link objects (at most 3), and link objects that have a list of connections to node objects (always 2). I am trying to construct a list of possible paths to other nodes that can be reached given a fuel budget and a fuel cost on each link. What it is supposed to do is go through each non backtracking connection of a node, and spawn a new route and thread to investigate that, leaving the current one to end at that node and thus create a list of routes to every node in the reachable area. When executed, the list of end destinations are valid but many of the paths that are constructed to get to them are wrong, going down other branches in the tree that are extraneous or entirely outside of the reachable area bounded by the fuel budget as well as jumping between nodes that aren't directly connected. There seems to be some pattern in the errors, when going down from the root of some branches of the tree the path goes down every offshoot in order first instead of going in a straight line, and when going up the tree the path tends to go further out and make triangle shapes, often landing somewhere other than the listed destination. I have already checked the link and node connections themselves to see if they are assigned properly, and they are. What am I getting wrong? Route class definition var origin Node var destination Node var totaldV float var totalt float var dVBudget float var tBudget float var tdVRatio float var links Array var nodes Array func duplicate values(originator Route) origin originator.origin destination originator.destination totaldV originator.totaldV totalt originator.totalt dVBudget originator.dVBudget tBudget originator.tBudget tdVRatio originator.tdVRatio nodes originator.nodes links originator.links func init(originator route) if originator route ! null duplicate values(originator route) Tree traversal algorithm var routes Array onready var root get node( quot .. quot ) func traverse(current node Node, previous route Route) if previous route null Starts off the recursion by providing an initial node previous route Route.new(null) previous route.origin current node previous route.nodes.append(previous route.origin) previous route.dVBudget 2000 previous route.totaldV 0 for link in current node.connections if (previous route.totaldV link.dV lt previous route.dVBudget amp amp !IsBacktracking(previous route, LinkDestination(link, current node))) If there is enough fuel and the link isn't backtracking, go through it. var working route Route Route.new(previous route) Copy the previous route to make the new route routes.append(working route) working route.destination LinkDestination(link, current node) working route.totaldV link.dV working route.totalt link.t working route.links.append(link) working route.nodes.append(working route.destination) traverse(working route.destination, working route) DisplayRoutes() root.get parent().pathSelectionFlag true UI control boolean func IsBacktracking(route Route, destinationNode Node) gt bool for nodeI in route.nodes if (destinationNode nodeI) return true return false func LinkDestination(link Node, originNode Node) gt Node Finds the node on the other side of a link for nodeI in link.connections if (nodeI ! originNode) return nodeI return originNode
16
Why calculate A Pathfinding F Cost? I just made an A Pathfinding system in unity that doesn't calculate the f cost (g cost h cost) and I wondering why do u actually have to calculate the f cost? I mean my pathfinding system that works perfectly fine. Any ideas?
16
A pathfinding for grid with direction dependent nodes? I'm trying to understand if the A algorithm is a possible pathfinding solution for my game. I have a simple grid of nodes that an enemy can move around on, but the nodes represent traversable terrain at different heights in my game world. So although an enemy might be able to "jump down" from Node A to Node B (where Node A is much higher than Node B), it could not do the reverse and "climb up" from Node B to Node A. In other words, whether the A algorithm can travel from one node to another depends on the direction of travel. It may be possible in one direction but not the other. Can A handle a situation like this, or do I need a different pathfinding algorithm?
16
Longest path algorithm for roguelike maze generation I have a simple grid based map composed of rooms, like this (A entrance, B exit) 0 1 2 3 0 B 1 2 3 4 5 A 6 And I'm stuck trying to make a suitable algorithm to create a path of doors between the rooms, in such a way that the player has to explore most of the map before finding the exit. In other words, I'm trying to find the longest possible path from A to B. (I'm aware that this problem can be solved for acyclic graphs however, in this case there can be cycles.) EDIT Another example where rooms are connected using floodfill, and the exit is chosen as the farthest room from the entrance 0 1 2 3 0 B 1 2 3 4 A 5 6 Note that the path to the exit is not the longest possible path at all.
16
Pathfinding towards a moving target in 2D Platformer I have an enemy in my 2D platformer that chases the player around the level. I implemented a modified version of A that works with gravity as described here https gamedevelopment.tutsplus.com tutorials how to adapt a pathfinding to a 2d grid based platformer theory cms 24662 But for a moving target I would have to calculate a new path whenever the target moves. Of course I'm going to run the pathfinding on a separate thread and only once a second or something like that, but it's still a waste to calculate the path from scratch. So I found this algorithm for transforming the old path to the new path with the new start and target position called FRA http idm lab.org bib abstracts papers ijcai09b.pdf However the platformer version of A has a kind of 3D grid where nodes with different jump values in the same 2D location has a different z coordinate. Is it possible to use FRA when jump values comes into play? Do I have to recalculate jump values?
16
Godot How do I asign movement cost to tiles in a Tilemap? Pathfinding I am trying to apply godot's Navigation to create a pahtfinding enemy in a Platformer game. I've read about a method to allow for pathfinding to take into account gravity. My issue is that what I know I must do is to add more movement cost to higher tiles. How do I do this? EDIT I have since found the documentation for the Astar Node. Wish me luck.
16
Finding the "Important" nodes of a grid path On a Navmesh Grid, all nodes are essentially vertices or turn points so the returned path is efficient in that it only involves points where an entity must change its direction. A grid path, however, involves nodes at every point along the path. For long paths, there could be hundreds of nodes contained even though most of those nodes just follow a line and don't change the direction of the path. Note Paths are lists of a GridNode object. I haven't tested this hypothetical issue in application yet so my first question is Is this even an issue? For a game that requires real time pathfinding for roughly 200 entities on a grid of 4,096 nodes, will the returned paths consume too much memory and resources? My main concern is related to how entities will handle paths, which is to check for reaching the target node before moving on to the next one and calculating the new direction needed. With more spaced out nodes, entities might have more leeway with following their paths if pushed off of it. Secondly, if it is a potential issue, how would I solve it and cull out the insignificant nodes of a path?
16
Shortest path to a road I have a road network and a vehicle that is current off the roads. I want to find the shortest path to any road. An obvious solution is to run a pathfinding algorithm between the current vehicle location and all the points on the road, but that's hardly scalable. I am curious to know if there is an algorithm out there that I could use to maximize the performance of this operation.
16
Path Planning in a chaotic, ever changing environment I've implemented Path Planning a few times, using A on nav meshes, and also Continuum Crowds but now I am trying to plan paths in very chaotic environments. In this environment, new routes and new blockages are created constantly, and chaotically. This is because the environment is fully destructible, and the debris can create new obstacles. In such an environment, nothing can be pre computed. What would be a good way to sense the traversability in such a world? There is no concept of a grid in my world, b.t.w, but I wonder if I should introduce an artificial one for the purpose of planning. But if navigation could be achieved without a grid, that would be much better of course. Note that the navigation is not merely dynamic in the sense that certain transitions get opened closed, but actually chaotic. This stops me from a simple approach of enabling disabling certain edges on the navigation mesh. That approach would be usable if, e.g. a gate gets locked unlocked. But in my case, in a blink of an eye, the routes could be drastically changed where simple mutations of a pre computed mesh are not doable.
16
UE4 Navmesh precision I'm trying to make my very tiny man pathfind his way through a map of a school but the navmash won't recognize some of the hallways cause they are very narrow like this. So as you can see the man can fit but the navmesh says no so can anyone help and keep in mind that i am very new to unreal engine so please make your explanation easy to understand.
16
Pathfinding with different sized units I am actually working on a general purpose pathfinding library (find it here), mostly oriented for grid based maps. I was looking for ways to integrate support for pathfinding with units of different sizes. Actually, I am working with the assumption that all units are square (i.e. their widths and heights in tile units are the same). In researching, I came across a very comprehensive article about Annotated A star, using True clearance values for pathfinding. I tried it, and succeeded in implementing it, and got it working with a wide range of search algorithms (A star, Theta , Dijkstra, DFS, Breadth first search and Jump Point Search). There are some small details of implementation I think I am still missing. First of all, when an agent is 2x2 sized (i.e it occupies 4 tiles on the grid map), what tile can be assumed to be the agent position ? On the same page, clearance based pathfinding will fail in some cases. Let's consider the following map, where 0's are passable tiles, 1's are obstacles and x's matches walkable goal to be reached. Let's assume we are pathing with a 2x2 sized unit 00000000 00111100 001xx100 001xx100 00000000 For targets on the left (tiles 4,3 and 4,4), clearance value is 2, for both. No problem here. But for the others (tiles 5,3 and 5,4), clearance value is 1. So depending on how the agent position is taken, pathfinding will fail while obviously, for each of these target, the agent can properly fit into the dead end space. Another scenario, with the same 2x2 sized agent 0000000x 0000000x 0000000x 0000000x xxxxxxxx Well, all tiles are walkable here, no obstacles. We want the object to reach any goal on the rightmost or bottom most border. Each of these targets have a clearance of 1, so annotated pathfinding wil obviously fail here...depending on how the agent's position is taken. How do I work around this issue?
16
Pathfinding in multi goal, multi agent environment I have an environment in which I have multiple agents (a), multiple goals (g) and obstacles (o). . . . a o . . . . . . . o . g . . a . . . . . . . . . . o . . . . o o o o . g . . o . . . . . . . o . . . . o . . . . o o o o a What would an appropriate algorithm for pathfinding in this environment? The only thing I can think of right now, is to Run a separate version of A for each goal separately, but i don't think that's very efficient.
16
How can I find all shortest paths using A ? It is possible for A Path Finding to return all the shortest paths given a graph map? For example, given the map below a X b The said map can return four (4) distinct path. 1 a11X11b a22X22b 2 333 a3 X 3b a4 X 4b 444 The paths follow the Manhattan Heuristic and a Eight (8) directional transition with a default G value of 1.0f for testing. The question given the Pseudocode of A will only return me one (1) of the four (4) distinct paths which I wish to return all four (4) paths instead.
16
How do I handle objects with a width and height in grid based pathfinding? I'm using the Jumper library for Love2D to do grid based pathfinding, which worked fine until I wanted to make larger enemies (with larger collision boxes). How do i do that? My initial idea was to make a new map for each entity that needed pathfinding I could make a new map, with all the objects scaled up in size, but that seems way to complicated. To give an example, I could have a wall with a passageway that is wide enough that my player has no trouble walking around it, but a giant ogre would have to walk around.
16
Handling multiple agents in astar pathing When working with grid based path finding in how do you normally handle different agent types? In the game I am working on I have a regular agent, and one that occupies 2 cells on the grid, and one that can fly. The idea I have now is to use a separate AStar map to store the grid for each type. The height is max 4 units so I can use AStar for flying as well. This keeps it possible to add new actor types as well but is it waste of memory? Also how to deal with avoiding nodes occupied by other agents? The game is turn based so I don t want to do any object avoiding type thing. Is there a simple way to mark a node in the AStar as temporarily unwalkable? I am using the Godot Engine and would like to use the in built astar implementation but I can create my own if really needed.
16
How does heavily constrained delaunay triangulation work? In short I'm trying to find an algorithm for performing a Delaunay triangulation of a heavily constrained polygon (for the purpose of pathfinding), with the understanding that most of the resulting triangles will be illegal (non Delaunay) due to the constraints. Making the effort should still help reduce generation of long thin triangles where possible. I'm trying to understand how constrained Delaunay triangulation works, within the context of game maps where the available ground surface for navigation and pathing is defined by a polygon on a flat 2D plane. The polygon needs to be triangulated for use in pathfinding, such that moving from point A to point B passes through as few polygons as possible (so polygons need to be as large as possible). I first looked into regular Delaunay triangulation, and there are multiple methods available, but they all assume a point cloud where the goal is to create ideal triangles without constraints. Then I looked into constrained Delaunay triangulation, but there is very little available I could find beyond academic papers, and many of those simply perform a regular Delaunay triangulation, then cut triangles that intersect constraints and re triangulate around them. This seems backwards and inefficient to me when literally ALL of the triangles I want to end up with will be constrained. I saw a GDC video, where the Starcraft 2 devs talked about using constrained Delaunay triangulation, and you can kind of see it when you look at the pathing mesh in the Starcraft 2 editor (see below). However, very few of the generated triangles are legal, due to the number of constraints in the map layout. Still, I am assuming the Delaunay algorithm influenced the selection of points to triangulate, in order to get the best triangle coverage. However, I can't find any further info on how this might work. How does one start with constraints, points connected by fixed lines, and then quot fill in quot the remaining lines to generate triangles that are a best effort attempt to not be overly stretched or narrow? Edit Screenshot example from Starcraft 2 editor
16
Techniques for (literally) cutting corners on square grid maps My game involves a level with deformable terrain and units that can travel in any direction but are slowed down by uneven terrain. Normal A star should work fine in most cases, except on flat land where no matter how the general purpose pathfinder worked it would not send units on a direct path. Theta star would work if the entire level was fairly flat, but would be much slower if it initially had to take uneven terrain into account. I think a Manhattan distance base A star algorithm would be fast and give a good enough hint to allow other path finding or steering algorithms to take over, but I'm not sure what type of algorithm to use to look ahead and decide when to abandon the path, take a more direct route, and where to jump back on the path later. (Theta star seems like it would be too inefficient if it was adjusted to take things like slopes, obstacles, or roads into account. See the solution proposed to the comment about avoiding minefields at http aigamedev.com open tutorials theta star any angle paths ) Edit I did not mention that I already implemented and tested A star on a similar grid. (I think I accidentally deleted something in this question.) Some of the more obvious cost heuristic functions I considered just don't result in realistic paths on a grid when an obstacle blocks the most direct path (basically when path finding is useful) (example pictures). The change to the cost function used by the Theta star algorithm seems like an ideal solution (considering the constraint of using a grid), but it makes the assumption that tiles have the same travel costs (and it takes much longer). My original reasoning behind using Manhattan distance was to outsource the "corner cutting" algorithm from the path finding algorithm, since it was more important to have a fast path finding algorithm in case the obstacle layout or terrain changed. It makes more sense to do the "corner cutting" algorithm once when the unit arrives than on every permutation of every search of path finding algorithm (the results of which may end up being scrapped anyway.) A four neighbor search with Manhattan distance is also interesting because you can see boxes of alternate paths and identify right triangles formed by the original path and the shortest path. A better question would have been "What is a fast way to identify shortcuts in a path with 90 degree turns?"
16
Determine route between rooms Is there a general purpose algorithm to determine a route between rooms of a building? Imagine a fixed layout, single level house with 50 rooms. Assume I have a data structure that defines the exits of each room and the room to which each exit leads. I'd like to know how to get from room 4 in the NW corner to room 37 in the E side, say. I want the shortest list of rooms that need to be traversed. (I don't need to see this graphically in real time.) Is it worth finding such an algorithm or should I just 'map out' the level and use the pathfinding abilities of my game dev platform of choice.. edit removed the A reference
16
Multi tile agent path finding algorithm? Suppose we have a uniform rectanglular grid as shown below. The a is an agent, o is obstacle and g is goal. What are the options of handling multitile agents (e.g. dragons or tanks)? . . . . o . . . . . . . o . g . . a a . . . . . lt too tight . a a . o . . . . . . . o . . . . . . . . . . . lt should go through this gate . . . . . . . . . . . . o . . . Update Found this article on clearance based pathfinding from Red Alert 3. It covers not only the clearance size, but also a capability ability of certain units to use certain terrains.
16
What is a good path finding algorithm when a target is moving? I've been looking for a path finding algorithm for a moving target. If there are no obstacles in proximity Seek behaviour would be good. However, A or some other path findings are needed when obstacles are on the way to the moving target. The problem I'm facing now is that calculating a path using A seems not efficient for a moving target. so I want to know if there are some good or preferred ways to solve this problem. The image below shows some basic background of the problem. The red arrow shows the direction my Seek behavior calculates. But I want the "Chaser" to take the green direction instead. Thanks in advance.
16
How do I implement group formations in a 3D RTS? I managed to get pathfinding work for a single unit, and I managed to avoid agent agent collision, but now I need to be able to send a group of agents to some location. This is my set up so far Waypoint pathfinding The minimum distance between two nodes is a little bigger than the biggest bounding sphere radius allowed for an agent. Agents avoid collisions with other agents by doing some steering behaviour I based on clearpath So now I need to send my agents somewhere in group. I have read some posts saying that some way to do it is to create a group leader and give the other units offsets to his position. But then the problem is, what if the group formation cannot be achieved? e.g. you want to form a rectangle, but at the target position there is a structure nearby which prevents you from creating a rectangle setup.
16
when to do A pathfinding? I'm trying to build my first game, a really simple RTS like Age of Empires but I have a question about pathfinding. When do this kind of games usually do pathfinding? I've read some games do a global pathfinding once at game start but I'm not sure if that will fit this kind of games. Do they usually calculate pathfinding each time a game entity starts a new task and has to move? How do they handle when a obstacle suddenly appears on the path? Do they re calculate pathfinding on every step? Or do they check if the current path is clear on every step? Or they just walk the current path until they actually hit the unexpected obstacle? Actually if you know a link to a source code of pathfinding on some RTS game I would really appreciate it. Thanks in advance
16
Pathing for pipe style layout I've been trying to think of ways to approach doing a pipe style game like the one pictured below, but am coming up short. The pic is from Star Trek Elite Force 2, the hacking minigame part. I've never played the game, but found this particular part via a search. The player must click on to turn each pipe section and get a path between the blue nodes, while not connecting to any red nodes. I assumed the way to create the pipe route is to begin from the end node and generate a path towards the starting node, then obscure the path with branches. But on trying this, the path is very obvious (pic added below), so I'm looking for other ideas. Does anyone have any pointers to set me in the right direction?
16
Reducing the number of edges in a pathfinder I've worked out an algorithm for pathfinding in a quite free form terrain (not constrained to grids), with the limitation that it doesn't allow the moving character to rotate. I'll use it for AABBs so that's not a problem, and I'll assume AABBs below. However, one of the steps consists of creating a graph in which the path is to be found, and that's where the problem is it seems to me that the number of graph edges to construct is going to be O(V ) where V is the number of vertices. Yet when looking at a typical graph, it is apparent that many of these edges do not need any consideration at all. So the question is if there is a way to reduce the number of edges. The algorithm goes like this. The input is a traveler, a series of boxes (the maze) and a destination point http www.formauri.es personal pgimeno temp rect4572.png (in this example, the reference point of the traveler is at the bottom right of the rectangle because I made a mistake estimating the MDs by hand sorry about that) Calculate the Minkowski difference of the traveler and each box in the maze http www.formauri.es personal pgimeno temp rect4574.png this reduces the problem to having a point crossing that maze, simplifying analysis. Create the graph 2.1. Each vertex is a corner of one of the boxes in the Minkowski difference. 2.2. For each pair of vertices, there is an edge iff the line between them does not have any point inside one of the boxes. In other words, if there is a direct line of sight between them. Result http www.formauri.es personal pgimeno temp rect4758.png (done by hand I may have forgotten edges) Run a pathfinding algorithm on that graph. http www.formauri.es personal pgimeno temp rect4776.png The path found is directly usable in the original map http www.formauri.es personal pgimeno temp rect5158.png The problem is step 2.2. Is it possible to reduce the number of edges? I'm not aware of any pitfalls in the algorithm, but if you see one, please let me know as well.
16
How do I implement group formations in a 3D RTS? I managed to get pathfinding work for a single unit, and I managed to avoid agent agent collision, but now I need to be able to send a group of agents to some location. This is my set up so far Waypoint pathfinding The minimum distance between two nodes is a little bigger than the biggest bounding sphere radius allowed for an agent. Agents avoid collisions with other agents by doing some steering behaviour I based on clearpath So now I need to send my agents somewhere in group. I have read some posts saying that some way to do it is to create a group leader and give the other units offsets to his position. But then the problem is, what if the group formation cannot be achieved? e.g. you want to form a rectangle, but at the target position there is a structure nearby which prevents you from creating a rectangle setup.
16
Finding N shortest paths I know about several of path finding algorithms that exist depth first search, Dijkstra's algorithm, A etc. Now I would like an algorithm that gives me the N paths with lowest cost. Can this be obtained by some simple modification of one of the above? Or is a different algorithm needed, and if so which?
16
UE4 Navmesh precision I'm trying to make my very tiny man pathfind his way through a map of a school but the navmash won't recognize some of the hallways cause they are very narrow like this. So as you can see the man can fit but the navmesh says no so can anyone help and keep in mind that i am very new to unreal engine so please make your explanation easy to understand.
16
In A star, how does the heuristic help determine your path? Say you're using a 4 by 5 grid. The G cost for horizontal and vertical movement is 10, and the G cost for diagonal movement is 14. On this page http theory.stanford.edu amitp GameProgramming Heuristics.html it says "At one extreme, if h(n) is 0, then only g(n) plays a role, and A turns into Dijkstra s algorithm, which is guaranteed to find a shortest path." Why would it find the shortest path? Wouldn't it find the longest path instead? If the heuristic no longer plays a role then it will never consider going diagonal because the cost of diagonal movement is 14. Previously, even if the G cost was higher than another adjacent node, it could still be chosen if the H cost was a bit lower. Now, even if the shortest path was by going diagonal, it would never go diagonal because the G cost of diagonal movement will always be higher than the G cost for horizontal vertical movement. So why exactly would it be guaranteed to find the shortest path if the heuristic was 0? Another thing, what would be the difference if, let's say we're using the Manhatten method, and after calculating the total number of squares moved horizontally and vertically to reach the target square from the current square the heuristic was multiplied by 1 or if it was multiplied by 100? Wouldn't the path be the same either way?
16
Simplify navmesh path I'm trying to implement pathfinding in my game, I'm using navmesh with triangles. I'm able to find a path but I want to simplify the path. This is what I have right now Green quad is start position and blue quad is the destination, the path taken by my character is in white. Wireframe Node 1 and Node 2 are in differents triangles, I want to delete Node2 and go from Node1 to final destination. How can I simplify this path ?
16
2D Sideview Procedural Water Generation How can I generate water in a procedural 2D sideview landscape? Here's what I currently have First generate the heightmap of the land Then generate the water, based on the land Here's how I generate the water based on the land Assign each block a lake target for water (rain) flow. First, choose the best direction. Then, for each block it checks along the way, calculate the slope between that block and the next block. If that slope is zero, keep on going to create a noninteger slope, until a MAX BLOCK DELTA X is reached. If this accurate slope is close to zero, we say the water drains or evaporates. Otherwise, keeping searching for the bottom of a lake, until the slope goes up again. Next, lakes are created, based on the most targets chosen in one proximity. Lastly, the lake height is calculated from the lake's amount of water (I don't know how to do this). I see some problems with my current algorithm, like if the bottom of a lake is flat the water drains. Could this be improved? If so, how? Either way, how would I calculate the lake's height? How would I do rivers? Edit Caves and overhangs are not allowed. Edit 2 This answer of my other question provides a way to identify valleys. I think this could be used, but I don't know which end to start scanning.
16
How to make natural looking paths with A on a grid? I've been reading this http theory.stanford.edu amitp GameProgramming Heuristics.html But there are some things I don't understand, for example the article says to use something like this for pathfinding with diagonal movement function heuristic(node) dx abs(node.x goal.x) dy abs(node.y goal.y) return D max(dx, dy) I don't know how do set D to get a natural looking path like in the article, I set D to the lowest cost between adjacent squares like it said, and I don't know what they meant by the stuff about the heuristic should be 4 D, that does not seem to change any thing. This is my heuristic function and move function def heuristic(self, node, goal) D 5 dx abs(node.x goal.x) dy abs(node.y goal.y) return D max(dx, dy) def move cost(self, current, node) cross abs(current.x node.x) 1 and abs(current.y node.y) 1 return 7 if cross else 5 Result The smooth sailing path we want to happen The rest of my code http pastebin.com TL2cEkeX Update This is the best solution I have found so far def heuristic(node, start, goal) dx1 node.x goal.x dy1 node.y goal.y dx2 start.x goal.x dy2 start.y goal.y cross abs(dx1 dy2 dx2 dy1) dx3 abs(dx1) dy3 abs(dy1) return 5 (cross 0.01) (dx3 dy3) (sqrt(2) 2) min(dx3, dy3) def move cost(current, node) cross abs(current.x node.x) 1 and abs(current.y node.y) 1 return 7 if cross else 5 It produces the desired path from the second pic, but does not handle obstacles very well (tends to crawl on walls) and fails to produce optimal paths sometimes on longer distances. What are some tweaks and optimizations I can apply to improve it?
16
Find Minion with shortest path I'm working on a game like Settlers III IV. There are buildings which produce goods which have to be gathered by carrier units. I have to find the carrier with the shortest path to collect the goods. So far, not a big deal. I simple do a expanding circle, starting from the production building, and choose the first carrier found due it has the shortest direct way. If this carrier can't reach the building (e.g. is on another island or so), the search goes on. But now take a look at my awesome paintskills. The black line is an obstacle which my minions can't get over. Red lines are direct paths, blue is absolute path. The first carrier is A, but it's direct way is blocked. Second is B, direct way blocked as well and third, C, has the longest path of all. As you easily can guess, I want to sent B due it has the shortest absolute path. What's the lowest affort do determinate if a carrier with blocked direct way has a shorter way then a carrier with a longer direct way? I'd love to have some lecture about that, but I only was able to find (a lot) of pathfinding where the unit itself searches the path, not the target searches the unit with shortest path. Edit Simply trying out until the minion with shortest path is found is no solution. I don't want to make it stuttering on a i7 or so. Settler 3 is a 17 years old game and somehow they have implemented such a functionality without needing over 9000 gigahertz. If you have any idea which involves routing tables or whatever, I'm happy. Goal is simply to find the minion which could arrive as fastest, in the shortest time possible. Not a big deal if therefore 200mb of routing table have to be generated or whatever.
16
How to handle pathfinding on a non grid non node terrain map I'm not sure if this is even path finding. All I have is a 3D map that has hills, etc. I'd like the enemy to flock an object, but also walk around other objects. These blocking objects may be added after the path is calculated, which would cause a re calculation of the path. What algorithm am I looking at here?
16
Which algorithm for controlling cars on a race track? I think A is a good place to start, but since cars cannot move in all directions (they move like cars do, trying to move forward and steer), I was wondering if someone could point me at other approaches they've used. Also, I was wondering about the "Racing Line". Should one just precompute the optimal paths, and then use the A to select the path that isn't blocked by other cars ? EDIT My question is different from Driver AI in racing game because that question is about approaches. I am interested in learning about specific tried and trusted algorithms like A .
16
Pathfinding with car steering Is there pathfinding algorithm which takes car steering into account? I have large space where user can place cars (trucks actually) and other blocker objects. Objects can be placed vertically or horizontally oriented and have different sizes (may be 3x6 or 2x4 or other size). User needs to be able to select new location for any car then I need to calculate how can that car move to selected location. I have pathfinding working, and I can find paths with different size but only for square objects. Update Pathfinding need to give only path that is possible with that type of car. For example on empty map with only one car, if user selects new location right next to its current location, car can't strafe or turn in place it has to either reverse and steer or do U turn or something. Also it must ensure that car orientation at end is what user requested.
16
Node representations in a navigation mesh There are different ways to represent nodes in a navigation mesh. It's either along triangle centroid, along triangle vertices or along edge midpoints. As I understand if you choose triangle centroid or edge midpoints as nodes, the path isn't going to be optimal, but you can use a funnel algorithm to optimize it. If you choose triangle vertices as nodes however, I understand you can find the more optimal path from get go. But you will get a "wall hugging" issue. Which you can solve by using some algorithm I unfortunately forgot the name of. What is the preferred or most optimal option?
16
Voxel river flow simulation I am making a Voxel game and I'd like to add rivers that can be redirected. So I thought that if a player replaces a river block or digs up a block next to a river block the river would repath itself to the sea. The rivers path would have a direction and a speed in that direction. The rivers path would be determined by these rules If the river can go down in its direction it will and then pick up speed. or if it has a speed under 2 and it can go sideways and down it will and keep its direction. Otherwise it will keep going in its direction until blocked, where it will pick a new direction. If the river can't go anywhere it will fill up the layer its on like a bathtub and go up. Repeat until it reaches the ocean. However I can't figure out how you can know what to fill. The data would be stored in some sort of height map. 1 same level, 0 down a level, 2 up a level For example 222222 211112 211112 211112 211112 222222 I can tell that the 2s completely surround the 1s meaning that all the 1s should get filled with water if the river goes up. But how can a computer tell?
16
Why does a 3D scene need to be voxelized before it can be transformed into a navmesh? Why do solutions such as Recast voxelize a 3D scene before transforming it back into polygons? Would it not be possible to just determine intersections of meshes, check for slope angles and adjust triangulations in that way? I think agent height problems could also be solved by testing sweeps upwards against the other meshes.
16
Correct way to handle A no pathing? I'm developing a little game for fun and I wrote a pathfinding system based on the A algorithm. What is the best or correct way to deal with unavailable paths? A by default will go through every node on the grid until it either finds the target node or it has exhausted all of them. This can become problematic if certain areas are cut off into "islands" and A tries to find a path there. The obvious solution might be to flood fill regions and check in advance, but the problem is that I plan for my world to be a bit dynamic new areas might appear, some areas which are accessable at one point might not be later, etc. Another solution I've read about is that I can limit the amount of nodes it's allowed to search before it gives up, but this sounds a bit hacky and something I'd like to avoid if possible if there are better ways, because it means that there could be a very long and complex path to the target but it'll still not find it just because of this limit. So how should I do it? I appreciate any help here, fellow devs!
16
A in 2D grid with obstacles in between graph nodes I am using standard A (and Jump Point Search) for pathfinding in my 2D game. A map in this game is a simple 2D grid (tile based). A node (i.e. grid cell) in my map graph can either be blocked or walkable. That works fine so far. Now I got a new requirement There can be obstacles in between cells as well, i.e. walls. I thought the easiest way to implement this is to make the cell "behind" a wall an obstacle while searching for a path. However, that does not really work, because if I search for a path from the other side of the wall, then "behind" is also on the other side... So my question Is there any "best practice" to implement this, or, if not, what are your ideas?
16
2D Top Down Can't follow the path accurately In my game, there are many agents. Agents request a path, then after attaining a path to "goal" they follow the path. However player and many other things in the world can impact their position by pushing them or pulling them. When agents get pushed and they happen to advance forward closer to "goal", I want them to smartly follow the previously given path. I have pictures below to enhance your understanding of my situation. I COULD recalculate path every a few seconds or when agent gets out of path BUT I have DOZENS of these little agents. I don't want to do path finding for DOZENS of agents again, again, again, and again whenever they walk out of the path.
16
How to fix cutting corner problem in A star pathfinding So this is a problem when doing diagonal jumps (checking diagonal neighbor nodes). In 2d it can be prevented by doing some checks, like if up and right is blocked, don't take up right neighbor for calculations. But in 3d thous check become a bit to much and to tedious.. so if I still want diagonal paths, what could be a good solution?
16
Finding a path with minimal number of turns on a grid? There is a path, generated by my implementation of A , where diagonals aren't allowed, and the heuristics is the Manhattan distance. Is there a way to always or nearly always find a path with the least amount of turns? Even if it's a bit longer, and even if it costs more computationally. Or is there a way to algorithmically "fix" a path later? Like on the image below, cut those long detours and replace them with those blue parts. My current version is far from optimal, both length wise, and both turn wise. I also tried multiplying the heuristic value of a tile, if it isn't going in the same direction as the line made from the previous 2 tiles. But that didn't help either.
16
Optimization of A in Python I am working on an IA (in Python) for small board game, and I need to do a lot of pathfinding per round in order to find the best move I can do (minmax implementation). My problem is that even if the board is small (9 9), I am able to run it (only) approx. 10000 per second, and I don't know how to speed it. Do you have some advise? def shortest path(self, start, goal) elements heapq.heappush(elements, (0, start)) came from cost so far came from start None cost so far start 0 current None while len(elements) gt 0 current heapq.heappop(elements) 1 if goal.is on goal(current) break for next in self.edges current .neighbors new cost cost so far current 1 if next not in cost so far or new cost lt cost so far next cost so far next new cost lowest priority new cost goal.heuristic(next) heapq.heappush(elements, (lowest priority, next)) came from next current way if goal.is on goal(current) reverse edge current while reverse edge in came from way.insert(0, reverse edge) reverse edge came from.get(reverse edge, None) return way
16
Pathfinding Tile Based Navigation Mesh I'm developing a real time, tile based RTS. This is an example map This map consists of 4 regions with 256 tiles each. Blue tiles represent obstacles. Units can move in the standard eight directions. Units are bound to tiles one tile can hold one unit. These are some examples of the ideal paths I'm looking for. Typical A stuff My question is Is a navigation mesh applicable to a tile based RTS? I've only seen navigation maps used in games where units are free moving and not bound to a grid of tiles. What would the navigation mesh look like on this particular map? An example image would be excellent.
16
Obstacle avoidance in Bezier Curves I use an A algorithm to find a path voiding obstacles. On obtaining the path it would be a good idea to reduce the number of points. Then I would like to typically do a spline interpolation or Bezier Curves to find a smooth path but is it not possible that post smoothening my character bumps into an obstacle? If not possible then why and if it is possible, then how do I avoid it?
16
Correct way to handle A no pathing? I'm developing a little game for fun and I wrote a pathfinding system based on the A algorithm. What is the best or correct way to deal with unavailable paths? A by default will go through every node on the grid until it either finds the target node or it has exhausted all of them. This can become problematic if certain areas are cut off into "islands" and A tries to find a path there. The obvious solution might be to flood fill regions and check in advance, but the problem is that I plan for my world to be a bit dynamic new areas might appear, some areas which are accessable at one point might not be later, etc. Another solution I've read about is that I can limit the amount of nodes it's allowed to search before it gives up, but this sounds a bit hacky and something I'd like to avoid if possible if there are better ways, because it means that there could be a very long and complex path to the target but it'll still not find it just because of this limit. So how should I do it? I appreciate any help here, fellow devs!
16
nurbs and pathfinding optimization I'm working on a project, and my current milestone is pathfinding. I have a working prototype that consists of several components a manually drawing of a path, that matches the visual path that the characters are allowed to walk on a grid for A calculations a ray that pokes through the grid cells neighbors during the A evaluation, and if it intersects a perfect GREEN pixel, sets the cell as walkable for A calculations, and if it hits a transparent pixel, leaves the cell as not walkable after the rough A path is calculated, an algorithm for nurbs makes the turns in the path, more ease in, so to speak My current issue is that the nurbs path Looks like it can use some optimization, And I can use your help to nudge me in the right direction, either pointing me to some literature or directly brainstorm.. Please see the picture below, it should be clearer what I mean, my goal is to have nurbs in a more straight line, perhaps using some sort of extrapolation algorithm that is based on the A result, and simplifies it in such a way that the nurbs curve is straighter from start to end the project is browser based Away3D framework(sea3D framework more specific) its github repository can be found here Thanks! below is an example that shows the components described above in GREEN the path that was draw manually, in RED the A walkable path, in BLUE shades the nurbs And another example how it actually looks in game, without all the pathfinding visual representations
16
Voxel river flow simulation I am making a Voxel game and I'd like to add rivers that can be redirected. So I thought that if a player replaces a river block or digs up a block next to a river block the river would repath itself to the sea. The rivers path would have a direction and a speed in that direction. The rivers path would be determined by these rules If the river can go down in its direction it will and then pick up speed. or if it has a speed under 2 and it can go sideways and down it will and keep its direction. Otherwise it will keep going in its direction until blocked, where it will pick a new direction. If the river can't go anywhere it will fill up the layer its on like a bathtub and go up. Repeat until it reaches the ocean. However I can't figure out how you can know what to fill. The data would be stored in some sort of height map. 1 same level, 0 down a level, 2 up a level For example 222222 211112 211112 211112 211112 222222 I can tell that the 2s completely surround the 1s meaning that all the 1s should get filled with water if the river goes up. But how can a computer tell?
16
Astar heuristics closing in on an answer before searching around to find nodes with lower movement costs I am having some trouble with my A path finding. everything works fine and the path is always found. However, my game is a open map space strategy game. There are no walls etc to navigate around. Now, the movement cost along the navgrid is the same unless the agent chooses to navigate thro a 'jump gate' (in which case the cost is 100 times cheaper. almost always the better option). I have a problem where the heuristics will narrow in directly towards the answer rather than searching around for a better solution. If my heuristics function always returns 0, then I always get the correct route, however with no heuristics I need to search the entire map and this makes it far too slow. As you can see, the top agent ignores the jump gate and flies directly towards the destination, completely ignoring the gate way. The bottom agent opts to use the gate way (only because its heuristics was causing it to search in a north west pattern anyway. What are some possible solutions?
16
Line of Sight Clear Path Check Theta For Rectangle Character I am implementing Theta pathfinding in a tile based 2D game. A tile is either blocked or unblocked. The character has a rectangle collider with a width and height in tiles. Is there an algorithm for finding all the tiles the rectangle will overlap when moving in a straight line from A to B on the tile grid?
16
Best pathfinding for a 2D world made by CPU Perlin Noise, with random start and destinationpoints? I have a world made by Perlin Noise. It's created on the CPU for consistency between several devices (yes, I know it takes time I have my techniques that make it fast enough). Now, in my game you play as a fighter ship thingy blob or whatever it's going to be. What matters is that this "thing" that you play as, is placed in the middle of the screen, and moves along with the camera. The white stuff in my world are walls. The black stuff is freely movable. Now, as the player moves around he will constantly see "monsters" spawning around him in a circle (a circle that's larger than the screen though). These monsters move inwards and try to collide with the player. This is the part that's tricky. I want these monsters to constantly spawn, moving towards the player, but avoid walls entirely. I've added a screenshot below that kind of makes it easier to understand (excuse me for my bad drawing I was using Paint for this). In the image above, the following rules apply. The red dot in the middle is the player itself. The light green rectangle is the boundaries of the screen (in other words, what the player sees). These boundaries move with the player. The blue circle is the spawning circle. At the circumference of this circle, monsters will spawn constantly. This spawncircle moves with the player and the boundaries of the screen. Each monster spawned (shown as yellow triangles) wants to collide with the player. The pink lines shows the path that I want the monsters to move along (or something similar). What matters is that they reach the player without colliding with the walls. The map itself (the one that is Perlin Noise generated on the CPU) is saved in memory as two dimensional bit arrays. A 1 means a wall, and a 0 means an open walkable space. The current tile size is pretty small. I could easily make it a lot larger for increased performance. I've done some path algorithms before such as A . I don't think that's entirely optimal here though.
16
How should I use Monte Carlo method to simulate some police cars that keep patroling in a tile based map? I have a tile map (isometric) and I have some police cars that they patrol all the time on the map, there is some building and other cars in map too so they are considered as constraints in my shortest path algorithm (below). I use to randomly select some target for each police car and use A algorithm to find the path to the randomly selected destination tile and this cycles over and over. because cars should move all the time! (except those that gamer should control) The problem is police cars routes are correlated and they do not just traverse the area randomly, for instance, they do not usually cover a same area or they do not repeat their own route so my implementation based on some random destination point wasn t a good idea and the result was not satisfying. Take a look at the following picture, it shows how randomly selecting the destinations worked for me, obviously, it is a dumb patroling for sure, even a cockroache could do better! Suddenly, I remembered Monte Carlo Method and I thought it would solve my problem, because it exactly does what I wanted to do, However may be I should use Zobrist Hashing since it is tile base in nature. Does anyone has any idea how should I use this kind of methods? Question in Brief How can I use Zobrist Hashing or Monte Carlo method to set destinations points for my patroling car (like police car)? If anyone knows another way to implement a patrolling method, he she is very welcome to post an answer, I am not sure if Zobrist Hashing is the best and worth to implement. First Edit (added following paragraph) I need to distribute the cars and their destination points in a homogeneous manner. Every kind of solution that get me close to a good pattern could be my answer, of course there is a lot of methods to do so, but I dont have any clue.
16
Overlaying grid for pathfinding My game is not grid based, so units can be at any arbitrary coordinate and move at different speeds. My obstacles are all rectangular and axis aligned, so naturally it makes sense for me to overlay a grid over the map for pathfinding. Each unit will take up a grid cell (floor(unit.x CELL SIZE), floor(unit.y CELL SIZE)). I will then run standard A grid based pathfinding on the grid. The problem is that although the path is grid aligned, the unit movement is not. Thus, in the midst of moving, the unit might end up colliding with a cell that is blocked, and get stucked. Here's a picture to illustrate I'm trying to get from point A to point B. B is the center of the grid cell, since it is a waypoint from the found path. A is the point the unit is currently at. The pathfinder thinks A to B is valid movement, since it takes the grid cell of A as the start point and the diagonal neighbour B is not blocked. But moving from A to B might result in position C, which is blocked. I thought of using a soft collision radius for pathfinding, but it has its problems. The pathfinder will not return any paths where there's a soft collision. So if the current location of the unit already has a soft collision, the unit cannot move! It seems that it is necessary to keep the pathfinding collision and physics collision identical... How do I resolve this problem, and what is the standard way to overlay a grid for pathfinding?
16
Is there an algorithm to construct lines (sets of grid points which are all connected) from an unsorted set of grid points? I have a 2d square grid used for pathfinding that I wish to convert into a navigation mesh. My idea is to pluck out all of the nodes that are on the edge of walkable space, simplify the amount of data with a line reduction algorithm, then triangulate the set of points. I am stuck at the simplifying step. To find edge nodes I use a marching squares algorithm. The downside to using marching squares is that the points are unsorted, and in order to pass the points into the Ramer Douglas Peucker algorithm they need to be sorted by connectivity (and separated into individual lines). I'm looking for an algorithm that can either sort my collection by connectivity or discover edge nodes in a consecutive manner. I'm trying out Djikstra search to find a path from one point to the next. To determine if these points are connected, during path reconstruction if the parent point has a Euclidean distance greater than 1 to the current point then they are not directly connected. I might be able to get this to work but it is proving to be extremely slow. Here are screenshots of the graph I am working with 2d pathfinding grid unsorted edge nodes discovered via marching squares
16
Simple bare bones path finding routine I have a 2D grid with a number of cells. I need to find a path from one cell to another. There are no obstacles or opponents, and all cells are identical. What is a SUPER SIMPLE routine to calculate the shortest path? I have read about A and other routines, but they are waaaaaaaay overkill in my case at this point. (Maybe I will need them later, in the future.) Thanks!
16
How can I compute the shortest path in Euclidean environments with non convex polygons? Can someone suggest papers or algorithms about calculating shortest paths in Euclidean spaces with non convex polygon as obstacles?
16
Restrict A pathfinding to overlapping "safe zones" within map I've been bashing my head against this idea for a few days without luck, I'm hoping someone sees something I don't. So I have a 2D map containing walls and obstacles, and I have a unit that navigates through it (A and funnel algorithm). So far so good. Now, for gameplay purposes, I need to limit the movement of this unit to circular safe zones that I can place on the map. Think of them like cell towers, the unit has to stay within range of at least one tower, with the max range dictated by the tower (possibly different for each tower). Effectively, imagine drawing a set of interlocking circles over the map, and the unit must remain within that. Now for the complicated part. The map is a constrained Delaunay triangulation, not a grid, so the triangles that A is using can vary in size and shape. With a grid, I could imagine limiting individual grid cells by circle distances, but in my case these triangles could be larger than any one circle. There could even be cases where the start and end points of a path are within the same triangle, but because of the network of circles, an indirect path would have to be chosen to stay within the circles. The only option I can think of involves adding these circles into the triangulation as additional edges, altering the map. This would mean rebuilding the map triangulation each time a player adds or removes these circles, and would require that I maintain a separate copy of that triangulation per player. And since these circles don't care about map walls, I'd have to alter my triangulation method to allow edge splitting and removal, to prevent overlapping lines from rendering the triangulation invalid. I feel like there has to be another way to do this. I've considered Running A purely on the circles first, then placing that intermediate path on the map and re pathing it to avoid obstacles. Finding all of the circle intersections between the start and end points, and treat those lines as portals that I must pass through, somehow altering the A pathing to prioritize passing through them. Performing a regular path search on the triangulation, but forcing a dead end whenever entering a triangle that is too far from a circle. Then refining that path to conform to the circles themselves. Each of these have issues, or scenarios where they fall apart. Has this been done before? Any input on how this might possibly be achieved would be appreciated. Edit Adding an image to show what I'm trying to accomplish. The red lines show the path that A would generate using just the map triangulation. The green lines show the desired path, taking the circle bounds into account.
16
Find shortest path (quickly) on the surface of a 3d model? Imagine this scenario we have a 3d model, for instance a doughnut, apple or an orange (possibly something more complex). There's an insect (let's say an ant) on the surface of that food item. Now that ant wishes to reach a certain specific coordinate embedded on the surface of the 3d object in the shortest time possible (using the shortest path, ignoring physics). Now the ant AI could use Dijkstra on the original mesh but that might be low res so the ant will zig zag on the surface, outlining the shapes of blocky faces. You could split the faces but the angular nature of the edges, making up the structure of the mesh will continue to drive the ant to more in ziggy zaggy like manner (imagine a rougelike with very small squares, you can still only move in 8 directions at any given point). What we did is split the edges (of the model) to evenly sized pieces and embedded "navigation vertices" between these pieces, we then connected the vertices of each edge with vertices of other edges sharing a face with it (4 other edges because faces are triangular). This works pretty well cause it means the any can travel freely between faces, ignoring their shape almost completely (unless they are very small and were not split). We also have the ant "pulled" (dragged even) by an imaginary ant that is a few steps ahead to completely eliminate the more rigid areas in the path (think sharp corners). Sounds great right? But this is not terribly fast. Any advice about that is appreciated.
16
How can I navigate to a target between bodies moving along fixed paths? The problem An autonomous ship starts at the outskirts of a solar system, and wants to move to a moving target, which is one of the planets. There are also many other planets moving at the same time, and these should be considered the only obstacles. I want to find the optimal path to the target. To keep it simple, the world is 2D, and the planets are moving in uniform circular motion around the sun as opposed to how planets actually behave. Also, assume the ship knows pretty much everything about the world. Most importantly, the location, speed, and orbit radius of every planet. With complete knowledge, this seems conceptually simple. For any planet and any time, you can find its location by doing some fairly simple math. But how would you apply this to pathfinding? Would it be just to pathfind in 3 dimensions x, y, and t? In theory this makes sense, but I think working that out to an actual solution would involve a lot of complications. Is it really as simple as 'setup a on a grid with x,y,t values'?
16
What are the disadvantages and or limitations of navigation meshes? I have a lot of materials on navigation meshes, what they are, their advantages over graphs made up of waypoints, etc. However, I haven't seen much information regarding the limitations and the disadvantages of using navigation meshes, other than the obvious time they take to be created manually (which is relatively solved by Recast). Surely this isn't a completely "magical" technique that presents itself without any drawbacks? Could someone please explain what the limitations and disadvantages of using a navigation mesh over, let's say, a graph made up of waypoints? Or point me in the right direction?
16
How to find the nearest object from another, in a non tile based game where obstacles are present? The nearest object means the path from the initial position to this object is shorter than the path from initial position to any other object. The path is the smallest number of pixels this object must move to reach the target object while making sure that it does not collide with any obstacle. Like in this example below, consider that object A has to determine which object is closer, object B or object C. The pink rectangle is an obstacle. Now if we consider the euclidean distance, object B will be closer but due to the presence of an obstacle euclidean distance will give false answers. Another solution would be to find the distance using some pathfinding algorithm (like A ), which will give the correct solution, but will be slower than simply calculating euclidean distance. The ideal solution should give the answer as an object the path to which is no more than 10 larger than to the nearest object. And it should take no more than 10 millisecond on a modestly powered computer to find the nearest object for 1000 different objects on a map that has upto 1000 obstacles of different sizes and the map is no larger than 1000 1000 pixels (like in the image above the nearest object for A is C, for B it is A and for C it is A). Also it should not take more than 50 MB of RAM (excluding the size of RAM used to store the coordinates of objects and obstacles and their sizes). And the map is dynamic. The solution need not return the path between the objects, it need to only find the nearest object. What will be the ideal solution of this problem?
16
How are flow fields different from potential fields? I've heard of of both flow fields and potential fields for pathfinding in games. They sound similar, but I never see them mentioned in the same contexts. Places that mention one never mention the other, as if they're completely unrelated. How are they different? Why would I choose one over the other?
16
Overlaying grid for pathfinding My game is not grid based, so units can be at any arbitrary coordinate and move at different speeds. My obstacles are all rectangular and axis aligned, so naturally it makes sense for me to overlay a grid over the map for pathfinding. Each unit will take up a grid cell (floor(unit.x CELL SIZE), floor(unit.y CELL SIZE)). I will then run standard A grid based pathfinding on the grid. The problem is that although the path is grid aligned, the unit movement is not. Thus, in the midst of moving, the unit might end up colliding with a cell that is blocked, and get stucked. Here's a picture to illustrate I'm trying to get from point A to point B. B is the center of the grid cell, since it is a waypoint from the found path. A is the point the unit is currently at. The pathfinder thinks A to B is valid movement, since it takes the grid cell of A as the start point and the diagonal neighbour B is not blocked. But moving from A to B might result in position C, which is blocked. I thought of using a soft collision radius for pathfinding, but it has its problems. The pathfinder will not return any paths where there's a soft collision. So if the current location of the unit already has a soft collision, the unit cannot move! It seems that it is necessary to keep the pathfinding collision and physics collision identical... How do I resolve this problem, and what is the standard way to overlay a grid for pathfinding?
16
How to achieve partial pathfinding? Let's say I already have an A algorithm. How can I handle the cases when the goal cannot be reached, and still attempt to get there? For instance on the following example Notice the amazing GIMP skills! The yellow unit needs to reach the green spot, but it's on island and can't actually reach it. Yet, on a typical RTS, the unit will try to go as close as possible. My problem is that I don't know how to tell A that the closest tile to the goal is the square near the sea. How can I have this partial pathfinding? Is A still a good choice?
16
Algorithm for waypoint path following? I have a worldmap, with different cities on it. The player can choose a city from a menu, or click on an available cities on the world map, and the toon should walk over there. I want him to follow a predefined path. Lets say our hero is on the city 1. He clicks on city 4. I want him to follow the path to city 2 and from there to city 4. I was handling this easily with arrow movement (left right top bottom) since its a single check. Now I'm not sure how I should do this. Should I loop threw each possible path and check which one leads me to D the fastest ... and if I do how do I avoid running in circle forever with cities 1 5 2 ?
16
Line of Sight Clear Path Check Theta For Rectangle Character I am implementing Theta pathfinding in a tile based 2D game. A tile is either blocked or unblocked. The character has a rectangle collider with a width and height in tiles. Is there an algorithm for finding all the tiles the rectangle will overlap when moving in a straight line from A to B on the tile grid?
16
What are some techniques used for mouse tracking, with a bit of "emulated lag"? I am trying to implement a system, where the cursor (in my case the player's avatar) is always about 1.5 seconds (a configurable interval) behind where the mouse actually is. If I change the cursor's location every time through, I get an emulated mouse cursor with no delay, I'm wondering if there are any pre canned type of solutions I can throw at this before I "roll my own." Source code or even just basic steps you've used would be helpful.
16
Tile walking algorithm for already known set of walkable tile? Suppose I already have a list of tile that specify which tile the character can move to, and these tiles are clustered around the character. If I want to produce a path (maybe not shortest, but just a short path) to the desired tile, how would I construct it with the given list of tiles? I was going to do an A algorithm, however, thinking again, it will complicate my coding process. Therefore, is there a better way to find short path for known list of movable tile?
16
Overlaying grid for pathfinding My game is not grid based, so units can be at any arbitrary coordinate and move at different speeds. My obstacles are all rectangular and axis aligned, so naturally it makes sense for me to overlay a grid over the map for pathfinding. Each unit will take up a grid cell (floor(unit.x CELL SIZE), floor(unit.y CELL SIZE)). I will then run standard A grid based pathfinding on the grid. The problem is that although the path is grid aligned, the unit movement is not. Thus, in the midst of moving, the unit might end up colliding with a cell that is blocked, and get stucked. Here's a picture to illustrate I'm trying to get from point A to point B. B is the center of the grid cell, since it is a waypoint from the found path. A is the point the unit is currently at. The pathfinder thinks A to B is valid movement, since it takes the grid cell of A as the start point and the diagonal neighbour B is not blocked. But moving from A to B might result in position C, which is blocked. I thought of using a soft collision radius for pathfinding, but it has its problems. The pathfinder will not return any paths where there's a soft collision. So if the current location of the unit already has a soft collision, the unit cannot move! It seems that it is necessary to keep the pathfinding collision and physics collision identical... How do I resolve this problem, and what is the standard way to overlay a grid for pathfinding?
16
How can I make my units follow predetermined paths? I'm planning my first game and am planning on using the engine set out in Beginning Android Games, as it deals with a load of stuff that is just noise at the moment to me (because I've no real world experience yet). There's no real time restraint this is a learning experience more than a real world project, although I would love to be able to release something at the end of this project. The way the book tells me how to do movement has been very much acceleration and velocity based with other forces thrown in (wind, gravity etc) but it's not covered how I can set a predetermined path for an enemy to follow. I was thinking that I could use a lookup table to map points for the enemy to head for, and then I'd just need a way of smoothing out the turning so that the motion is fluid. Is this the correct approach? I know this is a bit of a vague question, and I would give you some code, but I'm very much in the planning phase at the moment, so I'm just looking for some pointers or things to think about whilst I'm trying to work out how it's all going to hang together.
16
A search in hexagonal grid with minimum turn radius I need to run an A search through a hexagonal grid. However, I have one nasty constraint my vehicle can only turn so sharp. It has a specified minimum turn radius. I can't quite see how to translate this constraint into something I can use with each cell expansion to determine if a neighbor is viable or not. My grid cells are significantly smaller than the minimum turn radius. I have an initial angle and location of the vehicle it seems I need to keep a current angle with each cell. With that in mind, I'm not quite sure when I need to reset reference point. It seems that I cannot do that every cell or I will only go in a straight line. I can translate that turn radius into a polygon (with several hundred sides) where each side length is the distance between my grid cells. I'm not sure how to use this, though.
16
What is the most appropriate path finding solution for a very large proceduraly generated environment? I have been reading quite a bit in order to make the following choice which path finding solution should one implement in a game where the world proceduraly generated, of really large dimensions? Here is how I see the main solutions and their pros cons 1) grid based path finding this is the only option that would not require any pre processing, which fits well. However, as the world expands, memory used grows exponentially up to insane levels. This can be handled in terms of processing paths, trough solutions such as the Block A or Subgoal A algorithms. However, the memory usage is the problem difficult to circumvent 2) navmesh this would be lovely to have, due to its precision, fast path calculation and low memory usage. However, it can take an obscene pre processing time. 3) visibility graph this option also needs high pre processing time, although it can be lessened by the use of fast pre processing algorithms. Then, path calculation is generally fast too. But memory usage can get even more insane than grid based depending on the configuration of the procedural world. So, what would be best approach (others not present in this list are also welcome) for such a situation? Are there techniques or tricks that can be used to handle procedural infinite like worlds? Suggestions, ideas and references are all welcome. EDIT Just to give more details, one should see the application I am talking about as a very very large office level, where rooms are generated prodecuraly. The algorithm works like the following. First, rooms are placed. Next, walls. Then the doors and later the furniture obstacles that go in each room. So, the environment can get really huge and with lots of objects, since new rooms are generated once the players approaches the boundary of the already generated area. It means that there will be not large open areas without obstacles.
16
Moving walkway in Three.js pathfinding algo or vector math ala Nature of Code? I am trying to develop a moving walkway for a 3D virtual space made in Three.js (link here). Right now guests navigate using WASD or the arrow keys and the mouse to look around. My goal is to have guests would navigate themselves onto the walkway and be moved along a path through the space, like a high speed lazy river. They could hop off any time once they reach their destination. I was planning on using vectors and adapting some steering behaviors code from The Nature of Code series (which is based on Craig Reynolds' steering behaviors). I would accelerate the user once they're on the path and keep them on the path using steering, until they move themselves off. I am curious if there is a better way to do this and determine the pathway. I checked out Don McCurdy's Three.js pathfinding work, but it requires that you build an external mesh in something like Blender and import that into Three.js, which I haven't been able to do yet. A lot of Blender's options have also changed since he wrote the tutorials, so it's hard to map. I'm all ears if anyone has suggestions.
16
How should I use Monte Carlo method to simulate some police cars that keep patroling in a tile based map? I have a tile map (isometric) and I have some police cars that they patrol all the time on the map, there is some building and other cars in map too so they are considered as constraints in my shortest path algorithm (below). I use to randomly select some target for each police car and use A algorithm to find the path to the randomly selected destination tile and this cycles over and over. because cars should move all the time! (except those that gamer should control) The problem is police cars routes are correlated and they do not just traverse the area randomly, for instance, they do not usually cover a same area or they do not repeat their own route so my implementation based on some random destination point wasn t a good idea and the result was not satisfying. Take a look at the following picture, it shows how randomly selecting the destinations worked for me, obviously, it is a dumb patroling for sure, even a cockroache could do better! Suddenly, I remembered Monte Carlo Method and I thought it would solve my problem, because it exactly does what I wanted to do, However may be I should use Zobrist Hashing since it is tile base in nature. Does anyone has any idea how should I use this kind of methods? Question in Brief How can I use Zobrist Hashing or Monte Carlo method to set destinations points for my patroling car (like police car)? If anyone knows another way to implement a patrolling method, he she is very welcome to post an answer, I am not sure if Zobrist Hashing is the best and worth to implement. First Edit (added following paragraph) I need to distribute the cars and their destination points in a homogeneous manner. Every kind of solution that get me close to a good pattern could be my answer, of course there is a lot of methods to do so, but I dont have any clue.
16
Aron Granbergs Unity Pathfinding AI goes back and forth The agent goes back and forth after calculating the path with seeker.StartPath (transform.position,target.transform.position, OnPathComplete) . The gizmo shows the correct path. Please watch this short video to get an impression on what happens. It starts after adding about 100 obstacles during runtime. Is this a known bug or am I doing something wrong? My test case is really simple. I can provide the project if necessary. Link to the Video http screencast.com t 2ww04975l
16
Path finding algorithms? I posted this question on stack overflow first, but I guess no one is very interested in video games there... What are some path finding algorithms used in games of all types? (Of all types where characters move, anyway) Is Dijkstra's used a whole lot? I would think not, as it doesn't actually trace out the steps to take to get somewhere, right? If I'm understanding it right, it only determines which object is the closest. 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'm basically looking for a quick overview of path finding in general. 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 blog.net archives 000152.html, which I hear is a great authority on the subject, but it doesn't really explain HOW, once the meshes are set, the path finding is done. IF A is what they use, then how is something like that done in a 3D environment? And how exactly do the splines work for rounding corners?
16
Construct flow field cost map from polygon geometry I'm looking into implementing flow fields for pathing large numbers of units across a map. From what I can find, flow fields are always constructed as a grid, and require building a cost map of obstacles and terrain levels. Edit Pathing cost will ultimately come from a variety of sources, not only the map geometry. However, map geometry was the only piece that comes from existing geometry, as opposed to being calculated on the fly. Other sources include Walkable areas of the map (including slopes but excluding cliffs and canyons) Player constructed buildings (which must be pathed around) Range limits (remote control units can not stray outside the range of the nearest control tower) Enemy attack range (resource gathering units may want to try to steer clear of the attack range of enemy towers, if possible) Player created waypoints (influencing the route units will take to get to a particular destination, to avoid enemy defenses or perform patrolling) Assuming I start with map geometry (not a grid), this would seem to mean that I would need some way of rasterizing my map polygons into the cost map. But is rasterization the best way to accomplish this? I'm assuming this is a solved problem, but have been unsuccessful in finding other options.
16
Correct way to handle A no pathing? I'm developing a little game for fun and I wrote a pathfinding system based on the A algorithm. What is the best or correct way to deal with unavailable paths? A by default will go through every node on the grid until it either finds the target node or it has exhausted all of them. This can become problematic if certain areas are cut off into "islands" and A tries to find a path there. The obvious solution might be to flood fill regions and check in advance, but the problem is that I plan for my world to be a bit dynamic new areas might appear, some areas which are accessable at one point might not be later, etc. Another solution I've read about is that I can limit the amount of nodes it's allowed to search before it gives up, but this sounds a bit hacky and something I'd like to avoid if possible if there are better ways, because it means that there could be a very long and complex path to the target but it'll still not find it just because of this limit. So how should I do it? I appreciate any help here, fellow devs!
16
Simple Stupid Funnel Algorithm (SSFA) for 3D Navigation tl dr I need an algorithm similar to SSFA except for portals with 4 vertices (or n vertices if an algorithm like that exists). I'm working on a game that requires pathfinding in 3 dimensions. By this I mean agents have full control over their position as opposed to many games where agents only control forward, back, left, right, and need to walk up stairs or ramps to go up and down. To do this I made a "nav mesh" using an octree that checks for collision at each region, and subdivides if there is a collision (until a certain cube size limit). So I now have a graph where each node is a cube with some size based on the octree. Using this I can run the A algorithm for pathfinding on the graph. Unfortunately, just moving towards the center of each node looks bad, and even moving towards the center of each connecting face of the node (the smaller of the two connected node's adjacent faces) looks bad. In the past, I've used the SSFA for path simplification, but it only applies to situations with an edge as a portal, not a face. Is there an algorithm for this, or is there a way to make my pathing look better? Ninja edit I'm already somewhat using steering behaviors, but since the center of nodes can vary wildly, based on the complexity of the octree, it still doesn't look nice.
16
How to proceed on the waypoint path? I'm using Dijkstra algorithm to find shortest path and I'm drawing this path on the screen. As the character object moves on, path updates itself(shortens as the object approaches the target and gets longer as the object moves away from it.) I tried to visualize my problem. This is the beginning state. 'A' node is the target, path is the blue and the object is the green one. I draw this path, from object to the closest node. In this case my problem occurs. Because 'D' node is more closer to the object than 'C' node, something like this happens So, how can i decide that the object passed the 'D' node? Path should be look like this One thing comes to my mind is that I use some distance variables between the two closest nodes in the route path. (In this example these are 'C' and 'D' nodes.) As the object approaches 'C' and moves away from the 'D' node at the same time, this means character passed the 'D'. However, I think there are some standardized and easy ways to solve this. What approach should I take?
16
Pathfinding and collision avoidance on mobile Currently I'm developing a Diablo like game for mobile platform(iphone5 ). A simple A search will find the path, but collision avoidance still needs to be taken into consideration. There will be about 50 monsters active at the same time, so performance is very important. I found some methods that might work. NavMesh RVO The recast detour library works well on the pathfinding part, but its crowd simulation quickly reach the limit(more than 5ms for 30 agents). Another library RVO2 seems fine(less than 2ms for 50 agents), but the library has some license issues. Flow Fields Physics Engine Many RTS games use this method, but it seems that a physics engine is required to resolve collisions. If many agents don't share a common goal, this method might cost more than traditional A pathfinding. Steering Behaviors Physics Engine Steering Behaviors includes many concepts, I think simple avoidance behavior might work(just turn left right if there is something in front) , but the method still requires a physics engine to work together. I'm still not sure which one to use, maybe there exists other pathfinding and collision avoidance methods. P.S. Halo Spartan Strike uses Havok AI(based on RVO?), but I didn't see many enemies in that game, so I wonder whether the first method(NavMesh RVO) will works well on mobile platform.
16
How can I better implement A star algorithm with a very large set of nodes? I'm making a game with nodejs in which many enemies must converge on the player as the player moves around a relatively open space (right now it is an open field with few obstacles, but eventually there may be some small buildings in the field with 1 or 2 rooms). It's a multiplayer game using websockets, so the server needs to keep track of enemies and players. I found this javascript A library which I've modified to be used on the server as a nodejs module. The library utilizes a Binary Heap to track the nodes for the algorithm, so it should be pretty fast (and indeed, with a small grid, say 100x100 it is lightning fast). The problem is that my game is not really tile based. As the player moves around the map, he is moving on a more or less 1 to 1 per pixel coordinate system (the player can move in 8 directions, 1 or 2 pixels at a time). In preliminary tests, on an 800x600 field, the path finding can take anywhere from 400 to 1000 ms. Multiply that by 10 enemies and the game starts to get pretty choppy. I have already set it up so that each enemy will only do a path finding call once per second or even as slow as once every 2 seconds (they have to keep updating their path because the players can move freely). But even with this long interval, there are noticeable lag spikes or chops every couple of seconds as the enemies update their paths. I'm willing to approach the problem of path finding differently, if there's another option. I'm assuming that the real problem is the enormous grid (800x600). It also occurs to me that maybe the large arrays are to blame, as I've read that V8 has trouble with large arrays.
16
when to do A pathfinding? I'm trying to build my first game, a really simple RTS like Age of Empires but I have a question about pathfinding. When do this kind of games usually do pathfinding? I've read some games do a global pathfinding once at game start but I'm not sure if that will fit this kind of games. Do they usually calculate pathfinding each time a game entity starts a new task and has to move? How do they handle when a obstacle suddenly appears on the path? Do they re calculate pathfinding on every step? Or do they check if the current path is clear on every step? Or they just walk the current path until they actually hit the unexpected obstacle? Actually if you know a link to a source code of pathfinding on some RTS game I would really appreciate it. Thanks in advance
17
Best practices for periodically saving game state to disk I'm working on an MMO. All of the player and environment data lives on a server and is kept in memory. There's a "world" object which keeps track of all of the maps, characters, etc. and their relations to each other. To avoid data loss in case of a crash, I've been periodically serializing the world to disk. The trouble is, this object can be quite large, so when the server starts writing, there's noticeable in game slowdown for a few seconds, which I'd like to avoid. Any pointers on how to go about this in a more efficient way?
17
game state update structure and distribution in MMO? I'm developing an MMO, which has to maintain a global game state. Now I want to distribute the updates, which the players make to this state, to players which can see those updates (area of interest etc.) Is there a common structure format for these updates and for a global game state? Like, every action a player sends to the server has to include a type, the coordinates etc. And are the updates, which gets distributed from the server to the players in the same format or are they different? Also should I include timestamps or use the receive time from the server to check which action came first and which sencond etc.? And what should I send back to the player if he send an invalid action?
17
MMO Some NPCs controlled clientside? I'm making an online game and considering whether to handle certain NPCs clientside. Is this common? For example I play Elder Scrolls Online and it seems basic townspeople NPC locations aren't quite synced up with my friends. I guess it makes sense if they're only wandering around in a set area for that to be handled clientside right? So my question is, should I go with this method, or are there any good reasons why I shouldn't? Any examples of games that do, so I can see how they handle it?.
17
Does TCP slow down server and other clients for MMO game hi guys i made a server and client for mmorpg game of course very amateurish. i am using UDP to send coordinates if the packet is lost doesnt matter i am already sending 10 times in a second. UDP doesn't slow down server and server doesn't slow down other clients. But i also want to use TCP for ID PW and attack skill because when i use attack skill he needs to go absolutely to server. If i use TCP for them, Will client1 slow down Server ? or Will Server slow down other clients ? i am using c ,opengl,SDL 1.2 and SDL net 1.2 I will be grateful for your help ) EDIT I ADD VIDEO D youtu.be J7Ulh4vUBu0 when only udp server loop 658982 in a second like at the end of the video if i add tcp this valuse slow down ?