Are the algorithms a* and pathfinding a* the same? - path-finding

I also want to ask another thing, I'm making a game and inserting a pathfinding a* program into the game, but there is one side where the enemy is stuck in a dead end when they want to chase me. The enemy will come out from a dead end, if I change positions. Does the a* pathfinding algorithm fail or is that the result?

Related

Linear programming to find a graph circuit

The question itself is pretty simple... This is a vechicle routing problem.
I have a directed graph
I need to get a linear programming model that will somehow tell me the shortest circuit that visits all nodes, and starts and ends at the star. You are allowed to go over an edge more than once. A node is any crossing on the image.
We had like 4 hours of this in class, I have no idea where to even start...
I'm not expection anyone to give me the full model, but I was hoping someone would tell a strategy so I could do this.
Thank you in advance.
I would start from Dijkstra's algorithm for undirected graphs. There are some variants with similar or better performance. Take a look at https://en.wikipedia.org/wiki/Shortest_path_problem#Undirected_graphs, pick a choice, and keep us informed ... :)
The answer here seems to be very easy. (That is, very easy in theory, very hard and a lot of work to code in practice).
This seems like a straight-forward TSP (Travelling Salesperson Problem). Read about some general literature on TSP. You need to set up and solve a TSP where your nodes are the "cities" in a TSP. You also need to include your star as a city in the TSP.
The Dijkstra algorithm will not give you a solution. The Dijkstra algorithm is used for finding fastest/shortest paths between a node and other nodes in a (typically road-) network. However, distance-wise your problem is super-simple: Getting the cheapest travel cost (and path) from one node to another node in your problem is (almost) trivial.
If you are to solve this problem "for real" (not just discuss it), you need to acquire a TSP solver that is able to take your network (both edges and nodes) as input. Your input needs to specify which edges are directed and which are uni-directed. A lot of work in practice: Even if you use a tool, you still need to familiarize yourself with the tool.

Pathfinding to a moving target

Working on a recent project I wondered how to find a good/perfect path to a target that is moving with a steady speed. I tried standart A* pathfinding but it failed, since the heuristic will be wrong the more the object moves and I just canĀ“t find a way to make that work for me. Maybe you guys got another algorith that should work with just fine or some calculation tuning with A* that would work...
Thanks for your afford :)
A* should in general work, but then of course you need to recalculate every time the target moves. For 99% of cases, this is actually ok. For example, in video games you can get away with only recalculating the best path once every second or so, so it's generally not a huge performance hit.
However, if you really need something more powerful, check out Generalized Adaptive A*, an algorithm specifically designed to handle moving targets. And if you really want to be on the bleeding-edge, there are multiple adaptations of GAA* that are faster in certain cases - see this post (under "moving target points") for more details.
Using A* with a moving target is ok, but you must recalculate the whole path again. I don't think A* likes just having it's destination / goal changed.
Your A* needs to be very well optimised to run in real time and recalculate the new path every time the target moves.
Remember to play with your H to get a balance between working out the shortest path and the quickest to calculate. All depends on your map and obstructions really.
However A* may not be the best path finder for your application, but I'd need to see your map and more info..

What's the best method to implement multiplayer on a Unity Billiard game?

I'm making an online billiard game. I've finished all the mechanics for single player, online account system, online inventory system etc. Everything's fine but I've gotten to the hardest part now, the multiplayer. I tried syncing the position of each ball every frame but the movement wasn't smooth at all, the balls would move back and forth and it looked "bad" in general. Does anyone have any solution for this ? How do other billiard games like the one in Miniclip do it, I'm honestly stuck here and frustrated as it took me a while to learn Photon networking then to find out it's not that good at handling the physics synchronization.
Would uNet be a better choice here ?
I appreciate any help you give me. Thank you!
This is done with PUN already: https://www.assetstore.unity3d.com/en/#!/content/15802
You can try to play with synchronization settings or implement custom OnPhotonSerializeView (see DemoSynchronization in PUN package). Make sure that physic simulation disabled on synchronized clients. See DemoBoxes for physics simulation sample.
Or, if balls can move along lines only, do not send all positions every frame. Send positions and velocities only when balls colliding and do simple velocity simulation between. This can work even with more comprehensive physics but general rule is the same: synchronize it at key points. Of course this is not as simple as automatic synchronization.
Also note that classic billiard is turnbased game and you do not have all the complexity of players interaction. In worst case you can 'record' simulation on current player client and 'playback' it on others.

Move prediction in a chess game?

Is it possible to find the pattern of a chess player and predict the most appropriate next move?
Is there any algorithm can solve this problem? Can you suggest any reference to find out the algorithm.
You could try it with this http://en.wikipedia.org/wiki/Computer_chess#Leaf_evaluation and http://en.wikipedia.org/wiki/Evaluation_function and also take a look at http://en.wikipedia.org/wiki/Deep_Thought_%28chess_computer%29
Maybe that helps...
Programmer Puzzle: Encoding a chess board state throughout a game
Chess game in JavaScript
Is there a perfect algorithm for chess?
This could help, technically there's no computer with power enough to solve a chess problem perfectly.
search more on stackoverflow for more views !
To a degree. An easy means of prediction in AI is the use of Case-based reasoning agents.
Assuming your chess pattern detector has been trained on a fairly large number of games, it will indeed be able to guess an opponent's moves based on current board state and previous moves. The correctness of its suppositions are of course dependent on how many games it has been trained on, as well as the content of games it has been trained on.

Intersection of a line - game development

I am creating a game where I want to determine the intersection of a single line. For example if I create a circle on the screen I want to determine when I have closed the circle and figure out the points that exist within the area.
Edit: Ok to clarify I am attempting to create a lasso in a game and I am attempting to figure out how I can tell if the lasso's loop is closed. Is there any nice algorithm for doing this? I heard that there is one but I have not found any references searching on my own.
Edit: Adding more detail
I am working with an array of points. These points happen to wrap around and close. I am trying to figure out a good way of testing for this.
Thanks for the help.
Thoughts?
Your question has been addressed many times in the game development literature. It falls under the broad category of "collision detection." If you are interested in understanding the underlying algorithms, the field of computational geometry is what you want.
Bounding rectangle collision detection in Java
Collision detection on Stack Overflow
Circle collision detection in C#
Collision detection algorithms
Detailed explanation of collision detection algorithms
Game development books will also describe collision detection algorithms. One book of this sort is Game Physics by Eberly.

Resources