Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
CBM

GZDoom - using animations present in a quake 2 md2 model - need help

Question

GZDoom - using animations present in a quake 2 md2 model:

 

I wish to learn how to use animations present in an md2 file... here is what I have tried so far

 

I have been trying to figure out how to use animations stored in MD2 models


so far, I have read a ton of info online but not gotten any wiser, the examples on the zdoom wiki does not seem to work

I really wanted to be able to use named animations

when I open an md2 model in "misfit" (an md2 model editor and converter), I can see most md2 models seem to use "frame animation" instead of "skeleton" animation... when I use the examples on the ZDoom wiki, then the engine complains that there are no skeleton animations

 

i've been told that in order to make gzdoom use md2 animations, I must use Frame animation.

Amd then know each frame name and what they does.

 

But that doesn't tell me all I need to know, so I hope someone in this forum might be able to help me out.

 

//I tried this...

Model sydney
{
Path "Models\monsters\sydney"
Skin 0 "sydney.png"
Model 0 "tris.md2"
Scale 1.5 1.5 1.5

INTERPOLATEDOUBLEDFRAMES   // what does this mean???

//spawn - quake2 spawn sets a and b (S)
FrameIndex Q2SA A 0 1
FrameIndex Q2SA b 0 2
FrameIndex Q2SA c 0 3
FrameIndex Q2SA d 0 4
FrameIndex Q2SA e 0 5
FrameIndex Q2SA f 0 6
FrameIndex Q2SA g 0 7
FrameIndex Q2SA h 0 8
FrameIndex Q2SA i 0 9
FrameIndex Q2SA j 0 10
FrameIndex Q2SA k 0 11
FrameIndex Q2SA l 0 12
FrameIndex Q2SA m 0 13
FrameIndex Q2SA n 0 14
FrameIndex Q2SA o 0 15
FrameIndex Q2SA p 0 16
FrameIndex Q2SA q 0 17
FrameIndex Q2SA r 0 18
FrameIndex Q2SA s 0 19
FrameIndex Q2SA t 0 20
FrameIndex Q2SA u 0 21
FrameIndex Q2SA v 0 22
FrameIndex Q2SA w 0 23
FrameIndex Q2SA x 0 24
FrameIndex Q2SA y 0 25
FrameIndex Q2SA z 0 26
FrameIndex Q2SB a 0 27
FrameIndex Q2Sb b 0 28
FrameIndex Q2Sb c 0 29
FrameIndex Q2Sb d 0 30
FrameIndex Q2Sb e 0 31
FrameIndex Q2Sb f 0 32
FrameIndex Q2Sb g 0 33
FrameIndex Q2Sb h 0 34
FrameIndex Q2Sb i 0 35
FrameIndex Q2Sb j 0 36
FrameIndex Q2Sb k 0 37
FrameIndex Q2Sb l 0 38
FrameIndex Q2Sb m 0 39
FrameIndex Q2Sb n 0 40

//run - quake 2 run set a (R)
FrameIndex Q2rA A 0 41
FrameIndex Q2rA b 0 42
FrameIndex Q2rA c 0 43
FrameIndex Q2rA d 0 44
FrameIndex Q2rA e 0 45
FrameIndex Q2rA f 0 46

//attack - quake 2 attack set a (A)
FrameIndex Q2aA A 0 47
FrameIndex Q2aA b 0 48
FrameIndex Q2aA c 0 49
FrameIndex Q2aA d 0 50
FrameIndex Q2aA e 0 51
FrameIndex Q2aA f 0 52
FrameIndex Q2aA g 0 53
FrameIndex Q2aA h 0 54

//pain - quake 2 pain set a (P)
FrameIndex Q2pA A 0 55
FrameIndex Q2pA b 0 56
FrameIndex Q2pA c 0 57
FrameIndex Q2pA d 0 58
FrameIndex Q2pA e 0 59
FrameIndex Q2pA f 0 60
FrameIndex Q2pA g 0 61
FrameIndex QppA h 0 62 //unknown sprite? - only 61 sprites????
FrameIndex QppA i 0 63
FrameIndex Q2pA j 0 64
FrameIndex Q2pA k 0 65
FrameIndex Q2pA l 0 66

//jump - quake 2 jump set a (J)
FrameIndex Q2jA A 0 67
FrameIndex Q2jA b 0 68
FrameIndex Q2jA c 0 69
FrameIndex Q2jA d 0 70
FrameIndex Q2jA e 0 71
FrameIndex Q2jA f 0 72

//flip - quake 2 flip set a (F)
FrameIndex Q2fA A 0 73
FrameIndex Q2fA b 0 74
FrameIndex Q2fA c 0 75
FrameIndex Q2fA d 0 76
FrameIndex Q2fA e 0 77
FrameIndex Q2fA f 0 78
FrameIndex Q2fA g 0 79
FrameIndex QpfA h 0 80
FrameIndex QpfA i 0 81
FrameIndex Q2fA j 0 82
FrameIndex Q2fA k 0 83
FrameIndex Q2fA l 0 84

//salute - quake 2 salute (SL)
FrameIndex Q2sl A 0 85
FrameIndex Q2sl b 0 86
FrameIndex Q2sl c 0 87
FrameIndex Q2sl d 0 88
FrameIndex Q2sl e 0 89
FrameIndex Q2sl f 0 90
FrameIndex Q2sl g 0 91
FrameIndex Qpsl h 0 92
FrameIndex Qpsl i 0 93
FrameIndex Q2sl j 0 94
FrameIndex Q2sl k 0 95

//taunt - quake 2 taunt set a (T)
FrameIndex Q2tA A 0 96
FrameIndex Q2tA b 0 97
FrameIndex Q2tA c 0 98
FrameIndex Q2tA d 0 99
FrameIndex Q2tA e 0 100
FrameIndex Q2tA f 0 101
FrameIndex Q2tA g 0 102
FrameIndex Q2tA h 0 103
FrameIndex Q2tA i 0 104
FrameIndex Q2tA j 0 105
FrameIndex Q2tA k 0 106
FrameIndex Q2tA l 0 107
FrameIndex Q2tA m 0 108
FrameIndex Q2tA n 0 109
FrameIndex Q2tA o 0 110
FrameIndex Q2tA p 0 111
FrameIndex Q2tA q 0 112

//wave - quake 2 wave (wv)
FrameIndex Q2wv A 0 113
FrameIndex Q2wv b 0 114
FrameIndex Q2wv c 0 115
FrameIndex Q2wv d 0 116
FrameIndex Q2wv e 0 117
FrameIndex Q2wv f 0 118
FrameIndex Q2wv g 0 119
FrameIndex Q2wv h 0 120
FrameIndex Q2wv i 0 121
FrameIndex Q2wv j 0 122
FrameIndex Q2wv k 0 123
FrameIndex Q2wv l 0 124
FrameIndex Q2wv m 0 125
FrameIndex Q2wv n 0 126
FrameIndex Q2wv o 0 127
FrameIndex Q2wv p 0 128
FrameIndex Q2wv q 0 129

//point - quake 2 point (pt)
FrameIndex Q2pt A 0 130
FrameIndex Q2pt b 0 131
FrameIndex Q2pt c 0 132
FrameIndex Q2pt d 0 133
FrameIndex Q2pt e 0 134
FrameIndex Q2pt f 0 135
FrameIndex Q2pt g 0 136
FrameIndex Q2pt h 0 137
FrameIndex Q2pt i 0 138
FrameIndex Q2pt j 0 139
FrameIndex Q2pt k 0 140
FrameIndex Q2pt l 0 141

//idle (crstand) - quake 2 idle set a (i)
FrameIndex Q2iA A 0 142
FrameIndex Q2iA b 0 143
FrameIndex Q2iA c 0 144
FrameIndex Q2iA d 0 145
FrameIndex Q2iA e 0 146
FrameIndex Q2iA f 0 147
FrameIndex Q2iA g 0 148
FrameIndex Q2iA h 0 149
FrameIndex Q2iA i 0 150
FrameIndex Q2iA j 0 151
FrameIndex Q2iA k 0 152
FrameIndex Q2iA l 0 153
FrameIndex Q2iA m 0 154
FrameIndex Q2iA n 0 155
FrameIndex Q2iA o 0 156
FrameIndex Q2iA p 0 157
FrameIndex Q2iA q 0 158
FrameIndex Q2iA r 0 159
FrameIndex Q2iA s 0 160

//walk (crwalk) - quake 2 walk set a (w)
FrameIndex Q2wA A 0 161
FrameIndex Q2wA b 0 162
FrameIndex Q2wA c 0 163
FrameIndex Q2wA d 0 164
FrameIndex Q2wA e 0 165
FrameIndex Q2wA f 0 166

//crattack - quake 2 cr attack (CA)
FrameIndex Q2cA A 0 167
FrameIndex Q2cA b 0 168
FrameIndex Q2cA c 0 169
FrameIndex Q2cA d 0 170
FrameIndex Q2cA e 0 171
FrameIndex Q2cA f 0 172
FrameIndex Q2cA g 0 173
FrameIndex Q2cA h 0 174
FrameIndex Q2cA i 0 175

//crpain - quake 2 cr pain (CP)
FrameIndex Q2cp A 0 176
FrameIndex Q2cp b 0 177
FrameIndex Q2cp c 0 178
FrameIndex Q2cp d 0 179

//xdeath (crdeath) - quake 2 xdeath set a (x)
FrameIndex Q2xA A 0 180
FrameIndex Q2xA b 0 181
FrameIndex Q2xA c 0 182
FrameIndex Q2xA d 0 183
FrameIndex Q2xA e 0 184

//death - quake 2 death set a (d)
FrameIndex Q2dA A 0 185
FrameIndex Q2dA b 0 186
FrameIndex Q2dA c 0 187
FrameIndex Q2dA d 0 188
FrameIndex Q2dA e 0 189
FrameIndex Q2dA f 0 190
FrameIndex Q2dA g 0 200
FrameIndex Q2dA h 0 201
FrameIndex Q2dA i 0 202
FrameIndex Q2dA j 0 203
FrameIndex Q2dA k 0 204
FrameIndex Q2dA l 0 205
FrameIndex Q2dA m 0 206
FrameIndex Q2dA n 0 207
FrameIndex Q2dA o 0 208
FrameIndex Q2dA p 0 209
FrameIndex Q2dA q 0 210
FrameIndex Q2dA r 0 211
FrameIndex Q2dA s 0 212
FrameIndex Q2dA t 0 213
}

//and then this..

//the following 4 attempts assume for the sake of easiness, that the model only has an idle animation with 3 frames and then a walk 
//animation with 3 frames

//new attempt 1

model sydney
{

//path, model, skin etc goes here...

//idle - lets just say she has 3 idle frames to make it easy
SDNI A 0 1 // idle animation frame 1 ?
SDNI B 0 2 // 2
SDNI C 0 3 // 3

//walk - and then lets just say she after that has 3 walk frames to make it easy
SDNW A 0 4 // walk anim frame 1?
SDNW B 0 5  // 2
SDNW C 0 6 // 3

// 6 frames in total - 3 from idle and 3 from walk ?

}

//new attempt 2

//I have yet to try this.... will it work?

model sydney
{

//path, model, skin etc goes here...

//idle - lets just say she has 3 idle frames to make it easy
SDNI A 0 1 // idle animation frame 1 ?
SDNI B 0 2 // 2
SDNI C 0 3 // 3

//walk - and then lets just say she after that has 3 walk frames to make it easy
SDNW A 1 4 // walk anim frame 1?
SDNW B 1 5  // 2
SDNW C 1 6 // 3

// 6 frames in total - 3 from idle and 3 from walk ?

}

//new attempt 3

//or perhaps this is the way to go???? :

model sydney
{

//path, model, skin etc goes here...

//idle - lets just say she has 3 idle frames to make it easy
SDNI A 0 1 // idle animation frame 1 ?
SDNI B 0 2 // 2
SDNI C 0 3 // 3

//walk - and then lets just say she after that has 3 walk frames to make it easy
SDNW A 1 1 // walk anim frame 1?
SDNW B 1 2  // 2
SDNW C 1 3 // 3

// 6 frames in total - 3 from idle and 3 from walk ?

}

//new attempt 4

//or this???? :

model sydney
{

//path, model, skin etc goes here...

//idle - lets just say she has 3 idle frames to make it easy
SDNI A 0 1 // idle animation frame 1 ?
SDNI B 0 2 // 2
SDNI C 0 3 // 3

//walk - and then lets just say she after that has 3 walk frames to make it easy
SDNW A 0 1 // walk anim frame 1?
SDNW B 0 2  // 2
SDNW C 0 3 // 3

// 6 frames in total - 3 from idle and 3 from walk ?

}

the model.. sydney..has the following frames

//spawn - 40 frames
//run - 6 frames
//attack - 8 frames
//pain - 12 frames
//jump - 6 frames

//flip - 12 frames
//salute - 11 frames
//taunt - 17 frames
//wave -11 frames
//point - 12 frames

//idle (crstand) - 19 frames
//walk (crwalk) - 6 frames
//crattack - 9 frames
//crpain - 4 frames
//xdeath (crdeath) - 5 frames

//death - 20 frames

16 animations in total

what am I doing wrong?

Edited by CBM : code edit

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 1

MD2 models don't have any concept of "animations" stored in them, they are only frames.  So to make an "animation" means to list every single frame number which that animation uses.  The last value of FrameIndex is that frame number, and it begins at zero.

 

If each object is a single MD2 model, then the number before the frame number should always be zero.

 

Each different MD2 model is going to need its own modeldef and its own list of FrameIndex commands to specify the frame numbers.  It sucks to write it all out by hand, but there's probably no tool to help creating these modeldefs.

Share this post


Link to post
  • 0

The best learning tool I can think of is to check out Enjay's Gene-Tech, which is chockfull of MD3 models.

 

5 hours ago, CBM said:

when I open an md2 model in "misfit" (an md2 model editor and converter),the model.. 

 

Maverick is the continuation of Misfit.

Also useful is Noesis for checking out the animations.

Share this post


Link to post
  • 0
21 hours ago, Kappes Buur said:

The best learning tool I can think of is to check out Enjay's Gene-Tech, which is chockfull of MD3 models.

 

 

Maverick is the continuation of Misfit.

Also useful is Noesis for checking out the animations.

Yes, I have recently begun to use Maverick and Noesis.

 

I have looked A LOT on projects like Gene-Tech and others that use MD2 and MD3 models in GZDoom... But I just can not make heads or tails around how the modeldef code relates to the actual MD2 or MD3 model

 

for now I have an MD2 model with decorate code that does work, but in order to use other MD2 models, I edit the other MD2 models so they have the same number of animations with the same number of frames as that model I know that works.... it is very far from ideel and often causes the models animations to look ... weird ... in GZDoom....

 

I was hoping that someone might be able to explain in detail how to map sprite lumps in modeldef to actual md2 and md3 model animations (I use Maverick to view and edit MD2 and MD3 animations)

Share this post


Link to post
  • 0
23 minutes ago, andrewj said:

MD2 models don't have any concept of "animations" stored in them, they are only frames.  So to make an "animation" means to list every single frame number which that animation uses.  The last value of FrameIndex is that frame number, and it begins at zero.

 

If each object is a single MD2 model, then the number before the frame number should always be zero.

 

Each different MD2 model is going to need its own modeldef and its own list of FrameIndex commands to specify the frame numbers.  It sucks to write it all out by hand, but there's probably no tool to help creating these modeldefs.

ok, well I had another look at the genetech mod and I think I have finally figured it out

 

I looked at the gunner.md2 model

 

it has 70 stand frames and apparently it means that they must be adressed as "stand00" to "stand69" instead of "stand"

 

not intuitive but atleast now I know :D

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×