game physics

hi there

so i made a giant robot
i want to make a giant robot that effect,s other object under him by his feet without making them Collision on a barrier


i also want this robot to have it,s own physics on his body and his feet, and nothing more than that like,




the only place the object can move on is under his body or under his feet but only if his feet are lifted form the ground, like actual physics
is ther,s a way blender can do that

1 Like

You can take a look at this: http://blender.stackexchange.com/questions/21286/collision-groups-and-mask

Use collision groups and masks to specify which objects collide with which. This setting is under the “Physics button” for colliding objects.

(Ex. collision mask of (only) 1 can collide only with collision group 1.)

So for your example, have the object on a collision group that doesn’t interfere with the entire robot’s collision bounds, but does interfere with the feet. Also tinker with the ground’s collision if you have to.

ho this is cool ill chick it out

Good luck!

if you just want the foot to plant on any surface, use raycast with IK bone, limb collision can be done either with triangle mesh or compound physics, the former is slow and the later requires some hack

OK this thing worked but there are still some thing that I didn’t understand yet about thy

e mask

For an object, a collision mask determines which collision group(s) the object collides with.

Ex)
Object A has this mask:

That means Object A collides with objects that have at least this pressed for collision groups:

Keep in mind you can have more than one button selected for a given object (by holding down shift).

hi again
Mirror|rorriM thank you so much for showing me how to use the mask group but the bad news is i have more problems to come and i hope you can help me out this time

this time i have more questions that i want to know how to solve them, there going to be a 2 section questions and also about game physics or so,

so for first i did try,d using the collision group to solve the problem that i talk,d about in first time i started this thread, the robot actual physics and the parent object physics,
and it really did worked great, now whenever the robot body walk,s the little box,s beneath it only get,s effected by the robot physical body and not the parent object body, but the problem is,
when the robot move,s into a surface with obstacles , like [high grounds and low grounds ] the robot don’t play along according to his shape, like what you can see in picture num1



Instead of acting according to it,s shape ? the parent object still,s effects the robot body ,so i want to be more like picture num2




so the first question is : is there is a way to solve this? or is it, just as simple as this, "it,s above blender,s capability,s "

for 2nd
if you sow game,s sens ps2 and xbox , game,s where changed letarly, from being just thous beautiful object,s that where just simply made for you to control and to have fun while playing them, to something becomes more like a movie, where theirs some actions that will happens in the medal of the game while your playing ,into an actually mixture of gameing and movie show, on the releass of the ps3 and xbox360
the actually change was on the resolution and some elments that wher added to game,s to make them more fun playbole and injoyabole , … yeah some of you might say: hay some of this elments are actually excest in some of the ps1 game,s , yeah, thy actually are, like : metal gear sold1 the resdent evil 1,2,3 , but ther are very very rarr to fing in ps1 game,s
some of this elments are actually!!!.. … hmmmm
[ the scenematic scene,s during the game ]
some of them happens while you just stand ther and watch ,the scenematic scene take you along the story , like the[ "metal gear sold 2""resedint evil series"and"GTA series " ],while thers no cut,s that will take you from the game scene to the scenematic scene, this are the popular ones that every one will remeber them, and remeber every beautfull moment he spended playing them
and some of them , are actually happening while your playing the game , like while your runing on a streat sudnly an aircraft fall,s down like the batel field3 ,or your on a car driveng and sudnly a gunship show,s up and try, to take you down ,but you fall from the road to the open see,s , alos batel field ,but 4 not 3, lot,s of lot,s of game,s that have this type of senematics scenes during tha game, while you have fully control of your carecter, and not like the other,s where you just set ther and watch the scene

i know some of you will probrbly say : hay this completly has nothing to do with this form, yes it is,… it has every thing i want to know about question2 ,you didnt forgit about it do you?
so hers what i am trying to explayn :
if you can see this video that i uploaded ,trying to explayn my problem in,t

i am trying to make type num1 of the scenematic,s scene: where these 2 characters, supposed to play along the game and you just watch them,
so character 1 should walk,s till he reach to charecter 2 which he is standing ther waiting for chartecter 1 to arrive ,then character2 will throw a phone to charcter1 and wakls to the car to the driver set, charcter 1 will stand ther and looks to the phone and then move,s to the pasenger set and hub to the car
it,s sems easy does it? … but it,s not
look to the video

can you see the problem?

p for problem,
p1 : how or what can i do to make the character animation fit,s to the parent object movments,if you can see his feet arnt actually moving , thy are sliping like if he is playing the moon dance, the parent object movments are also animated, because you cant control a movement of a charecter by logic , like turn her and stand her for 2 min, then walk again and stand her for another 2min, you cant control this type of scenematic movment,s by logic , believe me,
or what is the beater way to animat a charecter and make him move , because in belnder you cant make a game with a charecter if you didnt parnte your armeture to an object, and i resently i descoverd that you cant control an armeture physics in the game, not like the object,s where the physics take,s the object shape,
p2: which is the hard part, if you can see whene character2 give charecter1 the phone the phone didnt move along with characet2 hand to fly up and fall in to character1 hands, so what can i do to move the phone form to charcter1 to 2, dont tell me to animate the phone all the time, because i cant animate it also if i want charcter2 to walk before the scenematic start,s then hel just stand ther waiting for you to give you the phone, i cant animate it all the way till he stand,
i tryd linking the phone by constraints to the charecter hand and then shift it to a nother constraint link just like we do on render animation, just animate the constraints ,but i found i problem ther 2, for 1st , the constraints cant be animated in game , for 2nd constraints dont work during game , i tryd parenting it and chaning the parent on the game, but it didnt work 2
so what can i do for this, and is or what is the beater way to do it
p3:if you can see on the vedio , the 2 charcters should ride the car and the car should move while thyr tolking, but the problem , is how can i animate the car and still make her keep her physics, during the animation, and how can i keep the 2 charecters to set on the car and move with it tell it stops and then thy get out of it,
i tryd parenting them during the game the moment thy tuch the car, but the problem is that the animation, doesnt work, if you can see on the video the chrecter postions chaneg the moment the object is parented to the car, it,s just like if the object understand the the moment he parented to the car the moment the start postion space of his animation changes to the new start postion space ,acording to the parent postion, i really didnt understand this and i really dont know what am,i tolking about,
but thoug i think you got the idea, dont you?
what can i do to animate the car and keep the charecters to set ther tell the animation end,s

so i think that,s all for today , and i really hope you help me throw this because i really really need this theng,s
but thank you again for your time for your comments and your wonderfull feed backs it really helps alot , not just me, but the whole comunity by reading this and knowing problems before falling to them , like i did, >_<
and also will the foundation trys to solv this problems if they really did didnt have any way to solv them ? will thy provide us with a beater new engine to use ? or will thy just let us suck it up and move on ?
all of this will be descoverd on the nearst future .
and yeah

dont forhget to cheke out my latest video

thanks again

  1. your mech legs don’t align to the contours of the terrain by themselves, you need to use IK animation with raycast aka foot planting to animate/align them physically

  2. wall of text are difficult to understand but in general you should avoid physics when doing cutscene animation

  3. nice game

guramarx

1- what are the ik animation, or the raycast, please forgive me i don’t know alot of thing her!!!

2-how can i avoid physics ?

3- thank you

Nice work with the animations! I hope you can develop that into a game.

For your first problem:

Take a look at this:

Try making your robot body have a ‘rigid body’ collision type. Lock Z Rotation
in the ‘physics’ tab under the ‘physics’ button, and make your robot have a ‘box’ collision bounds.
This is how you can align your robot to a surface (not sure if that was what you were asking for).
Kind of like this:
Rigidbody.blend (497 KB)

This method will not cover all surface solutions, but it can work for that case you presented.
You may have to tweak those physics settings a bit though.

p1 : how or what can i do to make the character animation fit,s to the parent object movments,if you can see his feet arnt actually moving , thy are sliping like if he is playing the moon dance, the parent object movments are also animated, because you cant control a movement of a charecter by logic , like turn her and stand her for 2 min, then walk again and stand her for another 2min, you cant control this type of scenematic movment,s by logic , believe me,

You actually can control the movement of the parent while animations are played. But I don’t
know the specifics of how you implemented your animation. Please refer to my answer and the blend file on this post:

Also look at what sdfgeoff has to say.

Basically, you want to try parenting your object and armature to an empty, then moving/transforming the
empty to move the entire body. What you want to do is move the body, wait, move the body, etc. (to avoid moonwalks).

p2: which is the hard part, if you can see whene character2 give charecter1 the phone the phone didnt move along with characet2 hand to fly up and fall in to character1 hands, so what can i do to move the phone form to charcter1 to 2, dont tell me to animate the phone all the time, because i cant animate it also if i want charcter2 to walk before the scenematic start,s then hel just stand ther waiting for you to give you the phone, i cant animate it all the way till he stand

I don’t know how you implemented the phone animation, but I’m sure you can use parenting (setParent()). Or if you’re really desperate, you can have two copies of the phone, where you set one (on the pants) invisible and the other (in the hand) visible when the tossing begins.

p3:if you can see on the vedio , the 2 charcters should ride the car and the car should move while thyr tolking, but the problem , is how can i animate the car and still make her keep her physics, during the animation, and how can i keep the 2 charecters to set on the car and move with it tell it stops and then thy get out of it

I’m not very sure what you want here, but please also refer my answer and the blend file on that post I mentioned. This time, try parenting the empty to the car.

Thanks for your compliments! It is the collaborative effort of the community that makes us progress. It’s also good to see you working hard at what you are doing. Oh and like guramarx said, please keep your text as minimal as possible.

If you want more help, I think sending a blend file would be good. Your problems are very specific.

Yo, I hear you like walking robots in BGE:

That’s a fully dynamic walk-cycle, with no animations. Each leg uses some clever math to figure out where it needs to be, and then performs the inverse kinematics to make the end go there.

Now, because that blend was for a university assignment about solving the inverse kinematics, I did it all by hand in python, manually placing the legs each frame. Since you just want this for a game we can use BGE’s buit in IK solver.
I have a blend for this to somewhere. Hmm. It doesn’t adapt to height properly.

So. How would I do this?

  1. Think of a video game walking vehicle as … a hover craft with legs that move under it to make it look like it’s walking.
  2. Forget hand-coded animations unless you really want to restrict what the player will do with said vehicle.
  3. Learn a little about developing AI. In the above system, the robot is a collection of four AI legs. Each one with it’s own desires and constraints. They all communicate with each other and decide on the resultant motion.
  4. Correct physics for the legs will be hard. Objects parented to armatures don’t get physics information updated as (I belive) the meshes get merged at game start and reinstancing a physics mesh is expensive. The solutions are to either solve the inverse kinematics yourself or to have separate graphical and physics meshes, where the physics ones imitate the position of the graphics ones (parenting won’t work here, it’ll have to be done through python).

This seems like a fun project, and fits with the Weekly Nano Game, so I’ll have a go at it for the next four hours.

I like your video demonstrating the environment. I’d be interested to see your shader/material setup for the world. I’m also curious as how you did the sun lens-glare. It looks like a nice simple method.

  1. Correct physics for the legs will be hard. Objects parented to armatures don’t get physics information updated as (I belive) the meshes get merged at game start and reinstancing a physics mesh is expensive. The solutions are to either solve the inverse kinematics yourself or to have separate graphical and physics meshes, where the physics ones imitate the position of the graphics ones (parenting won’t work here, it’ll have to be done through python).

1 - create ‘tags’ stick to each bone center and align to bone and parent them to the bone
2 - create ‘child shapes’ place at bone tag and match bone shape (using box - or capsule etc)
3 - on runtime pair up the shapes and tags into a list

4 each frame, unparent the child shape, move it to match it’s bone tag rot and position, and parent to the compound root object.

hay
Mirror|rorriM
about what you said,[sending a blend file would be good.] i really want it to attach the blend file but i really dont know why did forget about it, so ill do it just now

about the first p

Try making your robot body have a ‘rigid body’ collision type. Lock Z Rotation
in the ‘physics’ tab under the ‘physics’ button, and make your robot have a ‘box’ collision bounds.
This is how you can align your robot to a surface (not sure if that was what you were asking for).
Kind of like this:

i want the robot to align according to the robot feet and not to the parent object, like i want him to ignore the parent object physics

for 2nd, is parenting the armature and the body to an empty , beater than parenting it to a mesh object,? and should i just animated as well?

for 3rd, what i meant is that i want to animate the car, but if i did she will loss her game physics during the animation , like for ex, her Wheels wont roll if i just animated the car, and the 2 characters wont be parented to the car correctly

Thanks for your compliments! It is the collaborative effort of the community that makes us progress. It’s also good to see you working hard at what you are doing. Oh and like guramarx said, please keep your text as minimal as possible.

If you want more help, I think sending a blend file would be good. Your problems are very specific.

thank you again, for saying that i really appreciate it,
and about the text, i am really kinda confused ? !!! what text ?

sdfgeoff

for first i do like walking robot,s so so much
wow, man this so high level, are you controlling the robot ?or is it just randomly walking around,
i didn’t know that wee can animate thing,s by python, this is just so high level, iam just an amateur ,who is just learning things, so i really dont know anything about animating with python, not to mention ,this detailed physics , i mean look to how this robot walking, it,s just like an actual robot moving, around ,

and about the sun lens glare

I like your video demonstrating the environment. I’d be interested to see your shader/material setup for the world. I’m also curious as how you did the sun lens-glare. It looks like a nice simple method.

i did linked the the blend on the video description
and her is a link,

you can check it on the blend, it,s a stopped method that i use for this kind of stuff ,an object with a track actuator, that, tracks the sun, and having a ray sensor, if the ray, hit,s the sun it,l be visible ,and if not it,l be invisible

[B]BluePrintRandom

[/B]about what you said :
what are the tags?

@BluePrint
Eh?

@alf0
I was steering it there with WSAD. That blend took a long time (comparitively) to develop because I was doing all the kinematics myself. For something intended for a game I’ll just let BGE handle it.

iam just an amateur ,who is just learning things, so i really dont know anything about animating with python, not to mention ,this detailed physics

Keep learning and keep playing and keep having fun!
(Crap, I just realized I’ve been doing this for like 7 years now. I feel old!)

Here’s something I started two hours ago:


Physics on each foot and adapting to terrain. Currently his walk cycle is way to fast (a single frame to move each leg into a new location) so his walking is move like gliding with oscillating legs. I’ll finish it off sometime tomorrow probably. (I need to think about how to regulate the feet motion properly. I’ve never been satisfied with previous implementations)

Blend:
Robot.blend (1.58 MB)

I’ve gotten you started with your animation problems:
animation body 4.blend (2.09 MB)

Try animating the empty I’ve added to that file to control the movement of the character.
Move the empty when the character takes a step forward (meaning one foot goes
back), stop the empty when the foot lands, repeat.

I’ve also parented the phone to the bone for a limited time, then removed the parent
with a delay sensor. Your Cube.005 Action was messing things up.

I’ll leave it up to you to do the rest.

For the robot physics, check out alignAxisToVect():


(and other people’s suggestions).
sdfgeoff 's robot code seems to be working pretty well. I recommend you look at that.

Sdfgeoff - check this file out - https://blenderartists.org/forum/attachment.php?attachmentid=450384&d=1472021862

using a compound root object as the ‘core’ that the armature parents to, you can unparent /Move child shapes and then reparent them each frame, give the actor a full body collision shape.

that is how this actor is going up these steps - <a href=“https://www.youtube.com/watch?v=cx_9F0RNtzc” target="_blank">
https://youtu.be/cx_9F0RNtzc

(the actor changes which animation to play based on a ray down from the feet)

i agree with BPR.seem that fit perfectly in this case, but better use foots more big(at lest 3 times) :smiley: