Yeah, ideally I would want the ONS links to be visible only when in line of sight as well. But technically, it aren't that easy: The way it is now, I recalculate the vertice of the link lattice only when a factory is finished or destroyed. And then I cache it in a display list, so that drawing is fast. If it were to obey los, I wouldn't be able to cache anymore the link geometry, I would have to recalculate it every frame. Or maybe just a couple time per second, but still, I'm afraid it would cost too much CPU.
I know that a couple version ago, when ONS was set to "homebase only" which causes long links, on a map such as major madness, you could feel the game pause for like half a second or so everytime the ONS link lattice had to be recalculated. Since then (KP 3.6 -> KP 3.7) I optimised by fixing a silly mistake in my code that made it use many super short segments, but I'm not sure that's enough to allow it to run several time per seconds without decreasing performance. It may seem odd that drawing such simple links could have a CPU cost, but keep in mind they're coded in Lua, and that I'm not the best OpenGL coder.
The code change to make ONS links obey los is simple enough, but measuring the associated performance drop is not. CA used to have a gadget profiler, but it relied on a custom gadget handler with so many differences in the callins I couldn't get it to work with KP last time I tried. Now that I understand a bit better Spring's Lua, maybe I could port it or write my own, and eventually I hope that I will, since ONS is not the only gadget I'm curious to know the CPU cost of, but that's the sort of unenticing task I keep delaying forever.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum