Jump to content
  • 0

API: Add a way to get all sectors influenced by faction


Rinart73

Suggestion

I'm requesting a function that would allow to get all sectors controlled by a faction through influence (client-side and maybe server-side):

local sectors = {Galaxy():getFactionControlledSectors(int factionIndex)}

Why?

Right now on both client & server we can get all sectors that are owned (have stations in them) by a faction (at least the ones that player/alliance know about):

local sectors = {Player():getKnownSectorsOfFaction(int factionIndex)}

But all owned sectors have influence that spreads in a circle shape around them. And currently there is no performance-friendly way to get list of sectors controlled by a faction through influence.

Currently to get that list I have to do the following:

  1. Get all owned sectors of a faction
  2. Get the "influence" stat from their SectorView
  3. Transform this influence value into a radius (which is bigger than it actually is for some reason)
    local approximateRadius = math.sqrt(influenceValue / math.pi)

     

  4. Get all sectors that completely fit in that radius
  5. For each of them call this function:
    Galaxy():getControllingFaction(n, m)

 

It takes 1-1.2 seconds to get this info for 1/7 of a galaxy. Not very fast, but right now there is just no other way to do this.

Link to comment
Share on other sites

0 answers to this suggestion

Recommended Posts

There have been no answers to this suggestion yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...