Relation values

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

h2o.Ava
Posts: 349
Joined: Sun, 12. Oct 08, 04:04
x4

Relation values

Post by h2o.Ava »

Correct me if wrong.. I calculated them as:

Code: Select all

0		0
1		0.00064		
2		0.00128
3		0.00192
4		0.00256
5		0.0032
6		unknown
7		unknown
8		unknown
9		unknown
10		0.01
11		unknown
12		0.01592425		10^(12/10) / 995.2702277
13		unknown
14		unknown
15		0.032
16		unknown
17		unknown
18		unknown
19		unknown
20		0.1
21		unknown
22		unknown
23		unknown
24		unknown
25		0.32
26		unknown
27		unknown
28		unknown
29		unknown
30		1
Named Relation Ranges (thx sprIder):

Code: Select all

  self:          1.0  to  1.0
  ally:          0.5  to  1.0
  member:        0.1  to  1.0
  friend:        0.01 to  1.0
  neutral:      -0.01 to  0.01
  enemy:        -1.0  to -0.01
  killmilitary: -1.0  to -0.1
  kill:         -1.0  to -0.32
  nemesis:      -1.0  to -1.0
Last edited by h2o.Ava on Fri, 13. Dec 24, 12:50, edited 9 times in total.
sprIder
Posts: 135
Joined: Sat, 3. Jul 10, 23:23
x4

Re: Relation values

Post by sprIder »

Short answer: You're correct.

Longer answer: a look at libraries\factions.xml can help:

Code: Select all

Default Relation Ranges:
  self:          1.0  to  1.0
  ally:          0.5  to  1.0
  member:        0.1  to  1.0
  friend:        0.01 to  1.0
  neutral:      -0.01 to  0.01
  enemy:        -1.0  to -0.01
  killmilitary: -1.0  to -0.1
  kill:         -1.0  to -0.32
  nemesis:      -1.0  to -1.0

UI value mapping (analogously for negative values):
  1.0       = 30
  0.32      = 25
  0.1       = 20
  0.032     = 15
  0.01      = 10
  0.0032    = 5
These values are fixed. Between them, logarithmic interpolation is used. Approximate formulas:
  uivalue = 10 * log10(relation * 1000)
  relation = 10^(uivalue / 10) / 1000
Between -0.0032 and +0.0032 (UI -5...+5) linear interpolation is used, and 0.00064 equates to one UI value step.
h2o.Ava
Posts: 349
Joined: Sun, 12. Oct 08, 04:04
x4

Re: Relation values

Post by h2o.Ava »

yeah, i kept finding the short lists, but no level by level list. hopefully this helps someone else in the future
h2o.Ava
Posts: 349
Joined: Sun, 12. Oct 08, 04:04
x4

Re: Relation values

Post by h2o.Ava »

Hmm. The calculation is not 10^(uivalue / 10) / 1000
12 is calculated to be: 0.015848
but is is actually somewhere around 0.015925

seems the calculation is closer to 10^(uivalue / 10) / 995.4
(at least for 12)

Return to “X4: Foundations - Scripts and Modding”