Tag Info

New answers tagged

4

Imagine you're travelling from A to D: The distance from A to C + the Manhattan distance from C to D (which is equal in this case to the distance from C to D) is less than the distance from A to B + the Manhattan distance from B to D. I haven't included numbers, but hopefully this is apparent from looking at it -- the Manhattan distance from B to D is ...


1

I've seen some people address this by having AI mark the path they plan to walk on as more expensive for other AI. This has the effect of some avoidance between agents but since it isn't time aware (the future path is more expensive always, not just when the agent will be there in the future) it can make some odd behavior if it is too strong of an effect. ...


0

Panda Pajama answer is pretty good. Basically the question comes down to what is the minimal amount of data you can send that will put multiple clients in the same awareness of each others state, and how do you handle the lag where during that lag clients might be in a different state. So procedurally generated, where all the interactions are known before ...


3

A* operates fundamentally on a graph, not a grid. When you create a grid for A* to search, what you've actually done is created something called a "lattice graph." The connections between nodes in the lattice can be anything. They don't have to just be straight lines between neighboring grid cells. In your case, you can combine the best of both worlds just ...


39

I've worked on the networking code for two real time AAA networked games, one for smartphones and one for a handheld console. To directly answer your question "why", well, some games use one or the other because it suits them better than the other. This depends not only on the type of game, but also on what type of network we're talking about (linked arcade ...


3

I have no insight on Valve's development process, so this is purely my opinion, but: Interpolation: I'd say it'd be better for fast paced games, like FPSs for example, where having a consistent position for an enemy on time across players is important. Interpolating means that, even if some packets are dropped (AFAIK, most multiplayers FPSs use UDP instead ...


1

Depending on your implementation and needs, this may not work for you, but one method is to use Unity Navmeshes. The way Navmeshes work is that you select the portions of the level which you want your runner to be able to move in and then bake them. This will then define where your runner can move. You will need to add a NavMesh Agent to your runner. The ...


1

If you end up having to roll your own, the common solution to having objects on paths (cameras moving over time, objects moving over time, cars driving in traffic lanes) is to use curves. Here's a gentle intro to 2d bezier curves I wrote that you can easily extend to 3d. http://blog.demofox.org/2014/03/04/bezier-curves/ ...


0

Essentialy A* needs to be configured with what is not an accessible tile , so you can configure that by making an algorithm using gameObjects 'surface taken on the terrain then calculate the tiles to avoid at runtime .Then add it to the closed list (if there is not something for that already )


1

It's not a massive change, just instead of current_node == destination it will be destination_set.contains(current_node). Otherwise you can reverse the search, go from the endpoints to the start. That way you can use A* (given a proper heuristic). You just need to start with all endpoints in the starting set.


0

Cant comment so Ill leave as answer instead. I like the implementation of A* from this page: http://www.redblobgames.com/pathfinding/a-star/introduction.html. It goes step by step on how to build a path finding algorithm from the simplest and gradually increases complexity. I scanned over your implementation and it is not clear to me where the bug is. But ...


2

AStar is a suitable algorithm and can easily accomplish what you're describing. It all comes down to either applying a set of rules or costs to the various connections between the nodes in your world(graph). For example you could just have a bit of logic code in your TryGetNeighbours function call in each step of your pathfinding algorithm [untested code ...


2

Yes it can. You just have to create a method like "CanIMoveFrom1to2(currentNode, targetNode)". Then in A*, before analyzing that node any further, just check if its walkable from this node, if not, discard it, if yes then add it to open list.



Top 50 recent answers are included