3D models in GZdoom, how-to?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

3D models in GZdoom, how-to?

Post by 9skulls »

After hours of googling and few forums searches, I had to make a new topic --- so sorry about that:

I know how to use 3ds max and I recently installed Milkshape 3d to convert my .3ds files to .md2. However, that is as far as i've gotten in making my own models to appear in my doom levels.

So basically i just want to know if there's any tutorials about how to get started with custom 3d models in GZdoom. Few topics i need answers in:

1) How to export models from Milkshape to md2-format so that they WILL work in GZdoom/Doom Builder2? (and extra question: do i need to add bones to my model in milkshape in order to succesfully export the model in .md2?)

2) What kind of LUMPs do I need to create/modify to make a simple non-interactive/decorative model appear in my doom map?
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: 3D models in GZdoom, how-to?

Post by Nash »

1) MD2 sucks and is a lossy format. Use MD3 instead. Be sure to generate the QC file (it's in Tools I think, can't remember) and place the QC in the same directory as your .ms3d before exporting to MD3. If it's just a static decoration, you don't need to add any bones.

2) [wiki]MODELDEF[/wiki]

Since you are using 3ds Max though, why go through all of the unecessary steps? You can export directly out of Max right away. Which version of Max are you using? Chances are I may have the correct exporter for your version of Max.
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

Re: 3D models in GZdoom, how-to?

Post by 9skulls »

Nash wrote:1) MD2 sucks and is a lossy format. Use MD3 instead. Be sure to generate the QC file (it's in Tools I think, can't remember) and place the QC in the same directory as your .ms3d before exporting to MD3. If it's just a static decoration, you don't need to add any bones.
.ms3d, you lost me there. What format is that?
Nash wrote:2) [wiki]MODELDEF[/wiki]
Tried that and couldn't get it work :/ As a result I get this red exlamation mark in the place where the object should appear in when playing my level. Though I think that's because of bad model data. Need to practice a little more.
Nash wrote:Since you are using 3ds Max though, why go through all of the unecessary steps? You can export directly out of Max right away. Which version of Max are you using? Chances are I may have the correct exporter for your version of Max.
I'm using 3DS Max 2010 (x64), is there a build in feature to export to md2/3?
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: 3D models in GZdoom, how-to?

Post by Enjay »

9skulls wrote:.ms3d, you lost me there. What format is that?
Milkshape's native format
9skulls wrote:As a result I get this red exlamation mark in the place where the object should appear in when playing my level.
That is almost certainly a mistake with your DECORATE code rather than your modeldef. The red <!> indicates that you have put an actor in your map that Zdoom has no understandable definition for. It is not the kind of error you get with a faulty MODELDEF - which would usually be an error reported to the console either preventing the map starting or simply making the actor invisible, depending on the nature of the error.
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

Re: 3D models in GZdoom, how-to?

Post by 9skulls »

Thanks for the replies!

So here's what I tried:

1) I open up Milkshape 3d and import my model (.3ds-file) and rotate it a bit to make it look like it's supposed to.

2) I then go to menu Tools > Quake III Arena > Generate Control file.. and make the control file (what's the file for anyways?)

3) I go to export menu and save the model as .md3. Export succesful.

4) Then I open SlumpEd and make a new wad-file that contains the required data lumps (let's just call this wad "stuff.wad")

5) Inside the stuff.wad I create 2 lumps, MODELDEF and DECORATE.

6) In MODELDEF, I have these lines:

Code: Select all

Model KirjainN
{
   Path "Mallit"
   Model 0 "N.md3"
   Scale 1.0 1.0 1.0

   FrameIndex ASD1 A 0 0
}
and inside the DECORATE:

Code: Select all

actor KirjainN 12021
{
  height 40
  radius 20
  +SOLID
  states
  {
  Spawn:
    ASD1 A 10
    loop
  }
}
7) I save the wad-file and open Doom Builder 2. In the small New Map -window I then insert the path to my external stuff wad (to be used as extra resource) and as I proceed to create the map, this error pops up:

Code: Select all

Unable to load resources from location "C:\MyFolder\stuff.wad". Please make sure the location is accessible and not in use by another program. The resources will now be loaded with this location excluded. You may reload the resources to try again.
NullReferenceException when creating data reader...
So what am I doing wrong? (and no, no other program was running when db2 was running..) And i must say I don't quite understand the relation between the DECORATE and MODELDEF lumps and how the frames work.. :/
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: 3D models in GZdoom, how-to?

Post by Enjay »

Perhaps an example would help?

This uses almost exactly your code but with a couple of tweaks. just load the zip without unpacking it.

[edit] Hmmm, the DRD file link didn't work. I'll attach it here instead. [/edit]

[edit] Arrrgg! the board limit has been reashed. Hang on. [/edit]

Doh! silly me misreading the DRD link

http://files.drdteam.org/index.php/file ... eltest.zip
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

Re: 3D models in GZdoom, how-to?

Post by 9skulls »

Enjay wrote:Perhaps an example would help?

This uses almost exactly your code but with a couple of tweaks. just load the zip without unpacking it.

[edit] Hmmm, the DRD file link didn't work. I'll attach it here instead. [/edit]

[edit] Arrrgg! the board limit has been reashed. Hang on. [/edit]

Doh! silly me misreading the DRD link

http://files.drdteam.org/index.php/file ... eltest.zip
That .lmp file in Sprites folder... what is the purpose of it and how can I make my own .lmp files since they seem to be very essential in getting the 3d models to work?
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: 3D models in GZdoom, how-to?

Post by Ceeb »

9skulls wrote:That .lmp file in Sprites folder...
Is probably a sprite. :P

edit

Actually, it looks like it's some kind of a placeholder. The armor model apparently uses it... And in modeldef, it appears that that "sprite" is replaced or something.

I don't know, but the sprite seems to be a placeholder.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: 3D models in GZdoom, how-to?

Post by Enjay »

It is a sprite. I only used it because that was the name of the sprite in 9skulls DECORATE and MODELDEF code and I assumed that he had a sprite named like that in his WAD already. It is merely a copy of one of the sprites from doom2.wad. A PNG graphic would have been equally effective, as would replacing every instance of ASD1 in the code with the name of with a pre-exiting sprite (I tend to use POSS - example below) and remove the need to add a sprite to the WAD completely. What the sprite looks like is irrelevant because it will never be seen as the model will be used in its place.

Code: Select all

Model KirjainN
actor KirjainN 12021
{
  height 40
  radius 20
  +SOLID
  states
  {
  Spawn:
    POSS A 10  <------Look here!!!!!11one
    loop
  }
}
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: 3D models in GZdoom, how-to?

Post by Nash »

http://www.zshare.net/download/65887113048b8e71/

MD3 exporter for 3ds Max 2010 x64. Enjoy. :)

In case you don't know how to install plugins: it goes into your (Max 2010 installation folder)\plugins.

(For example, C:\Program Files\Autodesk\3ds Max 2010\plugins)

From then on, you can export your MD3 directly out of Max by going to File -> Export, and looking for the "Quake III Arena" format in the export box.
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

Re: 3D models in GZdoom, how-to?

Post by 9skulls »

Thanks guys, that helped alot and I got it working! I learned that if you don't use any textures for your model, it appears to be invisible in the game (i thought the texture was not so crucial if you at least assign a simple single-colored surface to your object in milkshape).

One more question (about texturing): let's say I install that plugin so that I only need to use 3Ds Max to make my md3-files, how do I need to handle the textures of the object? I know how to do the uvw-mapping and texturing for normal 3d objects in 3ds Max, but since the output format is md3, do I need to do something differently? I just texture my object as usual, export it to md3 and later when I'm writing my MODELDEF i need to make sure that the same texture file is found in the same directory as the md3 model itself (or at least to make sure the line "Sking 0 ..." points to right place where the texture file is)?
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: 3D models in GZdoom, how-to?

Post by Nash »

UV map as normal in 3ds Max... but know that whatever image you define in for the model's skin MODELDEF will be used.

For convenience, place the texture in the same directory as the MD3. I use this structure for my mods:

Code: Select all

models\
	chair\
		chair.md3
		chair.png
	table\
		table.md3
		table.png
sprites\
	...
...
decorate.txt
modeldef.txt
User avatar
9skulls
Posts: 62
Joined: Sat Sep 20, 2008 4:53 am
Location: Still at the main menu -screen
Contact:

Re: 3D models in GZdoom, how-to?

Post by 9skulls »

Thanks mate, I got a hang of it now :)

So how about animating 3d models? I make my model in 3DS Max, animate it and when exporting, I choose which frames to include in the file (basically i just should select all the frames that contain animation?) and click ok. So how do I add this animation to DECORATION? Am I supposed to handle the animation of a 3d object the same way like normal sprite animations? Like in http://zdoom.org/wiki/Actor_states here? I'm a bit confused about the use of "frames" in DECORATE, so let me check if I got this right:

This is an example state from decorate:

Code: Select all

See:
      POSS A 4  // <-- frame 1, duration 4?
      POSS A 4  // <-- frame 2, duration 4?
      POSS B 4  // <-- frame 3 ...
      POSS B 4
      POSS C 4
      POSS C 4
      POSS D 4
      POSS D 4
      loop
So in here "POSS" means the sprite name, "A/B/C/D" is the number of the frame and "4" is the duration?


And does this do the same thing in one line as the previous example:

Code: Select all

See:
      POSS AABBCCDD 4
      loop
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: 3D models in GZdoom, how-to?

Post by Nash »

To answer your 2 questions: yes, and yes. You're getting the hang of DECORATE.

With MODELDEF, what you are basically doing is you are replacing each frame from the sprite with a frame from the model animation.

This is best understood if you try it yourself.

In Max, when exporting, remember to include only the frames you want to export. In the exporter, there would be a field where you have to key in the range of the animation. You would type something like "0-25" to export frames 0 to 25.

Remember, GZDoom interpolates model animations so sometimes your model may not animate exactly as how you previewed it in Max.

If you are animating rigged characters (with bones, bipeds or whatever), you're going to have to bake the animation into keyframes first before exporting; otherwise nothing will be exported. If you haven't gotten this far yet and don't understand what I'm talking about, then it's safe to ignore this paragraph. :)
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: 3D models in GZdoom, how-to?

Post by Enjay »

Nash wrote:Remember, GZDoom interpolates model animations so sometimes your model may not animate exactly as how you previewed it in Max.
Quite right and, of course, most of the time it looks better that way. However, on the odd occasions that it doesn't look good, an individual model can be set to not interpolate frames and there is also the global cvar to turn it off completely for all models if you really don't like interpolation for some reason.
Locked

Return to “Editing (Archive)”