Temple of The Roguelike Forums

Development => Programming => Topic started by: lithander on December 07, 2012, 06:26:52 PM

Title: Torso & Head direction
Post by: lithander on December 07, 2012, 06:26:52 PM
In most RLs the characters and monsters just have a position. Are there any games where the orientation of the torso and head are simulated in a gameplay-relevant way? I can't come up with a decent control scheme for the player character but imagine it could add some depth to movement and combat. Any ideas or suggestions?
Title: Re: Torso & Head direction
Post by: Ancient on December 07, 2012, 07:57:23 PM
GearHead implements this for mecha.

DoomRL remembers the direction of last move you took. This influences dodging. It is easier to dodge missiles moving perpendicular to your path.

7DRL Mujahid explores view only in front of character in nice detail.

As for simulating facing of the head - usually this is absolutely horrible idea. In every traditional roguelike this failed miserably. The problem is called the lighthouse syndrome. Players tend to

IMO you don't want control scheme to differ from your usual movement keys. Assume the torso is going the direction of last movement or attack. Unless you are going to do tank roguelike.

Sil does flanking nicely. There torso orientation is not tracked. Instead when attacker has another ally behind the defender flanking bonuses are added. Example:

.....
.o...
..@o.
.o...


Each orc has two other orcs available to help when meleeing the hero. In Sil you may notice attacking goblinoids tend to assume such pattern around you.
Title: Re: Torso & Head direction
Post by: lithander on December 07, 2012, 10:41:30 PM
Thanks for all the valuable input! :)

I had to google 'lighthouse syndrome' but I guess now I know what you mean. The limited FoV should increase the suspense and add to the experience not make it annoying to play and I realize that's difficult, otherwise the thread wouldn't exist. ;)

In Mujahid turning seems to take a turn, and I guess that's to prevent the behavior you called 'lighthouse syndrome'. I think it works pretty good! Feels quite 'stealthy'. :)

The main reason for decoupling torso & head direction (or view direction, from walking direction) was that I hoped to allow for strafing and leaning to the sides. While the latter would allow you to peek around a corner without risking to be seen yourself (at the cost of a turn), strafing allows you to move without changing your current direction. All this is meant to reinforce the idea of staying in cover, planning your next move and striking quick and well prepared.
Title: Re: Torso & Head direction
Post by: UltimaRatioRegum on December 08, 2012, 12:59:15 PM
I'm doing this in Ultima Ratio Regum. The way you face affects:

a) fields of view. You can only see in a 160o/170o area in front of you, you cannot see behind you. The same goes for NPCs - you can see which way NPCs are facing, and that will obviously affect if they can see you, or only hear you.

b) attacking. If you attack an NPC from behind, you might able to attack their back (so spine, hamstrings, etc), whereas attacking an NPC from the front will give you access to different parts. The same applies to NPCs attacking you, of course.

c) It also takes a turn to change what direction you are facing. It is a quicker activity than moving in terms of turns-elapsed, but changing the direction you have takes time. Equally, if you are sprinting, for instance, you cannot suddenly change direction. If you are sprinting to the west, you can change direction to NW, SW, N or W, but trying to change to any of the "backwards" directions will force you to slow back down to walking.

d) what you can do/throw/look at: you can only examine objects in your sight range, you can throw in any direction but obviously you won't know what you're doing if you throw "backwards", and similarly you can jump in any direction, but there's a risk in jumping in unknown directions.

e) I intend, later, to implement the ability to sidestep, and also the ability to move backwards whilst still keeping your vision int he same direction. There might be more factors too, but I can't bring them to mind.
Title: Re: Torso & Head direction
Post by: Omnomnom on December 08, 2012, 03:49:34 PM
DoomRL remembers the direction of last move you took. This influences dodging. It is easier to dodge missiles moving perpendicular to your path.

Did not know that...
Title: Re: Torso & Head direction
Post by: AgingMinotaur on December 08, 2012, 08:41:49 PM
Vapors of Insanity is another game with explicit facing. In games I've seen do this, I feel the interface can become a bit heavy handed compared to the traditional RL system, which is really quite snappy. At the same time it does add to tactics in a way that's potentially very interesting.

Facing could also solve some problems inherent in bumping. Consider when you bump a friendly NPC, and get prompted: "Attack (y/N)?" For a game like Rogue, bumping is perfect because it saves you a keystroke compared to an attack command that needs a direction (ie. like [z]ap does). In a game with explicit facing, it's just as sensible to have "move" and "attack" as separate commands. That would also make something like long reaching pole arms more feasible. In Crawl, for instance, some of these melee weapons can be used with a 1 space range, obviously not by bumping, but with a separate command. Pretty obscure.

I'd love to see (or make!) a Roguelike that does facing well on a hex grid. Or maybe we are finally ready, as a community, for the Spelunky of First Person Shooters. :D

As always,
Minotauros
Title: Re: Torso & Head direction
Post by: lithander on December 09, 2012, 12:49:52 AM
Mark, your description illustrates perfectly why it could be interesting to take the characters orientation into account. :) But, I wonder, what solution you found to make it easy and intuitive to control your character - especially when you want to allow walking backwards and strafing I can't see it working with the established Num-Pad movement. Simulating all this without ruining the flow of the game sounds like the real challenge here. :/

When I played Mujahid yesterday the help-screen says "Use the mouse to look around and aim". It wasn't implemented that way but I kinda expected to be able to control the view direction with the mouse, while walking with the keyboard. Pretty much what you'd do in a FPS game, too. Didn't sound like a bad idea to me. So this evening I hacked together a small prove-of-concept.

http://web.pixelpracht.net/stealthRL.php

Draw some walls, then move around using WSAD. Whatever direction you point in with the mouse the characters new looking direction will become. So, you can strafe and move backward and it comes quite natural to me. What do you think?

And now I'm gonna give Vapors of Insanity a try.^^
Title: Re: Torso & Head direction
Post by: guest509 on December 09, 2012, 12:38:19 PM
Facing may be important for combat, but field of view should take into account not just what you see but what you hear, feel, taste and smell.

Unless you are doing a roguelike that simulates a creature/person who cannot hear, then that's a whole different thing.
Title: Re: Torso & Head direction
Post by: Paul Jeffries on December 11, 2012, 12:46:44 AM
I think the best way to pull off something like this would be to have it viewed from first-person in a Dungeon Master/Legend of Grimrock style.

However, that said - I was working myself on an FPS-Roguelike a while ago but found that I didn't really like the feel of it and eventually switched to an overhead third-person view (http://www.vitruality.com/2012/08/devlog-the-evolutionary-stages-of-a-game-concept/).  First-person view felt very restricted, in the sense that it gives you far less information about your surroundings than you would actually have in real life.  Most FPSes get around that by limiting themselves in some way (mainly by making the game about shooting things a long way away, so that your immediate surroundings are not as important), but for something like a roguelike I didn't think it a good fit.
Title: Re: Torso & Head direction
Post by: AgingMinotaur on December 11, 2012, 10:49:41 AM
How about a UI where you turn with the left and right arrows and advance with the up arrow? It's not the most economical system, counting key strokes, but has other potential merits. As in, it works without a numpad, and allows for easy implementation of eg. sideways movement.

Right this moment, I'm thinking it's worth a try. If the rules are tailored to fit this scheme, it might work for something like a weird west RL/shoot'em-up.

As always,
Minotauros
Title: Re: Torso & Head direction
Post by: UltimaRatioRegum on December 11, 2012, 11:13:54 AM
Mark, your description illustrates perfectly why it could be interesting to take the characters orientation into account. :) But, I wonder, what solution you found to make it easy and intuitive to control your character - especially when you want to allow walking backwards and strafing I can't see it working with the established Num-Pad movement. Simulating all this without ruining the flow of the game sounds like the real challenge here. :/

Weird - thought I replied to this last night. Apparently not. Anyway, I was thinking I could simply have it so that if you hold down shift and a movement key, you keep your direction; if you don't, then you move as normal. Would be very simple to implement, I think...
Title: Re: Torso & Head direction
Post by: Bosman on December 11, 2012, 12:23:31 PM
... Anyway, I was thinking I could simply have it so that if you hold down shift and a movement key, you keep your direction; if you don't, then you move as normal. Would be very simple to implement, I think...

I was thinking about exactly the same solution. That does not seem to be complex at all. Actually, if you also implement the type of movement where you advance with the up arrow and turn with left/right arrows then together with the shift functionality this is exactly like movement in old-school FPSs (e.g. DukeNukem3D).
Title: Re: Torso & Head direction
Post by: lithander on December 12, 2012, 11:54:56 PM
I've implemented your suggestion (link (http://web.pixelpracht.net/stealthRL.php)). For me it seems less intuitive to press the correct key because instead of pressing into the direction you want to go you have to think relative to your current facing. With strafing (hold SHIFT) this relative movement was almost impossible to get right so now while pressing SHIFT it doesn't take the facing into account. It's okay but I think I prefered the mouse controls (press SPACE to toggle between modes) over the keyboard-only version. Is it just me?

I guess the reason why it worked well in older FPS is that they are from the ego perspective so you see the world from the characters perspective and you're less likely to think in world-coordinates then in a topdown view.
Title: Re: Torso & Head direction
Post by: Bosman on December 13, 2012, 07:21:25 AM
I guess the reason why it worked well in older FPS is that they are from the ego perspective so you see the world from the characters perspective and you're less likely to think in world-coordinates then in a topdown view.

That is true. I must have suffered a temporary brain dysfunction when writing my previous post and forgot about this detail :) I tried your link and it really does seem a bit cumbersome. However, the Scheme 1 with Shift is not what I meant. In your example in Scheme 1 when you just walk normally the arrow keys work relatively to the character but when you press shift they switch and work relatively to the screen - this is the most confusing to me. It would be easier if it stayed relative to the character so that you would not have to change the perspective in your head. What I mean is: the character is facing N, you press right arrow (RA) to turn E, you press up arrow (UA) to walk E, you press and hold shift and press UA and you still move E (shift just means "no turning" but when going forward no turning is involved anyway), you hold the shift and press RA and you now move S (right arrow meaning move to the right according to character's perspective without turning). That would be what I meant and what I think would be easier to grasp. However, I'm not so sure anymore if that would actually be easy and clear enough.
Title: Re: Torso & Head direction
Post by: UltimaRatioRegum on December 13, 2012, 09:21:58 PM
I've implemented your suggestion (link (http://web.pixelpracht.net/stealthRL.php)). For me it seems less intuitive to press the correct key because instead of pressing into the direction you want to go you have to think relative to your current facing. With strafing (hold SHIFT) this relative movement was almost impossible to get right so now while pressing SHIFT it doesn't take the facing into account. It's okay but I think I prefered the mouse controls (press SPACE to toggle between modes) over the keyboard-only version. Is it just me?

I guess the reason why it worked well in older FPS is that they are from the ego perspective so you see the world from the characters perspective and you're less likely to think in world-coordinates then in a topdown view.

To me, control scheme 0 works really well (the mouse is also a nice touch!). I've just tried implementing it in URR, and currently each numpad key moves you in that direction (so up is up, no matter how you face) and with shift held down, the same applies (ie up is up), and it works really well, actually. Personally, I find the oldie-FPS version a little counter intuitive! I know what you mean about having to think about your current facing, but the way I've done things in URR, that's the case anyway - as I said, you can't suddenly change sprinting direction, turning around takes time, etc. It'll need some playtesting, that's for certain, but I think it could be workable. You only have to keep track of your facing, not a varying control scheme in terms of whether directions are absolute or relative, as it were. Hmm. Now I just realize I'm going to have to allow NPCs to do that once I get going on the AI!
Title: Re: Torso & Head direction
Post by: AgingMinotaur on December 14, 2012, 09:35:43 AM
Very nifty demo, lithander 8) Agreed that the scheme with mouse works well, but I anticipate some problems that have to be ironed out. As in, when you move your guy around without moving the mouse, the position of the cursor relative to the avatar changes. This could lead to annoyances, especially in a system where turning around costs time. Also, I personally prefer a game that can be played with just the keyboard, but would surely get used to an interface where I'm forced to use the mouse as well. And, yeah, it feels as like an FPS-inspired control scheme needs an FPS-inspired map display.

As always,
Minotauros
Title: Re: Torso & Head direction
Post by: lithander on December 14, 2012, 12:12:51 PM
Thanks for trying the demo, guys! And I'm glad to hear that you like the keyboard + mouse controlscheme because personally I found it pretty interesting, too. Maybe I'll expand on that idea over the christmas break and add some gameplay.
@AgingMinotaur, I agree that the subtle change of viewing direction despite NOT moving the mouse is a little annoying. I could imagine 2 solutions:
a) only when the mouse is getting moved the desired viewdirection is recalculated. Very easy to implement.
b) the character is always in the center of the screen and the map is scrolling. That way your mouse positiion would always be relative to the character regardless of it's current world position.

Based on your feedback I added 2 new control schemes to the demo (http://"http://web.pixelpracht.net/stealthRL.php"):

What I mean is: the character is facing N, you press right arrow (RA) to turn E, you press up arrow (UA) to walk E, you press and hold shift and press UA and you still move E (shift just means "no turning" but when going forward no turning is involved anyway), you hold the shift and press RA and you now move S (right arrow meaning move to the right according to character's perspective without turning). That would be what I meant and what I think would be easier to grasp.

I added this as "Control Scheme 2" but I can't get the strafing right on an intuitive level. :/

I've just tried implementing it in URR, and currently each numpad key moves you in that direction (so up is up, no matter how you face) and with shift held down, the same applies (ie up is up), and it works really well, actually.
I'm not sure I understood you correctly. Is "Control Scheme 3" what you meant? I quite like it. I would prefer this over 1 and 2.

But it makes looking around a dedicated action (costing a turn) and I'm not sure how that affects the gameplay. Would you feel like "just" changing your facing is a waste of a turn in combat situations? Not sure. :)
Title: Re: Torso & Head direction
Post by: pat on December 15, 2012, 10:09:14 PM
When I played Mujahid yesterday the help-screen says "Use the mouse to look around and aim". It wasn't implemented that way but I kinda expected to be able to control the view direction with the mouse, while walking with the keyboard. Pretty much what you'd do in a FPS game, too. Didn't sound like a bad idea to me. So this evening I hacked together a small prove-of-concept.

http://web.pixelpracht.net/stealthRL.php
Mujahid was my effort, and I struggled for a while with the best way to implement the directional fov for a turn based game so that it wasn't obnoxiously obtrusive but also added something to the gameplay in terms of tactical depth. Turning takes 1/3 as long as moving and that was the cost trade off which felt about right to me and I still think its about right. It's deliberately simplistic in overlooking strafing and moving without turning in other ways and that's probably the next logical extension of the system and I guess it probably would have fit well into the game as it is.

Interestingly, a significant proportion of people who have played the game actively dislike having to press a key twice to turn and then walk a step - I guess because it's so unintuitive compared to virtually every other roguelike with a simpler movement scheme. I have no doubt that I turned off a whole slab of the roguelike community by adding that extra complexity, but that was the whole point of the game so it's more a matter of idle curiosity as opposed to something I can do anything about.

I'm going to play around with your demo, it sounds cool but it seems to me that a directional fov needs some kind of movement cost to look around or otherwise it's just an annoying restriction which is resolved by fast twitch mouse movement which doesn't gel with a turn based game. It would work perfectly in a real time game, and it's kinda what pyromancer does (except that pyromancer uses the mouse for casting as opposed to looking, but it works pretty well).
Title: Re: Torso & Head direction
Post by: radad on December 20, 2012, 03:01:20 AM
I tried implementing a directional facing method once. I rotated the world about the player though so that the player always faced up the screen. It was a little disorienting but you did get used to it.