Third Person Template (Xbox 360 gamepad support and Mario Galaxy style gravity)

CONTROLS:
The default controls are mouselook for the camera, and WASD to move (although you need to press the midde mouse button to toggle manual camera controls- the default is automatic), LMB to jump and climb up a ledge, RMB to run and drop off a ledge.

Press F1 to switch to keyboard controls(WASD moves the camera, arrow keys move the character, left ctrl key toggles auto/manual cam controls, Z or shift runs and drops off ledge, X or Space jumps and climbs ledge), and F2 to switch back to mouse controls. F3 switches to Xbox 360 controller mode, which requires you to have a USB Xbox 360 controller plugged in and installed (you may need to unplug other joystick controllers for it to work). The Xbox 360 controls are: Left Stick- move, Right Stick move camera (manual camera controls must be toggled on with Y button), A button- jump or climb ledge, B button- drop off ledge. I don’t think any other kind of controller will work for this mode.

HOW TO PLAY:
In the demo level, you can reach the planet by jumping on some springs behind and to the right of the starting position. By going straight forward, touching the gravity switches to progress, then crossing a series of platforms you’ll be able to reach a large, blocky stone structure, which I call the gravity maze. The goal is to explore the maze using the gravity switches and find all 3 hidden Suzanne heads. The red flags are checkpoints. If you touch one and then die by falling or touching a spike ball, you’ll respawn at the checkpoint.

DESCRIPTION:

Hi, everyone. After a lot of hard work, I’ve finally got my third-person template finished to my satisfaction. I spent a lot of time making documentation, meaning a lot of code comments, setup instructions, and notes on using each of the features. I also added a couple new things as well: Xbox 360 controller support and Mario Galaxy style planetoid gravity.

Here’s a general summary of the features:
.Pretty much everything is configurable
.Three control schemes: keyboard only, keyboard/mouse, X360 gamepad
.Manual and automatic camera control
.Jumping, with configurable air control and variable jump height (depending on how long you hold it)
.Slope physics
.Compatibility with stairs and steps (you can adjust the maximum step height)
.Ledge hang and climb, with animations
.Gravity can be modified: there are switches that change it’s direction as well as planetoids with their own gravity field.
.Death, respawning, and checkpoint features
.Springs
.Support for moving platforms (but rotating ones aren’t handled properly yet)

All Python logic is stored in external modules, which allows for better organization and an easier way to use the module with other .blends (just copy the .py files into the same directory as the .blend). All the .py files and the .blend are packed into a .zip file, along with instructions and notes. If you plan to use this template, I strongly suggest you read all of the instructions and notes first. All the configuration settings are in the config.py file. If you want to do any tweaking, open that file in notepad, notepad++, or whatever .txt editor you have, and change the settings (it’s really easy to do, even if you don’t know Python).

The default controls are mouselook for the camera.

Also, you can change the default controls to Xbox 360 gamepad mode, if you like. All you need to do is, in the .blend file, select the controller object in the editor (it looks like a giant game controller), look in it’s logic panel, find the game property called “Control Scheme” and change its value to 3.

Okay, here’s the .zip file. It requires at least version 2.66 or later. You’re free to use it in any way you like.
Third Person Template.zip (1.53 MB)

Also, if you have any questions regarding how to use this template, or apply it to your character, feel free to ask. All feedback in general is welcome.

Here are some pics:[ATTACH=CONFIG]253132[/ATTACH][ATTACH=CONFIG]253131[/ATTACH]

Attachments



Also, if you have any questions regarding how to use this template, or apply it to your character, feel free to ask. All feedback in general is welcome.

this… is just… so awesome. i don’t even make these kinds of third person games but just this template makes me want to make something. xD seriously, good work. well done. ^^

nice!!! i love the ledge hang, and stares, the gravity switching could be used in one of those infinite upside down stair mazes

Bumping so this thread doesn’t fade into obscurity. It’s a little discouraging to see this get so little attention, after working so hard on it. If some more people would try it and leave feedback on what features they would like to see added, and what I could change to make this a more helpful resource, that would be great.

Oh, and thanks for the supportive comments, you two. Haha. :slight_smile:

This is actually really nice also the transition between the character movement direction is very smooth.
As for feedback I think that you could add a script to the camera which by moving the mouse enables you to rotate the camera around the character, so that I will make it easier to jump from platform to platform.

Push the MMB to enable mouselook camera controls. I mentioned that in the original post, but I can forgive you for missing it because the post is so darn long. :wink: I’ll try to edit the OP for clarity.

It is very cool, nice work. :yes:

I think if you made a clear level (with as many obstacles/courses) it would be funner to play, but the demo shows off the mechanics very well. Tiny critic is when wall-hanging, there is an area where you climb, hit your head, and go back to hanging, and get stuck in the loop (blue platform area). Also I think the right analogue stick for camera movement on Xbox controllers should be enabled by default (instead of pressing y). Cool resource, well done.

OK ,Thanks.

I agree, this is an amazing resource and deserves so much more attention. I will do my best to make use of it and share any significant progress I make.

This is amazing.
The camera clips under the floor when you go low enough
with the camera. Is there anyway to make the camera
follow a cross hair so it focuses on lets say a gun ?

you should make some vehicles for it, and maby weapons, and enamies that ragdoll when you kill them!

Attachments

GTA_ALPHA.blend (266 KB)

the mouse look controlls dont work well when an overlay scene is added, is there a way to fix this, so i can add an overlay scene with a health bar like a hud :confused:?

the mouse look controlls dont work well when an overlay scene is added, is there a way to fix this, so i can add an overlay scene with a health bar like a hud :confused:?

I havent looked at this particular template, since i dont have an old xbox controller. But on some of my stuff I add an overlay scene and it shouldnt interfere with mouselook stuff unless your using mouse controls on your overlay scene. In which case you could disable the mouselook when your doing something on the overlay scene. youd have to be more specific.

all the overlay scene consists of is a camera looking at a plane. no mouse look on the overlay scene. on the main scene, the mouse look still works even with the overlay scene present, but the problem is when i stop moving the mouse, the camera keeps on moving around the player. this problem still occurs even when there is nothing on the overlay scene

Have been looking for something like this. Got a lot to learn :slight_smile: Thanks for this

This is awesome!
Took me a while to figure out how to use the Xbox controller, works great and being I don’t play PC games, (but use Blender to make 'em, oh the irony) I feel right at home!

Quick question:
How can you disable the auto-camera tracking and use the manual one on startup?

This is a great and really easy to use third person player. I’m a complete newbie on the game engine stuff and got it to work no problems.

I’ve used it as the player for exploring auto generated 3d maze puzzles. See here http://elfnor.com/blender-3d-maze-generator.html for a description and the link to the .blend on github.

Thank you.

Cool game, elfnor! Good to see someone getting good use out of my work. I’ll take a look at the attachment and reupload if necessary.