Author Topic: Getting other models in game  (Read 5048 times)

Offline Luther Blissett

  • Moderator
Getting other models in game
« on: August 09, 2011, 04:42:05 am »
After a lot of pissing about, I've managed to... almost... get one of the other models in game. Not quite there, definitely not usable yet, and there are a lot of little problems to fix, as noted below - but it suggests that it will eventually work.

Here's some pics for those who don't like reading so much :

Giant Fail, Tiny Fail

So, what I attempted was basically testing the existing skeleton, and overlaying the model of the fatman onto it, and reattaching them together. In game terms, for the time being I have simply been replacing the "CR_HumanMaleStrong.X", so I could test things moderately quickly. Though I've been able to import the original human .x file, the vertex / bone linking seems to have ended up a bit garbled.

Orientation Fail, Forwards Fail

Of course, the skeleton is designed for a slightly different body shape - and obviously the animations, including the "idle pose" are different. So currently, the fat man will stand like the hero model, with wide shoulders and his feet apart. There are a lot of problems of scale and rotation with import and export - partially from different programs using either Z or Y as "up" and partially because .x appears to be a very variable format. Some X importers / exporters won't read or write the correct file types, or will only do so partially.

Not knowing what I am doing.

One of the main problems was trying to determine exactly how things had been done before, what the different parts of the skeleton were, how they were linked together and then what format they were exported in. Ideally, if Karpov reappears at some point, he'd be able to give us his recommended programs / formats etc, possibly even source files.



So, after over 9000 attempts, I finally exported one that vaguely worked... apart from that arm. It's using all the hero animations, so it can walk, run, punch, shoot etc - except obviously the pose is all wrong - eventually, it should walk, shoot, punch and stand like Vic does. I guess he's a fat man trying to look like a hero :)



Current problems still present :
- The hair is positioned for the hero model, therefore isn't quite positioned correctly - though I could make him slightly smaller, which may work. Otherwise we may need to separately rig hair for each body type somehow - or if it attaches to something on the skeleton, perhaps I can stretch the "head nub" of the base skeleton a bit instead.
- If you look at the shadow on his feet, it comes from where his feet aren't... I think this is because I slightly reshaped the T-pose to fit, whereas I should have reshaped the model to fit the T-pose, though this may not be a problem if it had its own animations.
- The subsets, to allow a texture to cover certain parts of a model and not others (i.e. skin colour, short sleeves) isn't working - but I think I can fix this quite easily. They'll need doing for all the other body types too.
- Obviously, his arm is stuck out at a right angle. I have no idea why this is. The animations tested in the program with this model don't behave like this - only when in game. It's a mystery. His other arm works fine.
- There may be something wrong with the attachment points - he seems unable to mount a weapon. It just doesn't appear. I'm guessing that something needs to be attached to the "LHandle" and "RHandle", but I don't know what.
- The texture is only provisional. I might leave it like that until I've seen the shaders that Johnnybravo is working on - as their "engine shadow" will affect how much "painted shadow" we need on a texture, as well as overall colours.



Ultimately, the fat man can walk and run and use and fall, and it's almost correct. I had pretty much no idea what I was doing, so anyone who's less of a 3D noob than me should be able to get this all working pretty nicely, given a little time.



Of course, despite his best efforts, the fat bastard is never going to fit into that jacket - however, I should be able to use the same methods to try and rig a few of the armours we've made but not implemented to test yet.

Current version of file is here :
fatmantest_CR_HumanMaleStrong.X
To test quickly, backup your "CR_HumanMaleStrong.X" and drop this one over it.

Note that this file will very quickly be obsolete, as I intend on trying to solve some of the weirder problems present (unless someone else does it first). Also, the file contains a load of surplus animations, which won't affect the game, but if you can import .x with animation to a 3D prog ("Fragmotion", which is sort of free will do it), you'll be able to test a few animations in there. It does increase the file size a bit though.

[EDIT]

Tried a bit further with this :
= Hair as before
- 'Foot shadow' was actually a few rogue vertices from the bottom of the foot, that's fixed.
- Subsets now work properly. You can compare Subset Example Man with the image below.
- Stupid arm is fixed


= Attachment point for weapons still doesn't work
= Texture / shadow unchanged
+ He has picked up a strange 'wobbly leg'. Can be solved either by adjusting the skeleton, or adjusting the model so the legs are a little more apart.



Attachment points for weapons is the main one. Looking in the fo3d and where they attach to, they should work. I can't see why they aren't. A bit of a mystery, this one. Unless anyone's got any bright ideas to try, it might be a "wait for Karpov" on this one.
« Last Edit: August 15, 2011, 12:29:40 am by Luther Blissett »

Offline Karpov

  • Moderator
  • Come Together
Re: Getting other models in game
« Reply #1 on: August 20, 2011, 06:27:48 am »
You are doing quite a good research there...        ;)

Sorry for being away that long, but here I am to rescue you... and Vic.
Weapons go attached to an additional bone which is not connected to any other bone in the body, and it is called R_Handle_1 or L_Handle_1.

Offline Luther Blissett

  • Moderator
Re: Getting other models in game
« Reply #2 on: August 20, 2011, 04:35:48 pm »
Good to see you back, sir :)

The strange thing is that both the handles are present in the export, which is why I'm confused as to why it wasn't working. If I import the .x file, they're still present as well. Very peculiar. I remember one or two of my earlier "mutated export attempts" having weapons present (though because the figure was so messed up, it wasn't actually holding it) so I wonder if there's a setting I've unclicked somewhere during testing.

Most recent file is here if you want to have a look at it and see if you can make sense of it :
Fatman test rig (with wobbly leg and unable to hold guns)
http://www.megaupload.com/?d=14KJAE4W

Even if it doesn't work, I've learnt quite a lot recently through the process- armour rigging appears to work moderately well, though I'll need a little more practice to be able to contribute fully to this. If I learn a little more and get things working just right, I might be able to help out a little more with getting all this stuff done :)

[edit]
Got the gun to appear on the model (well, "near the model" would be more accurate). This was straightforward renaming of "R_handle_1" and "l_handle_1" to the upper case equivalents - exactly as they're written above (i.e. "L_Handle_1" - noting the L and H). This is strange though, as it didn't seem to matter on the original human model. The skeleton I was using was imported straight from the Direct X model in the 3D SDK. I can't understand why one X export would need case-sensitive naming and another wouldn't. It might just be an error in the export or something. Anyway, the gun now appears.

However, the gun is very much not in the correct place. It floats above the character. Not sure about this one yet. When the "switch weapon" animation plays, the gun swings round as you'd expect - except its position relative to the arm is vastly incorrect.

Also of note - the "*_Handle_1" bones ARE connected to the skeleton on my model... but a "*_Handle_" bone is nearby (without the 1 at the end) which ISN'T connected to the rest of the skeleton. I'm not sure if this is an import error of some form - I may try appending a "1" to the end of the unconnected bones, and getting rid of the other ones... or something like that anyway.

Not quite there yet, but getting closer. Of course, the best option may still be "Let Karpov do this properly when he has time", but there's no harm in me trying to learn more. If I eventually manage to get it working properly, in a way which is satisfactory to all involved, then obviously it helps to share the workload.

[edit2]
The "handle renaming" thing seems to have worked. We have a fat man, carrying a gun. All animations work to a degree. He's still got wobbly legs, but I think I know how to fix that (I'm going to move the mesh legs outwards, rather than the bone legs inwards), but might not have time for a day or two.


Do note however that using the normal "hero idle" pose, the gun intersects his fat belly, and he also doesn't stand like an idle Vic. I believe this can't really be fixed without separate animations for each body type, so as well as "male_Idle.X", we'll need a "fat_Idle.X", a "midget_Idle.X" a "junkie_Idle.X" etc - and the same for with the different weapons. Obviously Vic (and others with the same sprite) in the original game had his own "walk" and "idle" animations - he stood with his knees bent and legs close together, for example, rather than the wide-legged stance of the hero model. Animations for "peasant" and "loser" are obviously very different reagrding their walk cycle, but things such as the punch animation would only be slightly different.

I'm certain that some of the animations are transferrable between the similar models, i.e. copy and rename the file will work. Some of them will need adjusting slightly (i.e. idle with rifle is rotate arms forward and bring legs in), and some will need remaking entirely if we're to replicate the movement of the original sprites.

In the meantime, if we can put the models in game, sharing animations which don't quite fit (i.e. copy all male_***.X to fat_***.X), we can at least begin testing and playing around with the models in game, then slowly start to replace the animations with the correct ones as and when we have time.
« Last Edit: August 22, 2011, 12:04:28 pm by Luther Blissett »