Not-In-The-Way Thirdperson

Not-In-The-Way Thirdperson

Postby greaserpirate » 31 Jan 2012, 04:11

I heard someone suggest an over-the-shoulder type thirdperson a while a go, and I decided to try making a mod for it myself. It turned out to be extremely easy, since no matter where you move the camera it still focuses on where you're shooting. However, I could only move the camera absolutely (north/south as opposed to left-right) so it's not technically an over-the-shoulder camera, but I'm not sure how the degrees of the player's yaw is measured. I tried treating it like degrees, and it didn't work, but it may be just because I haven't taken trig yet so all my knowledge is secondhand from my math-nerd friends. :)

In my opinion this is a huge improvement over normal thirdperson because you can actually see your target, as opposed to having your head be in the way most of the time.

Srcreenshot:
Image

View more screenshots: http://imgur.com/a/jaVF0#0


By the way, I should probably tell you: to use it, after compiling, type /thirdpersonx 3 /thirdpersony 3 /thirdpersonz 1.5 or some variation of that. I find those values were best when combined with /thirdpersondist 8.

Here's the source code. I didn't have to change much, just some things on lines 49-51 and 2212-2216 of game.cpp.
Attachments
game.cpp
Will work w/ standard Cosmic Edition.
(119.71 KiB) Downloaded 355 times

Friendship is Magic Voice Chat Mod
(Map) Trespass
(Map) Suspended
Find out more about >DOOM< here: www.redoomclan.tk
User avatar
greaserpirate
 
Posts: 350
Joined: 22 Jun 2011, 18:23

Re: Not-In-The-Way Thirdperson

Postby Glennz » 31 Jan 2012, 16:08

Looks nice... :)
Maybe have this as a setting?
The second and fourth images look better then the first and third, are they of different height or something?

Image

Looks very nice, great distance and position

Image

Looks a little weird???
Last edited by Glennz on 31 Jan 2012, 18:31, edited 2 times in total.
User avatar
Glennz
 
Posts: 21
Joined: 21 Jan 2012, 10:26

Re: Not-In-The-Way Thirdperson

Postby GooshGoosh! » 31 Jan 2012, 16:12

I've downloaded it, I don't know how to install it or as you say: compile it.

please help me :( (I'm using Windows 7 by the way, very soon I'll move to Linux)
Last edited by GooshGoosh! on 31 Jan 2012, 16:44, edited 3 times in total.
User avatar
GooshGoosh!
 
Posts: 49
Joined: 30 Jul 2011, 16:01

Re: Not-In-The-Way Thirdperson

Postby TheLastProject » 31 Jan 2012, 16:18

That plays surprisingly nicely. So nicely, in fact, that I would love to be able to choose between "First Person" and "Third Person" under gameplay style under profile. That would be sweet.

(I've tried your default values, but I generally prefer a higher /thirdpersondist, even up to 20, because it shows quite nicely how your character moves, something you can barely see when you move forward with /thirdpersondist 8)

There is only one downside to this at the moment: the camera has the urge to go into parts of the map it shouldn't go relatively often, causing rendering issues. In case this can be fixed (and even if it can't be), I really want the third person standard settings to be changed from the current default to something like this, possibly with higher thirdpersondist.
Hats, Afros, wings and raptor feet. This game is showing progress indeed.
TheLastProject
 
Posts: 432
Joined: 06 Nov 2011, 17:04

Re: Not-In-The-Way Thirdperson

Postby inpersona64 » 31 Jan 2012, 17:50

TheLastProject {l Wrote}:That plays surprisingly nicely. So nicely, in fact, that I would love to be able to choose between "First Person" and "Third Person" under gameplay style under profile. That would be sweet.

(I've tried your default values, but I generally prefer a higher /thirdpersondist, even up to 20, because it shows quite nicely how your character moves, something you can barely see when you move forward with /thirdpersondist 8)

Along with this, I'd love it if you were able to "switch sides" in game while being in 3rd person. What I mean by this is that when you use the over-the-shoulder view, you are only viewing from one shoulder view. So if there was a button that symmetrically switched from the current shoulder to the other, that would be great. An example of this can be seen in games like Gears of War and SOCOM: U.S. NAVY Seals Confrontation (a game I played again last night, nostalgia ftw). It's not a big deal though. If it were included as an option in 1.3, that'd be great. But the over-the-shoulder idea in general is a really great idea IMO.
User avatar
inpersona64
 
Posts: 474
Joined: 01 Apr 2011, 18:19
Location: Eastern USA

Re: Not-In-The-Way Thirdperson

Postby arand » 31 Jan 2012, 19:44

One problem I noticed with this is that the camera offset appears to be relative to the world rather than relative to the player, meaning for example that if the camera is offset to the right, relative to the player, when you are facing one direction, it will be offset to the left when facing the other direction.

Other than that, it's pretty cool, a large offset (/firstpersony 50) is really nice for making cinematic camera tracking of a player, but as per above, it only works from one direction :)
User avatar
arand
 
Posts: 211
Joined: 26 Mar 2011, 21:42

Re: Not-In-The-Way Thirdperson

Postby GooshGoosh! » 31 Jan 2012, 20:18

Can someone tell me how to install the mod!? I really want to try it out, but I don't know how to install the f***ing thing!! :x
User avatar
GooshGoosh!
 
Posts: 49
Joined: 30 Jul 2011, 16:01

Re: Not-In-The-Way Thirdperson

Postby arand » 31 Jan 2012, 20:31

You replace the existing src/game/game.cpp with the file supplied by greasepirate above, then recompile the game.

viewtopic.php?f=53&t=2593 has some info about compiling, there are no step-by-step instructions for windows.
User avatar
arand
 
Posts: 211
Joined: 26 Mar 2011, 21:42

Re: Not-In-The-Way Thirdperson

Postby sireus » 01 Feb 2012, 00:41

greaserpirate {l Wrote}:However, I could only move the camera absolutely (north/south as opposed to left-right) so it's not technically an over-the-shoulder camera, but I'm not sure how the degrees of the player's yaw is measured. I tried treating it like degrees

It's in degrees, but you'll have to convert it to radians for use in functions like sinf. However, instead of fiddling with trigonometric functions yourself, you can simply create an offset vector, rotate it and then apply it to the camera position. Something like
{l Code}: {l Select All Code}
vec offset = vec(0, 2.0f, 0);
offset.rotate_around_z(player->yaw * RAD);
camera->o.add(offset);

This will probably not work as is, but you get the idea. If you have z offset, you can also rotate around the y (or is it x?) axis for pitch, obviously.
sireus
 
Posts: 109
Joined: 24 May 2011, 20:10

Re: Not-In-The-Way Thirdperson

Postby greaserpirate » 01 Feb 2012, 02:40

arand {l Wrote}:One problem I noticed with this is that the camera offset appears to be relative to the world rather than relative to the player, meaning for example that if the camera is offset to the right, relative to the player, when you are facing one direction, it will be offset to the left when facing the other direction.

Other than that, it's pretty cool, a large offset (/firstpersony 50) is really nice for making cinematic camera tracking of a player, but as per above, it only works from one direction :)


Yeah, I don't really know how to get around that. I know the player's yaw (it's stored in the hard-coded variable "player1->yaw") but I can't seem to find what it's measured by. I made it so it would print the value every frame update, and I got huge numbers like 234789798798 and -523984798734. Any help, devs?

Oh, and by the way, for all of those who want to use this on Windows but can't compile, I think I can cross-compile it for windows on Ubuntu. Move these files to your "bin" folder (Back it up first!) and tell me what happens.
Attachments
winbin.zip
Sorry, Mac Users. I don't know how to compile for Macs yet.
(1.93 MiB) Downloaded 334 times

Friendship is Magic Voice Chat Mod
(Map) Trespass
(Map) Suspended
Find out more about >DOOM< here: www.redoomclan.tk
User avatar
greaserpirate
 
Posts: 350
Joined: 22 Jun 2011, 18:23

Re: Not-In-The-Way Thirdperson

Postby arand » 01 Feb 2012, 04:01

I cargo-culted it, based on greasepirate's and sireus's work, it seems like
{l Code}: {l Select All Code}
FVAR(IDF_PERSIST, thirdpersonx, FVAR_MIN, 0, FVAR_MAX);
FVAR(IDF_PERSIST, thirdpersony, FVAR_MIN, 0, FVAR_MAX);
FVAR(IDF_PERSIST, thirdpersonz, FVAR_MIN, 0, FVAR_MAX);
and
{l Code}: {l Select All Code}
vec offset = vec(thirdpersonx, thirdpersony, thirdpersonz);
offset.rotate_around_z(player1->yaw * RAD);
camera1->o.add(offset);

Does kind of what we're after...

In order to get something close to the over-shoulder style camera it seems like
{l Code}: {l Select All Code}
/thirdpersonx 2
/thirdpersony -5
/thirdpersonz 2
/thirdpersondist 0

gets close.

It is imperfect and ugly, and it makes your aim offset with the same amount :D and that will likely be the hard part to crack if this is ever going to be viable :)
User avatar
arand
 
Posts: 211
Joined: 26 Mar 2011, 21:42

Re: Not-In-The-Way Thirdperson

Postby greaserpirate » 02 Feb 2012, 04:13

sireus {l Wrote}:
greaserpirate {l Wrote}:However, I could only move the camera absolutely (north/south as opposed to left-right) so it's not technically an over-the-shoulder camera, but I'm not sure how the degrees of the player's yaw is measured. I tried treating it like degrees

It's in degrees, but you'll have to convert it to radians for use in functions like sinf. However, instead of fiddling with trigonometric functions yourself, you can simply create an offset vector, rotate it and then apply it to the camera position. Something like
{l Code}: {l Select All Code}
vec offset = vec(0, 2.0f, 0);
offset.rotate_around_z(player->yaw * RAD);
camera->o.add(offset);

This will probably not work as is, but you get the idea. If you have z offset, you can also rotate around the y (or is it x?) axis for pitch, obviously.


Thanks a million for the code! At this point, the mod is pretty much all your content. :D

arand {l Wrote}:It is imperfect and ugly, and it makes your aim offset with the same amount :D and that will likely be the hard part to crack if this is ever going to be viable :)


It's simple to fix. If you add this code, which was only a few lines above, after "camera1->0.add(offset)":
{l Code}: {l Select All Code}
          findorientation(camera1->o, (self ? player1 : focus)->yaw, (self ? player1 : focus)->pitch, worldpos);


the camera and player focus on the same point.

Now about that being hard.. :lol:

Friendship is Magic Voice Chat Mod
(Map) Trespass
(Map) Suspended
Find out more about >DOOM< here: www.redoomclan.tk
User avatar
greaserpirate
 
Posts: 350
Joined: 22 Jun 2011, 18:23

Re: Not-In-The-Way Thirdperson

Postby Glennz » 02 Feb 2012, 10:31

greaserpirate {l Wrote}:
sireus {l Wrote}:
greaserpirate {l Wrote}:However, I could only move the camera absolutely (north/south as opposed to left-right) so it's not technically an over-the-shoulder camera, but I'm not sure how the degrees of the player's yaw is measured. I tried treating it like degrees

It's in degrees, but you'll have to convert it to radians for use in functions like sinf. However, instead of fiddling with trigonometric functions yourself, you can simply create an offset vector, rotate it and then apply it to the camera position. Something like
{l Code}: {l Select All Code}
vec offset = vec(0, 2.0f, 0);
offset.rotate_around_z(player->yaw * RAD);
camera->o.add(offset);

This will probably not work as is, but you get the idea. If you have z offset, you can also rotate around the y (or is it x?) axis for pitch, obviously.


Thanks a million for the code! At this point, the mod is pretty much all your content. :D

arand {l Wrote}:It is imperfect and ugly, and it makes your aim offset with the same amount :D and that will likely be the hard part to crack if this is ever going to be viable :)


It's simple to fix. If you add this code, which was only a few lines above, after "camera1->0.add(offset)":
{l Code}: {l Select All Code}
          findorientation(camera1->o, (self ? player1 : focus)->yaw, (self ? player1 : focus)->pitch, worldpos);


the camera and player focus on the same point.

Now about that being hard.. :lol:


Sounds awesome, this needs to be in 1.3. :)
User avatar
Glennz
 
Posts: 21
Joined: 21 Jan 2012, 10:26

Re: Not-In-The-Way Thirdperson

Postby arand » 02 Feb 2012, 20:19

greaserpirate's suggestion seems to fix aiming :)

But the more I poke at it, the more it is apperent it needs a bit of polish before it would be Good™

It still makes aiming behave different in our case compared to the standard third person:
I you try switching between
{l Code}: {l Select All Code}
/thirdpersondist 25; thirdperson
/thirdpersondist 0; thirdperson y -25
You notice that in the first, default case, the player is always kept centered in the screen whilst aiming, whereas with our new y offset, the aim does not keep the player in focus, making it act very strange when you aim far up or down; you actually aim a good bit behind the player at full tilt :) it would be nice if it acted similarly.

Continuing on, how would clipping be corrected? It appears currently clipping is corrected based on the scalar thirdpersondist value, any idea how to do that with our now vector entity?

I wonder if it would make most sense to have /thirdperson go 0..3 as [none, default, left shoulder, right shoulder], or if there would be better with a new /thirdpersonstyle for the three alternatives (or more?)
User avatar
arand
 
Posts: 211
Joined: 26 Mar 2011, 21:42

Re: Not-In-The-Way Thirdperson

Postby Catalanoic » 02 Feb 2012, 22:10

I think that is perfect to combine this with View Bobbing or Trembling Camera, discussed here: viewtopic.php?f=53&t=2053
User avatar
Catalanoic
 
Posts: 46
Joined: 28 Sep 2011, 17:57
Location: Barcelona, Catalan Countries

Re: Not-In-The-Way Thirdperson

Postby greaserpirate » 04 Feb 2012, 01:19

arand {l Wrote}:It still makes aiming behave different in our case compared to the standard third person:
I you try switching between
{l Code}: {l Select All Code}
/thirdpersondist 25; thirdperson
/thirdpersondist 0; thirdperson y -25
You notice that in the first, default case, the player is always kept centered in the screen whilst aiming, whereas with our new y offset, the aim does not keep the player in focus, making it act very strange when you aim far up or down; you actually aim a good bit behind the player at full tilt :) it would be nice if it acted similarly.


"Thirdpersony" wasn't actually intended as a replacement for "thirdpersondist". In this release I will remove it, and rename "thirdpersonx" to "thirdpersonshoulder" and "thirdpersonz" to "thirdpersonheight" for clarity.

Here are the files. I'm going to be away for a while, but I might check the forums occasionally. If anyone wants to add on to this code, feel free.
Attachments
game.cpp
For those who can compile.
(119.78 KiB) Downloaded 353 times
winbin.zip
For the Windows people. (NOTE: also contains the Killer Mode!)
(1.93 MiB) Downloaded 333 times

Friendship is Magic Voice Chat Mod
(Map) Trespass
(Map) Suspended
Find out more about >DOOM< here: www.redoomclan.tk
User avatar
greaserpirate
 
Posts: 350
Joined: 22 Jun 2011, 18:23

Re: Not-In-The-Way Thirdperson

Postby GooshGoosh! » 10 May 2012, 22:41

I hope it will be added to 1.3 version :D
User avatar
GooshGoosh!
 
Posts: 49
Joined: 30 Jul 2011, 16:01

Re: Not-In-The-Way Thirdperson

Postby wowie » 10 May 2012, 22:59

GooshGoosh! {l Wrote}:I hope it will be added to 1.3 version :D

Only if it is added as a mutator, it lets you see around corners, which encourages camping since you can see without being seen.
I lost the game.
User avatar
wowie
 
Posts: 314
Joined: 15 Mar 2012, 22:22

Re: Not-In-The-Way Thirdperson

Postby greaserpirate » 11 May 2012, 01:33

wowie {l Wrote}:it lets you see around corners, which encourages camping since you can see without being seen.


It may allow you to see around corners, but you can't shoot around them. I tried it out, and it didn't work- your legs, arm, and head always stick out, allowing your target to get an easy headshot on. It makes much more sense to firefight around the corner, i.e. shoot, duck behind corner to reload, pop out and shoot again, etc. Or if you're lazy, to hide at a 90 degree angle to the door and wait with your gun at head level for them to come around, aided by radar.

But if you really think it's a problem, I can prevent the player from entering a negative thirdpersonshoulder value, so they only see over the player's left shoulder. (if you try looking around corners like that, your whole body will be sticking out.)

Friendship is Magic Voice Chat Mod
(Map) Trespass
(Map) Suspended
Find out more about >DOOM< here: www.redoomclan.tk
User avatar
greaserpirate
 
Posts: 350
Joined: 22 Jun 2011, 18:23

Re: Not-In-The-Way Thirdperson

Postby wowie » 11 May 2012, 03:34

I'm sorry, cheap shots are always the first thing I think of when I think of 3rd person view {edit:} in a first person shooter. But, if you've tested it and it doesn't affect gameplay, I'm fine with it. {edit:} :)
I lost the game.
User avatar
wowie
 
Posts: 314
Joined: 15 Mar 2012, 22:22

Re: Not-In-The-Way Thirdperson

Postby ZeroKnight » 14 May 2012, 17:11

Looking around corners can be done with any implementation of third-person, really. So the point is kinda moot. Though you do still actually have to spring out to shoot.
[ Github ][ WazuClan -- irc.wazuclan.com #wazuclan ][ Zero's Archive of RE Extensions, Scripts, WeapMods & More! ]
User avatar
ZeroKnight
 
Posts: 524
Joined: 08 Jun 2011, 01:24
Location: Ohio, United States

Re: Not-In-The-Way Thirdperson

Postby inpersona64 » 15 May 2012, 17:29

wowie {l Wrote}:I'm sorry, cheap shots are always the first thing I think of when I think of 3rd person view {edit:} in a first person shooter. But, if you've tested it and it doesn't affect gameplay, I'm fine with it. {edit:} :)

People in SOCOM Confrontation do that all the time. I think its one of the reasons 1st person just appeals to me more. But a mutator for third person (so that EVERYONE has to play in it) would be pretty nice.
User avatar
inpersona64
 
Posts: 474
Joined: 01 Apr 2011, 18:19
Location: Eastern USA

Re: Not-In-The-Way Thirdperson

Postby qreeves » 18 Nov 2012, 10:48

Okay, so I had a "glimmer idea" this evening and decided to try something out with this "off-center third person" prospect, and I think the results might actually be a fair compromise that may even be appealing. My idea was basically this: If it is so much trouble to line up the camera and player orientation positions when going "off center", then why do it at all? The only important vector is where the player is aiming, so in third person, move the on-screen cursor instead. This seems to result in a semi-fluid camera state, once you get used to the fact you're aiming from the player and not the camera. Screenshots attached.
Attachments
20121118193632.jpg
20121118193617.jpg
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: Not-In-The-Way Thirdperson

Postby arand » 18 Nov 2012, 12:28

I like this new thirdperson mode, it seems like it might take a while to get used to the smoothness and relativeness, but it doesn't seem overly tricky compared to previous thirdperson as far as I can tell.

I'm not a habitual user of thirdperson, so mine might not be a heavy-weighing opinion though ;)
User avatar
arand
 
Posts: 211
Joined: 26 Mar 2011, 21:42

Re: Not-In-The-Way Thirdperson

Postby S.E.S » 18 Nov 2012, 13:13

Rebuild and looked - like nice - it looks more spectacular.
In general, I think, the old form in the third person basically was really important when editing (to see the aspect ratio) and time-trial. If for first new kind of nice, then what about for the second "I was plagued by vague doubts."
Quin, maybe it makes sense to use the old form for "time trial" and "editing"?
And so the game is, of course, has be a new, more spectacular views. Nice!
User avatar
S.E.S
 
Posts: 82
Joined: 08 Apr 2012, 11:43

Who is online

Users browsing this forum: No registered users and 0 guests