PVI Quad in Visual Basic
Posted on 2003-02-27
I'm working on a terrain visibility model. It currently works very well, but I really need to optimize it. I have a height map that is 1000*1000. I am currently doing line of sight calculations in real-time, however with 64 players on the terrain, doing calculations every turn, the overhead is tremendous. Each calculation can be up to 1400+- iterations per test. There are 32*32 tests per turn. This is 1,450,000 iterations per turn. I would like to precalculate the line of sight iterations, but can't simply do it to an array- To do it with an array of bytes would require a Gig of memory. My C++ gurus have recommended a PVI Quad algorithim, which I understand conceptually, but haven't written one. Can someone show me this or any other algorithim to help me speed up this process? I've scoured the net and come up empty handed.