WIP Servo Movement Script

I’m really not sure where to put this, because it’s kind of a resource, but it’s not done.

I’m working on a BGE movement script using servos, and thought I might as well post what I have so far and get some early public bug-testing, crits, and comments.

The main things I want to know are:

  1. Your key rollover. Unless you have a very high-quality keyboard, your keyboard can most likely only register a maximum of 3-6 keys at a time, not counting modifier keys such as ctrl or shift.

  2. The efficiency of the script. Hopefully, the script is arranged and executed in an elegant fashion.

Please keep in mind that the script isn’t done. There’s still running, jumping, only allowing speed and direction changes on ground, stair movement, surface properties, easy customization, and possibly splitting the script up into smaller methods.

Thanks in advance!

EDIT: The file attached to this post is old. Click here to go to the next version of this file. The next version may or may not be the most recent version.

Attachments

fps2.blend (175 KB)

Hello
well, I know nothing about Python or programming, but the view setup seems to work perfectly…and the code looks…complex! :wink:

Now, there’s many FPS setups available for the “old” 2.4 series but none for the forthcoming 2.5 one!
Maybe you want to give it a try?
Anyway thank you for sharing!
Bye

Thanks, OTO! I love your tutorials! I’m glad you like the view setup.

I could try a 2.5 FPS template, but I like using my laptop, and it is magically unable to run 2.5 even though it probably has the best processor in my house. The worst graphics card, but the best processor. Which, apparently, means that it runs the BGE really well. Thanks!

Bump!

I have some new stuff in this update. The main course: a running speed, a crouching speed, jumping, only working when on the ground, and detecting surface types. On the side: some bug fixes for the code.

I tried to make the movements more realistic, so you can’t change speed or direction in mid-air.

What I want from you, dear reader:
My next task is getting movement on stairs. Primarily, the player should scale stairs smoothly and stay on the stairs while doing so. Also, is there a way for the origin of the Mov_player object to float directly on top of the stair slope so that there is no moving when turning? At the moment, the Mov_player object collides with the slope, pushing it away from the slop and moving. Essentially, if the movement works like in a commercial FPS game such as HL2 or Halo, I’ll be happy. Thanks BlenderArtists!

Instructions:
w - Forward
s - Backward
a - Left Strafe
d - Right Strafe
space bar - jump
left shift - run
left ctrl - crouch

Attachments

fps2.blend (182 KB)

:C I get an instant crash when using the second template :confused: First one is awesome though. :smiley:

Still working perfectly to me, just the “crouch” function is not working!
Bye

I’ve always likened to tight controls for any type of FPS game. If your going for movement like in the Halo series or COD series, your controls are much more loose. The movement is very nice, perhaps for a different type of first person game. Very pretty script though.