I am making an RTS game, and I implemented path finding with A*. My A* algorithm uses 8 directions and terminates early in the case of no path found (I use 50*the  vector distance between the unit and the point as the limit to dequeueing the fringe).  If there's no path then they will go to the nearest valid point to the destination.  This problem arises because a structure is bigger than 1 tile  I am having trouble now with attacking a structure, right now I have it so that it checks each "tile" of the structure, and gets the distance between the unit and the structure "tile".  Plus, it will see if theres a path from that tile to the unit, and if there is then the tile is  put in a priority queue, where priority is min distance.    Here, this can be a lot of path finding calls for 1 unit using this, the number of calls is dependent on the x*y size of the structure.  Here is a picture to illustrate (with the orange being the unit, red being barrier (that can potentially move) and the blue being the structure)    Here there will be 9 calls to path finder, 8 of them will fail almost immediately , 9 will produce the path from the unit in orange to the bottom right corner of the structure.     It can get much worse with an example like this:    Here there will be 6 path finding calls which could take a long time depending on the space between the unit and the structure.  So there must be a better way to path to a closest available tile of a structure without calling path finder for each tile in the structure and I need help with that.  How would I go about treating the entire blue region as the goal? My node only encompasses one tile, so would I need multiple destinations (so multiple f values)?
I've implemented AStar in Java and it works ok for an area with obstacles where the chosen destination is reachable.  However, when the destination is unreachable, the calculated "path" is in no way to the closest location (to the unreachable location) but is instead some random path.  Is there a feasible way to tweak AStar into finding the path to the closest location to an unreachable destination?
Number of ways to choose $n$ balls from $3n$ balls, distinguishable/indistinguishable. Books for self-studying time series analysis? Firefox doesn't launch in Ubuntu 13.04 Firefox starts when I use sudo in the terminal, but not from the launcher. All the other apps work like a charm, just not Firefox. How can I fix this? What determines SPECIAL inheritance in children? Alert on edit after a downvote I wonder if it would be possible to extend the current notification system.   Namely, if I downvote a question and that thing had an edit, I'd be happy to see that in my inbox. As possibly the cause for downvote was cleaned up and it should be undone. I understand that in a lot of big-lab fields it is common for the principal investigator to append their name to a paper even if they did not write the paper, design the experiment, or collect data since they spend energy securing funding, and managing the whole lab. What about for small labs?  What are the requirements for a supervisor to be included as an author on a paper, as opposed to just appearing in the acknowledgements? If you are working on your own projects independently of your supervisor, but using funding provided by your supervisor (how does this change when the funding provides resources versus just your salary), are you suppose to add them as authors or just acknowledge the source of funding? How to stack three relations Layover at Tokyo Narita airport: can I travel outside, and what kind of visa would I need? Can I use SharePoint Designer 2013 to edit SharePoint 2010 sites? Can I use SharePoint Designer 2013 to edit SharePoint 2010 sites?   Couldn't find this info in the web. Alt-click for edge loop Hi I am a complete newcomer to blender and am following this tutorial, where he says to alt+click to select an entire row or "edge loop". I have followed all instructions exactly up to this point (3 times to make sure!). Alt-click does nothing. Thank you for your help. p.s. If possible, please keep answers in simple layman's language. I see some similar posts about alt click and loop select but had trouble following since the explanations were too advanced. Thank you! Video starts where he demonstrates alt+click: How can I create a Windows bootable USB stick using Ubuntu? I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu? If $a$ divides $bc$ and $\gcd(a,b) = d$ then $\frac a d$ divides c I'm trying to prove that if $a$ divides $bc$ and $\gcd(a,b) = d$ then $\frac a d$ divides c. I tried using Bezout identity but couldn't get anywhere. Cannot replace a packed image in the uv image editor I was trying to replace an image in my UV image editor, but the image defaults to a different image. how do I fix this? Display the original, unedited post on the post editing page I edit people's posts occasionally on ServerFault when the grammar/punctuation/coherence goes below a threshold that my OCD can handle. However, on some of the thornier posts I would like to be able to compare my edits to the original text, especially when doing a final proof-reading of my edits.  At the moment, my only options are to either copy the original text into a text editor or copy a duplicate of the text into the editing field. From there I can compare my edits to the original text and make sure I'm preserving the original meaning as I attempt to untangle less than optimal communication.  This request is somewhat similar to this Meta post: "" How to withdraw your paper from an open access journal where it has been accepted? My paper got accepted in a mediocre open access journal. However later I found out that its publishing fees was too high.   What would be the correct way of asking a withdrawal of your article from the journal? Laptop w/o battery US bound flight? Need clarification on the Draw 4 rule. - Player 1 lays down a Draw 4 Card and says the color is Red. - Player 2 does not have a Red card but has a Draw 4 Card. Can Player 2 lay down his Draw 4 Card and have Player 3 draw 8 cards? induction with 2 recursive sequnces I'm having trouble solving this problem. I have relation for two sequences of natural numbers.   $$a(n)+\sqrt3\cdot b(n)=\left(1+\sqrt3\right)^n$$  and I have to prove that recursions:  $$\begin{align*} &amp;a(n+1)=a(n)+3b(n)\\ &amp;b(n+1)=a(n)+b(n) \end{align*}$$  will satisfy relation mentioned above. I tried solve it using induction but I failed. Can anybody help with some other ideas? Always wanting more , of anything, never has enough,never contented with what they have At what age does a toddler stop being a toddler?