[crossfire] mapguide/director question

Alex Schultz alex_sch at telus.net
Thu Sep 15 02:32:22 CDT 2005


Mark Wedel wrote:

>
     
      So if you fire across the world maps, there will only be a few objects 
     
     >
     
      on each space the meteor has to check against.
     
     >
     
     
     >
     
       In comparison, in the director loop, it has to check on all the 
     
     >
     
      objects on the space, which is considerable (all the other meteors).  
     
     >
     
      And you have a whoel bunch, so this is happening a whole lot.
     
     
You seem to be implying that the meteors checking for other objects is 
the issue, however from what I've found in profiling it's all the flames 
checking all the other flames to see if they are a counterspell seems to 
be about 2/3 or so of the time. From what I've saw, most proposed 
solutions to this involved merging the flame objects so there's only one 
layer per square, however this would greatly complicate how they 
disappear and how the damage of each changes. However believe I have 
thought of a solution that would take much less effort and would shave 
off the time it takes for the counterspell checking:
Have a "countermap" which lists the number of counterspell objects on 
each square of a map, when one counterspell object is added, it adds one 
to the correct spot in the array (or whatever data structure it is), and 
when removed counterspells subtract one from that spot on the array. 
Then the big loop that currently goes through every object on the square 
for counterspells only has to quickly check the "countermap". This does 
not completely get rid of the issue, though I feel this solution is the 
most efficient in gain vs. complexity.

>
     
       So at some level, it isn't any worse if there is only one meteor 
     
     >
     
      going back and forth . But if you have 100 going back and forth, that 
     
     >
     
      hundreds of times worse than if those were being fired across an open 
     
     >
     
      map.
     
     
However, assuming it's the flames that are the big part of the problem 
and not the meteors themself, when they explode, they will explode in 
the same place and all the flames would have to check eachother being 
counterspells just as much as when the directors were affecting the meteors.

Anyways, based on these results though, I would say that the circular 
spells thing should be fine so long as the changes to directors I'm 
making make it so meteors and other more potent ones wouldn't be 
affected by the directors.

Alex Schultz

    
    


More information about the crossfire mailing list