how to move on a 3d grid

This is my first exploration in Blender GE for a basic 3d game with two players . I am trying to see where I can take this concept and will as I progress ad more features to make it into a game.

For now I can move the black pawn on all axis but what I need is that the pawn follows the bumps in the landscape…

How can I restrict the movement of the player to this floor and is there maybe a good video tutorial that could help me on my way with this challenge?




thanks,
Jackie

Here’s a quick and dirty blend showing a player piece constrained within a cube. Use left and right arrow keys.

Attachments

gamebound.blend (477 KB)

Thanks Equip,that looks very good and the way the piece slides is beautiful.

I am using Blender 2.49b. I did install 2.5 to check the gamebound.blend but failed to read the properties of the transaparant cube (is this perhaps done in Python?)… my vocabulairy in Blender GE is very limited so searching for an answer or a tutorial is difficult; Could you direct me to more information please? My player piece is not constrained by anything and simply slides true every obstacle I have tried so far.

Thanks again

I am now using uv wrapping and texturing the mesh, this may have been the problem… …; I have a calling to make this work.

If you are new to the game engine I recommend you use 2.5 (now 2.57). In 2.5 you need to be in Blender Game mode (center of main menu bar). Game mode gives you pretty much all the relevant options for realtime sims and removes most that aren’t required. You can still go to Blender Render mode anytime to do raytraced renderings etc but then return to Game mode. The properties for the grid, cube and cylinder were set in Properties (Buttons in 2.49) > Physics. And here gravity is set in the world panel. Dynamic objects are affected by gravity, static objects aren’t.

The cube will allow the cylinder to occupy it’s space and trap it within as long as the collision bounds of the cube are set to triangle mesh. Any other setting (afaik) and it throws it out.

There’s no python in this demo and a complex game can be made with logic bricks. For myself I learnt to script and haven’t learnt advanced use of bricks.

I added motion to the cylinder’s y and z axis via actuator , motion type: simple motion, each in Location
The example is working great in my opinion; and this working model you gave me now makes me very happy already. I will look up how to manipulate the grid further next and dig in deeper into the way you build the example. Thanks!

Are you looking to constrain the player object so it snaps to a grid when it moves?

I attached the Blend file here.
up and down controls (up and down arrows) now work and jump works with spacebar.
gamebound2.blend (488 KB)

Yes I think this would be an interesting option. As I was thinking this could turn out into a strategic gameplay having not to deal with controls was my first choice. On the other hand the way it handles now is much fun and maybe for now I would leave this open.

Yeah, a game like this probably needs snappy little moves. I’m not sure how many different moves would be needed. Maybe three: turn, jump up and jump down, depending on how you did it.

There would be a few ways of doing it. With or without gravity, with or without ipos (pre-programmed animations) etc.

I’ll see if I can come up with a few moves.

This blend isn’t directly relevant to your game but shows some simple moves without any jumps or physics or anything.

L and R arrow key to turn, Up arrow to move.

Attachments

simpleMoves.blend (589 KB)

I got rid of the empty, made the player cube collision free and parented it to a dynamic cube, called RealCube. RealCube is invisible at runtime and the player cube again has a slow parent relationship. Spacebar now raises RealCube 5 units vertically then falls. It doesn’t look natural since we can only see player cube and player cube is slow parented but it still looks OK. I substituted a cube for the empty because I was uncertain that I could get an empty to behave as a dynamic object (that can fall with gravity amongst other things) and set sensible collision bounds for it.

Since the player cube is moved around by change of location it’s able to pass straight through static objects that have collision bounds set. But if you let it land on a static object it will rest on top. You can for example park the player cube inside the blue or yellow block, hit space and the player cube will “fly” up and then come to rest on top.

Attachments

simpleMoves2.blend (605 KB)

I love it! And am learning soo much from you Equipe that I can not thank you enough.

While you where working this out in such an eloquent way I had no luck trying an empty cube (with a parent playercube) to jump on an other grid (one level higher or
lower); when I pressed play it did nothing but that does not garuante it could not work, because of the little experience I have with GE.

anyhow all your imput got me thinking how the flat board could maybe even represent all levels in this mountainscape… for example by using colour for hights and the appearing and dissapearing of playerpieces on the flat board for the blocking of views that would occur in a 3d game.
a 2d view or a top view map that includes all the info of the 3d world would I think improve gameplay.

thanks for the brilliant help.
I will try and build further on your suggestions.

Yo. Yeah I think it’s fun too. Keep learning and experimenting. You can do all sorts of things with Touch, Collision, Near, Ray and Radar sensors as well, making things appear, disappear, pop up in different places etc. After a few weeks of that you’ll find that your logic panel becomes a bit cluttered and unmanageable. Then you can use a few simple scripts in a Python controller to streamline things and enable things that are difficult to do with bricks alone.

Try putting in a couple of sounds, Just some beeps or something. While you are designing they can be aural cues that things are happening. Like an object beeps if it’s within 2 units of another object or something. It helps reinforce your understanding of what’s going on. And you’ve probably seen by now that you can have more than one actuator connected to a controller. Or that you can have more than one sensor connected to a controller. And that the controller can be And or Or or Nand etc.