[Question] How does station generation at the start of the game work precisely?

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

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

Post Reply
User avatar
PersonyPerson
Posts: 38
Joined: Sat, 20. Oct 18, 12:50
x4

[Question] How does station generation at the start of the game work precisely?

Post by PersonyPerson » Fri, 19. Apr 24, 07:45

How does station generation at the start of the game work precisely?

What I already know for certain about how it works:
- Wharfs/Shipyards, defence stations and story based stations are always in the same fixed location.
- Every other station is subject to random generation.

But to what degree is that randomisation? It seems that some sectors (usually ones with shipyards/wharfs in them) start have the same number of stations, but the type of stations are different. Some sectors, the variance is much greater with every start as some might have very few one game and then lots the next. Ship building sectors always seem to have at least one factory of every required resource nearby (to make the economy work). Some stations seem to be generated in small clusters of 2 to 5.

It's very ambiguous in trying to figure out. Is there a file where these values and variance are listed so I can have a look at them?

CBJ
EGOSOFT
EGOSOFT
Posts: 52078
Joined: Tue, 29. Apr 03, 00:56
x4

Re: [Question] How does station generation at the start of the game work precisely?

Post by CBJ » Fri, 19. Apr 24, 09:33

This is more of a Scripts and Modding question than a main forum question, but the file you're looking for is god.xml. One section of this deals with factories. Rather than defining station locations and numbers, it deals with production quantities, which are then distributed across how ever many stations are needed to provide those quantities. The randomisation is done procedurally using a seed, so you can get the same result in the same version of the game by using the same seed.

User avatar
PersonyPerson
Posts: 38
Joined: Sat, 20. Oct 18, 12:50
x4

Re: [Question] How does station generation at the start of the game work precisely?

Post by PersonyPerson » Fri, 19. Apr 24, 13:07

CBJ wrote:
Fri, 19. Apr 24, 09:33
This is more of a Scripts and Modding question than a main forum question, but the file you're looking for is god.xml. One section of this deals with factories. Rather than defining station locations and numbers, it deals with production quantities, which are then distributed across how ever many stations are needed to provide those quantities. The randomisation is done procedurally using a seed, so you can get the same result in the same version of the game by using the same seed.
Thanks. This helps a lot.

It took me a while to find god.xml because I didn't realise it was part of the .dat files and that I needed to download the X Catalog Tool in order to extract it. For those also looking for it, open XRCatToolGUI.exe whilst it's in your main directory -> Import Catalogs -> god.xml is located in 08.dat under "libraries/god.xml" -> DLC god.xml files are located in X4 Foundations\extensions\"ego_dlc_XXXX" in ext_03.dat -> Extract to a desired location -> Open via an app like Notepad -> Done!

Knowing all this, I still need a bit more clarification on the following terms:

Code: Select all

<quota galaxy="22" />
<economy max="0.75" maxbound="false" />
- Is "Quota galaxy" in reference to the number of desired production modules the faction has in the galaxy? You made it clear it's not the number of stations and I can see that when I saw the quota of Zyarth Hull Parts being "22", so is that what you meant by quantities?
- I'm guessing then that "Economy Max" would generate anything from 0% up to 75% of the Quota per seed on generation?
- "Maxbound=false" meaning that a faction can build over the "Economy Max" value later into the game, where if this value was true, then it couldn't?

Have I understood all this this correctly?

Zyarth also has a fixed spawn "Hull part landmark". Are the Hull part modules on this station factored into the overall random generation or does it exclude them?

Also, apologies about posting in the wrong place, but I wasn't sure if the answer to my original question required going this deep into files and code.

CBJ
EGOSOFT
EGOSOFT
Posts: 52078
Joined: Tue, 29. Apr 03, 00:56
x4

Re: [Question] How does station generation at the start of the game work precisely?

Post by CBJ » Fri, 19. Apr 24, 13:47

I've moved this over for you now.

The galaxy quota is the maximum number for the whole galaxy. The max and maxbound attributes are nothing to do with the quota. They are involved with the evaluation of locations, and are compared with the "economy value" of the space as defined in the map. This allows us to define that certain wares should only be produced in sectors that are defined to have high or low economy values. There are various other similar criteria that can be used to control the locations of factories.

User avatar
PersonyPerson
Posts: 38
Joined: Sat, 20. Oct 18, 12:50
x4

Re: [Question] How does station generation at the start of the game work precisely?

Post by PersonyPerson » Sat, 20. Apr 24, 00:08

CBJ wrote:
Fri, 19. Apr 24, 13:47
The galaxy quota is the maximum number for the whole galaxy. The max and maxbound attributes are nothing to do with the quota. They are involved with the evaluation of locations, and are compared with the "economy value" of the space as defined in the map. This allows us to define that certain wares should only be produced in sectors that are defined to have high or low economy values. There are various other similar criteria that can be used to control the locations of factories.
I'm going to make another guess again in which that criteria is defined by "macro="xu_ep2_universe_macro"" and many other files which peripherally impact random generation in where they all interact with each other. I haven't significantly dealt with .XML files in the past, so I think this is going well beyond my realms of understanding. I'm used to games that use .TXT files to define similar criteria.

X4 is one complicated game.

CBJ
EGOSOFT
EGOSOFT
Posts: 52078
Joined: Tue, 29. Apr 03, 00:56
x4

Re: [Question] How does station generation at the start of the game work precisely?

Post by CBJ » Sat, 20. Apr 24, 00:59

The macro="xu_ep2_universe_macro" entry is just telling it which map it belongs to. That's the standard game map. :)


Post Reply

Return to “X4: Foundations - Scripts and Modding”