Skip to main content
11 events
when toggle format what by license comment
Mar 12, 2016 at 0:16 answer added sam hocevar timeline score: 0
Dec 12, 2015 at 14:08 answer added Makcheese timeline score: 1
Dec 6, 2015 at 23:38 history tweeted twitter.com/StackGameDev/status/673647705202274309
Nov 21, 2015 at 21:02 comment added Peethor Once you have the dot product on all directions (or those that passed a simple pre-check), take the highest two (or just the highest if it's exactly 1. If they would both be equal, the weight would be 0.5 for both of them. Subtract the smallest from the biggest, divide that by 2, and add it to 0.5. That's the weight for the biggest. For the other, subtract it from 0.5.
Nov 21, 2015 at 13:02 comment added Cyborg @wondra: what I meant with different behaviours are any behaviours that could rely on having an ideal direction but also want to have some weighting for any directions that are off by some degree. I think you could use this for both approaching and fleeing for example, since both could be expressed in going into some direction.
Nov 21, 2015 at 12:58 comment added Cyborg @Peethor: would the dot product not give me the angle between the two vectors? What I'm interested in is, given an angle, the actual required direction vector and a length, what is the relation between the angle and the distance you are off from the ideal distance if you would have followed the actual required vector. I think there is atleast symmetry, as in, being 5 degrees off on the left side of the vector is the same as being 5 degrees off on the right side.
Nov 16, 2015 at 21:07 comment added Peethor Wouldn't this simply be accomplished by getting the actual required direction vector, and then calculating the dot product of your possible directions on that vector?
Nov 16, 2015 at 19:50 comment added wondra If you want different behavior you should specify what behavior you are after - if you don't, there is no correct answer. And for faster solution, I pretty sure there isnt better one that includes euclidean distance (there is for example squared euclidean distance or manhattan distance though).
Nov 16, 2015 at 19:28 comment added Cyborg @wondra: a faster solution is the primary goal since it will be performed quite often (likely also for other behaviours). But I'm also just curious.
Nov 16, 2015 at 18:04 comment added wondra What is your goal, a faster solution?
Nov 16, 2015 at 15:52 history asked Cyborg CC BY-SA 3.0