adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] pathfinding & walking


From: Kai Sterker
Subject: [Adonthell-devel] pathfinding & walking
Date: Sat, 10 Aug 2002 14:23:21 +0200

So far I've made the NPC speech bubble thing event-driven. It works
pretty well, although I had to make some small changes to the event
system. Especially the time_events weren't raised often enough. I did
some crude measurements. With the old scripts, one complete
mainloop+drawing took about 625ms. With the new schedules it takes about
550ms.

Now I want to do the same with the walking, because then the schedules
need not be run permanently, but only when needed. However, the
pathfinding code does not allow for this, as there need to be regular
calls to mapcharacter::follow_path to make the character actually move.
I intend to move this to C++ side (some sort of general moving class).
It will be possible to set a callback to get informed when the goal is
reached or the path is blocked.

That way, there is no more need to run any schedule. Instead, a schedule
will have a number of callbacks that are registered at construction
time. The callback could then re-register itself if neccessary. This is
for example what happens with the speech bubbles.

I commit what I have so far. Update your code and data, then you can see
for yourself. Just look at a character schedule of your choice and the
new schedule.py 'meta schedule'.

Kai
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]