Game Development Community

Trying to split the play controls into several modes.

by Kyrah Abattoir · in Torque 3D Professional · 09/17/2012 (9:59 am) · 10 replies

Hello everyone, i'm more or less realising that as a straight FPS the controls i would like to have would end up being too complex and "bolted on".

I recall Little big andventure got around this problem by implementing several player "modes"

Normal: for talking, using items and activating buttons.
Agressive: for kicking and punching.
Athletic: for sprinting and jumping.
Stealth: for moving discretely.

In essence, at the press of a key you are now playing a different game, because they wanted to make a game that was both about jumping puzzles, rpg esque dialogs and puzzles, combat and stealth.

Combat mode:
Pretty simmilar to what the starter fps game is, left click to shoot.

Normal mode:
If you had a gun in hand it is lowered or holstered, and i would like to use the now freed mouse to interact with the game world in a similar way we interact with standard OS applications, click things to activate their primary function, right click to obtain a rollout menu of secondary functions, drag and drop to grab objects physically?

Anyway, this is the idea i would like to achieve, maybe have a key to switch mode.

What would be the best way to implement this properly?, passing from one game mode to the other with minimal risks of overlap.

#1
09/17/2012 (2:06 pm)
Push/pop different action/key maps as needed.
#2
09/18/2012 (2:12 am)
Can you explain that a little more?

Would it be enough to short circuit the gun's firing mechanism too?
#3
09/18/2012 (2:25 am)
You take your standard 'default' action map and that can be overridden by another uniquely named action map. It's a common solution most often seen for having different controls when jumping into a vehicle.

For action situation x, instantiate keymap x. Pop the existing, standard, keymap and push a new one that defines new keys that have new functionality. When you change to a different situation, just pop the current keymap and push a new one.


Or you could shot circuit the gun's onfire() callback for any situation you can think of. As well as a combination of both methods -- that's the beauty of Torque, it allows different solutions uniquely dependent to a given situation.
#4
09/18/2012 (2:47 am)
Are those action/key maps server enforced? I might add a little delay when a player swap from one mode to the other and it's important that they cannot just bypass it.

My idea is that a player in normal mode would keep his gun but move in a non combat pose, like for a pistol the hand would be lowered to his side, or for a rifle "held on the chest".

It would act as a primary visual safety, the second safety would be to also have the weapon holstered, then it would send a visual message that this player has no intent on shooting.
#5
09/18/2012 (8:43 am)
I just lost an elaborate response and example because the website session timed out, so I'll summarize:

Create your uniquely named action/key maps as normal (client). For some actions/situations a client could pop/push a new actionmap as needed. In others you would have the server tell a client when to pop/push a new action map by using a commandToClient call.


In your case you would need a 'normal' actionmap for when the player is carrying a holstered weapon. This actionmap would contain all of the normally used keybinds, and would have one for the left-mouse button bound to a ready weapon function. Inside your ready weapon function you mount the weapon, pop the current actionmap, and push a new one which contains all of the keybinds that can be used when a weapon is readied. In this actionmap the left-mouse will now fire the weapon. You would also have a holster weapon function that could be called and is bound to some other key. This holster weapon function would unmount the weapon, pop the current actionmap, and push the 'normal' actionmap for use once again.

You can have as many actionmaps with any number of keybinds as you think you may need for each one.
#6
09/18/2012 (6:29 pm)
That makes a lot of sense :)
I do regret the "elaborate response" because i'm sure it was interesting.

From a gameplay perspective, this idea is nothing new, i got it from Little Big Adventure which was one of my most played games back in the days of 1Gb hard disks.

However i'm always wary of "super old" control schemes because a lot of things that used to be awesome in those days are simply unacceptable today. What do you think of this, i mean splitting controls for vehicles make a lot of sense, but splitting player controls across several "modes".

Could this concpet be seen as "clunky" today? rather than having, lets say "hold ctrl to make the mouse cursor appear and interact with objects"?
#7
09/19/2012 (3:17 pm)
I think the clunkiness is a factor of how efficiently you can switch between modes, as well as how 'useful' each mode is. For example, I've just been playing through Arx Fatalis. Fantastic game. You right-click to go into a sort of 'interaction' mode where your cursor moves about the screen and you can grab things and so on. That feels very natural, especially since you automatically enter that mode when doing things like looting corpses, and you can get out of it with just a right-mouse click. If I had needed to, for example, press the 'I' button to swap modes, it would probably start to feel a lot more tiresome.
#8
09/20/2012 (1:40 pm)
Using multiple actionmaps can be "clunky" for the developer to manage. But if handled in a programmatic way it will be completely transparent to the end user who would never need to press a button to toggle to a different mode -- unless you wanted them to.

#9
09/20/2012 (2:57 pm)
Well the way it was glued together in LBA was that each "mode" was a bit like playing a different game, so for ym two primary modes:

Normal: Passive stance and standard movements, can left click things to activate, right click to get a contextual menu (like on windows forms basically), left click and hold could allow to move things around physically.

Agressive: Movements are a bit sharper in this mode, the player character has his head a bit lower, left click fire the weapon (or swing it), right click brings the iron sight or parry for melee weapons. All the "interaction keys" (if there are any) are replaced by the gun moves if using a gun (pull slide, insert clip, etc, see "receiver" from wolfire games)

How clunky would it be to have (by default) F1 to go to normal mode and F2 in agressive mode.
Assuming that i will have more than two modes because otherwise, a toggle would be enough obviously.

Ideally going from mode to mode wouldn't be instant, it would be delayed by the weapon swap delay of the currently equiped weapon (a pistol take a fraction of a second to pull out of a holster, while a flamethrower can take several seconds to be ready to fire)
#10
09/20/2012 (3:26 pm)
Each mode would have it's own unique actionmap -- managing that set of keybinds on your end is the potentially clunky part. When toggling back and forth between modes just pop the current actionmap and push the new desired one, that simple. Every thing else that the action/situational modes depend upon would be normal setup for programmed functionality, animations, "stance" mode selection, etc.

You can have actionmaps assigned per weapon, per character/class type, or have them be situational. It's a very useful and versatile bit of functionality.

I would advise to not radically change common things like movement control and menu accessibility for example, as that could make things confusing for the player.