[MOD] Re:Scale - The universe: Bigger. Better. Immersive.

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

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

Post Reply
User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

[MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Tue, 2. May 23, 12:16

>>> DOWNLOAD OVER AT NEXUSMODS <<<
(Screenshots also to be found there)

A X4 map resizing mod.

This mod takes the entire map of the current X4 universe and scales each sector to the size of small to medium sized countries - instead of very small local regions.

This mod takes the entire map of the current X4 universe and scales each sector to the size of small to medium sized countries - instead of very small local regions. The aim is to improve and/or increase immersion of the game which has a sci-fi setting - primarily in space, so that the space one plays in does not feel like crammed small cities in space... which, as you probably know, is extremely vast. While this mod does add to the immersion and entities being spread out on their horizontal axes, it's still very small compared to actual space.

-> If you played with one of the older files for testing, remove them. Install this mod instead. It now works correctly.

QUICK SUMMARY (if you do not want to read it all):

- Normal systems got an upscale between 9x and 12x times
- "Embedded" smaller systems (Saturn I, II, Titan for example) got an upscale between 4.5x and 6x times
- Scanner range 750km
- Many sectors now span across many THOUSANDS of kilometers (!!)

- Scaling applies to all dimensions - X, Y, Z
- All DLCs including Kingdom End required
- New save needed, save will need this mod

- New custom save with Highways disabled recommended, as Highways do not function properly with this mod
- Ship engines NOT modified

- Good travel engines with high maximum travel velocity gain high importance for your loadout
- Traversal of a sector may now need several minutes instead of just some seconds or maybe a minute
- Asteroid, gas, and hybrid regions have not been scaled due to technical and game performance reasons
- Stray "?" icons may appear in your map outside a sector - simply fly to it (or command a ship of yours to fly to it) to appear inside the sector and then be fixed in that location
- Due to the nature of this mod and what it does, I think it should go without saying that this one is NOT compatible with Ventures

Code: Select all

Fix version 1.10:
- Bugs in map re-generation and how the files were packed caused many sectors to be ignored for the scaling. This has been fixed - all sectors including the entire Kingdom End sectors - are now scaling correctly

Fix version 1.01:
- Sanctuary of Darkness excluded from scaling so that the gates remain in the Safe Zone
Thanks to Eucharion / Realspace for pointing me in the right direction!


QUICK TIPS

- Scan early, scan often
- If an object is in range of less than 750km, stop and scan again - you may find remaining gates and stations
- Comm other ships to ask for the way to another sector
- Satellites will be more important than ever
- Equip your ship with the fastest engines you can afford
- Mod is even more fun when coupled with VRO (just tried it!)



DETAILS:

General

Every entity - stations, gates, and other things - are now much further apart and can no longer be made out just by flying through even without scanning - an issue that always bothered me since I am playing X4. When something said "Unknown Object", I was able to make out that this is a Jump Gate (apart from that that apparently scanners don't work for objects less than 100km away?). This mod changes this behaviour considerably. One will have to fly to a "?" on the map, or at least get close to it, to make out what something is.

The scale factor is not uniform, and is applied differently, depending on the type of system. I have experimented with re-scaling the map before, and this is a result of what I learned. It is as follows:

- Normal systems got an upscale between 9x and 12x times
- "Embedded" smaller systems (Saturn I, II, Titan for example) got an upscale between 4.5x and 6x times

Smaller systems cannot be scaled much further as their skybox is apparently smaller than normal systems... one would eventually hit that "wall" and just be in complete black space. To mitigate this issue, the smaller systems got a smaller scale - but it's still big enough to notice a change.


Resources / regions

Regions with resources, so asteroids, gas clouds, and hybrid regions containing both, have NOT been modified. The reason lies in the technical nature of the game. Every asteroid and gas cloud is its own entity which the CPU has to process... this means where it is, its contents, has it been mined, and if so, which yield was acquired... and so on. If I scale this up as well - meaning in amounts (also number of asteroids) and dimensions of a region - the game will maybe produce 5 FPS on every machine. For this reason the regions have not been scaled. Maybe at some point I will find a way to do so.


Ship engines

All ship engines continue to function as before - no changes have been made to those. In some systems, a Jump Gate may now be about 1,600km away. If you have an engine that can propel you with about 8,000m/s in Travel mode, you will need 200 seconds, or 3 minutes and 20 seconds, to traverse this distance. Applying a good engine for these distances becomes much more important.

Conversely, AI ships such as Xenon and Kh'aak will also need that travel time to get somewhere, which means you can base your strategy for their arrival somewhere (or your arrival somewhere) around this factor of time. If anything, a side-effect of this mod is that it will probably give you more time to prepare defenses and offenses... but the same goes for Xenon and Kh'aak too - so be aware of that.


Scanning and scanner range

So that you can still find everything in a system, but not all at once (one should still have fun exploring), I have increased the scanner range to 750km. As many systems are now larger than this, you most likely will only find some of the objects to be found in a system... you still have to perform some scanning sweeps in different positions to uncover all objects. In smaller systems you will probably see all objects in one scanning sweep.
Highways

Local and Ring Highways will immediately cease to function when using this mod (apart from that I personally always hated this Highway thing). According to my tests, the highway "columns" and the associated model(s) with those Highways seem to have a fixed length and size, which depend on the fixed locations of the connecting Jump Gates. But since the Gates are being moved and spread around the sector, the Highways no longer function and result in lonely, essentially useless strips for high-speed boosts. For this reason, start a new custom save with those disabled.

At least in my testing, the Highways appeared and work as intended, but they are very short and disconnected, so there is not much use in them.


Unknown entities with "?" outside a sector on map

In some systems, you will encounter stray "?" icons on the map which appear outside the border of a sector. Simply fly to that marker. This will then not only place it inside the sector, but also leave it fixed in that location so that it does not go "stray" again. But then on the other hand, I did have this phenomenon happen in a vanilla save also. May not be related to this mod.


Local superhighways "frozen"

This issue is now fixed.

I have added the optional file "Local Supergateway", which adds Accelerators to all systems which have Superhighways. NPCs can and will use those also.


Ventures

... cannot be used/done/played with this mod. Obviously.


!! IMPORTANT !!
!! READ THESE POINTS! !!



- Requires ALL DLCs - including Kingdom End
- Using this mod absolutely requires a new save!
- A new custom save in which you disable the local and ring Highways is HIGHLY recommended (read point about this below)
- Any save using this mod will continue to require this mod as the locations of everything are dependent on this data
- Local and Ring Highway(s) DO NOT WORK! It seems the models used for the highways have a fixed length and size, and depend on vanilla Jump Gate positions. These change with this mod, thus severing the Highway connections. NPCs will act confused when leaving a lonely Highway strip
Technical notes:
- The scaling was done by extracting the corresponding map XML files from the game's data
- The XML files were run through a PHP script which evaluated the X, Y and Z positions, and then applied the scale
- The PHP script got minimum and maximum scaling values for normal and small systems, then find a random number between those two and then apply this scale, hence making the scale not uniform and feel more unique

- PHP script can be provided for your own tweaking if you want to. Script is only 147 lines in size



Questions, issues, comments, or praises? Post them here and I will come back to you.
Last edited by MarcusInVR on Wed, 10. May 23, 11:37, edited 1 time in total.

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Sat, 6. May 23, 18:41

When the using the main mod, local Superhighways do not function properly. Sometimes they do but most of the times, they do not.

For this reason I have now added Accelerators to all affected systems which are made up of smaller systems, for example the Grand Exchange cluster. These Accelerators do work as expected.

The addon to the mod is called Local Supergateway and is found in the Optional Files of the Nexusmods page.

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Realspace » Sat, 6. May 23, 23:34

Superhighways have made me have more than one headache, before understanding how to increase their entry points in each sector. The frozen animation means you did not move their entry points accordingly. Just take a look at xrsge that has hundreds superhighways with internal distances of 800km or 16000km

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Sun, 7. May 23, 13:38

Realspace wrote:
Sat, 6. May 23, 23:34
Superhighways have made me have more than one headache, before understanding how to increase their entry points in each sector. The frozen animation means you did not move their entry points accordingly. Just take a look at xrsge that has hundreds superhighways with internal distances of 800km or 16000km
As mentioned in my previous post - I just added Accelerators in all affected systems to solve the problem. Apparently NPCs prefer those to the Superhighways. So for me, the issue is solved.

Lechrenski
Posts: 7
Joined: Tue, 30. Mar 21, 01:45
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Lechrenski » Wed, 10. May 23, 03:08

Marcus, I really like the idea of this mod, but I feel like I'd prefer something closer to 2x-3x larger sectors for playability reasons (and lack of patience). Can you please post the PHP script as well?

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Wed, 10. May 23, 09:36

Lechrenski wrote:
Wed, 10. May 23, 03:08
Marcus, I really like the idea of this mod, but I feel like I'd prefer something closer to 2x-3x larger sectors for playability reasons (and lack of patience). Can you please post the PHP script as well?
The script is now uploaded here:
https://www.marcusinvr.de/uploads/rescale_php.zip

Scaling values are placed at the top.

You will need to extract the original map data from the game including their extensions. Obviously, for copyright reasons I cannot upload and distribute these XMLs. I believe the base game was in 08.cat of the root folder, and the map files were in the 03.cat of every DLC. You will need the files having "_sectors" in their name only. Place these files in the "map" folder including their correct folder structure.

The resulting XML will be in the "mod" folder.

There is one sector in the exclude list - that's Sanctuary of Darkness. If you move the gates so far away from the Safe Zone, you will not be able to traverse the sector normally. Also - the main plot quest to find a way through will also not work properly. So if you do not have a hazard-removal mod of some kind, leave that in the exclude list.

The others are "embedded" sectors which get a smaller scale than normal sectors.

The script will generate one huge XML file in the correct subfolder structure. However, it will just slam all XMLs together in one single file... which means that you will need to remove some segments of lines in the resulting file. Example:

Image

There will be a few of those segments that you need to remove so that the sectors.xml is one valid XML file. It will be stored in the correct subfolder. If you are not using any other mod that increases scanning range, you will need the file I put in the libraries folder too. Pack that into a subst_01.cat and slam it into your "extensions" folder.

I hope that explains it well enough.

Enjoy.

Lechrenski
Posts: 7
Joined: Tue, 30. Mar 21, 01:45
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Lechrenski » Thu, 11. May 23, 03:55

Thank you very much for your well-commented code! This has spared me considerable time and mental effort.

For future reference, the "sectors.xml" file for the base game is located in "06.cat". Also, for some reason, my DLC extensions were in folders named "ego_dlc_xyz" instead of "dlc_ego_xyz" as expected in the PHP, so I had to modify the code to address that. I'm not sure if that is a Steam/GOG issue or something else. Thank you, as well, for pointing out that the resulting XML file needed to be modified to remove redundant declarations. I initially forgot to remove the "<macros>" and "</macros>" and ended up with a spammed error log. Oops.

Unfortunately, I'm still running into problems. I have chosen to go with a 2x rescale to start and removed the randomization (because it doesn't make sense to do that at such a small scaling, in my opinion). The code works flawlessly (aside from the modifications I mentioned), and I was able to pack that into a loadable extension. Aside from some questionable jump gate placement (I assume the _zones files need to be adjusted to fix some of these), the major issue is with the superhighways. Or, more specifically, the clusters. Grand Exchange, Avarice, and Titan/Saturn II (among others) are practically inaccessible.

I saw that you have a file on Nexus that is meant to address that problem for your 12x mod, but it doesn't work for the smaller rescale I am attempting. While Grand Exchange becomes accessible, the majority of other clustered subsectors are still marooned and my error log is spammed with messages of the form "Cannot find macro XML file from index 'props_gates_orb_accelerator_108_macro' in file 'index\macros'", "Missing component macro 'zones_rescale_cluster_606_sector0606_macro' in file 'maps\xu_ep2_universe\zones' as referenced in: index\macros" and "Highway superhighway001_cluster_42_macro could not find a map zone at its start position - is it outside of the entry zone?". I suspect there may be a way to algorithmically generate those gates from _cluster files similarly to how _sector files are modified, but that is just a guess. Or maybe it is the _sechighways file. Somehow, I suspect is it all three of _sectors, _cluster, and _sechighways, which makes this... a more annoying problem than I would like, but probably worth solving once-and-for-all instead of using bespoke solutions. But that is just speculation: you know much more about this than I do.

Anyway, thank you again for your code and fast reply.

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Thu, 11. May 23, 12:43

Here is the PHP for Local Supergateway:
https://www.marcusinvr.de/uploads/resca ... ateway.php

It is much shorter than the original - but works in a similar manner. This should allow you to place Accelerators where needed. You simply need to tune down the randomizer for the placement. The numbers are in meters, so the 300,000 in the file mean a maximum of 300km on the X-axis.

Hope this helps.

meatsicle
Posts: 5
Joined: Thu, 14. Jun 07, 01:22

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by meatsicle » Thu, 11. May 23, 23:08

Realspace wrote:
Sat, 6. May 23, 23:34
Superhighways have made me have more than one headache, before understanding how to increase their entry points in each sector. The frozen animation means you did not move their entry points accordingly. Just take a look at xrsge that has hundreds superhighways with internal distances of 800km or 16000km
Do you mind expanding on how to solve this issue so I can do it locally? I love this mod and no disrespect to the creator, but I find the accelerator solution a little inelegant.

meatsicle
Posts: 5
Joined: Thu, 14. Jun 07, 01:22

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by meatsicle » Thu, 11. May 23, 23:35

Lechrenski wrote:
Thu, 11. May 23, 03:55
I saw that you have a file on Nexus that is meant to address that problem for your 12x mod, but it doesn't work for the smaller rescale I am attempting. While Grand Exchange becomes accessible, the majority of other clustered subsectors are still marooned and my error log is spammed with messages of the form "Cannot find macro XML file from index 'props_gates_orb_accelerator_108_macro' in file 'index\macros'", "Missing component macro 'zones_rescale_cluster_606_sector0606_macro' in file 'maps\xu_ep2_universe\zones' as referenced in: index\macros" and "Highway superhighway001_cluster_42_macro could not find a map zone at its start position - is it outside of the entry zone?". I suspect there may be a way to algorithmically generate those gates from _cluster files similarly to how _sector files are modified, but that is just a guess. Or maybe it is the _sechighways file. Somehow, I suspect is it all three of _sectors, _cluster, and _sechighways, which makes this... a more annoying problem than I would like, but probably worth solving once-and-for-all instead of using bespoke solutions. But that is just speculation: you know much more about this than I do.

Anyway, thank you again for your code and fast reply.
I see those same error messages in the debug log using his unaltered mods.

Lechrenski
Posts: 7
Joined: Tue, 30. Mar 21, 01:45
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Lechrenski » Fri, 12. May 23, 04:57

OMG. It has been so long since I dabbled with PHP that I forgot "explode" is the name of a function.

Thank you again for your code. I don't have time tonight to see if this works, but hopefully I'll have some this weekend. I think I may have already convinced myself, though, that the best way to deal with this is to mess with the offsets in the cluster.xml files. I'll try that, too, if I have time.

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Fri, 12. May 23, 07:26

meatsicle wrote:
Thu, 11. May 23, 23:08
Realspace wrote:
Sat, 6. May 23, 23:34
Superhighways have made me have more than one headache, before understanding how to increase their entry points in each sector. The frozen animation means you did not move their entry points accordingly. Just take a look at xrsge that has hundreds superhighways with internal distances of 800km or 16000km
Do you mind expanding on how to solve this issue so I can do it locally? I love this mod and no disrespect to the creator, but I find the accelerator solution a little inelegant.
It's good enough for me.

// Edit:
It's good enough for the NPCs too.

// Edit 2:
I never liked those Superhighways very much anyways. I actually prefer the Accelerators.

meatsicle
Posts: 5
Joined: Thu, 14. Jun 07, 01:22

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by meatsicle » Fri, 12. May 23, 16:41

MarcusInVR wrote:
Fri, 12. May 23, 07:26
meatsicle wrote:
Thu, 11. May 23, 23:08
Realspace wrote:
Sat, 6. May 23, 23:34
Superhighways have made me have more than one headache, before understanding how to increase their entry points in each sector. The frozen animation means you did not move their entry points accordingly. Just take a look at xrsge that has hundreds superhighways with internal distances of 800km or 16000km
Do you mind expanding on how to solve this issue so I can do it locally? I love this mod and no disrespect to the creator, but I find the accelerator solution a little inelegant.
It's good enough for me.

// Edit:
It's good enough for the NPCs too.

// Edit 2:
I never liked those Superhighways very much anyways. I actually prefer the Accelerators.
My problem with it is that the superhighways (some working, some broken) remain next to the accelerators. To me, this isn't great for immersion. I'm fine with the accelerators if the superhighways were removed. Thanks for this awesome mod.

User avatar
Hector0x
Posts: 994
Joined: Mon, 18. Nov 13, 18:03
x3tc

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Hector0x » Mon, 15. May 23, 14:04

Great work. Would love a version which reduces sector size by half.

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Mon, 15. May 23, 15:21

Hector0x wrote:
Mon, 15. May 23, 14:04
Great work. Would love a version which reduces sector size by half.
I have posted my PHP script which performs the scaling. You can use that and adjust scaling size.

User avatar
Casishur
Posts: 1649
Joined: Fri, 1. Jul 05, 10:04
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Casishur » Mon, 29. May 23, 12:40

So this mod/script can change the value that prevents building stations further than 4500 km from sector centre?
CPU Typ Ryzen 9 3900x
Grafikkarte Radeon RX 6600 XT 8GB
Arbeitsspeicher: Corsair Vengeance LPX 32GB (2 x 16 GB) DDR4 3200MHz
Motherboard Name/Typ MSI B550 Gaming Plus
Win 10 64 bit

Betty : Autopilot.... hat.... total Versagt.

Twitch https://www.twitch.tv/Casishur

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Mon, 29. May 23, 13:36

Casishur wrote:
Mon, 29. May 23, 12:40
So this mod/script can change the value that prevents building stations further than 4500 km from sector centre?
Not sure. Never tested that.

ReScale resizes vanilla sectors... apart from that I have not changed any values.

User avatar
Casishur
Posts: 1649
Joined: Fri, 1. Jul 05, 10:04
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by Casishur » Mon, 29. May 23, 13:46

MarcusInVR wrote:
Mon, 29. May 23, 13:36
Casishur wrote:
Mon, 29. May 23, 12:40
So this mod/script can change the value that prevents building stations further than 4500 km from sector centre?
Not sure. Never tested that.

ReScale resizes vanilla sectors... apart from that I have not changed any values.
or not

https://steamcommunity.com/sharedfiles/ ... 2982258910 :o some try in a new game limit is 4500km from centre


I would like to build a viewing platform at the terraformer hub again, which is about 128.000km away from the sector centre.
This border just prevents me from doing so.

the last one was built in 3.0
CPU Typ Ryzen 9 3900x
Grafikkarte Radeon RX 6600 XT 8GB
Arbeitsspeicher: Corsair Vengeance LPX 32GB (2 x 16 GB) DDR4 3200MHz
Motherboard Name/Typ MSI B550 Gaming Plus
Win 10 64 bit

Betty : Autopilot.... hat.... total Versagt.

Twitch https://www.twitch.tv/Casishur

User avatar
MarcusInVR
Posts: 117
Joined: Fri, 15. Apr 22, 14:33
x4

Re: [MOD] Re:Scale - The universe: Bigger. Better. Immersive.

Post by MarcusInVR » Mon, 29. May 23, 20:00

Casishur wrote:
Mon, 29. May 23, 13:46
MarcusInVR wrote:
Mon, 29. May 23, 13:36
Casishur wrote:
Mon, 29. May 23, 12:40
So this mod/script can change the value that prevents building stations further than 4500 km from sector centre?
Not sure. Never tested that.

ReScale resizes vanilla sectors... apart from that I have not changed any values.
or not

https://steamcommunity.com/sharedfiles/ ... 2982258910 :o some try in a new game limit is 4500km from centre


I would like to build a viewing platform at the terraformer hub again, which is about 128.000km away from the sector centre.
This border just prevents me from doing so.

the last one was built in 3.0

That is a topic for the developers - not my mod.

I am scaling each entity's position about about 9-12 times from vanilla values in normal sectors (cluster systems have smaller scales). I have seen Jump Gates in approx. 2,600km distance in some vanilla sectors.

Post Reply

Return to “X4: Foundations - Scripts and Modding”