[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Adonthell-devel] Re: Pathfinding terrain costs, thoughts and chang
Re: [Adonthell-devel] Re: Pathfinding terrain costs, thoughts and changes
Sat, 22 Aug 2009 22:34:53 +0200
On Sat, Aug 22, 2009 at 7:25 PM, Frederico
>> 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
> Agreed. I was somewhat doubtful if this would compile under Windows. Just as
> a matter of curiosity, have you tried and did it work?
I can only test that once I'm back at work on tuesday. I'm quite
curious about that as well, but I believe it should work.
>> 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.
Please go ahead then :-). Picking up new things is part of this
exercise, after all. And Python in itself isn't too difficult.
There's also some Python code to expand on, currently all under test/.
Specifically, characters/character.py is a very, very incomplete piece
of code where things like race/species specific settings/rules should
tie in. (Right now it only handles part of the player interaction with
Stuff the engine requires, like the speed variable for the character
should probably live on C++ side, but actually updating the value
could be delegated to Python. A more complete example of the desired
design is the item implementation in src/rpg/item.h and
test/items/item.py and the classes derived from that, although it
actually does store most variables on Python side.
At any rate, if you have questions about Python (or SWIG, should you
need it), let me know. I'll keep my hands off the stuff and go back to
the modeller. But I'll be happy to discuss implementation details or
look over some code, should the need arise.