Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Controllers for virtual humans  (Read 3669 times)
0 Members and 1 Guest are viewing this topic.
Offline Ramona

Senior Newbie




Java games rock!


« Posted 2005-06-26 15:14:37 »

Hello,

I'm searching controllers for virtual humans, which controls the avatar in a physical way and which I can integrate in my project. Controllers written in Java are prefered, but I can also used Controllers written in other languages. The controllers I need are controllers for the locomotions walking and grasping, but others are also welcomed.

I hope anyone can help me or knows where to search.

Ramona
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #1 - Posted 2005-06-26 17:41:45 »

I don't know if something like that exists, but it would be great if there were !!
As far as I understood your request you have ODE-Geoms that resemble your human that are linked with joints.
Have you heard about inverse kinematics (IK)? It may be a good idea to look at that konzept if there isn't existing anything else. I don't actually know how complicated it is to write such an IK tool, or if there already exist one and I also don't know how much computation time an IK would take.
Next to that you would probably anyways (doesn't depend on what controller you're using)  have to write some skin tool, so the Geometry you render doesn't look so ugly (pretty important when animating humans with bones).

I think most of us could use such kind of tool(even simply to get away from ugly* frame animations).

*at least I think frame animations are ugly, because it simply looks stupid when you character walks down some stairs, as if it would be walking normaly and only falling down the steps.

:: JOODE :: Xith3d :: OdeJava ::
Offline Ramona

Senior Newbie




Java games rock!


« Reply #2 - Posted 2005-06-27 14:17:52 »

Yes I know inverse kinematics, inverse dynamics too. Because it seems, that there are no existing controllers for free - I didn't find one so far -, I have to implement it on my own. I hope it's not too time expensive.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline holodri

Senior Newbie




Java games rock!


« Reply #3 - Posted 2005-06-27 14:52:03 »

"endorphin" is a environment especially for stunts and game-movement developers. they do that with a mixture of motioncapturing and evolutionary algorithms. (http://www.naturalmotion.com/)
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #4 - Posted 2005-06-27 15:44:02 »

I was just wondering if it could be possible to just make dynamic trimesh with frame animation, so characters don't fall on stairs but really walk, if their steps have the proper size.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #5 - Posted 2005-06-27 16:02:03 »

If you use frameanimations it will look funny I think, because your human will either be hobbing down the stairs (it would probably also very difficult to do that, because the center of mass has to be set accordingly) or your character would lose it balance and be falling down the stairs. See the image below for that.

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #6 - Posted 2005-06-28 10:43:22 »

I see.
So another proposal :
For Gamma I plan to do a Java port of an open-source character animation library : Cal3D.
It use skeletal animation.
If we can get which vertices the bone is influencing, we could create and synchronize a correspondant physic structure.
And we could mix the animation and the physic behavior influence.
So we could do as in endorphin, but with a skin on the ragdolls ?
And for the center of gravity, I think it's really a problem in ODE.
Really, it wouldn't be possible to make possible to change the center of gravity ?

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #7 - Posted 2005-06-29 09:54:23 »

You can change the centerof gravity (you always will change it) when you create your body out of different geoms (like one for each bone). Then the center of gravity changes dependingly of the movements the caracter does. Like in nature.

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #8 - Posted 2005-06-29 12:37:14 »

Okay.
What about physic/animation synchronization ?
The problem with systems like endorphin ( as I can saw the example videos ) is we can't put ragdolls made of spheres/cylinders/cube, we need more sophisticated graphics.
So it would be like a sort of "skin" deformated in real-time by the physic engine..
However, if we're motivated to include this in Gamma, I'm afraid we can't do that for the first beta version...  Grin

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #9 - Posted 2005-06-29 13:05:49 »

hmm jeah we'll need such a skin thingi - everything else will look ugly. I know how it is done from 3dsmax, there every vertex got a vector of floats that specified how much the vertex is affected from the surrounding bones. When you added all these floats together you always got 1 as a result. The question now is that: does Cal3D contain also those weights?

Quote
However, if we're motivated to include this in Gamma, I'm afraid we can't do that for the first beta version...  Grin
We'll also need some stuff for later versions Wink

:: JOODE :: Xith3d :: OdeJava ::
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darkprophet

Senior Devvie




Go Go Gadget Arms


« Reply #10 - Posted 2005-06-29 20:22:51 »

You are talking about two differnet things here. IK  and ragdolls. Let me explain them to you:

Ragdolls,
Each Dynamic object is lined to a bone in the skeleton animation system whereby the rotation matrix and postion of the bone is derived from the dynamic object. Each dynamic object is linked to its previous by joints (either ball-socket, or hinge) to maintain human anatomy. As for ODE and ragdolls, the problem of two geoms connected by a joint do not collide can be simply solved by having each joint resembeled as a GeomSphere, then the bones like to the GeomSphere so that the humerous and the ula can collide and not penetrate each other like some wild magical creature from out of space! Also to take into consideration the max/min degrees the joint can move around. E.g, its easy for you to point your humerous forward but its difficult to point it backwards while keeping your arm straight. I dont believe even Havok has managed to do this as most ragdoll demos and games i have played the upper arms of the player and and often does go behind his back....

IK,
Each bone can be thought of as its own coordinate space with its own rotation matrix and its own position. The positions and rotations of children are influenced greatly by that of their parents. Inverse kinematics involves recursing backwards. So you place the last joint where you want it (say on the stairs), then IK algorithms will find out the rotational matrix and position needed for its parent so that the child has that valid position. This is useful in the stairs example you gave. This is also how modern games like Halo2 position the player's feet directly on uneven terrain, so that the player doesn't look like he's hovering with his feet penetrating the mountain...

Both are complicated to make and not for the light hearted to take on, so good luck to whoever is implementing them! Smiley

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #11 - Posted 2005-06-30 09:16:50 »

I know the difference(s) between ragdolls and IK and what I propose is to join them ( not keeping all of theirs respective features ).
Say :
 - The skeleton is loaded from a model
 - The different animations used by the controllers are in the model file and they're blended when there's more thant one controller in action
 - The "dynamic animation" react with the others physics objects of the world, so if you have a walk animation, there's no need to apply a force to make the character moving. There's a friction on his foot, so he will move by himself.
 - The skeleton have a skin that is deformed by the bones position, rotation..
 - The bones of the skeleton are physically represented by BallJoint(s)
I'm not sure I expressed myself correctly... but you may have a little idea of what I want to do.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline NewbTon

Junior Devvie




Odejava games rock!


« Reply #12 - Posted 2005-07-01 00:52:58 »

Well right now I'm working on something like that. I created a ragdoll that can perform various movements as configured in an XML document.

It consists of Bones (Bodies and Geoms) and Joints. The Joint ball is not suitable because you cant set stops on it, so I created a "combined jointball" that uses 2 hidden  bodies and three hingejoint. It's sounds messy but it works.

The guy can perform any movement that you want him to do using physics / angular joint motors ) only problem is that he will fall to the ground because he has absolutely no brain that will keep his balance for him.
A neat workaround for that was to make his "center bone" about the width of a  football field and make it non collideable with the
rest of the bones. Again a messy  but works at a minimum CPU cost.

I have a demo here that you could download if you dare

http://onlineboxing.net/boxing/demo/ob3d_demo.zip

 If you like it I wouldnt mind sending you sourcecode for this. It's a bit spagetthi since I had to learn while doing, but you could simply use some of it's ideas as a reference if you wanted.
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #13 - Posted 2005-07-01 12:46:55 »

cool - If you could give us the source this would be nice.

unfortunately I'm using linux and xith3d and not windows and Java3D, so I had no chance of testing your demo (without installing all the necessary libraries).

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #14 - Posted 2005-07-02 08:24:17 »

Well right now I'm working on something like that. I created a ragdoll that can perform various movements as configured in an XML document.
Well, that's cool. What is the format of your XML file ? What do you exactly define in that ? Would it be possible to make a graphical interface to edit the XML files ( showing the real-time animation of the model ) ? If you want to include it in Gamma, you can, we just have to change Java3D to Xith3D.. and use the Gamma abstraction layer above ODEJava.
If you are interested in Gamma, I can give you the Editor API.
Because the Editor is ALL-made of modules, it's really easy to extend it.

It consists of Bones (Bodies and Geoms) and Joints. The Joint ball is not suitable because you cant set stops on it, so I created a "combined jointball" that uses 2 hidden bodies and three hingejoint. It's sounds messy but it works.

The guy can perform any movement that you want him to do using physics / angular joint motors ) only problem is that he will fall to the ground because he has absolutely no brain that will keep his balance for him.
A neat workaround for that was to make his "center bone" about the width of a football field and make it non collideable with the
rest of the bones. Again a messy but works at a minimum CPU cost.

Is it really useful to use so many joints ( 3 hinge joints ) ? Each of them speed down the simulation... and if we can't use the Joint ball, can we use the Universal joint ?
And for another workaround : why don't just set the ragdoll direction to the normal of his feet contacts ? ( I don't know if what I say is very "understandable"  Grin )

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline NewbTon

Junior Devvie




Odejava games rock!


« Reply #15 - Posted 2005-07-02 15:03:45 »

The XML format is homebrewed, you can see an example of it in the "data" foulder in the demo.
I dont know if you can use the UniversalJoint. I dont think it gives a balljoint effect that you need for shoulders.
Btw, elbow, knee joints are implemented using only hingejoints though.
Yes theres an editor to setup skeleton and poses/animations.
 I will post the code, also the code for the editor But I warn you, this is not ready for serious use.

Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #16 - Posted 2005-07-02 20:13:06 »

Quote
I will post the code, also the code for the editor But I warn you, this is not ready for serious use.

Nice !! Editing some kind of code is the best way to learn it - so it's not bad but actually a good thing, because this way bugs are found more easily and it will be easier to implement it Wink

:: JOODE :: Xith3d :: OdeJava ::
Offline NewbTon

Junior Devvie




Odejava games rock!


« Reply #17 - Posted 2005-07-02 21:20:42 »

Ok, just give me a few days.
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #18 - Posted 2005-07-04 11:54:49 »

The XML format is homebrewed, you can see an example of it in the "data" foulder in the demo.

Anybody can tell me what internal file formats are not homebrewed in Gamma ??  Grin Grin
Ok so I'll see that.
The structure of the Editor could make it a lot faster to make the Physic structure editor.
I'll just look at your XML files and see what we can do.
And thank you very much for your contribution to Gamma.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #19 - Posted 2005-07-04 11:58:23 »

Again a messy  but works at a minimum CPU cost.
In fact it's not annoying to have such workarounds, as long as they're made in a transparent way for the user-developer.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #20 - Posted 2005-07-14 10:41:10 »

Wouldn't it be also an idea to make it more human like with a learning process? There are some criteria like movement speed and other stuff and then there is a AI which learns by try and error how to walk. So it can automatically adjusts it's behavior. This way we wouldn't have to think of complex movement structures to keep it moving - and it would also be able to keep standing at unnormal situations e.g. when it gets hit...

The only question would be what is easier writing the AI or writing the movement behavior.

It's just I see a problem with NewbTon way of controlling the Human - he said he would be using a big plate for the feet - This wouldn't be any change in contrast to frame animations, because the human won't be able anymore to fit into stairs.

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #21 - Posted 2005-07-14 11:39:44 »

Wouldn't it be also an idea to make it more human like with a learning process? There are some criteria like movement speed and other stuff and then there is a AI which learns by try and error how to walk. So it can automatically adjusts it's behavior. This way we wouldn't have to think of complex movement structures to keep it moving - and it would also be able to keep standing at unnormal situations e.g. when it gets hit...

The only question would be what is easier writing the AI or writing the movement behavior.

It's just I see a problem with NewbTon way of controlling the Human - he said he would be using a big plate for the feet - This wouldn't be any change in contrast to frame animations, because the human won't be able anymore to fit into stairs.
I think this is a good idea but :
 - If we want to use that in a game, the learning process has to be finished, or the game would be unplayable at the beginning
 - We should find a good learning "algorithm". I see many problems in this way, altough it's a very interesting idea.
Some ideas/problems :
 - How do we define the ragdoll "should walk" ? We could tell it may move ( comparing positions ) in that direction, and then it would try to move all his bones until its position is changed, and so on. One problem is : is the way human are walking the best way to move ? If it's not the case, we would see our ragdoll move like an animal.

Regarding the Gamma project, I think it would be reasonable to use this development plan :
- Version 0.1 : Only static graphics ( OBJ / 3DS formats ) are supported. However, it's possible to use constraints ( ODEJava joints )
- Version 0.2 : Frame animations ( MD2 ) are supported. And behaviors are made, so it's possible to apply multiple behaviors to make the object move : for example walk and fire at the same time
- Version 0.3 : Self-learning process is done

For the behaviors I suggest the following ideas :
- There are "key bones" that are needed for a behavior : for example a "walk" behavior would need all the human bones for legs : thigh, knee, foot
- Behaviors are all adjustable with different parameters ( speed, angles... )
- When they are multiple behaviors that act on the same "key bone", the result is the mean of all the modifications ( or maybe we should do a priority system ? ).

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #22 - Posted 2005-07-14 17:21:24 »

Your scedule for gamma seems to be good. We should ofcourse do this complex stuff later, so we have already a good testing environment. + We sure should make the learned stuff saveable (ObjectOutputStream), but I think this is implementation thingis which we should discuss when the time comes...

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #23 - Posted 2005-07-15 11:47:02 »

Yes, and for now it's important to finish all the 6 Gamma tutorial, because when they will be all running correctly we will have finished Gamma 0.1 !
Here's the list ( it has been extended since the first time ) :
1. Hello World : finished
2. Stress Test : finished
3. Shoot the cans : to complete
4. Splasher Boy : to do
5. Bidus : to do
6. <A secret project, for now> : to do

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (45 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!