Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 07/30/08 19:07

ONIrules
Member
Registered: 09/04/07

Learning to make models

Hello. Need a little help here. I'm using ModTool to create models,weapons, and even try to make new characters, but I don't know how. As you can see the pic below I'm trying to make a sniper rifle, but I don't know how to export the file and import to ONI. Can you guys teach me how to do this?

010241601.jpg

Last edited by ONIrules (07/30/08 19:07)

Offline

#2 07/30/08 23:07

Gumby
Member
From: Seattle, WA, USA
Registered: 08/30/07

Re: Learning to make models

Is there an option to export to obj or collada format?

...not that I'm an expert on this, I'm just waiting for someone who knows more to come around.


Iritscen: roll
Iritscen: it's amazing this program even works
Gumby: i know
Iritscen: and that statement applies to my code, not just yours

Offline

#3 07/31/08 00:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

Give me a day or so to write up a tutorial.

In the meantime, the model will need to have less than 2,000 polygons (I'm not sure of the maximum number of polygons that Oni will allow).

Try exporting some ONWC from Oni for comparison.
-extract:obj <directory> ONWCw2_sap.oni
See here: http://wiki.oni2.net/OniSplit#Models

That should give you a brief overview, until I write the tutorial.

Last edited by EdT (07/31/08 00:07)

Offline

#4 07/31/08 20:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

Here's a tutorial:

To add a new weapon to Oni, you will need to create 3 files, ONWC (properties of the weapon), M3GM (3D model) and TXMP (texture map for the weapon).

1) Import the new model into a 3D program. It should have less than 2,000 polygons. You may want to export a similar weapon from Oni to see its position and rotation in the 3D space. You will want to match those properties in your new model.  To export an ONWC as an .obj with .mtl, the basic command is -extract:obj <target directory> <ONWCw8_mbo.oni

2) Export the model as .obj along with the .mtl file. The texture map should be no larger than 256x256.  For the sake of the tutorial we'll name the weapon w50_new.  Thus you should have the following files: w50_new.obj, w50_new.mtl and w50_texture.png (The texture format can be .png, .dds, .tga)

3) Import the model into Oni using Onisplit. The basic command is
-create:m3gm <target directory> -tex:w50_texture w50_new.obj
This will create the M3GMw50_new.oni , in the target directory (it can be where ever you want)

4) Next you need to import the w50_texture.png file. The basic command is
-create:txmp <target directory> -genmipmaps -format:bgr555 w50_texture.png.
This will create the file TXMPw50_texture.oni

5) You will need to create the ONWC file. Export an ONWC file from Oni, which is similar to the type of weapon you will be importing, lets say the Mercury Bow. The basic command is -extract:xml <target directory> ONWCw8_mbo.oni This will produce the file ONWCw8_mbo.xml.

6) Rename ONWCw8_mbo.xml to ONWCw50_new.xml.  Open the file in a text editor.  You will need to change the following lines:
<Instance id="0" type="ONWC" name="w8_mbo"> to <Instance id="0" type="ONWC" name="w50_new">
<Geometry>#7</Geometry> to <Geometry>M3GMw50_new</Geometry>
<Name>w8_mbo</Name> to <Name>w50_new</Name>

Scroll down the file until you see the line <Instance id="7" type="M3GM"> (Note: the id number will vary depending on the weapon) Delete everything until the line </Oni>.  Do not delete the tag </Oni>.

7) Import ONWCw50_new.xml, the basic command is -create <target directory> ONWCw50_new.xml. This will create the file ONWCw50_new.oni

8) Now put all 3 files (ONWCw50_new.oni, M3GMw50_new.oni, TXMPw50_texture.oni0) into the level of your choice for testing. Rebuild/recombine that level.

9) Play Oni in the level you put the new weapons and give Konoko that weapon.  Hopefully, you will see your new weapon.

10) If the gun is invisible, then you will need to scale up the model in the 3D program and import into Oni.  If the weapon is black, then the texture map is missing.

Hope this helps

Last edited by EdT (07/31/08 21:07)

Offline

#5 07/31/08 21:07

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Thank you for the tutorial. Also put it on Oni Galore so other peoples can do this to.

Last edited by ONIrules (07/31/08 21:07)

Offline

#6 07/31/08 21:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

I will... :-)

Offline

#7 07/31/08 21:07

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

EdT: Just two more question. Everytime I export an OBJ file it also creates a MTL file right? Then after I export the file from ModTool why didn't it create a the texture map?

Last edited by ONIrules (07/31/08 21:07)

Offline

#8 07/31/08 21:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

If the model is textured, the texture map should be a graphics file, jpg, tga, bmp.  You will take that file resize it to 256x256 and import into Oni.

You can always post the files for me to look at.

Offline

#9 07/31/08 22:07

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Edt: Can you tell me a little more about how to texture the model? Sorry about posting so many questions.

Last edited by ONIrules (07/31/08 22:07)

Offline

#10 07/31/08 22:07

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

No problem, didn't the model come with a texture map?  If not, then its a lot of work to create a texture map for it.  You will need to look at the instructions for ModTool on how to do that.

Can you post the files for the model here:
http://drop.io/EdT_OniFiles/  I will take a look at it.

Offline

#11 08/01/08 06:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Drop the file which is w25_snr. It contains and obj, mtl and a 3Ds file.

Offline

#12 08/01/08 07:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

"<Instance id="7" type="M3GM"

So if I have the line "<Instance id="6" type="M3GM">" instead of "<Instance id="7" type="M3GM"
I start deleting this line all the way to </Oni> right? (Just to know so I can make more weapons in the future smile)

Last edited by ONIrules (08/01/08 07:08)

Offline

#13 08/01/08 10:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

ONIrules: I took a look at your files and I suggest you try to find another model.  This has over 5,000 polygons, it will crash Oni, so you would have to lower the polygon count (I don't know how that's done in ModTool). There are no textures, so that means you will have to create a UV map (A long and sometimes painful process, you will have to learn how to do that.) then create the actual graphics for the weapon.

And yes, the expression <Instance id="7" type="M3GM" will vary among the models, so just use that as a starting point for deletion.

Offline

#14 08/01/08 16:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

How did you count all the polygon? Isn't there an option in ModTool or any other program that counts all the polygon? I'm also using blender.

Offline

#15 08/01/08 16:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

There should be a get object info somewhere in the program.  :-)

Offline

#16 08/01/08 17:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Going to try making this Plasma Pistol from Halo. I think it less than 2000 polygons.

Last edited by ONIrules (08/01/08 18:08)

Offline

#17 08/01/08 21:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Plasma Pistol FAILED. BTW EdT where can I get a program that creates UV map?

Offline

#18 08/01/08 21:08

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Learning to make models

If you use Blender, ONIrules, then look at this sorta-hidden page: http://wiki.oni2.net/User:Iritscen/BlenderTutorial

It tells you near the top how to see the number of polygons in the file (although for Oni, it's actually the number of vertices that's the key number).  By the way, ONIrules, average polys for a weapon in Oni are way way way less than the models you are looking at online.  I'm not sure if you know that and you just wanted to test something fast by importing one of those, which is fine, but it is important to recognize that those models are, even by my standards, overly poly-intensive, before you go modeling your own.  And geyser thinks I'm crazy for using as many polygons in my work as I do.  But my HD character model work uses less polygons than that Plasma Pistol you mentioned a couple posts up.  Sorry if you already knew about all that, but I just felt it needed to be stated.

Oh, and while I'm posting here, I'll answer the question you directed at Ed: Blender creates UV maps.  I'm sorry that I don't have that part of the tutorial written yet (now you know why it's hidden).  There's a whole wiki devoted to documenting Blender, though, at: http://wiki.blender.org/index.php/Manual

Sorry I can't be of more help, I'm still figuring out Blender's UV stuff myself.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#19 08/01/08 21:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

Iritscen: Thanks. At least its better than nothing smile

Offline

#20 08/01/08 21:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

ONIrules: Can you post the files for the Plasma Pistol for me to look at.  Also, can you give me the URL to where you got the model.

Offline

#21 08/01/08 22:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

I tested 2 plasma pistols from 2 different makers. Both URLs have the "Download Model" button.
http://sketchup.google.com/3dwarehouse/ … revstart=0
http://sketchup.google.com/3dwarehouse/ … revstart=0

There is also a DAE file and other files too and no malicious code. Right now testing the Plasma Rifle (Not the SML3 Plasma Rifle)
Plasma Rifle Model http://sketchup.google.com/3dwarehouse/ … revstart=0

Last edited by ONIrules (08/01/08 22:08)

Offline

#22 08/01/08 22:08

ONIrules
Member
Registered: 09/04/07

Re: Learning to make models

OMFG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I import a BIG Plasma Rifle

010299063.jpg 010299064.jpg 010299065.jpg

Although its big, I'm at progress!

010299150.jpg 010299151.jpg 010299152.jpg   

Its good that Konoko is a superhuman. smile

Last edited by ONIrules (08/01/08 22:08)

Offline

#23 08/01/08 22:08

love_Oni
Member
From: Da Nang, Vietnam
Registered: 05/10/08

Re: Learning to make models

Er... I don't think that big gun can be stored in the holster...

Anyway, I'm curious to know how this gun shoot smile.

Last edited by love_Oni (08/02/08 10:08)


The Boy Who Knew Too Much tongue

Offline

#24 08/01/08 23:08

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Learning to make models

That would be a funny video... Konoko walking around with that giant weapon and then holstering it.  Now you see it... now you don't!

Offline

#25 08/02/08 00:08

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Learning to make models

Hey, glad to see you've got the hang of importing, ONIrules.  That's the second biggest gun I've ever seen ;-)

(http://en.wikiquote.org/wiki/Get_Smart)


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

Board footer

Powered by FluxBB