adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] Re: Pathfinding terrain costs, thoughts and changes


From: Frederico Cerveira
Subject: [Adonthell-devel] Re: Pathfinding terrain costs, thoughts and changes
Date: Sat, 22 Aug 2009 18:25:14 +0100

And finally, I made a change to keep the speed constant while the
character is jumping. I don't think terrain should have any effects
while the character is not actually touching it.

Guess that's the right thing to do. At first I thought that it should change as you jump but now I agree with you. I mean you are above the terrain after all.



there were two
calls to speed() that ignored the return value.

Yes. One of them was called when jumping, and now that I think about it there was absolutely no need for it to be there :(. My bad.
The other was called on character::update and had the objective of updating the speed when you're walking over different terrains without releasing the key. (Ex: If you start on wood and then press the down key without releasing it, when you get into the high grass you'll keep the same speed that you had on the wood). Though now that I test it further I realize that it had no effect at all, and there was also no logical expectation for it to have. My bad twice. (I must have wrote that on a really bad day)
As far as the last point is concerned your fixes have corrected it, so we're good.



And I have arrived at a different solution.

Glad you did. I myself wasn't too happy with the one I got.



>From a technical perspective, relying on inlined code to avoid
circular dependencies between the rpg and world module is dangerous.
Ultimately, it's the compiler that decides to inline code or not, so
things might break in the future or with different optimization
settings.

Agreed. I was somewhat doubtful if this would compile under Windows. Just as a matter of curiosity, have you tried and did it work?



So if we'd have to decide on a unidirectional dependency between rpg
and world, I would feel that world should have access to rpg but not
the other way round.

The way it is now is really arbitrary, no particular reason for it to be that way.



So as a conclusion, rpg should be linked into world, the opposite of
what we have now.

Does that hold up? Or did I overlook something? Suggestions?

Seems good to me. Better than what I got.


which I'd probably would
call species, as creatures and animals need be considered as well

Good point.


As far as implementation goes, the plan is to do everything that is
gameplay relevant in Python to allow (easy) customization of the rules
system. So I wouldn't have written a "race" class in C++, I guess.
OTOH, things like speed which need to be updated each frame for all
the characters would be too costly to do in Python. The trick here
might be to make speed a property of rpg::character (for simple rule
systems it could be set to a fixed value, like the current base speed)
and decouple reading and actual calculation. Then, calculation could
be done on Python side based on the rules implementation and could be
triggered by either player interaction (casting a "haste"-spell, etc.)
or by world::character, but only when the terrain actually changes.

Whatever increases flexibility and customizability is welcome. However there's a litlle problem. I don't know Python.
So should I start reading some Python tuturials and then try to convert the Race(Species) class to Python, or do you want to do it? Since you already have stuff on your hands I wouldn't mind anything at all to learn Python, (I have heard great things of it :-) ) and it would have other uses in the future. OTOH it would take more time to implement this particular feature than normal.



So far you have tied pathfinding to the race (...) Why not tie it to individual characters, so that a Forestkeeper
might not mind taking the direct path, even if it leads over swampy
ground, whereas a noble would avoid to step onto a patch of dirt at
all costs

Seems good too.

PS: Just so you know, I'll most probably be away of the Internet this weekend

- Frederico Cerveira



reply via email to

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