[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Advent-devel] uses of advent
From: |
Ingo Ruhnke |
Subject: |
Re: [Advent-devel] uses of advent |
Date: |
29 Oct 2002 15:12:15 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
"Frank W. Samuelson" <address@hidden> writes:
> Not to push, but when do you think you might work on this again?
> This code seems to be the best available adventure game engine for
> Linux out there, especially for the types of games I'd like to put
> together.
Hm, I can't really tell, at the moment am quite busy with Pingus. I
definitively will get back to this projects, but I don't really know
if it will be in a month or only in a year.
Even so Advent works basically, it has many many ugly quirks and not
very well designed pieces of code, its also pretty incomplete in a
number of regions. Once getting back at it I would probally start to
rewrite huge parts of the C++ part of the engine, since its not really
the best code and lots of the Scheme/C++ bindings could be generated
automatically by Swig. I would also like to move huge parts of the
code to the Scheme side and only keep basic drawing and input on the
C++ side. Another thing that really needs to be done is a split
between scenario descriptions and game code, so that one can easily
create a editor (or Gimp export scripts) for scenario definitions,
while not touching the game code.
> How difficult would it be to define a sort of generalized region
> trigger defined?
It should be relatively easy once familar with the code.
> For example, a door would be a specific kind of trigger region that
> changes scenarios.
Doors are at the moment a special kind of object, which triggers a
scenario change if the person reaches the doors hotspot.
Region-triggers shouldn't be necesarry for normal doors, only for
auto-opening StarTrek like ones.
> Could you give me a quick pointer to the location in the code to
> do this? Thanks.
One would have to create a list of trigger objects in the Scenario
class which then get called on Scenario::update() and which can check
there if the current_person is at a given position and trigger a
scheme function if that is the case.
Trigger object might look like:
class Trigger {
privtae:
SCM* callback_func;
public:
void update(Scenario* ) =0;
}
class RectTrigger : public Trigger {
private:
CL_Rect rect;
public:
void update(Scenario*) {
if (rect.is_in(ScenarioLayer::current_person->get_pos()))
gh_call1(callback_func, current_person.get_scm());
}
}
So after all trigger objects themself are not a problem to create, its
more the memory handling and the double-bookkeeping on both the Scheme
and the C++ site that will give a major headache here and there if one
works with the code.
I can implement the trigger-regions if you need them, but have you
actually tried to start using Advent or are you just looking around
for libraries/engines that might get the job done?
--
WWW: http://pingus.seul.org/~grumbel/
Games: http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: address@hidden
ICQ: 59461927