[Tool] .xmf/.xac <-> .dae converter

The place to discuss scripting and game modifications for X Rebirth.

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

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Mon, 30. Dec 13, 16:53

The converter takes the material to use from the node name. For example, this node name: "detail_m_mainXlod0XgenericXgeneric_tanks_01" contains the section of the LOD0 mesh of part "detail_m_main" that is using the material "generic_tanks_01" from the "generic" collection in the material library xml.

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 20:09

Ok that makes sense now, I was trying to figure out what the X....X Part was, forgot that the material file is split into sections.

This is my XML output now from your tool for my cube:

Code: Select all

<components>
	<component name="units_kill_box">
		<source geometry="\Extensions\SBMod_Test\assets\units\size_l\units_kill_box_data" />
		<connections>
			<connection name="Connection01" tags="part">
				<parts>
					<part name="part_main">
						<size>
							<max x="1" y="1" z="1" />
							<center x="0" y="-4.76837e-007" z="0" />
						</size>
						<lods>
							<lod index="0">
								<materials>
									<material id="1" ref="argon.ar_masstraffic_01" />
								</materials>
							</lod>
						</lods>
					</part>
				</parts>
				<offset>
					<position x="-0.061841" y="-0.042030" z="-0.147742" />
				</offset>
			</connection>
		</connections>
	</component>
</components>
I had to make the macro file for it, which looks like this:

Code: Select all

<macros>
  <macro name="units_kill_box_macro" class="drone">
    <component ref="units_kill_box" />
    <properties>
      <identification name="{20101,7201}" description="{20101,7202}" />
      <hull max="1600000" />
      <effects>
        <explosion ref="explosion_l_01" />
        <jumpin ref="jump_jumpin_l" />
        <jumpout ref="jump_jumpout_l" />
      </effects>
    </properties>
    <connections>
    </connections>
  </macro>
</macros>
And the components file looks like:

Code: Select all

<diff>
	<add sel="/index"><entry name="units_kill_box" value="\Extensions\SBMod_Test\assets\units\size_l\units_kill_box" /></add>
</diff>
And Macros file:

Code: Select all

<diff>
<add sel="/index"><entry name="units_kill_box_macro" value="\Extensions\SBMod_Test\assets\units\size_l\Macros\units_kill_box_macro" /></add>
</diff>
I sill cant seem to get the model to appear in game, I have no error in the debug log text file either now.

Edit: Added all 3 LODs now and still no luck :(
Image

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Mon, 30. Dec 13, 21:01

I posted an updated version of the conversion tool which fixes the collision file crash. It turns out that the game is much more picky about the vertex declaration in collision meshes than it is about visual meshes. Note that the command line has changed in preparation for .xac support - see the first post for details.

Also the tool now automatically merges overlapping vertices in all meshes and leaves out unnecessary information (like normals) from collision meshes. This way the resulting files are much closer in size to the original.

I can't help you with the macro .xml files, sorry... I know next to nothing about those.

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 21:05

Thanks for the updated tool. Ill start using that and see if it fixes my current problem. If not hopefully someone can chip in and we can get the first new model in the game :)
Image

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 30. Dec 13, 21:12

a macro file is basically similiar to a TShips entry in the previous games - it defines what a Ships is made of, explosioneffects, hull Strength etc. - and it contains connections to all parts a Ship is made of, and for Stations Information about in which order the Elements are built (Build Sequence and Build Stage) - some of this Info is not to be defined in the modelling program(basically the whole <properties> node), but the connections and build sequence/stage would make sense to define in a modelling program..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 21:15

Makes sense. New tool works so far :) Didn't fix my non appearing ship tho :(

Really don't know what I am missing now.
Image

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 21:22

I have a ******* box in the game **** yeh :D

Had to have class="ship_s" so it shows up, had drone instead so wasn't seeing it on the map :/
Image

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Mon, 30. Dec 13, 22:23

Nice. Post some screenshots when you make some more progress :)

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 22:29

I can indeed http://i45.photobucket.com/albums/f60/k ... bec3ee.jpg

Can you guess what it is ?
Image

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Mon, 30. Dec 13, 22:36

No idea. Looks good though :P

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Mon, 30. Dec 13, 22:38

BSG :) that's to big and has a drones texture.
Image

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Tue, 31. Dec 13, 01:26

Now im trying to figure out scaling, I am having great difficulty in simply changing the size of the model. Twice in the last few hours I have been able to change the models size in blender but it seems really temperamental. Changing the scale of the root nodes, the mesh its self all seem to have no effect what so ever. Having never used blender am I being completely silly ?

Its a shame the built in dae importer/exporter in 3dsmax seems to hate the file format and I cant seem to find the plugin egosoft use :(

On a better note heres a new pic with the model looking a bit smaller: http://s45.photobucket.com/user/killero ... 2.jpg.html
Image

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Tue, 31. Dec 13, 01:51

Scaling the nodes won't work, you have to scale the actual meshes: enter edit mode, select all the vertices, scale down. Then it shouldn't be a problem.

Of course Egosoft didn't actually use Collada - they probably exported straight from Max - it's just a format I picked for my converter because it has the needed features while also being supported by many modeling programs...

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Tue, 31. Dec 13, 01:56

Hmm, I have tired that and it doesn't seem to always work, maybe im just doing something silly with not being used to blender.

I have seen this
<author>Benedikt</author>
<authoring_tool>3dsMax 12 - Feeling ColladaMax v3.1.1_3.1.1 r6746.</authoring_tool>

In some of Egos files, I thought that was maybe where you got the idea to look into this file format.
Image

lubatomy
Posts: 234
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy » Tue, 31. Dec 13, 03:42

awesome ship to get in killerog.

To be honest the first time i got in game and saw all the surface turrets on capitals come to life and start firing, the first ship I thought of was the Galactica. Glad to see it starting to take form in game and cant wait to see it as a finished ship in game with the turrets and and everything working in all its glory.

ICO_hr
Posts: 415
Joined: Sat, 31. Aug 13, 17:56

Post by ICO_hr » Tue, 31. Dec 13, 05:17

killerog wrote:I have a ******* box in the game **** yeh :D
Can you try to export in FBX format and convert it to DAE with Autodesk FBX converter and test it in-game?

Autodesk FBX converter link: http://usa.autodesk.com/adsk/servlet/pc ... d=20481519

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Tue, 31. Dec 13, 15:26

I think that's the same exporter that's included in 2014, it doesn't like a few things, I am going to experiment today if I cant a chance. Much prefer 3dsmax to blender already. I might try and ask egosoft if they can give some pointers to there 3dsmax work flow with regards to how to export.

But first im going to try and get a custom texture onto the Galactica.
Image

Lc4Hunter
Posts: 2170
Joined: Sun, 2. Apr 06, 16:15
x4

Post by Lc4Hunter » Tue, 31. Dec 13, 16:11

killerog wrote:Now im trying to figure out scaling, I am having great difficulty in simply changing the size of the model. Twice in the last few hours I have been able to change the models size in blender but it seems really temperamental. Changing the scale of the root nodes, the mesh its self all seem to have no effect what so ever. Having never used blender am I being completely silly ?

Its a shame the built in dae importer/exporter in 3dsmax seems to hate the file format and I cant seem to find the plugin egosoft use :(

On a better note heres a new pic with the model looking a bit smaller: http://s45.photobucket.com/user/killero ... 2.jpg.html
=> If you use X3-models for reference, the scaling factor is 550% (or multiply with 5,5).
You can easily check this by importing the Split M3 from X3 and the Split M3 from Rebirth.
So i found out the exact scale of 550%.

[ external image ] [ external image ]
arc_ wrote:Scaling the nodes won't work, you have to scale the actual meshes: enter edit mode, select all the vertices, scale down. Then it shouldn't be a problem.

Of course Egosoft didn't actually use Collada - they probably exported straight from Max - it's just a format I picked for my converter because it has the needed features while also being supported by many modeling programs...
It works for max. You can scale up and the use "Reset X-Form".

By the way: Awesome job killerorg! Next step after texturing: How to make animations for shipparts. For example a rotating section of a destroyertype :D

killerog wrote:I think that's the same exporter that's included in 2014, it doesn't like a few things, I am going to experiment today if I cant a chance. Much prefer 3dsmax to blender already. I might try and ask egosoft if they can give some pointers to there 3dsmax work flow with regards to how to export.

But first im going to try and get a custom texture onto the Galactica.
As i know the exporter is selfwritten. It uses a database below (dont know for what, but i think for materials, shaders and so on).
Maybe the comment at the files is just a note, written by an exporter, from another program. As i know not all modelers used 3dsmax, some created their models with blender, than imported them into max and from there they exported it to the games engine.

User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ » Tue, 31. Dec 13, 17:02

Presumably "Reset X-Form" in Max does exactly the same: apply the node transform to the mesh and reset the node's transform :P

Animations for ship parts are stored in .ani files, which is another custom format. I don't know how these work yet... The only thing I've found out so far is that they can animate up to 5 attributes (I guess position, rotation, scale, and ...?) and support different interpolation types for each of those (piecewise, linear, bezier and possibly splines).

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog » Tue, 31. Dec 13, 17:50

Right im now using 3dsmax with no problems, the 2014 dae exporter works fine was just me misreading something.

New problem for those that love xml. Trying to add a new collection and texture to the material_library file but not having any luck. Im not getting any errors in the debug file but im not seeing the object the texture is applied to. If I use an ego texture the object appears fine.

Here is my diff file code. Can guess its going to be wrong :P

Code: Select all

<diff>
  
  <add sel="/materiallibrary"><collection name="killerog"></collection></add>
  
  <add sel="/materiallibrary/collection[@name='killerog']">
     <material name="BSG_GBadge" shader="shaderfx\high\XU_highway_tube.fx" blendmode="additive" preview="none">
	   <properties>
			<property type="BitMap" name="diffuse_map" value="extensions\SBMod_Test\assets\textures\ships\BSG_GBadge"></property>
			<property type="BitMap" name="specular_map" value="assets\textures\interiors\int_tile_01_spec"></property>
			<property type="BitMap" name="normal_map" value="assets\textures\interiors\int_tile_01_bump"></property>
		  </properties>
    </material>
  </add>
	
</diff>
And to access that texture I have named the object part_mainXlod0XkillerogXBSG_GBadge.

Get this solved and that's models with custom UVed textures in the game :)
Image

Post Reply

Return to “X Rebirth - Scripts and Modding”