adonthell-devel
[Top][All Lists]
Advanced

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

Re: [Adonthell-devel] pathfinding & walking


From: Alexandre Courbot
Subject: Re: [Adonthell-devel] pathfinding & walking
Date: Sat, 10 Aug 2002 16:33:30 +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.

Wow! Considering that the drawing operations are already quite huge, and
how short is the bubbles handling code, do you realize what an
improvement it is already?

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

Oh, right. Needless to say, that the new map engine will probably not
need a pathfinder update function to be called like that.

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

That's cool! :) Just tested it, it works like a charm on my box. Well, I
guess that event-driven Python scripting is *the* right thing to do.
When you think about it, it's much more fair than running the same
scripts continuously. Not only performance wise, but design wise also. 

I haven't looked much at the code yet - but it seems that in fact,
everything runs exactly the same from the player's point of vue, right?
This is really well done. Especially the fact the schedules classes
inherit from the speak class, I like it very much!

Something however: enter the inn and press escape to bring the menu. As
you will see, speech bubbles will continue to appear. Well, this is
nothing very serious to fix I guess.

See you later! I'll post something this evening about the new map
engine. I'm just making the base document of the polygonal map objects
definition, and it seems to work beyond all what I expected! I have a
Python implementation of polygonal collision detection working, and will
just write down the principle, theory and maths to see where
optimizations can be done. Anyway, I'm coming with something big this
time! (no bad interpretation please ^_^)

Alex.
-- 
Developers developers developers developers developers. Developers
developers developers developers developers developers developers
developers developers! ...
            - Steve Ballmer, Microsoft CEO




reply via email to

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