3DP file format

Discussion of Pop Top's last release of RRT.
milo
Engineer
Posts: 512
Joined: Sat Nov 11, 2006 5:36 pm
Location: End of the line

3DP file format Unread post

A few people have been waiting patiently for this:

Code: Select all

0000:0003 byte[4]     always 33 44 50 46  "3DPF"
0004:0005 word        always 4 so far (major version?)
0006:0007 word        always 1 so far (minor version?)
0008:000B byte[4]     always 33 44 4D 44  "3DMD"
000C:000F dword       number of INST blocks
              note: (0,0,0) appears to be track-level under center of loco
              note: 1 unit is roughly 1 foot
0010:0013 float       relative X   (note: +X is toward left side of loco)
0014:0017 float       relative Y   (note: +Y is toward rear of loco?)
0018:001B float       relative Z   (note: +Z is toward top of loco)
001C:???? INST[INST block count]

          An INST is a full representation of the model.  Successive INST
          blocks have lower polygon counts, possibly representing a view of             
          the model at a greater distance.
0000:0003 byte[4]     always 49 4E 53 54 "INST"
0004:0007 dword       vertex count
0008:000B dword       triangle count
000C:???? Vertex[vertex count]    
????:???? Triangle[triangle count]

          A Vertex is simply a set of 3D floating-point coordinates:
0000:0003 float       X
0004:0007 float       Y
0008:000B float       Z

          A Triangle contains vertex indices, normals, texture UV coordinates,
          and what I think is a material or texture index:
0000:000B dword[3]    vertex indices
000C:002F float[3][3] normals for each vertex
0030:0047 float[3][2] texture UV coordinates for each vertex
0048:004B dword       material index? (usually 0)
I have a quick-n-dirty Blender model import script working, but until I can get it to read .DDS texture files, it's fairly useless.

Somewhat disappointingly, there is no motion data in this file. I think the game may hardcode motions for objects with particular filenames:
_Light<n>
_Piston<n>
_ConnectingRod<n>
_CouplingBar<n>
_Drivewheel<n>
_Boggie<n> [sic]
_Bogie<n>
_Truck<n>
_Body
_LengthPoint
_ServicePoint
_TrackPoint

For buildings, animations appear to be done by flipping between _Anim<n> models.

Edit 2007/04/01: fixed INST definition
Last edited by milo on Sun Apr 01, 2007 11:32 pm, edited 1 time in total.
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Unread post

uuuuufffff Milo I am sorry. I had this information already. :oops: I got it from Pjay, but I only have a print version. I should have shared this with you…I was thinking we could have a long breath before we would tackle with 3D.

This information wasn’t helpful to me in that sense as I don’t understand coding and couldn’t figure out conversions. But it helped me to figure out how to swap wheels and etc. So we could leave moving parts aside for while and concentrate on how to get texture and body to be seen on a 3D editor.

I don’t know much about the editors. I downloaded Gmax. Well it is free, and MSTS can be used with it.

::!**!
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Unread post

I checked Blender. A free open source 3D program, sounds good. :)

Has anyone have any experience with it? Or Gmax? Is one of these better? I understand that MSTS has tools for Gmax? If I am going to learn a 3D program, I think that learning one is enough. But which one.

Milo if you have import program, can I have it? Even if it can’t support texture, it could help me to familiarize with the program.
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

bombar-If you're looking for a good universal 3D modeling program, one that will work with the current MSTS and some-if not all-future Train Sims, I would look at 3d Canvas.
GMax has been discontinued and is no longer supported.
3D Canvas will not run on Win 98. You must have XP. It also costs $35.00 (USD) for the Plus version, which has the ability to export into MSTS format.
There is a free version you can download to try it out and there is a Pro version which is $70.00 (USD), but I don't see why you'd need the Pro version. Check this link for a comparison chart of the 3 versions.
Personally I use Train Sim Modeler, but it only converts to MSTS and is useless for anything else, so I can't comment on 3d Canvas or GMax. I have tried them both but only after having got used to TSM and I found both to have a much steeper learning curve, but I understand that 3D Canvas isn't as hard to learn as GMax.
Hawk
milo
Engineer
Posts: 512
Joined: Sat Nov 11, 2006 5:36 pm
Location: End of the line

Unread post

gmax:
+ Cut-feature version of 3DS Max
- Discontinued
- Owned by Autodesk, whose business practices I abhor
3D Canvas:
+ $35 version supports MSTS
- Would require $70 version to support a .3DP add-on
Train Sim Modeler:
+ Is specifically designed for railsim games
+ $39 version supports MSTS
- Has some disturbing licensing policies for models built with it
- Seems to have zero provisions for scripting or adding third-party file formats
Blender:
+ Free
+ Easily modifiable (open-source and uses Python for scripting language)
- >steep< learning curve
- poor (though improving) documentation
- feature set and API appear to be constantly changing

I'd personally vote Blender, if just to let the most people play with RT3 models, but I'll accept 3D Canvas if our community insists.

One other possibility might be to build a converter to and from MSTS format. Developing new engines and buildings would be more cumbersome, but it'd make a huge base of existing work available to us. Not sure how feasible this is yet; I don't own MSTS, and don't know how the game keeps track of mechanically independent parts in a model.
User avatar
pure al
Dispatcher
Posts: 306
Joined: Sat Dec 23, 2006 11:38 am
Location: British Rail Class 450

Unread post

Hey guys,
Blender all the way for me. It didn't take too long for me to learn the basics. The community surrounding it is huge, and willing to help I would imagine. There are also a few tutorials I found very easy to follow that walk you through what's what. I think if you're looking for a program, go with that. Plus milo can probably make the ui look like RT3's scenario editor :D
User avatar
Hawk
The Big Dawg
Posts: 6504
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Unread post

There's been a couple of utilities created to convert an .s file (MSTS model data file) to something editable in TSM or 3D Canvas, but the creators were all but drawn and quartered by the community.
The model builders of the community as a whole don't like the idea of their models being converted for editing. Mainly because the MSTS community is abound with those that don't concern themselves with right and wrong.

The only licensing policy with TSM that I know of is that if you want to sell a creation you have to buy a $300.00 license. I've been using TSM for about 5 years and never had a problem with it. I've made 100's of models and added animation to a few dozen of them.
I will say tough that TSM isn't an option for RRT3 models since it only converts to MSTS and nothing else.
Hawk
milo
Engineer
Posts: 512
Joined: Sat Nov 11, 2006 5:36 pm
Location: End of the line

Unread post

Ah. Thanks for the info, Hawk; I really hadn't thought that one through and probably would have put my foot in it. Same likely applies to this community.

Conclusions:
  • Strike the MSTS converter (and, through it, TSM) as an option.
  • I'll halt development on the Blender import script.
  • I'll still build a Blender export script, so that we can create new models, but we'll have to build 'em from scratch. It will be up to each author whether he wants to make his .blend file available.
  • Sole textures supported will be .TGA files, partly to make ripping less likely, partly because there's an S3 patent on DXT3 compression that I don't want to run afoul of.
Does that address the issues? It's a little hard on the skinning guys, but they're no worse off than they were.
milo
Engineer
Posts: 512
Joined: Sat Nov 11, 2006 5:36 pm
Location: End of the line

Unread post

Whoops, misinterpreted what an INST was. Some of the .3DP files, usually the larger ones, contain multiple models with decreasing polygon counts using an INST for each. My guess is that the engine uses the lower-poly versions when the object is far away; it could also pick the INST based on the graphics detail selected in the game options. All of the INST objects appear to share textures. (Will edit description at top)

Heck if I know how to set that up correctly. Pure al, does this have something to do with 'layers' in Blender?
User avatar
pure al
Dispatcher
Posts: 306
Joined: Sat Dec 23, 2006 11:38 am
Location: British Rail Class 450

Unread post

Hmm. I can't tell you what an INST is, although from your explanation it could be the number of files of the same texture. If you're close to the model it uses the large one, then if you zoom out it starts to use smaller versions. All these textures use the same naming structure, which may be why you say 'Inst objects share textures'. Blender doesn't have 'layers' afaik. Was this helpful?
User avatar
bombardiere
Dispatcher
Posts: 425
Joined: Tue Nov 14, 2006 9:07 am
Location: Turku, Finland

Unread post

This is roughly correct. Not only the 3D files have smaller texture files, the 3D files itself has simplified versions for longer distances. E.g. objects farter away have simpler 3D structure with less “triangles”. There are 5 or 6 levels. All the levels “share” same texture in that sense as the textures has only one co-ordinates. This sets the location of triangle regales of the picture size. E.g. Co-ordinates are always same (I remember the scales was 0-1) for example 0.7x0.7. This location is relevative. The side of texture picture file is always 0 to 1, and it is counted same way regales its pixels size.

Uuuufff I don’t know if anyone can understand me. I am not expert and it is hard to me explain this. Short. Co-ordinates are same and are adjusted within smaller textures.

I don’t know if Poptop made smaller 3D triangles by hand or was there automatic scaling system.

I think we should choose unofficial official 3D program. I think Blender is good one. Open source and etc. But I am going to need help figuring it out. What are those funny arrows, and how I rotate the 3D model. (I managed to figure out how to change camera view)

Making new models is too much for me at the moment, but I would want to do following with the program:

1. Select areas and remove those (such as boiler domes, cow catchers)
2. Select areas and reshape or resize those (shorten or rounder the model)
3. Copy and paste shapes from other locomotive 3D files (boiler domes, engine cabs etc)
4. Edit texture locations. Fix the mirroring and set the skin textures for new areas.

This is a tall order, I know…
JoshM
Hobo
Posts: 31
Joined: Sun Apr 01, 2007 5:20 pm

Unread post

What program has anyone used to edit 3dp files. I got Blender but don't see how I could import a .3dp file. If I find the time I need to learn to make 3d models. Thanks
User avatar
pure al
Dispatcher
Posts: 306
Joined: Sat Dec 23, 2006 11:38 am
Location: British Rail Class 450

Unread post

Well get some practice in blender first. Look for tutorials online, they help a lot. It shouldn't be too long before Milo figures out a way for us to save out 3dp files. All 3D modellers will be very useful to the community.
PJay
Cat
Posts: 9
Joined: Tue Nov 28, 2006 2:06 pm
Location: Hooglede Posts:-32766

Unread post

milo wrote:Whoops, misinterpreted what an INST was. Some of the .3DP files, usually the larger ones, contain multiple models with decreasing polygon counts using an INST for each. My guess is that the engine uses the lower-poly versions when the object is far away; it could also pick the INST based on the graphics detail selected in the game options. All of the INST objects appear to share textures. (Will edit description at top)

Heck if I know how to set that up correctly. Pure al, does this have something to do with 'layers' in Blender?

hmm

http://studwww.ugent.be/~pbusscha/rt3/f ... DPspec.txt

Has been on my site for a long time, sadly though, it seems like it was not linked to from anywhere on my site. Sorry for the extra work it caused you. I'm sure I've pointed to it a few times at the Gathering forums though (I even created a very simplistic Java 3D viewer for the opbjects, various versions and screenshots are still available here : http://studwww.ugent.be/~pbusscha/rt3/p ... ngcreator/ )
User avatar
pure al
Dispatcher
Posts: 306
Joined: Sat Dec 23, 2006 11:38 am
Location: British Rail Class 450

Unread post

:shock: Wow you don't even know how much that could help me out! Pjay before you disappear again I just want to say thanks for all the programs and data. Seriously great stuff! Please tell us if you have any other hidden secrets :D I'm off to try the building creator now.
Post Reply