Jump to content
The Dark Mod Forums
MirceaKitsune

Help needed: Dragon character

Recommended Posts

Several days ago I was thrilled to hear that TDM 2.08 contains several new characters along with other fantastic improvements. Seeing how much work had been done on this release gave me a motivational boost to try contributing something myself, especially having worked on porting human(oid) characters to TDM in the past... this time I wanted to submit something that can hopefully be included in vanilla TDM perhaps with 2.09. As I was testing the new release I remembered an old submission on Blendswap called BGE Dragon, featuring a polished quality dragon for the now defunct Blender Game Engine, notable for the fact that it comes with animations for walking / running which makes working with it easier as you don't have to make those yourself. I always felt dragons would fit the theme of TDM wonderfully and allow for some amazing missions, to be fair suggesting them had long been on my mind... remembering how easy it was to work with this one, I figured I'd do the groundwork and instead submit a blend that contains everything needed to port it to The Dark Mod. I'm happy to announce I now have such a blend available!

vPhAzxu.png

The first thing was the polygon count; The original mesh is pretty high poly, clocking at about 30,000 polys which may be too much for TDM on most people's devices. I played with mesh decimation then did some manual corrections, managing to retain acceptable quality while generating models with okay polygon counts: lod0 = 9.306, lod1 = 6.009, lod2 = 3.218, shadow = 2.265. The original quality mesh is still included in the blend file, so if we need to re-generate any LOD version this can be easily done at any time.

Next I worked on separating the armature into two objects, based on the example for the human model I built my previous characters upon: The real armature that deforms the model and is used to export animations, with a control armature driving its bones that's only used to design said animations inside Blender. As the control armature uses a complex IK setup for bones this took some toying with, but in the end I could generate a simple armature which will hopefully work in exporting the md5anim set.

Speaking of animations I made sure those are also covered. For the endlessly looping walk and run animations I added markers that identify the frames between which they must be exported to get a seamless loop. I next turned the idle animation into a randomly occurring gesture, then proceeded to animate everything else from scratch to obtain:

  • Walk
  • Run
  • Idle (with two random gestures, stretching / pacing and looking around)
  • Sit (with "lay down", "stand up", "idle" animations) (seamlessly connects to "idle")
  • Sleep (with "lay down", "stand up", "idle" animations) (seamlessly connects to "idle")
  • Attack (two types, bite and slash) (seamlessly connects to "idle")
  • Die (brief animation at the end of which the ragdoll system is supposed to take over)

An example gif of the idle gesture from the Blendswap submission, converted to and intended as a random occurrence in-game:

dragon-idle-pose-by-dennish2010.gif

From here on I need your help and am calling on the artists who helped create the new monsters (eg: Manbeast) to aid in making this come true as well! I've done most of the work as far as the model goes, putting aside any tweaks that might be needed (eg: model scale and animation length). I'm also going to work on the texture next to produce the proper maps... my target is to have 4 different skins / colors in total. I also believe I can produce the sounds having already found promising submissions to start from on OpenGameArt. But before putting more work into this, I wish to be sure someone can help with the remaining steps so we can get the model in the game. What I need from fellow developers should be:

  • A new AI type for the dragon. Note that it's not intended to fly, especially not in its initial implementation; Later on we may add a fly animation and data to the AI for knowing how to use it... for now I only care to have it work like the spider, wandering around and attacking if it sees a hostile entity. This should thus be easy if we can copy another monster's code.
  • Exporting the assets from Blender to TDM, particularly the model and animations. As I don't have an AI nor a test case handy nor ever worked with exporting TDM animations or models for non-human characters, I need someone else to generate and test the mesh files. First the md5 mesh for each LOD, everything is included in the blend even the low-poly shadow mesh... afterward the armature actions for it need to be exported to md5anim files.
  • Lastly the defs need to be written, along with any other step I may have missed to make the character actually work. I should be able to do the material based on my previous examples once I finish the textures, so don't worry about that part... please just make sure the materials in the exported md5mesh have the same name as the material names in Blender.

Download blend version 0.5

I look forward to hearing your thoughts! If any developers or experienced contributors confirm they can take care of the integration, I can get started on the remaining assets soon ūüôā

Edited by MirceaKitsune
Updated blend to 0.5
  • Like 4

Share this post


Link to post
Share on other sites

That's very cool! Definitely not what I was expecting (some kind of mammalian beast). Should make for some interesting fantasy environments like castles or dungeons - always had a treasure hoard of some kind in mind.

Regarding your extra steps, I haven't been involved with implementing a character, though I'd have this to say:

  • I think the closest AI type to this is the werebeast, due to the inbuilt head and natural attacks. I think that AI can reasonably be used for both beasts, though would have to see whether there's support for a turning animation to avoid that it just spins in place like the horse.
  • I don't think any of those involved with creating the 2.08 beast characters use Blender (Springheel: Maya, Kingsal: 3DSmax, Diego: ?), so a .blend file would be unfamiliar terrain for them. Arcturus, however, is very skilled with Blender and still occasionally pops in to the forums. I think he'd surely point to or describe (or already has described) the steps needed to export a character for TDM from Blender. Also, as it happens Samson recently made a new .md5 import/export script for Blender 2.80+.
  • The defs & co. should be reasonably straightforward as we already have the example of the werebeast. The big roadblock that halted its development for years, however, was the ragdoll setup. Obsttorte and Springheel somehow sorted it out in the end.

To get back to Kingsal's comment about the pathfinding, I think this will in any case be larger than a horse due to the wings, so ideally there'd be a new AAS type - and we have very capable coders. In a pinch, mappers can just very generously monsterclip their map to avoid that the dragon tries to get into too small spaces, while leaving gaps for smaller AIs. The question is how big exactly it should be: the larger it is, the harder it is to create a suitably large & well-performing environment for it. Maybe it could come in 2 sizes.

  • Like 2

Share this post


Link to post
Share on other sites

Other major issues with something this large would be Inverse Kinetics for walking, turning, and keeping the wings and tail from constantly clipping into things.   I don't know how difficult that would be.  After five years we still haven't even got the werebeast into a fully working state.

 

You would still need some additional animations as well:

search

pain

 breath weapon (what's the point of a dragon without one?)

turn 180/360

 

Quote


I always felt dragons would fit the theme of TDM wonderfully

I couldn't disagree more, actually.  TDM is medieval steampunk and tries to avoid high fantasy tropes like orcs, elves and dragons.  That said, I'm sure there would be mappers who would love to use a dragon if it was fully functional.

  • Like 2

TDM Missions:   A Score to Settle  *  A Reputation to Uphold  *  A New Job  *  A Matter of Hours

Video Series:   Springheel's Modules  *  Speedbuild Challenge  *  New Mappers Workshop  *  Building Traps

Share this post


Link to post
Share on other sites
3 hours ago, Dragofer said:

To get back to Kingsal's comment about the pathfinding, I think this will in any case be larger than a horse due to the wings, so ideally there'd be a new AAS type - and we have very capable coders. In a pinch, mappers can just very generously monsterclip their map to avoid that the dragon tries to get into too small spaces, while leaving gaps for smaller AIs. The question is how big exactly it should be: the larger it is, the harder it is to create a suitably large & well-performing environment for it. Maybe it could come in 2 sizes.

It will obviously be a large creature. In terms of size I was wondering how we could make it just big enough so that it makes sense for a dragon, but at the same time small enough so the map doesn't need to be too large for them to walk around. I was thinking something between x1.5 and x2.0 the size of the horse (less than twice as large but more than its size plus half).

29 minutes ago, Springheel said:

Other major issues with something this large would be Inverse Kinetics for walking, and keeping the wings and tail from constantly clipping into things.   I don't know how difficult that would be.  After five years we still haven't even got the werebeast into a fully working state.

I couldn't disagree more, actually.  TDM is medieval steampunk and tries to avoid high fantasy tropes like orcs, elves and dragons.  That said, I'm sure there would be mappers who would love to use a dragon if it was fully functional.

There is a walk and run animation in the blend, they're meant to be normal md5anim's but we'll have to see about exporting them properly. Theoretically we already have quadruped creatures: The horse even if it doesn't attack, or the spider which is theoretically feral even if it has more than 4 legs... *shivers*

As far as fitting the TDM theme goes I had two thought processes there: First is that we long had some fantasy elements, such as zombies and skeletons and missions with magic, and now with 2.08 we have the man-beast which is technically somewhat of an orc... dragons felt like a logical next step to complete the set on this side of the fence. The other thought was that TDM has such a nice steampunk / medieval atmosphere, and dragons are so closely connected with that in folklore, thus the two would go like toast and butter; I'm sure if anyone here remembers a movie such as Dragon Heart many will have the thought "it would be cool to do something like this in TDM".

Fan missions are based on many themes though: Some are completely "down to Earth" without any magic or fantasy elements, others have just alternative biology such as giant spiders, others have undead zombies and skeletons which imply witchcraft and wizardry: The idea of assets is to give every mapper the tools to create the one they want, in a way that fits the steampunk theme of course. For starters though I'm hoping to at least have this as a pk4 mod which FM's can include and use... if there are strong reasons against defaulting it I'll be able to live with that, though I'm hoping to at least have it of default quality which this model should help greatly with.

Edited by MirceaKitsune

Share this post


Link to post
Share on other sites
13 minutes ago, MirceaKitsune said:

 

There is a walk and run animation in the blend, they're meant to be normal md5anim's but we'll have to see about exporting them properly. Theoretically we already have quadruped creatures: The horse even if it doesn't attack, or the spider which is theoretically feral even if it has more than 4 legs... *shivers*

 

It has nothing to do with the animations.  If there is no walk IK created for the skeleton, the entire model will lift up every time any part of it crosses an elevation, which will look quite ridiculous for something that large.  It also means all 4 feet will never all be on the ground unless the ground is perfectly flat.

Quote

 

 

  • Like 1

TDM Missions:   A Score to Settle  *  A Reputation to Uphold  *  A New Job  *  A Matter of Hours

Video Series:   Springheel's Modules  *  Speedbuild Challenge  *  New Mappers Workshop  *  Building Traps

Share this post


Link to post
Share on other sites
3 minutes ago, MirceaKitsune said:

As far as fitting the TDM theme goes I had two thought processes there: First is that we long had some fantasy elements, such as zombies and skeletons and missions with magic, and now with 2.08 we have the man-beast which is technically somewhat of an orc... dragons felt like a logical next step to complete the set on this side of the fence. The other thought was that TDM has such a nice steampunk / medieval atmosphere, and dragons are so closely connected with that in folklore, thus the two would go like toast and butter; I'm sure if anyone here remembers a movie such as Dragon Heart many will have the thought "it would be cool to do something like this in TDM".

That... is quite a stretch :D But if you can make it, and there are mappers willing to use it, then sure. I wouldn't search too much for a justification though, high fantasy is high fantasy, and beastmen are a nod to T2 apebeasts, not orcs, IIRC.

Share this post


Link to post
Share on other sites
4 minutes ago, Springheel said:

It has nothing to do with the animations.  If there is no walk IK created for the skeleton, the entire model will lift up every time any part of it crosses an elevation, which will look quite ridiculous for something that large.

I see what you mean now... yes I remember that effect on human characters and indeed it would look very ugly without that. I'm assuming it's not as simple as "project the foot bone to the ground each frame" and may take more work and tweaking to get right. I initially assumed the only unusual aspect about this would be the larger bounding box and everything else is already there in the code, but things are a bit more complicated now that you point them out in detail (the story of all software development).

Another issue I was thinking of yesterday but forgot to bring up: We will want to have lip-syncing on such a large model, as not having the muzzle open for vocal sounds would be pretty obvious especially on such a large creature... the armature bone is there but has to be properly rotated by the code. I assume ragdolls will also require adjustments so each bone bends the right way and we don't get noodle limbs. As I have no idea how to do those things I hope there are other devs motivated enough to be willing to help out... in the meantime I'll look into finishing up everything else I have knowledge in doing to leave only what I can't do up.

Share this post


Link to post
Share on other sites
58 minutes ago, MirceaKitsune said:

Another issue I was thinking of yesterday but forgot to bring up: We will want to have lip-syncing on such a large model,

We don't even have lip-synching on our human AI.  As long as there is a jawbone that can open the mouth, that's sufficient.

  • Like 1

TDM Missions:   A Score to Settle  *  A Reputation to Uphold  *  A New Job  *  A Matter of Hours

Video Series:   Springheel's Modules  *  Speedbuild Challenge  *  New Mappers Workshop  *  Building Traps

Share this post


Link to post
Share on other sites

Very cool! I'm not sure a dragon is a logical next step for filling out the AI roster, but its definitely impressive.

I think this could be a cool animated set piece in a mission, but jumping right into making this a fully functioning enemy type that works in  missions is crazy.  To your comment above, spiders are general easier because they're essentially a ball with legs that can turn on a dime.  There's lots and lots of problems with trying to do a quadruped this size, not to mention making it fun to sneak around and engage with.   

My sense is that something like this could work really well as an animated set piece/ scripted thing. For instance a mission where you need to steal from a sleeping dragon and waking it up fails the mission. Start with that and then think about making a fully functioning AI type.

  • Like 3

Share this post


Link to post
Share on other sites

Some good news: I spent today checking if I could export the md5mesh / md5anim set. The exporter gave me errors on both, the armature and mesh alike needed to have their bones and vertices fixed (I updated the blend file in the first post). After fixing everything the export worked! At least as far as I can tell from the export process, I didn't test them in-game as there's no AI or def: I'll have to re-export in case there are issue with the model scale, model orientation, the speed of an animation, or anything else wasn't exported properly. As long as the exported data isn't corrupt or broken for any reason though, I should be able to manage this step too... note that the Blend is for Blender 2.79 as the md5 exporter hasn't been yet updated to 2.8.

On top of that I have now finished the textures. My target of 4 colors was successfully reached: Black, white, red, green... each one with different eye colors too. Further more I included the material and skin file, those should be ready to use.

Download it here (0.3)

Other than the sounds which I'm only touching if things move forward, this should be everything in terms of assets... they are fully untested of course, notify me of any issues you find and I'll try fixing them and producing new md5mesh / md5anim sets. What's needed now is the part I have no idea how to do: The AI, the skeleton settings, and the def to make use of them.

Considering what was discussed earlier my suggestion would be: First copy the AI / defs of a fitting monster and put this model on it, in order to make sure it's properly scaled and the animations play well. Once the mesh and textures and animations are confirmed to work, find a bounding box side that fits... I'd suggest enough so it covers the wings in the idle pose, for some animations they might clip through walls but we'll see if that's an issue and adjust it later. Only at the end once this is all done setup the ragdoll physics, the IK for aligning the feet to the ground, and the rotation for the mouth bone for lip-syncing when playing vocals. Does that sound like a good approach?

  • Like 1

Share this post


Link to post
Share on other sites

Does the texture set include a normalmap?

Quote

Does that sound like a good approach?

If you're not going to be doing the work yourself, you will at least need to manage the project.  The first step would be finding someone willing to help, who actually has the necessary skillset to do one or all of the things that need to be done.  That person will need to decide what they can do and in what order.

 

  • Like 1

TDM Missions:   A Score to Settle  *  A Reputation to Uphold  *  A New Job  *  A Matter of Hours

Video Series:   Springheel's Modules  *  Speedbuild Challenge  *  New Mappers Workshop  *  Building Traps

Share this post


Link to post
Share on other sites
11 minutes ago, Springheel said:

Does the texture set include a normalmap?

If you're not going to be doing the work yourself, you will at least need to manage the project.  The first step would be finding someone willing to help, who actually has the necessary skillset to do one or all of the things that need to be done.  That person will need to decide what they can do and in what order.

 

Yes, original normal map and I generated the specular. They're all 4096px so it's very high quality too: Wasn't sure if that's considered too high-res for TDM, hopefully the engine handles them well and they won't need to be downscaled to 2048px.

That is the purpose. I also decided to pick up this model seeing how TDM 2.08 included several new characters, figuring developers who are knowing in this field are probably active again and the momentum could be used to add even more interesting stuff for 2.09. The ones I ported in the past aren't suited for vanilla unfortunately... this is probably the only one not using the human skeleton I'll be making after hearing how complex custom rigs are to set up. I'm not sure if the creators of the new creatures check this section regularly and will see this... maybe sometime I'll note them to ask if they can help, if that's okay.

As for maintaining, I have the blend source and can seemingly export the model and animations long as Blender 2.79 keeps working fine for me. I have no idea about the rig manipulation code and AI though, that's something I never touched and the part I hope someone who like this idea can help out with.

Share this post


Link to post
Share on other sites

The specular is B&W which means the model will look more like plastic or wet surface in TDM. For anything other than metals, you need to go the old-school way and invert the base colors, apply the surface patterns and then tweak the intensity of the whole thing: https://3dtotal.com/tutorials/t/brief-consideration-about-materials-pedro-toledo-texturing-lighting

  • Like 1

Share this post


Link to post
Share on other sites

Dragofer: Thank you for the great help! Sounds like there's a lot left to fix, I've taken note and shall look into it. It's nice to see how the model looks in-game for a start.

The bone names came this way with the blend: I didn't think renaming them would be important, I'll see how far I can go considering I'd have to change them on two rigs for consistency. I'll look into shrinking the spikes on the wings too, and yeah now that I understand collisions better I shall change the wing animations to always keep them close to the body. Model's much tinier than I expected, looks like I should scale it by about 10x? Textures and colors should be very easy to tweak... at least the specularity looks okay, maybe I'll make it just a tad darker.

Note that the animations starting with "ik_" in the blend file are used by the control rig, which uses complex bone constraints to achieve the desired effects... I can't change that without breaking everything but this is only important in Blender. And thanks for mentioning the md5 exporter for Blender 2.8, I'll update to that as well in this case.

Share this post


Link to post
Share on other sites

Judging from that ingame look: if all else fails, it would at the very least make a cool statue, both in large and small! So even should it not work out as an actual animated entity, give it a marble skin and place it in a large hall, or give it a silver skin and make it a cool lootable object :)

  • Like 1

Share this post


Link to post
Share on other sites
15 minutes ago, MirceaKitsune said:

Model's much tinier than I expected, looks like I should scale it by about 10x?

In general I'd try to keep it manageable at first, as per your earlier suggestion to make it ~1.5x a horse. In the end a larger version can be made, though it could help to see the WIP animations on a large model.

  

15 minutes ago, MirceaKitsune said:

I didn't think renaming them would be important, I'll see how far I can go considering I'd have to change them on two rigs for consistency.

I can imagine that down the line it'd be much easier to work with setting up all those joints for the skeleton/IK if they all adhere to the same rules. In the worst case some of those defs could be case-sensitive, which would be a pain to cross-reference.

Share this post


Link to post
Share on other sites

Progress made so far:

  • Scaled the model up by 8. Let's see how that looks... judging from the screenshot it should be about right. I'm not applying the scale to the objects as this breaks the rig, hopefully the exporter doesn't mind as IIRC it uses the state of the mesh as seen in the viewport.
  • Reduced the length of the spikes poking out of the wings to about half.
  • Renamed some bones to translate the german names to english, or remove uppercase letters at the beginning of names where they didn't belong. I could only rename some of them however: Touching other bones causes the control armature to break and not animate the root armature properly.
  • The wings are kept close to the body in every animation and only move slightly. They poke out a bit at times to avoid clipping, but only by a small amount.
  • Slightly desaturated the red and green skins, as well as somewhat reducing the intensity of the glossy texture. I don't know how to change the default skin given there doesn't seem to be one: Each skin is registered by its color and one needs to be picked when referencing the model.

I'm not sure if I'll have time to export the new md5's today. I'm aiming to first implement some of the new animations you suggested, mainly turning and pain as those are essential ones that I forgot. I'll test it using the map in that pk4 then update it with my changes.

  • Like 1

Share this post


Link to post
Share on other sites

Some more progress: the map is actually happy to load if I place a dragon AI in it. At first it was static in a T-pose, though still with random head turning, but this tweak to the animation channels has solved this:

	channel torso		( *pelvic_1 )			//all joints associated with pelvic_1 go into the torso channel
	channel legs		( *origin -*pelvic_1 )		//all joints except for those associated with pelvic_1 go into the legs channel

So I gave him a path node: he plays the walk animation, though he never leaves his spot and spins in place. So, new notes:

  • The game wants an af_pose for the dragon. This is simply the static T-pose (what you see when you search for "dragon" in DR's Create Model list), but as a single-frame .md5animation with a key set for each bone.
  • It's very likely the dragon doesn't move forward because the walk/run animations don't move the origin bone. This wiki article describes how speed varies within a walk cycle.
  • I'm wondering whether all the bones are making it from the .blend into the .md5mesh. For example, I can see "breast" and "pelvic_2" when I open the .blend file in Blender, but not in the .md5mesh opened in notepad. Maybe those are a different kind of entity? Edit: they're only controller bones for the benefit of the animator, it seems.
  • Foot bones are always misspelt as "food"
     
Quote

Scaled the model up by 8

8x is actually quite huge - a human could easily ride a dragon that size. Would probably choose 4x for now.

Quote

I don't know how to change the default skin given there doesn't seem to be one: Each skin is registered by its color and one needs to be picked when referencing the model.

You only need to rename the 3 default materials on the dragon mesh from dragon_body to i.e. dragon_body_black etc., then update the skins. There are no TDM models that I'm aware of that require a skin in order to work.

  • Like 1

Share this post


Link to post
Share on other sites

The Blender 2.8 md5anim exporter is throwing an error when I attempt to export any animation. And since I already saved the new Blend with it I can't go back to 2.79 either. Anyone know what this could be about? Here's a screenshot of what happens and the error I get when I attempt exporting:

TP3u6Ek.png

  • Like 1

Share this post


Link to post
Share on other sites

I've seen a similar error message when trying to export .lwo or .ase models while in edit mode or on a Blender version the exporter isn't made for. Could be that your selections are off, or you aren't using 2.80? Otherwise could try to talk to Samson on the TDM Discord.

  • Like 1

Share this post


Link to post
Share on other sites
On 7/16/2020 at 9:29 AM, MirceaKitsune said:

The Blender 2.8 md5anim exporter is throwing an error when I attempt to export any animation. And since I already saved the new Blend with it I can't go back to 2.79 either. Anyone know what this could be about? Here's a screenshot of what happens and the error I get when I attempt exporting:

The import/export script for 2.8 is a little picky about how the meshes/armature are grouped - you will need to add them to a collection.  Take a look at the readme file for the script - it should help clear it up.  Looks like I may need to add some better error checking to it.

 

Hope this helps

io_scene_md5_28-readme.pdf

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
12 hours ago, Samson- said:

The import/export script for 2.8 is a little picky about how the meshes/armature are grouped - you will need to add them to a collection.  Take a look at the readme file for the script - it should help clear it up.  Looks like I may need to add some better error checking to it.

 

Hope this helps

io_scene_md5_28-readme.pdf 189 kB · 0 downloads

Thank you, I see now. The issue was probably that I have them in multiple collections simultaneously. I shall try to re-export them later.

  • Like 1

Share this post


Link to post
Share on other sites

Till I get around to exporting the new md5 set, I updated the link to the Blend file in the first post, to include all my fixes mentioned above.

Share this post


Link to post
Share on other sites

I moved both the mesh and rig to their own collection, but the exporter still keeps erroring out when I try to produce a md5anim in 2.8. Any additional thoughts?

NQawyzJ.png

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...