Tag Info

New answers tagged

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

if you haven't already gotten this figured out, a simple way to do it without complicated path-finding is to check the position of all of the enemies vs yours. If the enemies are below you position, move them up. If they are too far to the left, move them right. It's as simple as that. Example: foreach (Enemy enemy in enemies) if(enemy.x > player.x) ...


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 ...


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

Looks like you want to implement stteringbehaviours. Take a look a chapter 3 of this book. I think it would make your game look more natural if you implement it this way.


0

In the words of one Icefox here, Collaborative diffusion using agents and an anti-object is useful for when you are not trying to find a path from a specific node to another specific node. ...Confirming my suspicions as given in the question's example situation. The meaning being that when you need a member of one group to find any member of ...



Top 50 recent answers are included