Hello everyone!

I just added a nice feature to the pathfinding package: movement smoothing. The .dll can now handle turning your entity for you, and will smooth out the turning radius so it looks more natural.

The new download package contains a demo of this functionality.
http://www.gamebeep.com/freebies/ez_path_src.zip

ALSO NOTE!! The new package prints out a "TRIAL VERSION" message on your screen. The inexpensive ($10??) non-trial version will be spam-free.

In short, here's how the smoothing works:

Code:

// Call pf_to_ent. This pathfinding routine takes two entity pointers as
// arguments. They are the source and target entity. The routine calculates
// the shortest path to the target, and sets the direction that the source
// entity needs to go in order to reach it's target.
// (See documentation for more information)

pf_to_ent(my, dst_ent);


// If I weren't using pf_smooth_turn, this is how I would turn my entity to
// face the correct distance:
//
// my.pan = my._PF_PAN_TO_TARGET;
// my.tilt = my._PF_TILT_TO_TARGET; // <- don't set for first person shooters
// my.roll = my._PF_ROLL_TO_TARGET; // <- don't set for first person shooters

// Call pf_smooth_turn to have the pathfinding .dll turn your entity for you
// in the direction of the next target node (or target entity). If you decide
// to use the pf_smooth_turn feature, you may wish to increase the node
// collision distance by calling pf_set_node_collision_distance(); Increasing
// the node collision distance will result in the actor starting it's turn
// earlier, which is a good idea if the turn takes longer because of the
// smoothing.

turn_speed = 10 * time;

pf_smooth_turn(my, VECTOR(my._PF_PAN_TO_TARGET,0,0), turn_speed);




Currently, pf_smooth_turn only works on the .pan of an entity. Future versions will also smooth tilt and roll, which could be helpful in games where 3d movement is possible.

Cheers!
- Bret