Jump to content

MP 3D Animated Flag model

Recommended Posts

So here's the issue/challenge!


I'm currently building a multiplayer map on what I try to reach the cap of the Quake III engine. The map is focused on inspiring people and overal already pretty immersive if I may say so myself. I'll show some screenshots later, somewhere on this forum. :P


I came to the point where I thought it would be awesome to have a flag. Not a static flag, not a shadered flag, but a full 3D flag, animated with bones/vertices. So that'll mean either an MD3 or GLM file extension to go with. File extension is not what I'm worrying about though, but a way to implement it in the game!


I could ofcourse make a glm, write an NPC file place an entity NPC on the roof with a cinematic spawnflag and write a simple script to loop/animate it. But, if a joking admin or player decides to try /npc spawn "flagmodel", he would piss his pants laughing ofcourse :P


Now my question is, could I somehow create such a thing and restrict people from spawning such a flagmodel? Or better said, how do I achieve that! because I'm pretty sure there's a way! :D


Thanks in advance!

Link to comment

MD3s cab have per-vertex animations, they'll do nicely. Unless you exceed their maximum dimensions of [-512, 512) units on each axis, but GLM has some similar limits. You'll probably have to do some scripting to make them play it though.


Of course you mustn't use misc_model, since that gets baked by Q3Map2. misc_model_static might do, and a func_* with a model2 key will certainly do. Take a look at the switches in SP for some reference on animated MD3s. (e.g. used in the Rancor level, I believe.)

Link to comment

@@mrwonko: I'll experiment with that! The problem is though that you can't see those switches from the rancor level in multiplayer. Most MD3 models that are animated in Singleplayer don't show in Multiplayer. But maybe it works differently if you do it yourself.

@@Xycaleth: Notice the part where I say I don't want to have a shader flag. :P
The reason I dislike a shadered flag is that it moves like water. In other words it doesn't give a shit about your flagpole and waves along it.
Also, it will only move just left and right, and doesn't curl up a little like a real flag would.

I got the inspiration for these flags when I was playing Skyrim.

I'll experiment with existing MD3 files and animations, and if I can't figure out how to get an MD3 file to animate for multiplayer, I'll step to GLM/NPC file.
JKA also has a few cinematic models, for example the "rocks" npc that's only used for the darkside ending. It spawns on top of Kyle when Jaden escapes.
I could make one animation where the flag just lays on the ground on "idle" and give it 1 health. If people decide to spawn it, it'll still behave like a flag by flopping on the ground. But it will dissapear instantly when they "kill" it :P
It will make a pretty boring NPC file, but a nice addition if used with a script.

Link to comment

Well, I can say I tried it now! :P

If I write an Icarus script that "affects" a misc_model_static, the game tells me it's an invalid target when I run the script.
Singleplayer uses misc_model_breakable btw. But when you load a SP map in radiant with MP settings, radiant tells me he can't find the source.
So, the MP just isn't capable of running MD3 animations.

No loss, because I was able to spawn luke in, write an icarus script and make him loop an animation.
something like this:

affect ( "danceluke", /*@AFFECT_TYPE*/ FLUSH )
	loop ( -1 )
		wait ( 2000.000 );


As you can imagine, the same applies to any NPC file. You can also run from a set frame, but I haven't figured that out yet.
No need for that btw, as you specify an animation set in the animevents :P

So, I decided to go for a GLM file and start working on that flag model/animation.
Here's a small preview: 

It has a lot of bones as you can see, so I keep my fingers crossed when I finally export it lol.
The side doesn't really show how much it really waves. So I'll show that when I finally get it in-game ;)
Archangel35757 likes this
Link to comment

Yep Arch! That's why I mentioned it :P
Thanks to your exporter, it's all working fine!


I had to divide the model in 3 separate parts though. The GLM file is limited to 32 bones per model, So three parts for the 80 bones this guy has.
There's no seam in the model thanks to the new carcass, so it works like a charm! :P

The UK flag is just a placeholder for the flag that i'm still designing. I wanted to make sure the model and animation works.
The NPC spawner is placed in the floor so you can't use push/pull on it. It's even safe there for explosions and such!
Also, the flag will trigger itself, and thus spawn itself would it die by the hands of an admin. Then it will just flap around hapily like it did before.
Thus, admins can screw around with NPCs would they load my map, kill them all, and the flag would just respawn :)

Boothand likes this
Link to comment

Appears to have seams on both sides of vertical red bar-- not sure if those are UV seams or mesh seams where you broke the model. Try adding smoothing groups to make your normals match across mesh boundaries and then before you export detach your smoothing groups... or alternatively-- add an edit normals modifier, check unspecified then collapse your stack. Read up on what "breaks" an edit_normals modifier.

Link to comment

I had to divide the model as I said. Otherwise carcass would tell me the model has more than 32 bones.
I solved the seam problem by just editing the shader file so it's just purely lit. Makes him less shiny as in the gif, and more burlap as I need :)

Link to comment
  • 3 months later...

Someone would need to modify the misc_model_ghoul ent for MP to support it animation similar to what I've done for the SP version in DF2 mod.


Also the amount of bones is quite alot just for a flag model, you should consider removing some. The cloth-like quality loss should be very minimal, if you do it right. :)

Link to comment

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
  • Create New...