Jump to content
  • 0
Rinart73

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

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.

Share this post


Link to post
Share on other sites

0 answers to this suggestion

Recommended Posts

There have been no answers to this suggestion yet

Guest
Answer this suggestion...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...