• Welcome to Twisted DIRT Forums.
 

MX Reflex Custom Model Library maker

Started by mcm2boys, January 09, 2015, 02:21:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mcm2boys

To go along with JamieT's ReflexSurfaceCreator here is the ReflexLibMaker.

There's no help file with this since it is pretty simple. The program helps create, load and save *.liblist files. These are text *.ini style files that hold the information needed to compile each model into a library. Moving left to right across the main menu bar the buttons are:

Red button - exit.
Blue button - Load a *.liblist that you saved earlier.
Blue button - Save the current *.liblist to file
Green button - Start the wizard that guides you through adding a model to the liblist.
Brown button - compile the current liblist into a *.modellib library file.

The library compiler will need the *.surface file from JamieT's tool, the texture(s) in BMP format needed by the model and if necessary a separate *.surface file to ceate the collision model. If no separate collision *.surface file is provided then the original model file will be used.

Note: If the model is complex or high poly shape then it will be better to provide a simpler shaped model for the collision otherwise you will slow Reflex down during the collision detection part of the game cycle. There is also the possiblity to create a collision model using combinations of simple box, sphere and cylinder shapes which replace the collision model.

There are several different types of model possible, the difference being how many textures they take. The simplest is diffuse, this uses one texture with the diffuse colours of the object. The next option is to include a normal map as well to give that 3D bump effect. There are a couple of other more advanced types including Ambient occlusion but you'll need to read up on that elsewhere..

You simply go through the screens filling in files or options where asked then press Add to add each model to the liblist. Close the wizard dialog when you are done. When you return to the main window you should see the all model data that has been added in the main window. Then you just need to add a library name at the top of the list and the extra shape based collision data, if you want to use that, and you can compile the library. Copy the library into the Reflex folder under the \models folder of the DE install and you can fire up DE and use your custom models.

Options:
   AI Avoid - AI will try to avoid hitting the object.
   Drive on - This is for bridges platforms or ramps, otherwise it causes riders to fall if they try to ride on the object.
   Soft Collision - Again for drive on objects to avoid strong collision reactions.
   Is Bale - adds flags to tell DE to allow up/down bale behavviours to this object (for bales)
   Invert faces - sometimes the collision model will be created inside out so you can drive into it and then get stuck inside the object. Ticking this box will turn the collision back outside out.

Here are some examples of the shape based collision data that you can use. This has to be entered manually, you will also have to add a line - CollisionIndex=n to the objects that use it, where n is the n from [Collision_n] of the shape the model is using.

For a box - used by bales:
[Collision_0]
numParts=1
part_0_type=box
part_0_position=0.000,0.000,0.000     
part_0_breadth=8         
part_0_height=2           
part_0_length=2   

For a cylinder:
[Collision_0]
numParts=1
part_0_type=cylinder
part_0_position=0.000,0.000,0.000     
part_0_radius=1           
part_0_length=2   

For a sphere:
[Collision_0]
numParts=1
part_0_type=sphere
part_0_position=0.000,0.000,0.000     
part_0_radius=1           

If you want to add more than one shape to an object then change numParts=n and for each shape use part_n_xxxx=  where n increases for each shape eg:

[Collision_0]
numParts=1
part_0_type=sphere
part_0_position=0.000,4.000,0.000     
part_0_radius=1           
part_1_type=sphere
part_1_position=0.000,0.000,0.000     
part_1_radius=2           

This will make a snowman shape.. :)


Finally any model that uses a physics type above ride through or static has to use the shape system because these objects can move when hit and they don't recognise the poly based collision models. This means using a poly based collision model on this type of object will result in a ride through object in game.

So after all that here it is:

Reflex Lib Maker v1.09 10 Feb 2015

mcm2boys

Due to small organisational error the wrong version of the Lib maker was uploaded. If you have already downloaded the tool then please download it again otherwise you will find the collision doesn't work.

mcm2boys

After release we found a few bugs in the lib maker so here is an updated version. The bug was related to using a separate collision model and saving objects with static collision that wouldn't always create a collision model leaving your models as ride through in game.

The updated link is in the 1st.

mcm2boys

A new option to create a model with diffuse alpha textures (transparency) and added an option to set the LOD distance (how far away the camera is from the object before it is not drawn) and some bug fixes. Many thanks to JamieT for all the testing again.

Updated link is in the 1st post..

TwizardT

could someone please take the time to make a video tutorial for this because I can't figure everythng out from the post.
this is probebly due to the fact that i'm dutch and don't understand everything written.

thanks,

TwizardT

filip42

Quote from: TwizardT on January 31, 2015, 11:23:25 AM
could someone please take the time to make a video tutorial for this because I can't figure everythng out from the post.
this is probebly due to the fact that i'm dutch and don't understand everything written.

thanks,

TwizardT

I would like also to see a tut video becouse I have also trubles with using the program  ;D

RonnieMacfan#77

Would be awesome with a tutorial cause i cant figure this out. :'(

mcm2boys

hmm, i don't really do videos - maybe someone with video making skills and has worked out how to use the program is interested. I'm not ruling it out but not soon.

Maybe i can step you through it more slowly in text - where are you getting stuck?


PS What software do you use to make video tuts ?

TwizardT

I use Mirrilis action to record videos.
it has a free version but then you will get a overlay saying recorded with:MIRRILIS ACTION at the top
I get stuck on this:

i got a model from a tree and used 3 different textures and i don't know how to add more then 1 texture
also for tuffblocks wich scaling in blender do you use? and wich sound? and I can't get it working with collision and stuff

JamieT

You can't add more than 1 texture at the moment.  If you have more than 1 texture you'll have to split up the model, or combine all the textures into 1, and then remap the UV coordinates on the model.

I would be very wary of making trees as 3D models.  You need to make sure it's as low poly as possible to avoid lag.  The stock tracks use a different system for trees, they're not just regular 3D models.

filip42

I think that I do something wrong in the ReflexLibmaker becouse my objects are't working for me but they are working form Jamie .  :'(

mcm2boys

@TwizardT - goeie dag jonge,
The scaling is for scaling the collision object. So as a default use 1.0 so the collision object is the same size as the original object. Some people like to scale bales slightly smaller 0.95 so that you can 'touch' the bale without hitting it. But 1.0 is good.

Since bales usually move you would need to use a Physics type of Hay Solid then you will need to use a box shape collision like the 1st example.  For a sound I would use TuffBlock.

I don't know what all the sounds are - the names give you a good idea what they are, but you can always make a model for each sound and see what sounds they make in game.

For trees I would use a cylinder shape for collision instead of the model itself, since that will help the collision detection cycle to be much faster. What are your steps using Lib Maker making the tree model, if you can make a vid i can tell you where you're going wrong if that helps..?

TwizardT

ten eerste hoezo opeens nederlands?
secondly: for some odd reasone when i compile the tuffblock model into a libraryfile it doesn't show up in DE (i did save it in \models)
and I still think a video would be very handy if someone could make one (mirrilis action is very simple to crack)

mcm2boys

I used to live in the Netherlands for a few years, i should be able to speak more nl than i can.

The lib file needs to go in the \models\reflex folder? You mean the *.modellib file doesn't show up in DE or the model when it's placed in a track?


I don't have time right now to make a vid but i will look into it when my deadlines have passed.

TwizardT

that would be awesome if you could make a video
also ive only got a \model folder not a \model\reflex folder and the whole folder doesn't show up in DE
this is where ive put the .modellib file:
C:\Program Files (x86)\DigitalEarthworks\models

and jamieT i have managed to make a low poly tree model with right textures wich compiles in your compiler(if that makes sense) i just don't know if it works cuz i can't see the library folder in DE

TwizardT

okay i have the folder working now but it indeed doesn;t show up when i place it

mcm2boys

I'm not a model maker, but my 1st guess would be the poly's 'facing' the wrong direction - or the scale of the model, model units should be 1 unit = 1 foot?


If that doesn't help then i'll have to hand over to JamieT since he's the expert on model creation.

JamieT

Yeah, 1 Unit on the model = 1 Foot.

When working in Blender I believe that an extra step is needed when scaling objects.  "Apply Transformations" is what you need to make sure you click after scaling, or rotating objects.

As for the objects not appearing... Is this in Digital Earthworks that they don't appear, or in the game?  Filip42 seems to be having similar issues.  He sent me his surface, and everything worked fine for me... but for him, objects weren't being placed in DE, due to the NAN vertical position thing...  Did you get to the bottom of that Laurie?  Could it be a case of commas and full stops getting mixed up?

TwizardT

i didn't make the object in blender i only exported it with blender cuz in c4D it doesn't export right
and i do get the NAN message on the y axis in DE
also ive made a video on every single step i take with making objects
i'll send a link to that when its finished uploading

TwizardT