[airstrike] Re: Goal oriented gameplay (was: generators, triggers and aiming)
Eero Tamminen
eero.tamminen at netsonic.fi
Mon Jan 10 17:11:25 EST 2005
Hi,
> > * Make everything in Airstrike an object: ai, trigger, generator etc.
>
> I am working on this now. I suggest we do not implement generators etc
> until this work is done (maybe tonight).
I'm in no hurry, there's a lot to do. :-)
> > * Add types to objects:
> > - Member for the object type
> > - Parent link that points to parent object type
> > - Helper function that traverses the type tree to root and checks
> > whether object or it's parent type had requested type
>
> I have checked in my solution to this to src/core/object.[ch]. It's
> not used anywhere
> yet though. I solved the typechecking with the function
>
> void *obj_ref(void *object, object_type_t *assumed_type);
>
> which must be used to take a reference to an object. This function may
> check if the object is of the assumed type (or inherits from that type).
>
> > * Note: Sprite capabilities and attribute checks are handled with
> > messages (e.g. MSG_IS_WALKING). This is needed by triggers
>
> We could also use the (currently underused) enum sprite_flags field
> of each sprite. Currently it has only one bit used.
>
> src/engine/sprite.h
>
> enum sprite_flags
> {
> SPRITE_PAUSED = 1, /* animation is paused, movement is still allowed
> */ };
>
> > * Add to object type struct counters for how many objects (sprites) of
> > the given type have been created and killed (live = created - killed).
> > - Modify these counters when objects are created/killed
>
> This will be automatic with the new object system.
>
> > - Add clearing of these stats to and call that on level load or
> > unload.
>
> This we will have to implement, although it should be really simple to
> do in objects.c.
>
> [snipped a lot of items]
>
> > I think this will be fairly straightforward to do with the new object
> > system, but it will require quite a lot of work...
>
> yeah, you are right. But it's doable.
Yes, and I think surprisingly many things are even easy to do, there are
just a lot of them. :-)
Btw. Did you check the player generator stuff? We might have some stuff
like:
struct player {
char *name;
ai_t *ai;
int alive;
}
/* Globals
*
* Airstrike command line parsing sets the names and AIs for players and
* the player generators use this to set the AI for the player sprites when
* they are created.
*
* When player generator is activated, it sets the corresponding player as
* alive, and when generator player count runs out, it sets player as not
* alive.
*
* playeralive/playerdead triggers follow the alive counts on this list and
* set level done/fail flags accordingly.
*/
struct player global_players[MAX_PLAYERS];
- Eero
More information about the airstrike
mailing list