Wednesday, April 8, 2009

Plague Line of Sight

So I was talking with a friend, Rowan, and he suggested that I store line of sight data on the grid instead of calculating it for sims. This is an obviously good idea so I've been spending my evenings coding that up. 

It's done now, and Plague is substantially faster than before - to put some numbers behind that, I used to get about 3fps with 400 sims, now I get 14fps.
The grid code has also been substantially tidied up which is nice because it used to be a bit convoluted. I'll be tidying up the remaining parts of the code tomorrow night. I'll upload v3.28 when thats done. 

After that I'll retackle the problem again seeing how much I can pre-calculate and store as a data file so that calaculations at runtime are minimised. I'll also add an option (in the options menu) to calculate map LOS during map startup - at the moment stuff is only calculated on an as needed basis, which is nice, but pre-calculating leads to the fastest Plague experience when you are playing. 

No comments: