Jump to content

GetFactions alternative in FO4


Recommended Posts

There seems to be an Actor.GetFactions function in Skyrim that is not available in FO4 and I'm trying to track down a run-time added NPC faction membership that's causing problems.

 

Apart from stepping IsInFaction thru a formlist of ~690 base game factions, any cunning alternatives ?

 

 

 

Link to comment
Share on other sites

Plan Z while through the big faction form list, save memberships and ranks in arrays, RemoveFromAllFactions, do the thing then add memberships back.

 

Issue is that it takes 80 seconds under zero load to evaluate the big list of all base game factions, that popcorn intermission is not going to work for real time combat.

 

Since players don't seem to really care about mod quality, I could just stick some skimpy outfits in as a diversion and leave a trail of broken NPC relationships behind .... kidding.

Link to comment
Share on other sites

Oh, heck, and you need to check ranks too?.. Can't you break that huge faction FormList in chunks? Assuming some factions automatically exclude some others?

 

If I find any other way I'll let you know, but for so far, I've had to use formlists alongside factions too.

Link to comment
Share on other sites

Update to benchmark (if anyone actually cares):

 

(1) Single thread of IsInFaction() and GetFactionRank() against a big FormList of 690 base game factions takes 75 to 85 seconds to process

 

(2) 10 threads of IsInFaction() and GetFactionRank() against 10 sharded FormLists of 69 base game factions takes 1 to 3 seconds to process. That'll do donkey.

 

Each configuration ~30 test runs in a clean save file with only 2 NPCs active in uGridsToLoad area.

Link to comment
Share on other sites

So I take it you're going with #2?

 

You can definitely speed #1 up by using an array as they are far faster, but it'll be a pain assigning so many to an array(s) in the CK because there's no drag and drop capabilities like with formlists :/

Link to comment
Share on other sites

I did have a run up with arrays of Faction property fills (autofill works fine), but its overly complex and no faster.

 

It seems the latency isn't in getting the Faction form pointers out of a formlist or array, it's the 700 calls to lookup IsInfaction within a single script/thread budget.

Link to comment
Share on other sites

Following this closely because I'm still having issues with my formlists reverting at runtime and I may have to use factions instead if I can't solve that one.

 

My question is do you really have to call IsInFaction on top of GetFactionRank? - seems like GetFactionRank can also tell you when an actor is not in a given faction by returning negative values. Using only one function may slightly reduce the processing time - not that reducing it to 30 or 40 seconds might really solve you problem though, I'll admit...

Link to comment
Share on other sites

> My question is do you really have to call IsInFaction on top of GetFactionRank? -

 

Depends on your usecase. If you have a massive volume of factions to filter of which only a small number will be relevant it is measurably faster to call IsInfaction on all of them and GetFactionRank only on the hits. In my case 700 input factions and only 10 faction ranks. Try both ways ...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...