Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (vicknick, AndrewAMD), 1,292 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Third Person Camera System #53623
08/30/05 03:48
08/30/05 03:48
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Hi,

I was told I better show this camera system when I got it working ok.

So here it is.

I still have never found a good way to keep the camera out of the walls other than by keeping the player a certain distance from the wall, which is what is done in this example. How I did it with this example was to create and invisble cylinder around the player that actually does the player movement, keepng the player a certain distance from the wall. There are other possible ways to do this, but this is probably the simpliest so that's what I did here. This example uses c_move, c_trace, etc.

I put 2 camera modes in the example so you get an idea of how to use the system. Hit F7 to change modes.

CAM_MODE_CHASE
The game starts in this mode. In this mode, you use the mouse to rotate the player and to change the camera tilt. Pressing the 'Q' key will force the camera to the front.

CAM_MODE_THIRD
In this mode, you use the A, D, or cursor keys to rotate the player. The mouse changes tilt and if you are not moving forward the mouse can also be used to rotate the camera around the player in a free style.

You can add whatever modes you like or add things to the existing modes. I put alot of extra camera movement functions in the code too, that currently aren't being used, but can be easily added into the camera mode functions, i.e., MoveCamLeft(), MoveCamRight().

An example of adding these to a mode would be changing CameraChase() to this:

function CameraChase()
{
// get angle diffrence between player pan and camera pan
CamPlayerAngDiff = ang(player.pan-camAng.pan);

if(key_q)
{
cameraRotationMode = ROTATION_MODE_SLOW;
MoveCamFront();
}
else
{
if(key_z)
{
cameraRotationMode = ROTATION_MODE_MEDIUM;
MoveCamLeft();
}
else
{
if(key_c)
{
cameraRotationMode = ROTATION_MODE_MEDIUM;
MoveCamRight();
}
else
{
cameraRotationMode = ROTATION_MODE_MEDIUM;
MoveCamBehind();
}
}

I just added keys Z and C to move camera off to left or right of player in that code.

There is some stuff that effects the camera that is in the PlayerEnt action, make sure you notice those if you are trying to add the camera system to your existing player action code.



It's at my 3DGS site, which is listed in my signature below. It's in the Camera link at my site.



Professional A8.30
Spoils of War - East Coast Games
Re: Third Person Camera System [Re: Locoweed] #53624
08/30/05 03:51
08/30/05 03:51
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Yeah, I tested this and in the test level, the camera only clipped when inside a doorway. I don't know if that's been tweaked, but I can say this is the best wall collision I've seen. This is the Holy Grail, or at least it was in that test 99.9% of the time.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Third Person Camera System [Re: Orange Brat] #53625
08/30/05 20:07
08/30/05 20:07
Joined: Oct 2003
Posts: 117
San Diego, CA
DCorwin Offline
Member
DCorwin  Offline
Member

Joined: Oct 2003
Posts: 117
San Diego, CA
This is the nicest camera implementation I've seen in GS! Good job!

How come the cyberbabe eats the soldiers when she walks into them though? :-)


Dave C. Polcino Digital Complete http://www.digitalcomplete.com dave@digitalcomplete.com -------------------
Re: Third Person Camera System [Re: DCorwin] #53626
08/30/05 20:48
08/30/05 20:48
Joined: Aug 2002
Posts: 2,692
California, USA
bupaje Offline
Expert
bupaje  Offline
Expert

Joined: Aug 2002
Posts: 2,692
California, USA
Very cool camera contribution -thanks!


Find me at: |Stormvisions| Twitter|
Re: Third Person Camera System [Re: bupaje] #53627
08/30/05 22:41
08/30/05 22:41
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Quote:

How come the cyberbabe eats the soldiers when she walks into them though? :-)




I dunno, maybe she's a man-eater. I think that was a song back in the 80's.

Just comment out these 2 lines of code in Enemy action and she will be more politically correct.

my.enable_impact = on;
my.event = EnemyEvent;

Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Third Person Camera System [Re: Locoweed] #53628
08/31/05 02:36
08/31/05 02:36
Joined: Jul 2002
Posts: 2,813
U.S.
Nadester Offline

Expert
Nadester  Offline

Expert

Joined: Jul 2002
Posts: 2,813
U.S.
Very nice. I was damn sure I remember editing your post


--Eric
Re: Third Person Camera System [Re: Nadester] #53629
08/31/05 03:37
08/31/05 03:37
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
@ Nadester
Lol, yeah you called me "goofy" if I remember right, thats why the edit is gone.

For a "very limited" time ( I am busy after all ), anyone who gives me a link to a game demo with a 3rd person camera, I will duplicate it and show you the code with this system if it is possible. Don't give me a link to SH3, I definately won't do that one for you.

But something like Lugaru, no problem (Well, not no problem, but possible). I don't know why I picked that game as an example, but it's camera was a bit unique when I tested it. Almost looks like it was made with 3DGS actually.

Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Third Person Camera System [Re: Locoweed] #53630
08/31/05 04:39
08/31/05 04:39
Joined: Aug 2002
Posts: 2,692
California, USA
bupaje Offline
Expert
bupaje  Offline
Expert

Joined: Aug 2002
Posts: 2,692
California, USA
errrr ... ZooTycoon2 (just happened to download the demo to show my kids and nieces ....). Overhead 'Builder' cam and has option to hold key and rotate the viewscreen, or player view and also to drop down and view the zoo as a visitor (or the guy who cleans up the poop -why my kids thought was funny ) Probably something like what yours does now.


Find me at: |Stormvisions| Twitter|
Re: Third Person Camera System [Re: bupaje] #53631
08/31/05 07:19
08/31/05 07:19
Joined: Aug 2002
Posts: 906
the future
N
nuclear_winter Offline
User
nuclear_winter  Offline
User
N

Joined: Aug 2002
Posts: 906
the future
Great job Loco!!!
Can you make the camera to delay a little, i mean character model to turn a little before the camera, as if the camera follows her... and for the FOV to increase when she picks up speed and softly decrease when she stops. Just some ideas here, if I'm out of my element and don't know what the hell I'm saying, I'm sorry!

For your camera offer, can you try a Crash Bandicoot camera? The main one that is "on a rail" behind the character and goes higher pointing down or lower pointing forward depending on the occasion (stairs, slopes, etc), then goes a little farther form him when he runs faster, revealing a bigger portion of the level. The camera also follows Crash to the sides while staying attached to the "rail" but does not keep him centered while jumping, making it possible for the character to disappear form view if the jump is too high . There are other levels which are sidescrollers, nothing special about the camera there (keeping the side view with the character centred in the middle), and there are the vehicle levels with a little more complex camera (delays after the vehicle turn to give the impression of sliding sideways).

Great job man, keep it up!

Re: Third Person Camera System [Re: nuclear_winter] #53632
08/31/05 17:16
08/31/05 17:16
Joined: Aug 2002
Posts: 2,692
California, USA
bupaje Offline
Expert
bupaje  Offline
Expert

Joined: Aug 2002
Posts: 2,692
California, USA
Maybe a useless post since it's not what you asked for but as I was reading here I wondered if a 'helium balloon with a rubber band' effect might be nice. The camera would float over the player, looking down at him, when he runs / walks depending on the speed the camera floats down to be a chase cam. When he stops it floats back to its overhead position. The 'rubberband' part would be the distance of the cam from player as he runs faster the camera distance stretches. When he stops it snaps back to original distance and of course slowly floats back to its overhead position.

Page 1 of 4 1 2 3 4

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1