[WIP][Tutorial] Building your own ship for dummies

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

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

Post Reply
BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

[WIP][Tutorial] Building your own ship for dummies

Post by BrummBear02 » Tue, 19. Feb 19, 00:28

Hello Forks,

Ill try to create a complete walkthrough to creat an S sized ship that fully works.

To get a rough idea of what you will be doing most of the time i put a video on youtube of me modeling for 1,5h on a X2 Titan remake.
If you watch from about 2:30min to 50min how im doing that detail you will get a rough idea of how long this all takes.
So patience is thing you need to bring most of. But dont get discouraged, its actually fun. On top of that its really calming work, at least for me.
Keep in mind im doing that purely as a hobby and the way i do things takes probably a lot more time since i barely know my way around blender.


https://youtu.be/wy7AbYdWYeI


Since i spend a lot of time figuring things out i thought it might be a good idea to share what i already know
and give those of u who are interested in creating ships a nice and easy start.

Please keep in mind that everything i say here is the result of try and error and a lot is unclear to me so some things i say are wild guesses.
If u know im talking bullcrap about something u can correct me and if i can verify that i was wrong ill change/add/remove that.
Also my english teacher was mainly the internet so if i phrase things weird or hard to understand just tell me how to do it better. no nitpicking here plx.

This will be completed over time since writing the whole thing will probably take me several hours.


please ALWAYS use lower case letters when naming files. Only use capital letters in the t files for naming ingame and the .ANI files.
if a reference is with a capital C while the file it refers to is with a lower case one it will cause the mod to not work.

Image


Contents:

- Software
- Creating a copy of a existing ship, rename it and add it to a shipyard
- Parts of a ship
- What can be done and what cant be done
- Choosing a ship fitting for our needs
- Editing the mesh
- Creating a collision mesh for our ship
- UV textures and vertex paint
- Moving connections around and other XML file stuff
- Creating custom materials
- the multimat material
- Animations (dont get all hyped on this one, its just for future updates if someone manages to do them)
- Troubleshooting




Software

We will work with the folowing tools:

X Rebirth Catalog Tool 1.10
Notepad++
Blender
XRConverter
How to use: viewtopic.php?f=129&t=360045


Another important tool is the modding community itself. You can reach out to us here on the board or on Discord. Really, give discord a try.

https://discord.gg/QgDJ69j




Creating a copy of a existing ship, rename it and add it to a shipyard


Getting prepared

Ok, first we need to unpack our game.
For this we need to start up the X Rebirth Catalog Tool 1.10 we grabbed earlier.
Read up on how to do that here: viewtopic.php?f=181&t=402452
Alternatively u can simply use the GUI that thing provides. Its pretty much self explanatory. Unpack ur whole game.

Image
Should look like this. Take note of the path i used. I recomend u create a seperate folder for ur unpacked X4 without spaces in it.
Somehow the converter we use later seems to have issues with spaces. at least for me. maybe its superstition from my side but better safe than sorry.



Now to convert all the models. Grab the XRConverter and put it into X4Mod root directory.
Image
Create a new text file, also in the root directory, and open it with windows editor.
paste this inside there and then go save as -> ConvertBAT_import.bat

Code: Select all

FOR /R "..\X4Mod\assets\" %%f IN (*.xml) do (
  XRConvertersMain.exe importxmf "..\X4Mod" "%%f"
  )
pause
Image

this will create a bat file that will convert almost all 3d models inside of the assets folde into .dae files.
Beware that this might take a while so double klick the freshly created .bat and go watch a movie/anime, play a game or do naughty stuff.

Also create a second .bat with

Code: Select all

FOR /R "..\X4Mod\extensions\cubix\" %%f IN (*.dae) do (
  XRConvertersMain.exe exportxmf "..\X4Mod" "%%f"
  )
pause
this will convert all .dae files inside the later created cubix folder into .xmf with their .xml waifu.


Copy a existing ship

Now we will grab an existing ship. Since i worked with the Argon Discoverer the most we will copy that one.
Create a folder named "extensions" in the root directory u installed X4 into. The one u use to actually play X4.
From now on i refer to this one as X4 Foundations and the copy we unpacked our game to will be X4Mod.

We will use the files from my koha mod and modify them because its simpler than creating new ones.

Now download my Koha mod here
and unpack it into the extensions folder. Then rename the Koha folder into Cubix.
Dive deeper into now X4 Foundations\extensions\cubix\assets\units\size_s and rename the folder the koha_data into cubix_data and delete the koha.xml in there.
also delete everything thats inside the now cubix_data.
Go to X4 Foundations\extensions\cubix\assets\units\size_s\macros and delete koha_macro.

In the end it should look like this
Image

go to X4Mod\assets\units\size_s and grab ship_arg_s_scout_01.xml and SHIP_ARG_S_SCOUT_01_DATA.ANI to copy those two into X4 Foundations\extensions\cubix\assets\units\size_s
Depending on your windows settings u might not see the file extensions. Ignore the .sig files. those are signature files to not flag ur game modified. they wont work on our ship.
Image

now go X4Mod\assets\units\size_s\macros and copy ship_arg_s_scout_01_b_macro to X4 Foundations\extensions\cubix\assets\units\size_s\macros
and everything inside X4Mod\assets\units\size_s\ship_arg_s_scout_01_data into X4 Foundations\extensions\cubix\assets\units\size_s\cubix_data


Editing the XML files

Ok, moving on. Now the xml part is a huge topic on its own and u can(and probably should do so sooner or later) read more about it here

For all editing we will use Notepad++

in X4 Foundations\extensions\cubix we will find the "content.xml" this file describes your mod in the extensions manager tool the game has ingame (where u can turn on and off extensions)
Simply swap out the word "Koha" with "Cubix" here and we are good to go.
If u press CTRL+F in Notepad++ and then select replace u can search for a specific word and replace it with something. Also swap out my name with yours.
Ive never cared about the date and version but if u are not a complete brain mess like me u can update that whenever u make a new version of ur mod. thats probably even useful.

Folder: t
\X4 Foundations\extensions\cubix\t are language files for the ingame naming and description.
if u **** this up it will show up as =ReadText= or something like that.
I havent played around with this too much and im pretty sure u can find some more info on this if u search the forum. For now simply replace the word "Koha" with "Cubix" in every file
For example: <page id="999832" title="Koha" descr="Koha" voice="yes"> becomes <page id="999832" title="Cubix" descr="Cubix" voice="yes">
also you should change the page id to one thats free. idk if there is already a post here on used ids or not.
this might interfer with other mods if they also use the page id u choose. for now stay on the one i used for the Koha.
The other files can be a simple copy of your 0001 or, if u feel generous, u can actually translate it. 0001-L049 for example is german. So if u want your mod to be translated to german if someone uses the german game version simply put a translation here. Keep in mind that if u leave the others untouched, for example only change 044 and leave 049 be, the german X4 players will have "Koha" in they shipyard while english players will have "Cubix" So change all of them.
Another option would be to delete all of the files expect the 0001. This means every player has the same name and description on the ship.

Folder: libraries
X4 Foundations\extensions\cubix\libraries are... well. libraries. for now we only need to have a wares.xml there.
Inside there we can add wares to stations i guess. in any case its used to add the ware "Cubix" to the argon shipyard.
It also defines whats needed for the production, the time it takes to produce, the credits it will cost and which licence one needs to buy it.
Again u simply change koha to cubix. for example koha_ware becomes cubix_ware.
Also adjust the page id if u changed it earlier. ( name="{999832,2}" description="{999832,3}" )

Folder: index

Inside here we will find components and macros.
We will start with components.
In our case the components file simply refers to our ship .xml which means we simply swap out koha for cubix again.

Code: Select all

<entry name="koha" value="extensions\koha\assets\units\size_s\koha" />
becomes

Code: Select all

<entry name="cubix" value="extensions\koha\assets\units\size_s\cubix" />
if we use more than one part on our ship wed need to refer to it here. for example i created a new L engine for my Raport port and to use it i need to refer to it in the components.xml.

Code: Select all

<entry name="engine_arg_l_allround_01_mk2" value="extensions\Raptor\assets\props\Engines\engine_arg_l_allround_01_mk2" />

macros.xml refers to every macro file we use. In our case again its simply one single file. If we use more than one macro in our mod wed need to paste a path here.
so again

Code: Select all

<entry name="koha_macro" value="extensions\Koha\assets\units\size_s\macros\koha_macro" />
becomes

Code: Select all

<entry name="cubix_macro" value="extensions\cubix\assets\units\size_s\macros\cubix_macro" />

Ship XML and macro

Now we take a deep dive into X4 Foundations\extensions\cubix\assets\units\size_s and rename the ship_arg_s_scout_01.xml into cubix.xml and the SHIP_ARG_S_SCOUT_01_DATA.ANI into CUBIX_DATA.ANI
This is the ships waifu xml. its basically a description of what the ship consists of.
For now we will open it and change only line 3 and 4

Code: Select all

	<component name="ship_arg_s_scout_01" class="ship_s">
		<source geometry="assets\units\size_s\ship_arg_s_scout_01_data"/>
into

Code: Select all

	<component name="cubix" class="ship_s">
		<source geometry="extensions\cubix\assets\units\size_s\cubix_data"/>
the first one needs to be in sync with whatever we did in the components.xml and the second one refers to the folder we store our 3D data in.

moving on by opening the macro folder. First we rename ship_arg_s_scout_01_b_macro into cubix_macro
Now open the file and change line 4, 5 and 7.

Code: Select all

  <macro name="ship_arg_s_scout_01_b_macro" class="ship_s">
    <component ref="ship_arg_s_scout_01" />
    <properties>
      <identification name="{20101,10103}" basename="{20101,10101}" description="{20101,10113}" variation="{20111,1201}" shortvariation="{20111,1203}" icon="ship_s_fight_01" />
into

Code: Select all

  <macro name="cubix_macro" class="ship_s">
    <component ref="cubix" />
    <properties>
      <identification name="{999832,2}" basename="{999832,1}" description="{999832,3}" variation="{20111,2001}" shortvariation="{20111,1003}" icon="ship_s_fight_01" />
again, we correct the macro and component name to keep things in sync and we refer to the correct page ID for naming the cubix. if u choose to use a different page id u need to adjust here accordingly.
also i have no idea what variation and shortvariation does since i didnt bother with that yet. probably the Vanguard stuff


If u start ur game now u should see the mod in the manager
Image
and it should also appear ingame in an argon shipyard.
Image
Last edited by BrummBear02 on Tue, 6. Aug 19, 02:34, edited 20 times in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship out of existing and own parts

Post by BrummBear02 » Tue, 19. Feb 19, 00:28

Parts of a ship

Well. Now lets look at the different parts a ship consists of.
As we already learned from the Discoverer copy we made a ship consists of a waifu XML file, a macro file, a data folder and a .ANI file.
Lets take a closer look at the actual 3D model of our cubix which is stored inside the X4 Foundations\extensions\cubix\assets\units\size_s\cubix_data folder.
If we open it up in blender it looks like this. How to get it into blender comes later, for now keep reading.
Image

As we can see here the ship is split in different parts that make up the whole thing.
Im not really sure what the anim_ or detail_ there does since the airlock is also animated but stored as detail while the poslights are simply flashingand im not sure if that counts as animated.
Also some parts are more than simple 3D models. For example detail_xl_switch
Image

As you probably know its something you can interact with ingame while the hull of the ship isnt really interactive. in blender those parts are simple 3d meshes and their interactiveness is added later in the waifu XML

Then there are the different modules of a ship. Engine, weapons and shields. As you can see here they are missing because those are not part of the ships 3D model and also simply added by the waifu XML
Image

Now we will take a closer look at the parts itself.

Image

Each part consists of an 3D mesh and its corresponding collision mesh which is mostly an exact copy of the mesh with the multimat material.
Each 3d mesh has a material and a texture assigned which are also in the name.

The nameing here is important but i cant really tell for sure how it works since i havent played around with it too much. Im guessing its something like this:
The capital X is a seperation and its important that its a Capital one.
lod0, lod1, lod2 and lod3 means level of detail. lod0 is, unlike one might think, the highest level of detail while lod3 is the lowest one. this is used to lower the load we put on our PC when the ship is far away and we dont need to render the thing in full detail since noone will be able to see it anyway.
Image

Also keep in mind that the bigger the ship the less parts it has. klingt blöd, is aber so.
an L or XL ship does not need for example landing gear, cockpit and airlocks. instead you just use the waifu XML to define a point where the game should add a pre-fabricated cockpid and landing pad.
and since docking is done differently and u cant walk near ur L ship and bump into it as station-walker it also doesnt need a exit.



What can be done and what cant be done

I dont really know when to talk about this one since its something that might kill your will to create a ship so we should talk about it from the get go
but if you are completely knew to this youll need some knowledge to understand what we are talking about i guess. so i put it somewhere in the middle.

Anyway. In the past weeks we figured out quite a lot and can do just as much. im pretty sure X:rebirth modders knew at least half of what we learned the hard way and thats the sole reason im writing this.

Optical wise, meaning everything you can see ingame, there are almost no limitations. we can add, change or remove stuff freely.
Here is a picture of my Split Wolf ship i got ingame and actually working:
Image

When it comes to collision meshes we are very limited in what we can do. We can edit the collision of the main body of a ship quite freely but any change to the animated parts will make the game crash.
this has to be tried for every mesh seperatly since i could not figure out a pattern. while this sounds discouraging its not as bad as it first sounds.
moving around the collision mesh is actually possible with the connection coordiantes in the XML file. the same goes for deactivating the actual collision of the collision mesh. meaning we can make it so we can walk through it via tags in the XML.
This enables us to work around most issues we encounter.

We can not add turrets to S ships. Well, we can. but they wont shoot. and here is another but: i think there is a mod that allows us to add turrets that shoot. some AI mod. meaning: if u go through some trouble and create an S turret(because M turrets are as big as an S ship and putting them there looks silly) u might be able to create an S ship with working turrets. but im not and i dont intend to do this. for now.
Also main guns, meaning those controlled by the player in the cockpit, can only face forward and can not be rotated. if done otherwise they show up in the shipyard ship building menue but when the ship is build they magically disappear into... idk, narnia probably.

And last the animations. While this is quite interesting and i got some things i would like to animate myself it cant be done. As far as i know there is no way of creating a custom animation.
there is a whole part on this tutorial reserved for animations simply because maybe some magical person appears and enables us to create them. lets hope for that unicorn.
But as always we are not completely powerless here. We can change the mesh, and with that the ingame appearance of existing animations. We can also change the position of them via waifu XML

For example this is an early version of my Split Wolf and i changed the appearance of the Airlock here. I used the discoverer one and it sure doesnt look like it. the animation works perfectly fine.
Image
Last edited by BrummBear02 on Tue, 19. Feb 19, 21:58, edited 6 times in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship out of existing and own parts

Post by BrummBear02 » Tue, 19. Feb 19, 00:31

Choosing a ship fitting for our needs

This is a difficult one.
Earlier we learned what we can do and what we cant. So Choosing a ship that fits our needs means we need to take a look at the parts we cant really change.

Meaning mainly animations. Lets just take a look at different argon ships so it becomes clear what im talking about.


Image
The Discoverer has 3 Animations. Landing gear (1) Airlock (2) and Drone hatch, which also serves as docking bay for the space suit (3)


Image
The Nova has the docking bay here
Image
and then we can see the cockpit has an animation since the ship has no airlock, there is a ladder as usual and only one landing gear. (1) we can probably add more of those landing gears but im not sure about that.
also the engines are animated and rotate depending on our fly movements (2)


Image
The Kurier (dont know the english name but i think u know what ship this is) probably has the docking bay somewhere. an airlock with kind of a catwalk instead of a ladder (1) and an rotated landing gear (2)
also this one sports quite a lot of interior we can recycle.


Image
Image

And lastly the Elite which has the usual ladder and a small door on its side (1) as well as animated flaps which move depending on our fly movement (2)


So when choosing a ship as base for our new ship we should look at the animations and aim to pick one we dont have to change too much. Simply to save work and keep the collision mesh as exact as possible since we cant change that one but only move it around, remember? also we can combine meshes of different ships we cant combine animations. if u want moving flaps youll have to pick the elite. if u want moving engines it has to be the nova.
Dont try to save time on this step and take a look at the ships of the other races as well. If id have to do my Wolf again id use the elite or a teladi fighter coz they fit the theme better.




Editing the mesh

Now starts the fun part. Well cant show u everything here, that would be way too much work and probably would not fit in 4 or 5 posts.

So open blender and delte the cube and the camera. Let the light be.
Image

Since we used the importxmf .BAT file earlier the .DAE files should already sit ready in our mod folder.
So we go File - Import - Collada
move your way to <Yoursteamfolder>\steamapps\common\X4Mod\assets\units\size_s\ and pick ship_arg_s_scout_01.dae
Double klick it or select it and press "Import COLLADA"
Image

Now we sale up the model to 1 so we can actually look inside without stuff vanishing. (If u press Numpad 5 stuff will also not vanish but u cant look inside ur mesh anymore)
Image

After this we get rid of the other lods since they will only bother us. instead of deleteing them you can also move them away. if u wanna keep them for whatever reason.
Image

now we wanna select the mesh we are going to edit. in this case its part_mainXlod0XgenericXgeneric_p1_hulltexture select it, then move your mouse back into 3d view and press "Numpad /"
this will hide everything thats not selected. Also press "Numpad ," to center your camera on your current selection.
Image

now press TAB to enter edit mode
With the middle mouse button you can rotate your camera. also the numpad provides you with a front, side and top view by pressing 1, 3 or 7. with 9 u invert it. for example top view becoms bottom view.
we are going to use the top view for now.
Image

short excursion: there are Verticles, which are points, edges which are.... edges? and faces which are the fiels between edges or Verticles. ull understand...
anyway, we need to turn of the limited selection so we can select stuff thats hidden behind faces
Image

Now press CTRL and drag a circle as shown. Pressing CTRL allows us to select multible things at once wihtout klicking all of them.
Image
Image

Now press DEL and select Verticles.
We ended up with this kind of mess:
Image
I turned on limited selection again so i dont see everything at once.

You can clean it up by selecting something you dont want and deleting the verticle or edge or face. depending on what you delete the result may vary. play around yourself a little.
Also remember that you can focus your camera on your selection by pressing "Numpad ," and rotate the camera freely by pressing the middle mouse button.
Scrolling zooms in and out. Keeping CTRL or Shift pressed and scrolling moves the camera sideways or upwards/downwards.
Also you can change your type of selection (shown inside the red box)
You can add connected things to your current selection by pressing "CTRL and Numpad +"
Image


After we cleaned the model we will add our new parts. As u might have guessed it will be a bunch of cubes.

To do that we select part_mainXlod0XgenericXgeneric_p1_hulltexture in Object mode and press Shift + D. This will create a exact copy of the whole mesh.
Now lets press the right mouse button to undo any transformations we might have done so the duplicated mesh stays in the same position as its original.
Enter edit mode by pressing Tab and then Press A and after that Del. select Verticles.

Image

This will select all and delete that to get a clean node that already has all the propertys we want.
We stay in part_mainXlod0XgenericXgeneric_p1_hulltexture.001 and go in edit mode. Also make sure you are in view mode Solid. Then we press Shift + A or select from the left Create - Cube.



We move the new cube to the side in any Position we like. Keep the cube selected and produce as many as u like to form a Wing. By using the snap tool we can make sure all is neatly alligned.
U can also add other shapes. Play around a little here. Fooling around is a great way to learn! Remember that transformations in Object mode get ignored so make them in Edit mode.
Also model only the right half. We will mirror it later.

Image

After we are done go to Object mode, select the newly created things in the Outliner and use a Modifier to mirror it to the other side.

Image

select the new mesh and while keeping shift pressed we select the old one. then we press Shift + J to join the all selected into the last selection.
Lastly we need to delete the lights. Just select it and press Del.

Image

Now lets get this into our game to look at what we have done. First create a folder "X4 Foundations\extensions\cubix\assets\units\size_s\Export"
Go File - Export - Collada. Change from Materials to UV Textures and uncheck "Use Blender Profile" i dont know what that actually does but it sounds suspicious.
Anyway, select the Export folder we just created and save it as cubix.dae.

Then run the ConvertBAT_export.bat we created when we started this tutorial. This will create a bunch of new folders. Navigate to "X4 Foundations\extensions\cubix\assets\units\size_s\Export\ship_arg_s_scout_01_data"
and since we only made changes to part_main-lod0 we also will only copy that one over into "X4 Foundations\extensions\cubix\assets\units\size_s\cubix_data"
say yes to overwrite.

Congratulations, you made your first changes to the Cubix.

Image
Last edited by BrummBear02 on Sat, 23. Mar 19, 05:30, edited 9 times in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship out of existing and own parts

Post by BrummBear02 » Tue, 19. Feb 19, 00:34

- Creating a Collision mesh for our ship


Now since we edited the looks of our ship the collision is completely off.
We are going to fix that now. To do that we need to pin down a collision mesh we can edit. Most of the time "anim_mainXcollision" or "part_mainXcollision" can be edited.

Since we are working with the Discoverer as a base we can edit the part_mainXcollision.
Now since we dont know what hinders us to edit some of the collision meshes we simply deactivate all the collision meshes in the waifu.xml by adding the tag "nocollision"
keep in mind to not add this tag to moving/animated things if u need them to have a collision. for example the ladder or the airlock.

Image

After we turned off all the collisions we dont need we are going to create a new one. They way we are going to do this is kind of "brute force" to knock out as much as possible error sources in one go.

First we select the existing "part_mainXcollision" then we press Tab, then A, then Del and then we select Verticles. That will delete everything inside but it leaves the node intact with material, offsets and all.
Image

Now we select every mesh we need a collision for and create a duplicate of it. Select it in Object mode, press Shift + D and then rightklick somewhere so u dont move this around and it stays at the exat same spot the original is. done.
In our case thats basically
"part_mainXlod0XgenericXgeneric_p1_hulltexture" and
"part_cockpitXlod0Xp1Xmultimat" and
"part_cockpitXlod0XgenericXgeneric_p1_hulltexture"


Now we got 3 new nodes

"part_mainXlod0XgenericXgeneric_p1_hulltexture.001" and
"part_cockpitXlod0Xp1Xmultimat.001" and
"part_cockpitXlod0XgenericXgeneric_p1_hulltexture.001"

Now we select the new nodes by keepig Shift pressend and klicking on them in the outliner and then we press CTRL + J to join them together.

Image

This leaves us with only one of the new nodes and an empty collision node. Select first the new node and then the empty collision node while keeping shift pressed. then again CTRL + J. it will always get joined inside the node we selected last.

Now we joined everything inside the collision node. That also includes materials, UV maps and vertex colours. We dont want that.

Image

So we go and remove all Materials other than "multimat" (leave that one alone since it was there in the beginning) UV maps and vertec colouring from the collision node.

Image
Image
Image

after that we export the model as .dae as we did before and run it through the converter. then we replace the existing part_main-collision.xmf with the newly generated part_main-collision.xmf...
magic happens and we got a matching collision to our edited ship.






- UV textures and vertex paint


Now we wanna add texturing to our model. To do that we need to go into "material" display. You can set it up so the textures also get displayed in solid display, ill comment on that later.

So the first thing we do is we switch into material mode.
Image


After this we need to add a light source or the whole thing will be black.
Make sure we are on Object mode and then press "Shift + A" and select Lamp - Hemi. This will add a hemispheric light. meaning its basically constant lighting from above if u dont rotate it. you can change its brightness my manipulating the energy value. you can also rotate it or add another one rotated by 180° to have light everywhere.
Image
Image


Now we are all set. So lets do dis.
First we need to select the mesh we wanna texture. In our case its the red box.
Image


Then we put Blender into UV editing.
Image


Now we select the whole mesh, still in edit mode, by pressing the "A" button. then we assign the .dds texture file we wanna use. keep in mind that u change the file u wanna use by editing the name of the node, not by just switching it here. This is only so blender displays it right.
Image


now we need to select the specific part we want to assigne a texture to. after thats done press "U" and select "Unwrap"
Image


As we can see now the UV map on the left does not match how it actually looks on the right. Thats because some verticles exist as doubles. This is usefull for Vertex colouring and sometimes also for UV mapping but in our case its bull. so we clean it up and remove the doubles.
Image


after that we go "U" and "Unwrap" again. voilà.
Image


The left red box shows selection mode, the right red box shows snapping mode and if snapping is on or off.
If the cursor is in the left part we can rotate by "R" scale by pressing "S" and move by pressing "G" just like in the normal edit mode. With "Shift + tab" we activate or deactivate snapping.
Now we press "A" to select all, if snapping is active we deactivate it by pressing "shift + tab"
rotate the mesh by 90° by pressing "R" and then typing 90 on the numpad. then move it in the general position show on the next picture and scale it down by pressing "S" and moving the mouse towards the UV mesh? idk how that thing is called. lets call it that.
Image


There is a shitload more to know about UV mapping. But there is at least another 3 shitloads of videos about it. Im bad at this myself so this is as far as ill explain it. but this should give you a rough idea of how its done and small changes can be done like that. texturing a whole ship is.... well. a lot of work.

If someone has nice and usefull tips on this topic im thankfull for them
Last edited by BrummBear02 on Mon, 27. May 19, 20:54, edited 5 times in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship for dummies

Post by BrummBear02 » Tue, 19. Feb 19, 00:38

-fourth. one to go-
Spoiler
Show
@MacBain just looked into the details of the used textures. try this in the libraries/material_library.xml (THIS IS JUST A GUESS INTO THE BLUE!!!)
<diff>
<!-- replacing Original Shader "XU_surface_test.fx" with currently used "P1_complex_surface.fx" for Argon legacy Textures-->
<replace sel="/*/collection[@name='argon']/material[@name='ar_hulls_01']/@shader">P1_complex_surface.fx</replace>
<replace sel="/*/collection[@name='argon']/material[@name='ar_hulls_02']/@shader">P1_complex_surface.fx</replace>
</diff>

MacBainheute um 22:27 Uhr
but will this not replace all textures for argon?

UniTraderheute um 22:27 Uhr
nope. this will replace the shader used and only that.
note the @shader at the end of the path

MacBainheute um 22:27 Uhr
i try it out

UniTraderheute um 22:28 Uhr
the rest is just to locate the correct shader value to replace

MacBainheute um 22:28 Uhr
but i dont understand it ^^

UniTraderheute um 22:28 Uhr
(note: this is basically ready to use - just create said file and then copypaste)
Last edited by BrummBear02 on Fri, 1. Nov 19, 23:33, edited 2 times in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship for dummies

Post by BrummBear02 » Tue, 19. Feb 19, 00:39

- Troubleshooting


Common errors when converting

Node part_detailXlod0XgenericXgeneric_p1_hulltexture has multiple meshes attached
Last edited by BrummBear02 on Tue, 28. May 19, 18:47, edited 1 time in total.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

StormMagi
Posts: 1324
Joined: Sat, 17. Mar 07, 04:53
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by StormMagi » Tue, 19. Feb 19, 04:24

Oh sweet. I am very much looking forward to this!
MOD XR Show Skills

Flying spaceships since 1993.

sco1981
Posts: 273
Joined: Fri, 14. Sep 18, 14:47
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by sco1981 » Tue, 19. Feb 19, 09:25

Looks good so far. :thumb_up:
Keep up the good work!

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship for dummies

Post by BrummBear02 » Tue, 19. Feb 19, 21:36

StormMagi wrote:
Tue, 19. Feb 19, 04:24
Oh sweet. I am very much looking forward to this!
Well, glad to make u excited. Tell me if u have ideas to improve this. Formatting and colouring will be done when its finished.
sco1981 wrote:
Tue, 19. Feb 19, 09:25
Looks good so far. :thumb_up:
Keep up the good work!
thanks. i actually added another part today :D
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

User avatar
MegaJohnny
Posts: 2121
Joined: Wed, 4. Jun 08, 22:30
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by MegaJohnny » Tue, 19. Feb 19, 21:43

Thanks so much for all the detail you've put in! I've had thoughts about tinkering with ship models, and this will no doubt make it much easier to get into.

sco1981
Posts: 273
Joined: Fri, 14. Sep 18, 14:47
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by sco1981 » Tue, 19. Feb 19, 22:02

BrummBear02 wrote:
Tue, 19. Feb 19, 21:36
Also keep in mind that the bigger the ship the less parts it has. klingt blöd, is aber so.
:D

BrummBear02
Posts: 269
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: [WIP][Tutorial] Building your own ship for dummies

Post by BrummBear02 » Sat, 23. Feb 19, 02:38

MegaJohnny wrote:
Tue, 19. Feb 19, 21:43
Thanks so much for all the detail you've put in! I've had thoughts about tinkering with ship models, and this will no doubt make it much easier to get into.
glad to hear you find it usefull. please tell me if u tried to follow this and everything worked out for you.

Also i added another part. editing the model itself will probably come tomorrow.
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 20:25
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by Cg089 » Sat, 23. Feb 19, 22:20

Hi guys,

(Hopefully) a unicorn here. I managed to find source code for arc_'s old x rebirth converter (which had disappeared due to dropbox automatically closing inactive accounts, ugh) courtesy of a thread on the X4 reddit I came across, which got it from someone on Discord. I'm looking into why the converter has issues, I think it'd be awesome if we could add animations. Unfortunately, arc_'s code, while it seems to be reasonably well written, has no tests. So I need to add some. And the libraries are several years out of date. But I'm cautiously optimistic, since he had (apparently) a basically flawless converter for X rebirth, and I'd guessing the X4 foundations file format is mostly the same (with some tweaks or additions which are causing problems). I'll let you guys know how it goes.

StormMagi
Posts: 1324
Joined: Sat, 17. Mar 07, 04:53
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by StormMagi » Sat, 23. Feb 19, 23:39

Cg089 wrote:
Sat, 23. Feb 19, 22:20
Hi guys,

(Hopefully) a unicorn here. I managed to find source code for arc_'s old x rebirth converter (which had disappeared due to dropbox automatically closing inactive accounts, ugh) courtesy of a thread on the X4 reddit I came across, which got it from someone on Discord. I'm looking into why the converter has issues, I think it'd be awesome if we could add animations. Unfortunately, arc_'s code, while it seems to be reasonably well written, has no tests. So I need to add some. And the libraries are several years out of date. But I'm cautiously optimistic, since he had (apparently) a basically flawless converter for X rebirth, and I'd guessing the X4 foundations file format is mostly the same (with some tweaks or additions which are causing problems). I'll let you guys know how it goes.
Have you talked to sco1981 or Ojump? They have been working on importing X Rebirth ships and might be able to help.
MOD XR Show Skills

Flying spaceships since 1993.

Cg089
Posts: 80
Joined: Fri, 18. Jan 19, 20:25
x4

Re: [WIP][Tutorial] Building your own ship for dummies

Post by Cg089 » Sun, 24. Feb 19, 00:10

I haven't; I should & will a bit later, I'm killing time before a flight right now. I suspect they manually fixed their XML files, which is unfortunately likely completely unavoidable with porting ships from X Rebirth; the modules or whatever you want to call them just weren't there, so there's no way to just reconstruct them from scratch. But yeah, I should definitely get in touch with them, this work might come in handy for them.

Good news - I got the tool to build from source and it seems to work the same as it did.

More good news - I'm not sure the xmf format has actually changed whatsoever (it may have, I haven't really checked yet). It may be that the main problem is that new stuff in the XML files is ignored when making the .dae, and thus when converting back from .dae to .xmf, important stuff gets lost. For instance, the mounts for the engines etc get broken, hence crashes. Lots of stuff in "tag" attributes gets lost for instance. The Paranid Scout, for instance, goes from being a 78 KB xml to 22 KB xml. So it's no wonder everything breaks.

Also, while I bought it on sale, I skipped actually installing or playing X Rebirth. If there are any assets people can identify for me that exist in both (mass traffic?), that would be super helpful. Seeing what changed between the two XML files and seeing whether the .xmf files have actually changed at all would be the best resource (short of the devs actually being allowed to give us documentation, anyway - I blame the lawyers).

Also, BrummBear02, I hope it's ok with you that this discussion is happening in this thread - if you'd rather I make a separate thread for discussing this stuff, I'm happy to. But your post piqued my interest about the animation issues, and you seemed interested in it, so I thought posting here was probably wise.

Post Reply

Return to “X4: Foundations - Scripts and Modding”