SKKmods Posted June 13, 2018 Share Posted June 13, 2018 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 More sharing options...
Hoamaii Posted June 13, 2018 Share Posted June 13, 2018 I'm curious too - other than CheckActorFactionAgainstFactionArray, I couldn't find any. Link to comment Share on other sites More sharing options...
SKKmods Posted June 13, 2018 Author Share Posted June 13, 2018 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 More sharing options...
Hoamaii Posted June 13, 2018 Share Posted June 13, 2018 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 More sharing options...
SKKmods Posted June 13, 2018 Author Share Posted June 13, 2018 Yes could do, I have multithreading for a similar ~700 element big misc item scrap list evaluation sharded into 10 sub lists ... effort. Link to comment Share on other sites More sharing options...
SKKmods Posted June 14, 2018 Author Share Posted June 14, 2018 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 More sharing options...
Evangela Posted June 14, 2018 Share Posted June 14, 2018 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 More sharing options...
SKKmods Posted June 14, 2018 Author Share Posted June 14, 2018 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 More sharing options...
Hoamaii Posted June 14, 2018 Share Posted June 14, 2018 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 More sharing options...
SKKmods Posted June 14, 2018 Author Share Posted June 14, 2018 > 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 More sharing options...
Recommended Posts