Level Of Detail AI

Hi all (mainly shmooh :P) :

Ive changed AgentAction back to an abstract class mainly to add this feature in. What happens now is that its constructor takes an int as an argument.

That int will be checked (by the user) during the doAction(float time);

Speaking of that, that also has changed to doAction(int lod, float time);

the lod will be the LevelOfDetail of the entity that has called that action. so its just a call:

public void doAction(int lod, float time) {
  if (super.getLevelOfDetail() <= lod) {
    // do the action here

And thats basically it! Ofcourse you would have to keep managing the entities and setting their Level Of Detail too (probably the further away they get, the bigger the lod becomes).

And thats all folks, NEXT!


i think i may have rushed this feature. Ive reverted back to AgentAction being an interface. Sorry ://


I think that lod is important for ai, and a system to handle it should be made a priority.

Just to make shoure we are on the same track, lod is a system that gives less time to handle calculations to Agents that are off the screen and even less time to agents that are off the screen and far away.

Just be careful how much you remove, It would look terrible if you left a ai character that was supposed to wander only and come back only to fined it in the exact same place. Or in a rts have a battle frees because all the units stopped fitting when you left the battle. I am assuming that lod will be optional.

the removal of certain calculations will be up to the user of my API to set. If you set them all to say…-1, they will never be removed.

And ofcourse LOD will be optional