Author Topic: AI War 2 v0.608 Released! "Interface Evisceration"  (Read 4756 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: AI War 2 v0.608 Released! "Interface Evisceration"
« Reply #15 on: December 07, 2017, 12:18:36 pm »
First, I'm having trouble figuring out how to compute the path the Selected Units will take to the Hovered Planet. I'm guessing that you use faction.FindPath() internally; Unfortunately that function requires an ArcenSimContext which I don't know how to get in Visualization code. I could figure out a possible path in a more brute force fashion, but this exercise is pointless unless the pathing algorithm for routing and highlighting are the same (and I don't know how you made the changes for .607 to choose "safer" routes).

The second is that as written the code is going to need to recompute the path for the selection every time that GetColorForLinkBetweenPlanets() is called, which is awful for performance. The pathing information needs to be cached someplace for reuse and I'm not sure where to store it.
The solution to these two problems is the same: do the computation itself in the human faction's external per-sim-step logic (which has a context object), then save that list (which should be newly allocated every time for thread-safety reasons) to a reference on the faction controller object that the vis code can retrieve. You can restrict the computation to happen no more often than X seconds, or only if the hover planet has changed since last time, etc.

But no need to do it yourself, I'll handle it later. Thanks :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: AI War 2 v0.608 Released! "Interface Evisceration"
« Reply #16 on: December 08, 2017, 10:30:14 am »
It would be nice to have resource bar tooltips back for the weekend. If your release schedule doesn't allow for it that's fine though.