1) There is no advantage in scanning out-of-range ships.gnasirator wrote:For the range, why not scan all ships in a sector at once?
2) There could be 300 enemy ships in the array produced by "find". MCSI is an interpreted language, so *everything* is slow... especially arrays of variant data type (which is all MCSI arrays). Multiply this by 40 or 50 UT's and Galaxy Explorers, and you have potential to slow the computer to a crawl.
Signals are very much superior to timer loops, performance-wise. But SIGNAL_TARGETED is not a native signal. It is a timer loop.
ANYTHING that runs on a timer loop should be kept as absolutely tight as possible.
If you want to scan every ship in the sector, then it would be better to attach the scan to SIGNAL_CHANGESECTOR rather than in a timer loop.
I can envision your wanting to use both types of scans, but do not try to combine them into a single routine. The two tasks are very different.
(You may not notice the time consumed in a loop during testing. But try running a heavyweight loop during heavy combat. For example, fight 100 enemies while you have 50 UT's and a several thousand NPCs running. Do it on a five-year-old computer. With 3 GB of memory -- or less.
