Yeah, I'm bad at spotting where the DoForRelated/delegate pattern would be optimal. It's not one I'm used to.
It's not optimal performance-wise but it's ok. I find that it makes it easier to write correct code if I'm not manually checking for is-hostile, etc. In other areas it's more important because there's various filters that should
always be applied and may not be obvious. Looping over the raw entity lists would give you ships, wormholes, and shots, for example.
It occurs to me that one of the real UI annoyances I think people are having is how poorly Metal data is reported. At the moment it's pretty unusable (and it tends to overlap onto the Incoming Waves text). I fixed this for myself a while ago so I forget (though I think my solution is a bit hacky) that everyone else has to deal with it.
I tried to dig up the code for that, but the post I found from you on the topic didn't have code attached. Can you point me at it?
It wouldn't be a permanent solution, of course, but it would be a good point to start the discussion from.
What do people want from a metal display? Do they
want fire that can be fitted nasally?
The main things I want to see in it are:
- The stockpile amount. If it's some huge number it doesn't need to be precise, just a number of thousands or millions or whatever.
- The current change per second/step/whatever.
- If I'm bottomed out, I want to see the percent of current demand that is being met by the current production.
- If I'm bottomed out, I want to see the estimated time until my net metal production will be positive again.
- Not currently implemented, but in general I'd like to be able to see the estimated time until all my queued construction is complete (so turrets and whatnot are simple cases; looping build queues would just look at how long it would take to fill in the cap, and that gets tricky with multiple producers)
- Not currently implemented, but something relatively eye-catching when storage is full and I'm "wasting" metal income.
Then there's the question of what should show on the main display itself, whether any of that is conditional (on being bottomed out, or maxed out, or whatever), what should show in a tooltip, and whether there should be some alternate display mode you can toggle to show more info up there, etc.
Do we really need a "Planet" menu at all? There are two things you can do with it right now
I'm intending to move the resource-focus controls there, instead of having you build those aux structures to accomplish it. There are other potential "standing order" or "policy" decisions that would be per-planet and that's the logical place for them.
DoNotPathThrough seems like it could be limited to the Galaxy map (what if mouseing over a planet in the Galaxy Map gave you a "do not path through" toggle that was then represented by an additional UI element, say putting a red circle around the planet on the map, or placing a red line across the planet UI element)
It's logical to limit it to the galaxy map, but having it be a dedicated toggle would make it harder to add other such decisions.
And "Capture Planet" could just be done by directing your forces to attack the planet controller.
The point of the Capture planet toggle is to tell your forces which planets to capture without waiting until you're on the planet. So if you have an overwhelming force with a flagship you could just FRD it to the target planet and it will capture the planet without you needing to intervene further.
The "Galaxy" Menu also should only be available in the Galaxy Map screen.
My only concern with that is I don't want to have a different mapping of numbers to buttons-across-the-bottom based on whether you are on the galaxy map or not.
In fact, why not make the elements of the Galaxy Map always-available buttons in the Galaxy Map screen.
That would make the prior point workable, but there are other functions outside that menu that need to be accessible when you're on the galaxy map. For one, you need to be able to give the normal set of orders to your current selection.
At the moment the Galaxy Map seems dreadfully underutilized. Recall that in AIWC a player would spend a ton of their time in the galaxy map screen planning what to do next, and I expect that will be about the same in AIW2.
Certainly, and the main point of the Planet menu is to have not just "passive" decision making (where you look at data and think), but "active" decision making where you tell the game which planets to capture, which to avoid pathing through, which to focus on which resources, etc.
What about a display mode that showed the Strength of ships on each planet?
Sure, that would be a good idea.
What about adding a glow to the planet to show ownership
Adding support for that would be a Chris thing, I don't know what's involved.
(or actually changing the colour of the planet name, instead of just making the name Murdoch (Gold) or Murdoch (Unowned)?
That would be good, and probably more tenable.
Also having the lines between planets change colour would be nice (recall in AIWC that those lines would change colour based on who owned the planets at either end);
That would be great, I haven't investigated how easily those line colors can be changed at runtime.
One thing I'd like is to just go ahead and say that overlapping planet connections are not supported (it wouldn't crash, but it wouldn't be guaranteed to be pleasant), and draw polygons from the midpoints of all the border planets owned by one side, and fill those polygons with the controlling side color so that there's a real visualization of "owned territory". That might be beyond what Chris has time to add support for, though