[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

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

Post by killerog » Mon, 30. Dec 13, 00:59

Is that located in Documents (F)\Egosoft\X Rebirth or Documents (F)\Egosoft\X Rebirth\12316064 ?

If so they contain nothing from today.
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, 01:18

not sure which of both, but its generated at every gamestart when you append the "-logfile debuglog.txt"-Parameter to your XRebirth.exe ;) if something doesnt work it usually contains useful Info ;) (although you should compare with a clean start - some errors are from the regular startup/loading and not necesarily related to what you did)
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, 01:27

:oops: Forgot about that. Lots of errors in the file heres just a few, ill go though them tomorrow.

Code: Select all

[=ERROR=] Error in default context: ShipGenerator: No ship generated using group/ref/macro units_size_l_hydrogen_collector_macro
[General] ======================================
[General] ======================================
[=ERROR=] [JobEngine] No ship generated for JobID: 'sre_miner_hydrogen_large_02'. Probably invalid ship macro/group/ref definition.
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "diff" is not recognized in lookup 'ComponentXML'. Originated from: "extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector.(pck|xml)"
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "replace" is not recognized in lookup 'ComponentXML'. Originated from: "extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector.(pck|xml)"
[General] ======================================
[General] ======================================
[=ERROR=] LookupKeyName::LookupName(): The key name "sel" is not recognized in lookup 'ComponentXML'. Originated from: ""
[General] ======================================
[General] ======================================
[=ERROR=] Failed to create macro 'units_size_l_hydrogen_collector_macro' from file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro'
[General] ======================================
[General] ======================================
[=ERROR=] Missing component macro 'units_size_l_hydrogen_collector_macro' in file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro' as referenced in: index\macros
[General] ======================================
[General] ======================================
[=ERROR=] Macro not found: units_size_l_hydrogen_collector_macro
[General] ======================================
[General] ======================================
[=ERROR=] Error in MD cue md.osr_universe.StartupInit: ShipGenerator: No ship generated using group/ref/macro units_size_l_hydrogen_collector_macro
[General] ======================================
So I am guessing I've broken it :P
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, 01:45

those are relevant:

Code: Select all

[=ERROR=] Failed to create macro 'units_size_l_hydrogen_collector_macro' from file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro'

[=ERROR=] Missing component macro 'units_size_l_hydrogen_collector_macro' in file 'extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro' as referenced in: index\macros

[=ERROR=] Macro not found: units_size_l_hydrogen_collector_macro
either something is missing (do you have a complete macro file for this ship in »»extensions\sbmod_test\assets\units\size_l\macros\units_size_l_hydrogen_collector_macro ? - diff file here is not enough since this file is interpreted as regular macro file) or you were too thoroughly (did you redirect the macro/components in the index/[macros|components].xml ? - this is not necesary if you just want to modify them, only when you want to add one there is a need for that)
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, 02:11

I did redirect the file in the macro/components file. hopefully if ill remove that it will clear up the errors.

Edit: Now the game is crashing when loading a new game.

I have a full macro file in extensions\SBMod_Test\assets\units\size_l\Macros. This is an Ego file. And in the units_size_l_hydrogen_collector.xml file I have

Code: Select all

<diff> 
 <replace sel="//source[@geometry='assets\units\size_l\units_size_l_hydrogen_collector_data']/@geometry">extensions\SBMod_Test\assets\units\size_l\units_size_l_hydrogen_collector_data</replace> 
</diff> 
Edit: After a bit more testing it is the xmf files that are causing the game to crash. If I use the custom XML and Ego xmf files the game works fine, as soon as I add my XMF files the game crashes.

I also have a folder called units_size_l_hydrogen_collector_data containing all the meshes, some of which have been changed by arc_'s tool, plus a few other random files that are standard Ego files.

If I use the Ego xmf files I get this error:

Code: Select all

[=ERROR=] [Geometry::RequestCollisionMeshFilePtr] collisionMeshFile handle for geometry extensions\sbmod_test\assets\units\size_l\units_size_l_hydrogen_collector_data is invalid, returning NULL!
in the logfile. I have a file called units_size_l_hydrogen_collector_data (this is an Ego file) in the folder extensions\SBMod_Test\assets\units\size_l

Edit again: Few more tests and it looks like it is a problem with the mesh files.

@ arc_ do you want me to zip them up and send them your way so you can take a look at them ?
Image

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

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

Success, I have a modified ship in the game. There is at lest one or more bugged xmf files. Im testing them one by one at the moment..

Ill create a list here and update it as I go.

Working files:
part_main-lod0.xmf -- Only file I changed in blender, moved a few faces around.
anim_poslights-lod0.xmf
detail_l_alpha-collision.xmf
detail_l_alpha-lod0.xmf
detail_l_main-lod0.xmf
detail_m_alpha-collision.xmf
detail_m_alpha-lod0.xmf
detail_m_main-lod0.xmf
part_main-lod0.xmf
part_main-lod1.xmf
part_main-lod2.xmf

Bugged files:
anim_poslights-collision.xmf
detail_l_main-collision.xmf
detail_m_main-collision.xmf
part_main-collision.xmf

That's the complete list for this one ship (units_size_l_hydrogen_collector). The bugged files cause the game to crash when you start a new game (100% load then crashes).

Edit: Those files that don't work are much much larger then the egosoft files for the same model. Something is not being saved correctly when it comes to those files.
Image

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

Post by arc_ » Mon, 30. Dec 13, 15:28

File size differences are to be expected. The conversion tool always uses 32-bit floating point numbers for storing vertex positions, while the original files sometimes use 16-bit numbers (smaller size but less precision).

Can you upload an extension with the working files and at least one "bugged" file so I can reproduce the crash and debug it?

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

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

http://sbmod.co.uk/Mod_Downloads/SBMod_Test.zip

That's a working extension. Inside the folder conation the data is a folder containing all the files that didn't work.
Image

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

Post by ICO_hr » Mon, 30. Dec 13, 15:37

killerog wrote:Success, I have a modified ship in the game.
How did you put the ship back into the game? :o

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

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

Take a look at that file it has the working ship change in it. Im going to try and get a cube in the game now minus what ever files are not working and textures (no idea how these work yet as they do not show in blender/3dsmax) then ill do a write up.

So far I have the macros and .xmf files for a cube and the game is no longer outputting errors about them. I just don't see it in game :( So I need to play around a bit more. I also cant seem to get the generated XML file to contain texture information.
Image

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

Post Reply

Return to “X Rebirth - Scripts and Modding”