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

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

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

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

Post by killerog »

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 »

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_ »

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 »

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: 236
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy »

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 »

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 »

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
XWiki Moderator
XWiki Moderator
Posts: 2193
Joined: Sun, 2. Apr 06, 16:15
x4

Post by Lc4Hunter »

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_ »

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 »

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
User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ »

The second "sel" probably doesn't work because the 'killerog' collection doesn't exist in the original material library. Why not just do:

Code: Select all

<diff>
  <add sel="/materiallibrary">
    <collection name="killerog">
      <material name="BSG_GBadge" shader="shaderfx\high\XU_highway_tube.fx" blendmode="additive" preview="none">
      ...
    </collection>
  </add>
</diff>
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

if you have put the new files in your extension folder you have to specify the full path including Extensions/»your Extension« for it to work.. from what i see you just use the path inside the Extension folder.

and a small hint if you just add stuff directly under the root node:

Code: Select all

<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>
  </collection>
</materiallibrary> 
has the same effect and is easier to maintain ;) (see 2nd Post in the xml-diff-patch-Tuto ;) ) - although this only works directly under the root node, not deeper (but is enough for library files and t-files)

(NOTE: i didnt add the Extension Part sice i dont know whats the ID of your extension)
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 »

Well that works UniTrader. Another small problem. The uv I have applied to the whole ship doesn't seem to work 100%. Certain parts have the UV placed as shown in 3dsmax, other parts are completely wrong :(. So ive either forgotten something or theres a small bug in your tool? (no idea just guessing)
Image
User avatar
arc_
Posts: 62
Joined: Sat, 7. Dec 13, 20:30

Post by arc_ »

I did notice that Assimp (the library I use for reading .dae files) has a bug when multiple UV maps are present: it only reads the first one. I fixed this and uploaded a new version, see main post.

This version also has a bidirectional .xac <-> .dae converter. The command line is similar to .xmf: "XRConvertersMain importxac/exportxac <folder with extracted .dat's> <.xac/dae file>". I only tested the .dae -> .xac conversion by converting the produced .xac back to .dae and verifying that everything's still in place, since once again I can't get the game to use my custom file - so it's possible that the .xac's it produces are still unusable by the game. Try it out if you like. Once it's confirmed that the custom .xac's work I'll update the main post and the topic title.

Of note: the node naming convention is different here. For .xac's, the XR material names are taken from the .dae material names (again with dots replaced by "X"), not from the node names. I'll probably change the .xmf converter to do the same in a later version.
killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog »

Thanks :) Ill give it a try now and report back. Test my new 290 out as well that ive just fitted.
Image
killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog »

Hmm problem seems to still be there, heres a pic, as you can see the badge is fine and so are parts of the main ship. There are only two uv per lod. One for the badge and one for the main hull.


http://i45.photobucket.com/albums/f60/k ... 223051.jpg

Im going to try and import the DAE back into 3dsmax, see if it shows the UVs correctly there.

Edit: 3dsmax crashes on importing its own dae file :/

Edit again: Managed to get 3dsmax to import the file. UVs are correct so it has to be that library playing up I would guess.

Just tired again, doing it all from scratch same problem in the same places.
Image
ICO_hr
Posts: 415
Joined: Sat, 31. Aug 13, 17:56

Post by ICO_hr »

killerog wrote:I might try and ask egosoft if they can give some pointers to there 3dsmax work flow with regards to how to export.
If they're using custom exporter ask them just when they'll release it.If not just ask what format they use.This will be more than anough. :)
killerog wrote:

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>
Ok, but i see problem here.Why using new material that uses the same texture that are already in the game?My point is that this will add extra stuff in the Vram without any reason and when different people desides to add ships we'll end up with shit tons of the same textures that are loaded for no reason.Is there a way just using existing material that contains these textures?


I also want to ask how they attach parts like turrets or shields on the ships.Did they have something like model editor where they do these stuff.I'm asking because i've open some of the interior meshes and they have some pointers,markers or whatever they're called that are used for snaping perfectly different parts to one another but i didnt see anything like that on the ships.

Btw ES are using splines to define highways or at least superhighways that are build in Max but when i import any of the existing clusters there is nothing like that.Also did anyone have any idea how they define(make) highways, did they have something like world editor where they add by hand these stuff or everything is build in 3d software like Max or Maya?
This is really important if anyone wants to build cutom clusters.
Lc4Hunter
XWiki Moderator
XWiki Moderator
Posts: 2193
Joined: Sun, 2. Apr 06, 16:15
x4

Post by Lc4Hunter »

ICO_hr wrote:
killerog wrote:I might try and ask egosoft if they can give some pointers to there 3dsmax work flow with regards to how to export.
If they're using custom exporter ask them just when they'll release it.If not just ask what format they use.This will be more than anough. :)
Currently Egosoft has other priorities then releasing the converter ;-)
I asked them already and they told me the converter needs some rework because they have a database which is connected to/working with the converter.

But asking them for further details maybe could be an idea.
If someone would like to ask, i can give you the name of a nice employee you could ask.
lubatomy
Posts: 236
Joined: Mon, 29. Dec 03, 15:22
x4

Post by lubatomy »

ICO_hr wrote: I also want to ask how they attach parts like turrets or shields on the ships.Did they have something like model editor where they do these stuff.I'm asking because i've open some of the interior meshes and they have some pointers,markers or whatever they're called that are used for snaping perfectly different parts to one another but i didnt see anything like that on the ships.
I have been looking for that information as well. I think i see where it is defined in the xml file for the ship macro, but i dont see anything that corresponds to those points in the actual model but then I know very little about 3d modeling personally which could explain why I can not find the points.
killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Post by killerog »

That's the next thing on my list to find out over the next few days. But I should now start drinking and care that's its almost next year :roll:
Image

Return to “X Rebirth - Scripts and Modding”