Page 1 of 1

Optimizing a script that replenishes everything

Posted: Fri Oct 17, 2025 12:42 am
by Redeye43
So I built this huge script over a lot of work to replenish, refuel, repair, all that, for EVERY unit on a side - I included a batching system, but it's a bit crunchy. So far, on No BREXIT No Problem!, the first run without a cache takes 200-300ms on my system with a denominator of 1, while running with a full cache takes 70-110ms. I'm trying to figure out how to speed this thing up, because almost all of the actual time is coming from ScenEdit_GetUnit calls and the live data access component, where I pull stuff out of the results of the ScenEdit_GetUnit call. I think this is data marshaling lag but I'm unsure what's up. Anybody have ideas about how to make this script even quicker? I'd really prefer to just *trigger* it only when units fire, but I have no idea how to make an event that triggers when a unit *shoots,* and that somehow feels extremely inefficient.