Tag Info

Hot answers tagged

2

As discussed in the comments above, you may be over-engineering this. If you have ~12 characters who could possibly be attack targets, iterating over all 12 and checking the distance (or squared distance if you want to be extra frugal and avoid a square root) should take a negligible amount of time. In typical situations you'll spend more time waiting to get ...


2

There is an algorithm that adds this in automatically. Instead of merely moving away from the player, each AI will target the closest tile that is "out of range" of the player, I'll use 4 tiles. In the case that the AI is running from the player in an open area, it will choose to just run. In the case of a corridor, the AI "knows" it would be risky to slip ...


1

For path finding, A* (pronounced a star) ought to fit your situation real nice (for people who don't know what binding of Isaac is, it's basically the original legend of Zelda). For avoidance, I can't think of any named algorithms, but I think it will basically be pretty simple to code up some heuristics (rules) to where if an enemy is in the path of a ...


1

If I understand correctly, what you want to compute is the spline's radius of curvature at each point. Then you want to compare that value to an agent's turning radius to determine if the agent will leave the track there. [1] To do this, you need to calculateR(s)as you see here: https://en.wikipedia.org/wiki/Curvature (under "Curvature of plane curves" > ...


1

I think problem is that you are using the size variable instead of the current count of the items that the array contains, in your for-loop. Example for-loop you should use: for(int i = 0 ; i < count ; i++) playerUnits.get(i).doSomething();. When you create an array, its default size is 16, even though it contains 0 items. As seen from the Array source ...



Only top voted, non community-wiki answers of a minimum length are eligible