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]

The trouble with that approach is when two expanding events (explosions)
meet then you now have one event that is expanding in only one direction.
But you want both events to pass through each other and continue on
in their direction.

Maybe an approach where you cache the results of the most recent check
so if there is nothing that is vulnerable to effect on the square and
nothing on square has changed then use previous result of check.  So
you'd know you don't have to check square for anything of interest.
This might has a noticeable effect since some effects such as fireball
have a large number of fireball effects that pass over the same squares
in a short time period.

							sdw
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]