Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Procedural Walking Animation

Author
Message
hmm
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location:
Posted: 12th Mar 2010 21:33 Edited at: 12th Mar 2010 21:33
Here is some (messy) code demonstrating a procedurally generated walking animation (i.e. generated on the fly). The feet follow the height of the ground and never slide (as is common with traditional animating techniques), and the legs bend accordingly. The 'body' also sways a bit, simulating how people shift weight from one leg to another.

Kind of inspired/reverse engineered after watching this

Hope you find it interesting. I'm going to clean it up a bit, make it into the basis of a procedural animation system. Just cos I hate skinning and animating models so much.


hmm
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location:
Posted: 12th Mar 2010 21:40
forgot to say controls:

WASD to move
mouse to look
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 12th Mar 2010 22:27
very interesting, i like it, can you add a torso and arms?

God is real unless declared integer.
hmm
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location:
Posted: 12th Mar 2010 23:35 Edited at: 12th Mar 2010 23:39
Wow. Didnt even realise this would happen, but I altered controls a little bit and turns out it automatically handles walking backwards and strafing. Check it out (same controls except the 'player' is always facing the same way as the camera).



Will have a go at the rest of the body.
Dr Tank
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 13th Mar 2010 04:54
That's pretty sweet. The legs cut through eachother sometimes, but it's still cool. I'll give the code a read through at some point.

Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 13th Mar 2010 17:27 Edited at: 16th Mar 2010 19:27
That's a pretty cool code.
I'd suggest you ad momentum so it will try to balance itself in tight turns.

I'm keeping an eye on this.

chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Mar 2010 15:15
@hmm
that`s really great!.I always liked making things from the programming environment itself, without using external programs.I´ll keep it ...so I made my day



cheers.

learning every day
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th Mar 2010 15:31
Now this is great :-P

Cheers!
Sven B

hmm
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location:
Posted: 15th Mar 2010 01:06
thanks for your positive comments. have to say I'm quite proud of this little bit of code, I find myself just walking around for hours (not really hours...minutes maybe).
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Mar 2010 13:25
Impressive!
Sepnon
14
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 17th Mar 2010 02:16
very impressive!
keep improving
Madscientist
14
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 20th Mar 2010 02:02
It gives me an error that says the vector doesn't exist when it clearly does


If it hasn't exploded yet, I haven't touched it.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Jul 2010 09:36
This is some good code!

My signature is NOT a moderator plaything! Stop changing it!
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Jul 2010 22:22
Wow, conincidentally I just watched that same video yesterday. Great work!


Guns, cinematics, stealth, items and more!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Oct 2010 19:20
Inspiring work indeed. I'll have to study this carefully. Thanks.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Nov 2010 17:26
Nice work! I did something similar for one of the coding challenges here's my walking robot (also fires missiles) all procedurally done too:


Of course mine is vastly overcomplicated compaired to yours!

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Nov 2010 19:35
I was about to start something like this too. A neural network type creature.

Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 1st Nov 2010 20:24
Is the basic idea to first move the feet and then position the legs according to the new foot position?

This is some really cool code. I'll try to work through the math soon

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Nov 2010 19:42
Quote: "Is the basic idea to first move the feet and then position the legs according to the new foot position?"


Yes, I'd like to know what the key idea is too.

I could of course wade through the code to find out ...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Nov 2010 10:52
Quote: "Is the basic idea to first move the feet and then position the legs according to the new foot position?"

I'm not sure how hmm's code works but that's how mine works.

Depending on input from the player it decides where it will aim to place the next foot (also depending on which foot is next to use). Then it starts moving towards that position. Once committed to that movement it will do it no matter what, then the process starts again. I just made the body stay halfway between the two foot positions (in x and z) and the leg components are then placed, rotated and moved into position in order (thigh, knee, calf)... I wrote mine a while ago so I couldn't go into much more detail without studying the code anyway!

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Nov 2010 11:43
Quote: "I wrote mine a while ago so I couldn't go into much more detail without studying the code anyway!"


I know the feeling.

Login to post a reply

Server time is: 2024-04-19 21:21:59
Your offset time is: 2024-04-19 21:21:59