Dynamic Relations Calculating Tool

General discussion about X³: Farnham's Legacy.

Moderators: Moderators for English X Forum, Moderators for the X3:FL Forums

Post Reply
v_make
Posts: 59
Joined: Mon, 10. Sep 18, 07:12
xr

Dynamic Relations Calculating Tool

Post by v_make » Sun, 6. Jun 21, 22:56

The interactive tool is located at

X3FL-dynamic-relationships-tool

Moreover, an interactive analysis report is located at

X3FL-dynamic-relationships

---

This is **NOT JUST** a dynamic relationships stability checking tool. It gives you optimized strategy to achieve specific relationship, as well as its workload and efficiency.

For example, if you are to become friends with everyone but Yaki, Pirates, and Terran, the best strategy is to improve relationship with everyone but not Yaki, Pirates, Terran, **AND TELADI**, which is quite contrary to intuition.

The logic behind this strategy is that by improving relationship with Teladi's ally, it would already make notoriety points of more than enough to achieve good relationship with Teladi, which is verified by the tool.

---

This is a feature not planned but discovered during the analysis. Instead of blazenclaw's strategy to recursively improving relationship with the race of worst relationship, this tool generates solutions in a more mathematical way that allows the strategy to be optimized.

---

if you really want to maximize relationship with every races, or do it in a possibly exploited way
Spoiler
Show
a possible exploit is found by Deianeira
---

I was really intrigued by the new dynamic relation system but could not find a source telling me what is actually happening behind all the notoriety shift, so when I found blazenclaw's work I was very excited.

blazenclaw has done a lot in researching the dynamic relationship, and gave several lists of enemy combo to choose from(see his latest progress here). I was not aware of what approach he was using at then this but I wanted to explore the problem myself so I write a tool to address this.

The result is slightly different from blazenclaw's work. Long story short,
- A simple tool is developed that allows to generate best strategy to achieve desired relationships
- All 283 possible combos are given with total workload and efficiency
- The only two options to maintain at most 3 enemies (races, workload, efficiency)

Code: Select all

Terran - Yaki - Paranid, 195.74987462921916, 0.06130272125450846
Pirates - Terran - Yaki, 162.4439368085863, 0.07387163987622415
- 4 options to keep good relationship with all 6 major races with least enemies are listed as below:

Code: Select all

Atreus - Pirates - Duke's - Strong Arms - Yaki, 115.80946764695183, 0.08634872608589532
OTAS - Pirates - Duke's - Strong Arms - Yaki, 55.18972548571193, 0.18119314622409022
Atreus - TerraCorp - Pirates - Duke's - Yaki, 280.2498134147285, 0.03568245016171151
OTAS - Atreus - Pirates - Duke's - Yaki, 59.131288178803246, 0.16911520631449212
Credits to blazenclaw, Deianeira. See more in the edit history.
edit history
Show
Edit: fix relationship error as pointed out by Deianeira, and update conclusions accordingly
Edit: fix notoriety overflow not considered and update conclusions accordingly
Edit: update links and blazenclaw's progress
Edit: update possible combos count as pointed out by blazenclaw
Edit: update possible combos count
Edit: update new features
Edit: add credits
Edit: fix logical error
Edit: add possible exploit by Deianeira
Last edited by v_make on Tue, 8. Jun 21, 09:01, edited 9 times in total.
Regards.
Mark

Deianeira
Posts: 101
Joined: Wed, 12. Nov 08, 22:01
x3tc

Re: Dynamic Relations Calculating Tool

Post by Deianeira » Sun, 6. Jun 21, 23:22

Maybe your results are different, because your relationship matrix is wrong? Goner relations are asymmetric. If you do missions for Goners, you lose rep with their enemies (e.g. pirates, strong arms, duke's,..). However doing missions for their enemies doesn't influence your standing with them, as they are not their enemies' enemy :gruebel:

(btw they gain .1 with Argon, not .05 and even .15 with Terracorp.)

User avatar
blazenclaw
Posts: 80
Joined: Sun, 16. May 21, 00:03
x3ap

Re: Dynamic Relations Calculating Tool

Post by blazenclaw » Mon, 7. Jun 21, 02:16

Hey this is pretty cool! Haven't looked too closely yet, but there does appear to be some oddities with your conclusion- enemies of Pirates/Terran/Yaki is absolutely possible. It might be in part because it's necessary to have a greater-than-one return with the Goner. I'll put my (messy lol) code on git later today, but here's a quick screenie from an excel spreadsheet I've been using to quickly calculate individual sets. Your NaN row at the bottom also seems off by -0.3 for some races, not sure why (assuming it's a sum of coefficients). Also, the outlier Argon-Goner 0.10 relationship by itself shouldn't actually change any possibilities, just nudge efficiencies.

My method was algorithmic rather than analytical; I basically went thru each possible friend/foe combination (2**15) and progressively added one notoriety point gained to the lowest relationship friend faction from that set, until either all friends were positive or all were negative. Throw in a couple checks to make sure you're not calculating a subset of a known working relationship and it only takes a few minutes to run. I didn't say it was efficient :P

The 'two lists' was only because I didn't realize at first it was possible to befriend Yaki (lol); the steam guide has the most updated list and info.

Edit: Here you go, my py3 script. Good luck tho, because I may have a bad habit of playing code golf at times, and I'm certainly no professional dev :oops:

Code: Select all

# check each possible combination of ally/foe for ~16 factions... o.0
for checknum, selected_foe_numeric in enumerate(reversed(range(2**len(faction_list)))):
    # binary representation of all combinations to get ally/foe list, from all allies (111...1) to all foes (000...0), held as an array
    selected_foes = np.array([int(bin_digit) for bin_digit in f'{selected_foe_numeric:0{len(faction_list)}b}'])

v_make
Posts: 59
Joined: Mon, 10. Sep 18, 07:12
xr

Re: Dynamic Relations Calculating Tool

Post by v_make » Mon, 7. Jun 21, 08:08

Deianeira wrote:
Sun, 6. Jun 21, 23:22
(btw they gain .1 with Argon, not .05 and even .15 with Terracorp.)
fixed, thank you!
blazenclaw wrote:
Mon, 7. Jun 21, 02:16
Hey this is pretty cool! Haven't looked too closely yet, but there does appear to be some oddities with your conclusion- enemies of Pirates/Terran/Yaki is absolutely possible. It might be in part because it's necessary to have a greater-than-one return with the Goner. I'll put my (messy lol) code on git later today, but here's a quick screenie from an excel spreadsheet I've been using to quickly calculate individual sets. Your NaN row at the bottom also seems off by -0.3 for some races, not sure why (assuming it's a sum of coefficients). Also, the outlier Argon-Goner 0.10 relationship by itself shouldn't actually change any possibilities, just nudge efficiencies.

My method was algorithmic rather than analytical; I basically went thru each possible friend/foe combination (2**15) and progressively added one notoriety point gained to the lowest relationship friend faction from that set, until either all friends were positive or all were negative. Throw in a couple checks to make sure you're not calculating a subset of a known working relationship and it only takes a few minutes to run. I didn't say it was efficient :P
Wow hi! That's right there was something wrong about my analysis and overflow of notoriety was not considered. It is fixed now, as in the tool, and shows the correct result about the Pirates/Terran/Yaki enemy group, and the final conclusions are updated.

I updated the relationship according to your new picture. You might want to check your sum though as 0.3 shift is on your side :)

Your algorithm is direct and beautiful. My approach tends to solve the problem without recursion by directly solving 𝐑𝐗=𝐍, i.e. given the relationship 𝐑 (the matrix), target notoriety 𝐍 (vector with all 1 for the control group, all positive for friend races), find tactics 𝐗, which is a vector that represents how much notoriety point one should get from a race.

Man I'm amateur developer too (structural engineering graduate), pro gamer though lol

Edit: update status
Regards.
Mark

User avatar
blazenclaw
Posts: 80
Joined: Sun, 16. May 21, 00:03
x3ap

Re: Dynamic Relations Calculating Tool

Post by blazenclaw » Mon, 7. Jun 21, 10:16

v_make wrote:
Mon, 7. Jun 21, 08:08
I updated the relationship according to your new picture. You might want to check your sum though as 0.3 shift is on your side
Pffffffft I was double counting ATF and Terran in the spreadsheet, you're right :roll:

I did consider trying a linear algebra approach first, but couldn't figure out a nice way to deal with solving for 'value is positive' or similar rather than a specific value (as it might not literally be possible to have a specific arbitrary relation with all desired factions). Glad to see you found the start of a nice way though :D

I noticed that your results suggest there's 2496 possible combinations, which I'm not quite following the reasoning behind. What are the criteria you're choosing for "possible sets"? For instance, I see this line:
Yaki - Terran - Pirates, 162.44393680858624, 0.07387163987622418
and then in the next entry:
Yaki - Goner - Terran - Pirates, 192.88413850273844, 0.05702905425706546
which, is clearly a subset and also less efficient, lol. Possibly something about the way you worked around the overflow issue, or I'm just not reading it right? Or maybe it's from calculating the yaki-goner-terran-pirates set first, then later calculating the yaki-terran-pirates set (which would not be a subset of the former); I got around that by the binary approach. No idea, but stood out to me as something weird.

In any case, I'm... reasonably confident that my analysis is correct and there's only ~300 'optimal' sets of alliances for maximum inclusion, given I basically did an exhaustive search, but I suppose having a tool to see efficiencies of less-optimal sets could be of interest to some hardcore people lol. Of course, I also suspect it's actually a more efficient solution gameplay-wise and mathematically to basically increment one faction at a time, given the existence of a negative relation cap below which gains do not contribute to the DR system. Does run the annoyance of having more factions angry for longer, but eh.

Engineers, unite!

v_make
Posts: 59
Joined: Mon, 10. Sep 18, 07:12
xr

Re: Dynamic Relations Calculating Tool

Post by v_make » Mon, 7. Jun 21, 12:22

blazenclaw wrote:
Mon, 7. Jun 21, 10:16
For instance, I see this line:
Yaki - Terran - Pirates, 162.44393680858624, 0.07387163987622418
and then in the next entry:
Yaki - Goner - Terran - Pirates, 192.88413850273844, 0.05702905425706546
which, is clearly a subset and also less efficient, lol.
You are right, I did not prune the case sets quite well (I pruned the first duplicate result but not the rest thus got a significantly larger set)
The new case count is 283 (116 with Yaki), which is pretty close to your result. Might be a result of the newly changed Goner-Argon relation (0.05->0.1)? Anyway, I would not look into that tiny difference.

Much thx for your support!
blazenclaw wrote:
Mon, 7. Jun 21, 10:16
Engineers, unite!
:roll:
Regards.
Mark

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24961
Joined: Sun, 2. Apr 06, 16:38
x4

Re: Dynamic Relations Calculating Tool

Post by X2-Illuminatus » Mon, 7. Jun 21, 18:58

Good one. :) Added to tips and tricks overview.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Deianeira
Posts: 101
Joined: Wed, 12. Nov 08, 22:01
x3tc

Re: Dynamic Relations Calculating Tool

Post by Deianeira » Mon, 7. Jun 21, 22:28

By the way, the most efficient way to get high rank is to go to Rank -4 99%, gather 1000 influence and increase notoriety with those 1000 influence. This boosts your relation to about 70% Rank 9, almost max, without triggering 'dynamic reputation'. Destroy a few jump beacons or board like ten ships, then use just one agent with 6 tasks 8)

v_make
Posts: 59
Joined: Mon, 10. Sep 18, 07:12
xr

Re: Dynamic Relations Calculating Tool

Post by v_make » Tue, 8. Jun 21, 08:55

X2-Illuminatus wrote:
Mon, 7. Jun 21, 18:58
Good one. :) Added to tips and tricks overview.
Thx!
Deianeira wrote:
Mon, 7. Jun 21, 22:28
By the way, the most efficient way to get high rank is to go to Rank -4 99%, gather 1000 influence and increase notoriety with those 1000 influence. This boosts your relation to about 70% Rank 9, almost max, without triggering 'dynamic reputation'. Destroy a few jump beacons or board like ten ships, then use just one agent with 6 tasks 8)
I did experienced a similar situation at the beginning of the game, that when I did a very hard mission for Paranid and the notoriety went from like -4 to 8. It never happened again though. It looked like a bug to me, and when you make it stable enough by using agents, it's like an exploit instead of feature. I am tempted lol

Thanks for sharing
Regards.
Mark

User avatar
piranhai aka Dragonslayer
Posts: 960
Joined: Wed, 6. Nov 02, 20:31
xr

Re: Dynamic Relations Calculating Tool

Post by piranhai aka Dragonslayer » Sun, 20. Jun 21, 17:36

Deianeira wrote:
Mon, 7. Jun 21, 22:28
By the way, the most efficient way to get high rank is to go to Rank -4 99%, gather 1000 influence and increase notoriety with those 1000 influence. This boosts your relation to about 70% Rank 9, almost max, without triggering 'dynamic reputation'. Destroy a few jump beacons or board like ten ships, then use just one agent with 6 tasks 8)
Wait a minute. So lets say I have 4 factions left which are very in the red. I can push them all to be positive without affecting the others?

Midnightknight
Posts: 418
Joined: Sat, 12. Jun 10, 11:49
x4

Re: Dynamic Relations Calculating Tool

Post by Midnightknight » Sun, 20. Jun 21, 17:46

I think it's fixed in 1.2 cause i wasn't able to raise my Boron rep even while at -4. Or maybe the cap is triggered or something like that, but i really can't bring my rep up anymore. And with agents being a lot rarer too ...

Deianeira
Posts: 101
Joined: Wed, 12. Nov 08, 22:01
x3tc

Re: Dynamic Relations Calculating Tool

Post by Deianeira » Sun, 20. Jun 21, 19:02

Yeah, this exploit was fixed, sorry guys. It's now impossible to recover from low rep without destroying your rep with other factions.

Post Reply

Return to “X³: Farnham's Legacy”