Custom Characters

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Daystar
Posts: 58
Joined: Tue Jul 17, 2007 3:53 pm
Contact:

Custom Characters

Post by Daystar »

I was wondering if anyone had tried to make a function in a game using Irrlicht that would allow the player to customize their character's avatar. I need to know how would I go about doing this I'm not sure if all you have to do is make separate models and skins then pre-load then then as the player switched through the different parts then they are attached to the base model in a mesh viewer. I could really use some help with this.
DayStar
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Can you please describe in more detail exactly what you need cause that's bit too general for any serious help.
Describe what you're trying to do, what you want to get and then it would be easier for us to help you.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Daystar
Posts: 58
Joined: Tue Jul 17, 2007 3:53 pm
Contact:

Post by Daystar »

Well like if you were going to change the character's cloths,hair eye color, skin tone, etc...
DayStar
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

If it's just the colours you're changing then that's just done by maybe vertex colours (with some editing to how vertex colours are used as they're sometimes ignored) or changing the colours of the texture directly, maybe creating a new texture for the user's specific setup they want.

Do you also want to know about attaching things like helmets, armour, weapons etc...? That's what i thought your original post was more about.
Image Image Image
Daystar
Posts: 58
Joined: Tue Jul 17, 2007 3:53 pm
Contact:

Post by Daystar »

JP wrote:If it's just the colours you're changing then that's just done by maybe vertex colours (with some editing to how vertex colours are used as they're sometimes ignored) or changing the colours of the texture directly, maybe creating a new texture for the user's specific setup they want.

Do you also want to know about attaching things like helmets, armour, weapons etc...? That's what i thought your original post was more about.
The original post did include attaching things to the person too, would you be able to help me with that?
DayStar
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can attach elements to joints of skeletal animated meshes (such as b3d, ms3d, and .x). Those joints are moved according to the animation defined for that particular mesh.
For non-animated meshes you can simply child those nodes to the parent.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

In way, never done it myself but it's been talked about a lot on here and is fairly simple in principle.

The best way to do it is to use a model format that supports bones/joints (i.e. ms3d, x, b3d etc) and then you can connect things to the skeleton of your model, so you could attach a sword to the hand joint so your character holds it and swings it around like a sword when the arm is animated.
Image Image Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

In my setup I used 2 textures, one as a basic colour map, and another signifying areas which recieve custom colouring (Thats in red, blue is for reflective stuff kind of like a specular map and green is for dirt), look at this example here:
http://irrlichtirc.g0dsoft.com/BlindSide/modMap.JPG

Then in the shader I apply the "ModMap" with the same texture coordinates as the base texture and lerp between the custom set colour and the base texture colour based on the red value of the ModMap.

This allows me to create many different coloured ships like so:
http://irrlichtirc.g0dsoft.com/BlindSide/ingame.JPG

A very similar approach can be used for your requirements, eg. Marking hair and other stuff with a custom colour that can be changed.

Changing the vertex colour is also a good idea, another simpler approach is to just have seperate meshes for the hair and the body and other modifiable areas.

To attach meshes you gotta grab the bonescenenode and do a setParent() on the weapon.

Good luck
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply