[TOOL - UPDATE] Porting XR With a Rust Application

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

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

Post Reply
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

[TOOL - UPDATE] Porting XR With a Rust Application

Post by teleportationwars » Mon, 7. Oct 19, 01:53

Thanks to cg089 for helping out a lot with the learning rust part of this.
EDIT 3:
We are currently bitten by the 3.0beta art bug but that is the last technical issue
If anyone wants to help us annotating let us know

https://www.youtube.com/watch?v=_oh1hZo2-vo



EDIT 2:

XR Data Dependency tool is posted on GitHub:
https://github.com/albysmith/XR-Data-De ... es/tag/1.0

The XR Data Dependency tool will create a data dependency mod that is intended to be used by other ship mods in X4 that use assets from X:Rebirth. It will not add anything to your game without other mods. You must own X:Rebirth to use this extraction tool. X:Rebirth DLC will also be extracted (if present) into additional data dependency mods for use in X4.

This tool only extracts the data folders and animations files for units in X:Rebirth and its DLC. Modders can refer to assets extracted into the XR Data Dependency mod, and set their mods to require this one, rather than distribute the assets themselves. This allows modders to port ships from XR without having to worry about the issues brought up in this thread: viewtopic.php?f=181&t=418034&p=4878447& ... t#p4878447

We have included an example mod (Phoenix Port Mod) to show only the most basic requirements for porting a ship from XR into X4.


Additional updates on the larger project:
We figured out QUATERNIONS!! We just need to figure out some rules about when/where they need changing.
It also appears that we will need to individually annotate bridge locations; they don't transfer well between games.



EDIT:

EGOSOFT SAYS WE ARE GOOD TO GO!

If someone wants to come out of the woodwork to do the vanilla balance, you could tell us how you would like the values exposed. We can do anything from expressing it as some bounds on groupings to literally exposing them all.

This isn't actually required, but it would be cool if someone wanted to write some md using
<find_object_surface object="" posname=""></find_object_surface>
to generate new connections. It would be a complex thing to write and XR already has connections that just need a little love but such a tool would still be pretty nifty and allow a lot more cool stuff.


Original Post:

We have been working on some tools in rust to assist with creating TPWAR. This has put us in a position to make a tool for porting XR to X4. To that end, a small cry for contribution:

We could technically create something close to a one-click-solution for porting XR art to X4 by running an executable that locally moves art and generates xml/balance for owners of XR and X4.

We could really use some help in that effort.
- permission from Egosoft...
- quaternions: XR connections are fine for x4 but are rotated 180 degrees
- level of detail (lod): a process needs to be made to triage/change lod values. it is not enough to rename the files or change values in the components files
- vanilla-like balance: we would be making this for TPWAR balance so someone to maintain a vanilla version needs to be found


Here is an explanation of the tools we've made so far:

Teleportation Wars is pretty big. So big that the demand on our time to set values which are acceptable but not identical is by far the largest part. We have 117 new sectors. Those sectors will each require at least 5 regions to cover lockboxes, ore, gas, audio, point of interest etc. Thats a lot of regions, and a lot more values. Something like 50000 values.


These tools are undocumented. If someone would like to use one of these tools and finds our rust too annoying to read or doesn't know enough to edit and compile them for their own use please contact us on the unofficial Egosoft discord https://discord.gg/AWNAKU9 @mewosmith or @albysmith and we would be happy to help you out.


generate weapons to whatever bounds you specify in the config:

https://github.com/mewosmith/Teleportat ... onRefactor

generate ship variants or rebalance vanilla ships based on whatever bounds you set:

https://github.com/mewosmith/Teleportat ... ipRefactor

generate regions with some reasonable randomization with connections to sector offsets:

https://github.com/albysmith/Region_Generator


Some of the tool stuff is pretty nice for people not doing absurd mods. If you just want a copy of the behemoth or to rebalance some specific parts of ships you could pluck whatever xml you want from the output. The weapons have damage falloff. The regions have some unused art in the pool.

We should have an alpha out in the next few weeks of Teleportation Wars 3 with a lot of output from these tools to show off.
Last edited by teleportationwars on Mon, 18. Nov 19, 04:09, edited 3 times in total.

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Tool] Porting XR With a Rust Application

Post by teleportationwars » Wed, 9. Oct 19, 18:55

Sent this email to Bernd in the hopes of getting permission.
Following the instructions from X2-Illuminatus in viewtopic.php?f=181&t=418034, we are reaching out to request permission to create a tool that locally ports XR assets into X4. This tool would only function if the user supplied the XR assets. It would read from an extracted XR and include instructions for how to download and use the XRCatTool.

We have released some of the tools we use to make our teleportation wars mod here:
viewtopic.php?f=181&t=419288
Thanks for making such a great game!

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Tool] Porting XR With a Rust Application

Post by teleportationwars » Wed, 23. Oct 19, 20:20

Made this offer on the discord, but not everyone is there. We have all the data file moving around figured out. If anyone wants to port a worrying amount of xr stuff, and doesn't want to wait however long it takes to get all the recursive positions translated, then we could package a tool to port the art for you and let you do all the xml.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Tool] Porting XR With a Rust Application

Post by Max Bain » Thu, 24. Oct 19, 08:53

Hi,

this sounds very interesting, but I dont know enough about it and I dont have any experience in Rust. So a short description on how you compile it would be great.

If I want to port lets say more XR ships to X4, what do I need?

Also, what will your tool do exactly? I have problems with ships consisting of several different parts like Teladi ships. Will this tool put the components together as in the original? Important is also the question, will I have a .dae file for this as well so I can put modules on the ship model.

Maybe you can give a short workflow including your tool to get a final ship into X4 (for example: 1. execute the tool; 2. rename files XYZ; 3. open .dae in blender and put modules in it; 4. copy blender modules into xml; 5. insert cockpit; 7. ??? ... )
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [Tool] Porting XR With a Rust Application

Post by teleportationwars » Thu, 24. Oct 19, 15:11

Max Bain wrote:
Thu, 24. Oct 19, 08:53
Hi,

this sounds very interesting, but I dont know enough about it and I dont have any experience in Rust. So a short description on how you compile it would be great.

If I want to port lets say more XR ships to X4, what do I need?

Also, what will your tool do exactly? I have problems with ships consisting of several different parts like Teladi ships. Will this tool put the components together as in the original? Important is also the question, will I have a .dae file for this as well so I can put modules on the ship model.

Maybe you can give a short workflow including your tool to get a final ship into X4 (for example: 1. execute the tool; 2. rename files XYZ; 3. open .dae in blender and put modules in it; 4. copy blender modules into xml; 5. insert cockpit; 7. ??? ... )
We don't plan to make people install rust and compile it themselves. We will have a release page and a config file to handle the paths.

It'll take awhile to get all the translation between coordinates done.

Since that will take awhile, and people are doing more to port xr ships, we wanted to do something to help now. We want to take a look at directly extracting from the .cat/.dat (this is one of those things that can eat a lot of time in stupid ways) and then post a useable version for modders to require as a dependency.

We will call it:

xr_data_dependency

So users give it a config of:
  • their XR path
  • their X4 path
It will create a mod folder and move:
  • ship data folder
  • ship .ani
You still have to make all the xml.

The workflow of a modder requiring the tool is:
1. require xr_data_dependency as a dependency
2. link to some documentation for its use
3. point the source geometry node to /extensions/xr_data_dependency/assets/whatever the path was in xr

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [TOOL - UPDATE] Porting XR With a Rust Application

Post by teleportationwars » Fri, 1. Nov 19, 02:42

XR Data Dependency tool is posted on GitHub:
https://github.com/albysmith/XR-Data-De ... es/tag/1.0

The XR Data Dependency tool will create a data dependency mod that is intended to be used by other ship mods in X4 that use assets from X:Rebirth. It will not add anything to your game without other mods. You must own X:Rebirth to use this extraction tool. X:Rebirth DLC will also be extracted (if present) into additional data dependency mods for use in X4.

This tool only extracts the data folders and animations files for units in X:Rebirth and its DLC. Modders can refer to assets extracted into the XR Data Dependency mod, and set their mods to require this one, rather than distribute the assets themselves. This allows modders to port ships from XR without having to worry about the issues brought up in this thread: viewtopic.php?f=181&t=418034&p=4878447& ... t#p4878447

We have included an example mod (Phoenix Port Mod) to show only the most basic requirements for porting a ship from XR into X4.


Additional updates on the larger project:
We figured out QUATERNIONS!! We just need to figure out some rules about when/where they need changing.
It also appears that we will need to individually annotate bridge locations; they don't transfer well between games.

teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: [TOOL - UPDATE] Porting XR With a Rust Application

Post by teleportationwars » Mon, 18. Nov 19, 04:10

Video Posted

Post Reply

Return to “X4: Foundations - Scripts and Modding”