Re: LOS Gadget, v. 0.1
Posted: 21 Dec 2008, 10:54
In Spring, the unit updates itself in SlowUpdate. So there isn't really a search for units. The los bits in a unit are just an optimization to not have to read the los map at unit->pos everytime a unit / weapon / command AI needs to know whether that unit is visible.Argh wrote: When we get done making a LOS map... we need to iterate through the Units in those sectors, and, if Visible, set their LOS state and mask. That is a "search", to me.
The 100% overlap is in the rays casted for one single unit.Lastly... Tobi said there's 100% overlap. Did that take into account re-attempts to set the LOS state / mask that update? If not... well, depending on the mip level, you're probably talking about up to 900% overlap for that part. Sure, each pass is fast, you're just checking a bit state and mask. But... get 1000 Units on a map, it gets cumbersome, fast. World Builder is a situation where you're going to see that... a lot.
Indeed if you put 10 units next to each other you probably get close to 900% overlap. The bit state and mask things really haven't any negative performance impact at all. The expensive thing is 'just' maintaining the los maps for every team. Reading the los map at unit->pos and storing the result in the los bits is just an optimization (see above).