classes needed to create a simple person?

Started by
6 comments, last by fguihen 19 years, 6 months ago
hi. im new to all this game programming. i am making an application that shows the chaotic behavour of crowds. i want to do it in 3D. im wondering what would be usual ( and possibly best) method to create a simple stickman. my idea would be to create a class called "stickman". this would have a number of methods like "run", or "move_arms" etc.there would be a seperate class called "mans_intelligence" which would be the intelligence for my man. im not sure how it would work when i want the man to run, and move_arms at the same time,if id have to have each method in a seperate thread or something.are there any other ideas of how to do this properly that anyone can tell me? thanks.
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post
Advertisement
Stay away from threads -- they won't help.

Don't worry about animation until after the simulation is working.

Don't try to apply multiple animations to a model. If your stick man has three types of leg movement (stopped, walking, running) and three types of arm movement (still, swinging, flailing), then you will have nine animations. Generally, it is more effective and it looks better when an artist creates all the combinations rather than doing it in the software.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
IMO, it'll be very useful, if several animattions can be combined together. For example, if a charecter is walking on the street, as soon as he sees one of his old friends, his leg animation still remains the same, and a hand waving animation will be applied to the charecter's upper body(or just one of his arms).

It can be achieved by storing some specific boneIDs(or boneWeight) in the animation data. In the above example, the walking animation moves arms and legs, and hand waving animation only moves one arm, but has much higher influence on the arm and no influence on the other parts, so the two animations will be blend to form the final animation based on the weights.(and for boneID case, you can just replace the arm animation)

Of course if a charecter has diffrent body structure to the original one, the animation won't work correctly.

http://www.gamedev.net/community/forums/topic.asp?topic_id=272184
Don't use threads for animating multiple objects at once. Rather, just loop through the objects every frame and move each one. Your main game loop should look as follows:
while(true) {   currentTime = getTime();   foreach(person p in people) {       update(p, currentTime);   }   render();}

I suggest looking at a general tutorial on animation (for 2D games for example); then you can apply this in 3D with stick people fairly easily.
Quote:Original post by wanzi
IMO, it'll be very useful, if several animattions can be combined together. ...


Useful -- yes.
Easy to implement -- no.
Easy to make it look good -- no way.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Quote:Original post by JohnBolton
Quote:Original post by wanzi
IMO, it'll be very useful, if several animattions can be combined together. ...


Useful -- yes.
Easy to implement -- no.
Easy to make it look good -- no way.


He's right. There are better ways to implement this sort of thing.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
AFAIK Quake has already use somewhat similar technique. They call them tags, the main purpose for tags is to minimize the animation data(KeyFrame not bones though)
im a little more beginner than you all realise. can you explain what you mean by adding bone weights to the animation, and also more about the key frame method that you say they use in quake. im really beginning here so i need a lot of info and i need it to be put basicially.thanks all
I currently only use c# and directX9, in case its relivant and i didnt mention it in the post

This topic is closed to new replies.

Advertisement