• entries
    743
  • comments
    1924
  • views
    580356

Improving the player model (now with face colours! :))

Sign in to follow this  

1637 views

Just a quick post to show I'm still alive and that my game is not yet dead. Work has been pretty busy and the clocks changing in the UK has completely thrown off my body clock (what was 4pm is now 3pm) so not got a lot of hobby stuff done lately.

I've been making some slow improvements and changes to the player model, trying to give it a bit more character and make it a bit less clunky so I can start to look at more interesting animations.

charm.jpg

He now has a more interesting, cat-like head which just emerged from some messing about in my model editor. Made it in isolation with no real plan for it, then decided to chop off his old head and import this one instead. I've also scaled down the hands and boots which were far too clunky on the previous model.

shade.jpg

It's a bit of a fiddly process making modifications to a model that is already rigged and animated, but nothing the editor can't handle. Once I'd scaled down one hand, I removed the other hand, then mirrored the new hand across the X axis with the reference set to the origin, which placed the copy in the right place, then just had to go it and to Ctrl-N, Ctrl-W on each joining vertex to weld the vertices together. Similar for the boot. Then it was a case of running animations and checking what vertices needed weights assigning.

Having the facility to improve models gradually even after the rigging and animations are done is very important since it is much easier to work on an existing model that start a new one. I spent about two days on a new model this week which I ended up scrapping because it didn't work out well. I still maintain that writing Charm was a great idea rather than learning another model editor, since it has vastly increased my understanding of the modelling process.

I've started adding some support to Charm, the model editor, for setting colours on the faces, in lieu of a more sophisticated texture mapping system, but not quite ready to roll on that yet. I really do need to get into texture mapping functionality in Charm at some point though. Have a few ideas about how to handle it but noting set in stone yet.

I'm hoping now the model is a bit more agile I can start to look at some foot placement IK in the near future. Plan is to try to implement some three bone IK for the legs based on ray casts to the floor, and try to get the feet bones to clamp to the floor angle but not sure how well this is going to work out. Never done any IK before so a whole new area with all its own pitfalls and problems to discover, I'm sure, but after getting the rag doll stuff working, my confidence is at an unusual high.

Think I also need to start thinking about a proper third-person follow camera for the game. Some mechanics are hard to figure out until I have the camera in place, but this isn't a simple thing to get working well in a wide variety of level geometries so will probably need a lot of work.

[EDIT] Spent this morning finishing off the face painting stuff in Charm. Within the editor, you can define a palette for your model which is saved as part of the model file, then select faces and a colour and use the Paint button to set those faces to the palette index, so would be easy to change the palette colours to make alternative versions of a model for example.

Had to play around with the options a little, so that you can choose between no painting, palette painting or painting the influences of the current joint weights. The latter is a useful way to check your rigging, and was just a boolean yes or no before.

charm_painting.jpg

When the model is exported to the format I use in the game, the colours are read from the palette and baked directly into the vertices. Loading in game is just a binary read into memory reserved as a vertex buffer so just had to make a couple of small changes to the vertex declaration and the relevant shader and all was working.

painted_in_game.jpg

Really not good enough to live with forever, but adds a bit of character and means I can put off texture mapping for a little bit longer, since that is going to involve some major work on Charm to add a whole new layer of functionality, projecting parts of the model onto a 2D texture view and supporting moving the vertices around with respect to this view. Need to look into the model unwrapping facilities that the D3DX library provides as well as a manual option.

If I can map between the model and a set of unwrapped texture coordinates, I may even be able to support live 3D painting on the model somehow. But a manual system for setting up texture coordinates will be required either way so will probably start on that before I try to get too clever.

[EDIT 2] Just a tiny change... smile.png

eyes.jpg

Thanks, as always, for stopping by.
Sign in to follow this  


2 Comments


Recommended Comments

I went through a phase of finding IK techniques pretty interesting.

 

Maybe you'd be inclined to find a library to do it, but, if you want to tackle it yourself I can recommend the Cyclic Coordinate Descent method. It's an easy algorithm to understand & implement and it yields good visual results.

Share this comment


Link to comment
Thanks dmatter. I was actually planning to do an angular approach using trig for the legs, since it should just be a case of working out the angles of a triangle who's hypotenuse is the distance from the hip to the floor, and sitting on a plane along the look direction of the model.

Share this comment


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