Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Crossfires future.



>  With a big conglomeration, these objects need to start piling up (ie, a space
> might have a couple lightning bolts and a couple fireballs, so when another
> lightning bolt moves on top, it now needs to traverse all those objects also.)
> 
>  I am not sure if there is a good solution to this.  Seperating out living and
> non living objects per map square gains nothing, as you need to check the non
> living objects for things like sword or other things that might burn up, and
> the living space for things like monsters..

I had this kind of problems with a game I am making, it's a simple
kill-everybody-with-bombs game. The solution was to combine multiple
"explosion" objects to one, so when create_explosion() is called:

1) check if explosion is here, if yes, add damage to it and exit
2) otherwise create new explosion

There's a table damage_per_tick[ticks], and only relevant parts of that
table are modified by the stage 1, so that when the first explosion stops
the damage is reduced. This caused a dramatic speedup in the game.
I'm not sure whether this is feasible in crossfire though..
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]