I'm open for suggestions on how to improve performance. I wanted to start small and improve based on feedback.
I believe this mod is most helpful to beginner level players, and these don't tend to have huge bases. But you're right, the mod shouldn't slow down advanced players.
This is how it works right now: When enabled the arrows are calculated using ALL rails and drawn over ALL rails.
Why calculating all at once: Sometimes you need to look far ahead/behind the rail that is calculated.
Why drawing all at once: There is no way to react to cursor changes. All I could do is draw in the vicinity of the player character itself. This would not help when placing in map view.
Ideas I had:
Could add a custom tool which you could use to select the rails in question and the mod draws arrows only over these rails. The arrows could even disappear after some time automatically so you wouldn't need to clear them manually.
Use the character as center and draw arrows only in vicinity of player character. Max distance could be a mod setting.
Could add a custom shortcut to enable/disable the arrows so that the performance impact only happens when they are actually needed.
What's your preferred solution and why?