Friday, July 17, 2009

Combine?

So it occurred to me that I could combine both of these together - processing each "fire" to figure out any given spots given temp, and pre-calculating a grids ambient temperature when a fire is placed.

The problem with calculating what fires effect a specific spot is it could by ANY fire, any place on the earth, if the fire is big enough. If I have a million fires, even if only 500 of them effect a specific spot, because of the range-calc of each fire, I don't see any other way, using this technique, to figure out the temp then get get all million can calc which is having a effect.

Using the grid makes it much simpler - instead of looking at individual fires when a locations temp is calculated, when the fire is placed, all grid locations that that fire will impact have their temp recalculated. Several layers of grids work together on this and a fires effect is only calc'd on the largest possible grid.

So, combining these two - when a fire is placed, figure out the appropriate level of grid the fire will effect (Global, regional, local, small, etc) and instead of pre calc'ing the temp on that grid, in those cells, just add a indicator that the fire effects that grid (and cells). When a calc is requested, find all fires that effected the current grid(s) of the current location, and then do a calc against ALL fires that have entries in that grid.

This has two very large benifts that the first grid techinque didn't have - once the list of fires is know, a real distance calc (location of both calc location and fires location and radius of effect of fire) can be made - so this gets us back a true gradiant. It will also allow a fire to expire or reduce over time (based on the current date, on the calc modify the heat level of the fire by how old it is and how strong it intiall was).

So this Combo calc will have a lot more overhead, but by combining the two techniques, I think it's do-able - and gets what I really wanted to stat with in the first place.

No comments:

Post a Comment