• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Tutorial Doctor

Controls Programming/Mapping?

6 posts in this topic

Okay, so I have a 3rd person scene setup that makes the character move, but I have a very poor control system, and mainly because I am using a PC with no game controller (I could use a script that maps things to a joystick, but I want it to feel good using a keyboard). 

 

So, right now I have an empty for the body of the player, and an empty for the head of the player. Then I have a camera parented to the head object, and I script the head object to control like any 1st person game would on a PC. The mouse controls the direction you look in. 

 

Then I parent the actually 3d model of the character to the player empty. When I rotate however, it looks like the 3d model is glued to the camera. haha. 

 

Metal Gear Solid Controls are ideal (at least how intuitive they feel), but how would I do this on a PC?

 

I think controls can make or break a game, because that is what we are giving the user the ability to do-- control the game we design. 

 

Anyone have any ideas? Or perhaps can suggest some PC games that "do it right?"

 

Edit: Okay, for one style of game, the control scheme I have set up might work, but I would still like tips on how to do it like Metal Gear. I sort of have it though. 

 

Current Scheme: Camera both follows and looks at 3d character model. Dragging left on mousepad rotates the character to the left, and the opposite for the right. Move forward using the "W" key. Another control would rotate the camera around the character. TBC...

Edited by Tutorial Doctor
0

Share this post


Link to post
Share on other sites

I'm not sure what part(s) you need help with. It sounds to me that you have an offset problem. For 3rd person views (over-the-shoulder), your character's position is a pivot point on a fixed camera with an offset. So, all movement and physics are centered around the player-character and the camera is at a certain offset (rotated by the rotation matrix) from that player-character...... Does this help? As I said, I'm not sure what you want.....

0

Share this post


Link to post
Share on other sites
Thanks Hawkblood. My brother fired up Metal Gear Solid, and demonstrated it for me. You are right, the character is the pivot point.

I guess I am wondering how I should map the keys to make the controls fluid. At first, swiping right on the mousepad rotated the character to the right, and swiping left rotated the character to the left. I actually like how that feels too, and I might use it over the Metal Gear Solid control scheme.

I might use one or the other depending on the style of game I choose to make. Thanks again for responding!
0

Share this post


Link to post
Share on other sites

Always have options to change the directionality of the mouse axis' to accommodate different players' preferences. The same goes with keyboard bindings.

0

Share this post


Link to post
Share on other sites
Thanks! I am glad you said that! I see a lot of games today that don't let you change your controls. I will definitely try to implement that!
0

Share this post


Link to post
Share on other sites

I see a lot of games today that don't let you change your controls. I will definitely try to implement that!

Which is most definitely wrong. If there's one thing you convey to other people making games please make it be that they should not follow suit in the same laziness that a lot of AAA developers show these days, especially in PC ports. Controls and options are one thing that it is almost always better to have more of, short of it being haphazard.

 

In particular right now so many companies have focused all their efforts on developing games for console to where it is rare for us to even get basic features like key rebinding on ports, i f they do feature that, there is usually a lot of other stuff broken.

 

So yes, please do!

1

Share this post


Link to post
Share on other sites
Hello.
You're describing problems in two different areas: one is related to your game camera and the other is related to the player controls.

[subheading]Camera:[/subheading]

So, right now I have an empty for the body of the player, and an empty for the head of the player. Then I have a camera parented to the head object

[...]

When I rotate however, it looks like the 3d model is glued to the camera.

This behaviour is a direct consequence of parenting the camera to something controlled by the player.

The camera shouldn't be parented to the player character or one of its children. Instead, it should be controlled by a solver that tracks the player.
A possible definition for a solver is "a software routine that aims to solve a problem given a set of constraints."
Your "3rd person camera solver," a routine\method\function that you call each game tick to reposition and reorient your camera, could have the following constraints:
  • If the player is standing still, centre the player character on screen.
  • If the player is moving, centre on screen the point between the player character and a point ahead of the player in the direction that he's heading*.
  • Prevent level geometry from occluding the player.
  • Always mantain a certain distance from the player.
  • Always use Ease-In and Ease-Out interpolation when transforming the camera
* This is a feature that is often overlooked in independent\smaller projects, but can be consistently seen in AAA games. It allows you to see "ahead" and anticipate obstacles. The player character is still on screen, but his focus is shared with an arbitrary point ahead of him in the direction that he's heading.
You do this by making the camera aim at exactly the average position between the player character and this point ahead of him. You interpolate between the player position in a manner such that when the player is not moving, the camera is solely focusing on him. The faster that the player moves, the more you focus on the average position between the player character and the arbirtrary point.
I have implemented this in a small demo that you can download here: http://www.gamedev.net/topic/650327-why-do-2d-games-have-main-character-locked-in-the-middle-of-the-screen/#entry5111055

[subheading]Controls:[/subheading]
I believe that by far what makes the most difference with controls is regarding the player input for movement as relative to the camera.
When you press the "move to the right" key, you transform the [1, 0, 0] 3D vector from the local space of the camera to the world space, and then proceed to move and orient the player character with the resulting world space vector.
A lot of games (especially console games) don't make use of "turn left" or "turn right" keys. Rather, there are only movement keys and when you move the player character, he turns to face the direction that you are moving him with.
In some games you can even steer the player character just by having him move forward and then orbiting the camera around him - this is evidence that the movement is relative to the camera.
 
This style of control is much more intuitive. Regardless of where your character may be facing, pressing "right" will make him turn to the right side of the camera (for the person playing, it's the "right side of the screen") and move in that direction.
 
I'm not sure if you're using Unity. This is demonstrated in their documentation for the "transform.TransformDirection()" method:
http://docs.unity3d.com/Documentation/ScriptReference/Transform.TransformDirection.html Edited by Kryzon
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0