Simpler FPS Template (Version: 2.3a2)

2…3… 2.3.442.222311. D: oookay no 2.3a2. That is, a second alpha of 2.3.

Made in response to the need for a simpler to use FPS template, and as a compliment to Social’s template. Bear in mind this template is not simple, it is simpler to use.

If you ask a programmer how to make a first person shooter, they will stare at you like you just fell out of a tree. And hit your head very, very hard, in a particularly sensitive area. Or they’ll actually try to tell you, which is worse.

Keyboard controls!

WASD: Move around
Space: Jump (Hold and release)
Mouse is aim.
And a recent addition… arrow keys are also aim.

Aiming is smoothed using a similar method to the track-to actuator’s “time” variable.

The scope of this template covers advanced character dynamics, including jumping, swimming, magnetic surfaces, and wallrunning/improvised techniques. The method of suspending the character is a raycast spring.

So far it features jumping and magnetic surfaces. Wallrunning is slowly being worked out little by little, and swimming is off in the future.

wow, i really like how the tazer thing bounces off! but, it seems that jumping is reversed for me… :confused:
he goes down when i press the spacebar…
but other than that, this is really awesome!

It’s automatic jump compression; just press the spacebar and let go. =) Thanks for trying it out!

Right-click is gravity gun, and those curved walls can be walked on. Those things seem to be high-demand features, at least in this area of the forum…

that’s neat :slight_smile: We now have a cool polished FPS template .Maybe you can modify the vehicle setup one so we can drift :slight_smile:

Er, that link gets a server 404- oh, you fixed it.

It uses the builtin vehicle wrapper; you’re meant to toy around with the wheel friction settings if you want it to drift.

Did you want me to do that?

That’s impressive, and allows a lot of gameplay possibilities.
Thanks for sharing.

Do you think it can be adapted to make a 3rd person adventure template (link)?
That could be called “Simpler 3rd person adventure Template”? mm? :eyebrowlift: ?

Just take a look at it if you want to. I will do my best to understand the role of each and every setting but i am not sure that it’s possible, i don’t know. If you have some spare time, take a look :wink:

There’s quite a lot of glitches that I found, like the physics is off, and the gun crosshair is not 100% accurate.

It doesn’t work for me. I mean, I litterally can’t move or aim… and when I click a ball of light appears at the tip of the gun and quickly disappears. Finally I get 9-11 FPS, but that’s my comp, not the file…

This template is compatible only with 2.48.

Could you tell me what the console window is outputting?

@ Killer:
It doesn’t raycast to where the bullet will hit, and transform the position to screenspace yet, if that’s what you mean.
What do you mean “physics is off”?

could you maybe explain how you made the gravity gun type thing?
i just got an idea for an awesome game that involves it! :stuck_out_tongue:


A ray is cast. The hit object is found, and the position/orientation is recorded.

Then, a linear and angular spring is applied using those as the target position/orientation.

The springs can be found in the fps_math module; they’re called applyMatrixSpring and applyVectorSpring.

applyMatrixSpring(ob_1, ob_2, target, force, damping, debug = 0)

ob_1 is the object the target will be applied to.
ob_2 is the object the force will be applied “against”. If you don’t want one, you’ll have to give it a static object… this isn’t fixed yet.
Target: An orientation matrix.
Force: Force to apply.
Damping: Damping to apply.
Debug: If 1, this draws the ob_1 matrix, along with vectors showing the distance of each axis to the target axis.

applyVectorSpring(ob_1, ob_2, target, force, damping)

Similar to the matrix spring, but the Target is a position in global space. (3 floats)

The bendy white line is a bezier; basically a line of points, subdivided and smoothed. If you want to use them, make a list of positions in space, then give them to bezPath(points, res). Res is resolution, the number of smoothed points. Then, you can either use drawpath() on what that function outputs, or work out an efficient method of attaching vertices to the path… if you want a path to begin with, that is.

Yeah, I haven’t seen that kind of boolean conversion for key presses before in anything Blender. For that I give you heaps of mad props! Yay!

The way you do the linking between files is brilliant, and no constructive criticism! :eek: Yay!

I see that GameBlender has far more intelligent designers than BlenderArtists… I’d better head that way, try to catch some for myself :cool: (And more awesome smileys!)

(Side note: Didn’t mean more intelligent, more of the intelligent designers :] (And more intelligent))

EDIT: After reading through the python again, I found that I understood most of it. It is very well commented. May you have a great life with the ability to explain concepts to novices. =D

It looks like the GameBlender people has taken BlenderArtists by storm, I mean that, looking at the huge amounts of python and it would look as if the design just puts Social’s ancient template to shame.

The magnetic stuff is something I’ve never seen in Blender games before, and it’s nice how its implemented, a bit of tweaking would turn it into an FPS M.C.Escher would’ve designed.

Keep up this excellent work, for me though I’m currently settled with Social’s old template which I ended up modifying a bit like overhauling the walking system and adding tons of stuff, but what you have is amazing so far. Maybe I will find a use to pick chunks of code from the scripts and use them in other .blends

NOTE: To others I would run it in GLSL mode, then it won’t be all pink.

(Side note: Didn’t mean more intelligent, more of the intelligent designers :] (And more intelligent))

This forum has many BGE users, but several are mainly artists, some who want to get into the BGE after doing renderings and animation. I do both art and games myself.

.~. Is it bad I don’t know who M.C. Escher is?

Thank you for the praise, ^^;

Ever seen the paintings or prints that have buildings that are seen through different perspectives within the same image? A stairway leading ‘upwards’ that brings you to the basement? They’re awesome

Escher was known for depicting the impossible, if you want a case related to your demo, floors becoming walls and then turning into ceilings, or going up a staircase only to have it twist at a landing so it goes in a different direction.

Haha! You know, that’s a good idea… :eyebrowlift2:

Is someone interested in modelling Relativity? I could then put the template in it…

Sure but what do you mean by relativity, that “stairs go up to basement stairs go down to the attic” thing if you mean that i could be fun:yes::yes::yes:

Aye, that thing. It would be nice as a test environment, and it also gives me an idea for an important feature…