Box2D Forums

It is currently Fri May 24, 2013 10:32 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Side View Rag Doll
PostPosted: Thu Dec 13, 2007 11:00 pm 
Offline

Joined: Fri Dec 07, 2007 3:09 pm
Posts: 241
Viewable here: http://www.sfu.ca/~mnb2/Biped.exe (scanned for viruses with Kaspersky 6.0)
If you need freeglut, it's available here: http://www.sfu.ca/~mnb2/freeglut.dll

Image

Critique welcome.


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Thu Dec 13, 2007 11:10 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Nice! I would get rid of the neck. It is a bit unstable when I pick the guy up by the head due to the light weight neck in the middle.

Are you willing to share your model as a test-bed example?


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Thu Dec 13, 2007 11:36 pm 
Offline

Joined: Fri Dec 07, 2007 3:09 pm
Posts: 241
Sure, I suppose I can do that, since you put all the hard work into the physics :) The code is a bit messy right now, but I'll make a class for the test-bed in the next few days.

I put the neck in there because I'm eventually going to make a platformer with guns, and I didn't want any bullets to slip between the head and torso. Plus, how cool is it to shoot someone in the neck? :p I'll take it out for the test bed though. You're right, it causes a few minor problems.

The biped is modeled after a real person so I could get the proportions right (that was painstaking!). The mass, height, and friction should be fairly realistic too (I looked up values). I approximated the max rotations by how flexible I am :)

One thing though... I gave all the body parts a groupIndex of -1 so they don't collide with eachother... but when I create multiple bipeds, I guess they should all have a unique index. Should I require the developer to pass in a unique ID for each biped, or is there an easier/better way to do this?


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Thu Dec 13, 2007 11:53 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Thanks! I look forward to your contribution.

You can increment a biped counter and use that as your group index (negated).


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 1:02 am 
Offline

Joined: Fri Dec 07, 2007 3:09 pm
Posts: 241
Hrm.. it's so obvious, I'm not sure why I didn't think of that. Thanks!


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 4:44 am 
Offline

Joined: Tue Sep 18, 2007 6:17 am
Posts: 155
Location: Western Cape, South Africa
Cool biped, darkzerox.

I was thinking that perhaps you could move the green (right side, I presume) limbs slightly forward, putting it into a 3/4 view and giving a bit of depth to the biped.

And if this makes it to the SVN perhaps it should be as ubiquitous as the bomb :), a biped down the pyramid might be fun :)

You could also add motor forces to the joints to simulate a live person, whose limbs will try to cease motion (like in the slider crank test) which could make the biped slightly posable or even trying to always move into a default position. This combined with the 3/4 thing might let the biped stand straight for some bomb chucking :)


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 6:37 am 
Offline

Joined: Fri Dec 07, 2007 3:09 pm
Posts: 241
Thanks Wahooney. I'm not so sure about the 3/4 view, but you're welcome to modify the source. I just spent about 6 hours (on top of the previous 6, placing every vertex by hand) (re)writing 2 new classes: BipedDef and Biped (following Erin's lead). I've included several functions for setting parameters for all the body parts at once so that you don't have to adjust all 17 body parts and 16 joints by hand. A motor torque of about 25 N (default) is enough to make the biped stand up. My system can handle about 20 - 25 bipeds for it begins to lag, which makes for a decent size pile of dead bodies.

I still have to put it into a test class though. I'll do that later.

Then I have to figure out how to get this guy to walk... it's proving to be a bit more difficult than I thought.


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 9:14 am 
Offline

Joined: Wed Nov 28, 2007 9:46 pm
Posts: 34
anybody who get can get one of these guys to walk is going to have my utmost respect. I'd really like to do a 2D platformer someday with a ragdoll model, but the more I think about it the harder it seems. What happens when it falls over? How do you get it to run and jump? How does it's movement code adapt to different situations: slopes, stairs, etc.?

The only thing I can think of is some adaptive learning routines for movement. I've seen this done with 3d models before. You define the physical structure of the model, it starts twitching randomly, getting positive feedback when it actually manages to take a step or move, eventually the model teaches itself how to walk.

Am I overlooking an obvious easier solution?


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 10:01 am 
Offline

Joined: Fri Sep 28, 2007 7:49 am
Posts: 61
ninjascience wrote:
anybody who get can get one of these guys to walk is going to have my utmost respect. I'd really like to do a 2D platformer someday with a ragdoll model, but the more I think about it the harder it seems. What happens when it falls over?


Controlling a simulated 2D biped is still an active area of research in robotics and computer science, there are a lot of papers with useful ideas, however no great solution yet.

You might want to check out the videos on this site for some inspiration; in this case they've sidestepped the problem by making the control of the biped the player's problem! http://www.dgp.toronto.edu/~jflaszlo/interactive-control.html


Top
 Profile  
 
 Post subject: Re: Side View Rag Doll
PostPosted: Fri Dec 14, 2007 10:08 am 
Offline

Joined: Wed Nov 28, 2007 9:46 pm
Posts: 34
Spider Man, Spider Man, does whatever a spider can!

http://www.dgp.toronto.edu/~jflaszlo/in ... 10tour.mov


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group