Post news RSS basic obstacles avoiding implemented

basic obstacles avoiding implemented, also target seeking behavior

Posted by on

for the past few weeks or so I worked on implementing some behavior for target seeking and obstacles avoiding, and after poking around for a while, I ran into Eugene Zatepyakin's work

the result is basic and far from perfect, but functional nonetheless. Currently when the player clicks, the 3-D coordinates are evaluated, if the click is on the path, a blank hidden character is created and positioned at the same coordinates as the click, and all the other NPCs are treated as obstacles, while the blank hidden character is set as target for the seeking class. The behavior is the same if the click is on an NPC, said NPC becomes the target for the seeking class, and the remaining NPCs on the map are treated as obstacles.

So far in my tests I didn't test moving obstacles, but the class is implemented to evaluate the NPCs position per frame and the difference between source character and target character also per frame, so ideally it should work just fine. :-)

TO DO: for some reason I'm reluctant to use physics, unless I learn of a specific benefit that comes from implementing physics, I'll make due using classes such as the above. Also, some rotation when avoiding obstacles may be nice


Nice work, keep it up.

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.