Code Herder Code Herder

Mesh files

Mesh files

Hello, I was looking at the mesh files for sins and it looks like it's gonna be quite a bit of work to reverse engineer so I was wondering if anyone was already working on it or had reversed engineer the file format already.

Doing the graphic editing suite for galciv wasn't too hard, I cheated by using the extremely cryptic pear editor but without any way of fiddling and seeing the changes it could become painful.

Cheers!
53,004 views 91 replies
Reply #51 Top
Darkshimmer i have absolutely nothing to do with this plug-in. Its all Code Herder.

I thought you were already the Trek mods resident code monkey.. Aren't you?
Reply #52 Top
In theory these file formats shoud be supported :

* 3D Studio meshes (.3ds)
* B3D files (.b3d)
* Alias Wavefront Maya (.obj)
* Cartography shop 4 (.csm)
* COLLADA (.xml, .dae)
* DeleD (.dmf)
* FSRad oct (.oct)
* Irrlicht scenes (.irr)
* Irrlicht static meshes (.irrmesh)
* Microsoft DirectX (.x) (binary & text)
* Milkshape (.ms3d)
* My3DTools 3 (.my3D)
* OGRE meshes (.mesh)
* Pulsar LMTools (.lmts)
* Quake 3 levels (.bsp)
* Quake 2 models (.md2)
* STL 3D files (.stl)

I'm cheating a bit, I'm reusing a 3d engine mesh loading code. I just parse it once using the engine internal format.

I almost have it 100% functional but I still have some bugs with exporting objects with many materials and meshes associated with said material.

Not to bad for 3 hours of hacking last night
Reply #53 Top
First thing to come to mind at that photo... Transformers the Movie (the first one, the cartoon one... where Cybertron is attacked by that planet eater...)
Reply #54 Top
Oh noes! Petronius is doomed!

Congrats on a successful import!
Reply #55 Top
lol, awesome! Looks like my WoW Dwarven Warrior!!!
Reply #56 Top
and I thought dwarves were short
Reply #57 Top
that image is made of win.

when do the space ponies of various colors go in?
Reply #58 Top

that image is made of win.

when do the space ponies of various colors go in?


At a guess, as soon as some modelers can get their hands on that import function
Reply #59 Top
i'd like to get my hands on it, i got some trek ships i'd like to import to aid in my galactic conquest.

Stress i'm no coder, just a good trek fan who likes it done the right way!
Reply #60 Top
Yeah, yeah it's getting there

I still need to make something to allow you guys to set the various emitters.

Reply #61 Top
This is made of win.
Reply #62 Top
oh sweet mother of motherships! i hope you get all the bugs sorted asap, cant wait to get some new models in there!

keep up the ace work dude!

Kenetor
Reply #63 Top
Waiting with bated breath, Herder. You're really pushing the envelope on what we can do with the Sins beta.
Reply #64 Top
Mmm well had to waste some time getting a new gui building system integrated. It was worth it since it's much faster to create now. Anyway, it's getting there, once I have the emitter interface done, you'll have something usable. I'm slightly worried about some settings, like the normals, I think I saw some issues that could be caused by them in a mesh I imported. It's hard to tell until I investigate more but for now I'm concentrating on getting something functional for you guys. I'll take care of small visual glitches afterward and then more usability in the interface.

Reply #65 Top
That is some awesome work there. If this keeps up we will be able to import models before the official tools come out. That program of yours reminds me of the old Visual Mex Edit, or Homeworld Ship Editor from way back when. For those who dont know what the hell i am talking about, the MEX on a homeworld model (short for "Mesh EXtensions") was where all the hardpoint, collision box, and navlight data was keeped. In Sins it seems all this data is in the model itself (which is a good thing IMO). I am assuming you are going to use normals for firing arcs like in VME, and HWSE?

The only file formats we truly need are .3ds, or .obj, because they are pretty much universal, and can easily be converted between formats. MS3D supports both 3ds, and obj.

To IC. What units did you use for scaling? are the ships "truescaled" EX: 1 unit in the modeling program = 1 meter, or did you make up something else for this?
Reply #66 Top
In EaW you'd place hardpoints as bones, which covered weapons and attachment points for bridges and such. So these emitters are essentially those, serving both as weapon hardpoints and particle effects (ala the engine trails)?

If this is a stupid question, sorry, I haven't got much into the modeling stuff yet, and I'm asking for a mod team buddy of mine.

The only file formats we truly need are .3ds, or .obj, because they are pretty much universal, and can easily be converted between formats.


Another guy on the staff SSP forums has said that importing .ms3d would also be useful, though I dunno how easily you can convert from that format to .3ds or such. Again, I'm no modeler. (and I'd laugh if you could import whole .bsp levels!)
Reply #67 Top
In Sins it seems all this data is in the model itself (which is a good thing IMO). I am assuming you are going to use normals for firing arcs like in VME, and HWSE?

Each emitter has a position (relative to the model center) and a 3x3 rotation matrix. The rotation matrix is applied to a forward-facing unit vector [0 0 1], and the result is treated as the normal vector for the half-plane in which a weapon can fire:

Forward firing weapons have an identity matrix in place:
1 0 0
0 1 0
0 0 1

And the resulting normal vector [0 0 1] specified the half-plane in the positive Z (forward) direction.

Significantly, the firing arc for a weapon is *always* a half-plane. There is no facility for specifying a different firing arc. (Yes, I've asked for this before. )
Reply #68 Top
To IC. What units did you use for scaling? are the ships "truescaled" EX: 1 unit in the modeling program = 1 meter, or did you make up something else for this?

Pulling up the Kol, the exhaust emitters for the engines are at -338 Z, and the emitters for the forward beam cannon are at 256, for an overall length of 594. I can't find any backstory information on ship sizes in real-world units, but a factor of between unity and 1 unit = 2 meters seems reasonable (Kol would have a length of 1.2 km).
Reply #69 Top
Pretty neat find about the half plane firing arcs. I was 70% sure it worked that way but I hadn't gotten around to trying it yet.
Reply #70 Top
Thats what we are here for to help find these things out

Im finding many similarities between modding Sins, and Homeworld 1. Both can be edited with wordpad. The models with the exception of Sins models not using a Mex file seem to have very similar properties as well. Is it possible to PM me an .MS3D model of a Sins ship so i can check it out, and see what does what.

The thing that concerns me now is multi-texturing (more than 1 texture sheet for the same model). All of the models in Sins are UV mapped to just 1 huge sheet. This is a standard in the gaming industry. What i want to know is if models UV'ed to multiple sheets are supported. (this will save me a ton of time re-texturing my ships if true).
Reply #71 Top
Pretty neat find about the half plane firing arcs. I was 70% sure it worked that way but I hadn't gotten around to trying it yet.

I don't know what I was thinking when I called them "half-planes." A half-plane is a 2-D object. I think the appropriate term here is a "half-space." But I'm glad you understood what I was talking about.

The thing that concerns me now is multi-texturing (more than 1 texture sheet for the same model). All of the models in Sins are UV mapped to just 1 huge sheet. This is a standard in the gaming industry. What i want to know is if models UV'ed to multiple sheets are supported. (this will save me a ton of time re-texturing my ships if true).

As I mentioned in passing back in reply #40, there are some Sins models that feature multiple materials, with 3 textures for each material. (I don't blame you for missing it; there's a lot of info flying around in here.) I don't know if Code Herder has found the field in the vertex data that indicates which material a given set of U,V coordinates corresponds to, however.

Regardless, I think you're fine with multiple textures per model, without mapping everything onto a single sheet.
Reply #72 Top
Well, sins use materials. Each material is made up of a color texture, a data texture and a bump map. You can have multiple materials per models, so in short yes it should work, you won't have to redo your model. I tried a spaceship with 7 different material just for fun and it worked fine.
Reply #73 Top
You guys are way, way over my head now
Reply #74 Top
All will be clear in time.

Good to know that i wont have to re-texture 100 ships. Still actually getting them in game could prove difficult. Hopefully this tool will solve many problems.
Reply #75 Top
Bad news: it looks like firing arcs aren't actually based off of the emitters' exact rotation matrix.

I made a ship with one turret pointed at 60 degrees right, and one pointed at 60 degrees left. In theory, with 180 degree firing arcs, this should give an arc of (-150,30) for the one pointed at -60 degrees, and (-30,150) for the one pointed at 60 degrees. Unfortunately, when I tested in game, both turrets could fire at any target in the (-90,90) degree range.

It looks like the Sins engine just uses the rotation matrix of the emitter to classify a weapon hardpoint as front, left, back, or right, and once that classification has been done, all checks are then done in the model's coordinate system, not the emitter's coordinate system.