Results 1 to 15 of 15
  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    38

    Default How to overhaul camera in UT3?

    I want to overhaul my camera. I want to create a more Zelda-ish camera, where the character can run in tight circles onscreen and the camera needn't move, but if he starts running away the camera will follow. I want this instead of Unreal's default cameras, where the camera is always locked to the character's view. In other words, I need a way to uncouple the camera from the player.

    The older Unreal had several useful functions -- just wondering if they are still around and if not, what has replaced them?

    Code:
    function bool SpecialCalcView(out actor ViewActor,
                                  out vector CameraLocation,
                                  out rotator CameraRotation )
    
    event PlayerCalcView(out actor ViewActor,
                         out vector CameraLocation,
                         out rotator CameraRotation )
    
    function CalcFirstPersonView(out vector CameraLocation,
                                 out rotator CameraRotation )
    
    function CalcBehindView(out vector CameraLocation,
                            out rotator CameraRotation,
                            float Dist )
    From http://udn.epicgames.com/Two/PawnTri...amera_and_View

    Where do I start?

    Thanks!

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    118

    Default

    Check out CalcCamera.

  3. #3
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    38

    Default

    Thanks, I see it (in Actor.uc)

    Code:
    simulated function bool CalcCamera( 
                float fDeltaTime,
                out vector out_CamLoc,
                out rotator out_CamRot,
                out float out_FOV )
    So how do I go about doing this? Do I create a class that extends Actor or Pawn? And then copy this function and change the contents so that the behavior changes? (Ugh I'm quite new at this.)

  4. #4
    MSgt. Shooter Person
    Join Date
    Nov 2006
    Posts
    55

    Default

    You should extend from UTPawn.

    I'll be releasing a mutator this weekend that overhauls the third person camera to match that of Gears and Mass Effect, with a variety of configurable settings. That should be a decent reference for camera modification.

  5. #5
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    38

    Default

    Great, eager to see how to do this. Please post when you have something ready to demo.

  6. #6
    Skaarj
    Join Date
    Nov 2007
    Location
    San Francisco CA
    Posts
    4

    Default

    I thought you could override the player controller and modify it through that... hmmm, looks like I need to look into it more.

  7. #7
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    You have a few avenues of approach for this.

    1) Extend UTPlayerController and override the camera functions there
    2) Extend UTPawn and override the camera adjustment function there
    3) Extend PlayerController and use a custom Camera class (this is what I do)

    Note that #3 has a caveat if you extend a UTPlayerController : you will have to remove all cases of code that deletes the PlayerCamera, as UTPlayerController processes camera stuff internally.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  8. #8
    MSgt. Shooter Person
    Join Date
    Nov 2006
    Posts
    55

    Default

    While I wait for ModDB to approve Action Cam, you can download it and source from this link.

    http://www.zshare.net/download/5756755fe6fd23/

    It's a good example of a slightly more complex third person camera system than the default implementation, not to mention it's actually playable, unlike the thirdperson camera in UT3 (and UT2003/2004) which doesn't line up the crosshair with the actual fire location.

    (edit - ModDB approved the page) http://www.moddb.com/mods/10356/action-cam
    Last edited by fall; 12-19-2007 at 10:13 PM.

  9. #9
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    I also do more complex camera handling for Fleet Wars.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  10. #10
    MSgt. Shooter Person
    Join Date
    Nov 2006
    Posts
    55

    Default

    Quote Originally Posted by Pfhoenix View Post
    I also do more complex camera handling for Fleet Wars.
    What type of camera do you use?

    Action Cam is just a third person camera rotating off of an offset (for this release, it's static and positioned to the right of the player). The camera update does two sets of traces, one for the offset (calculated both to the side and backfacing for camera collision) and one to correct the aim vector to sync up with the camera, so where you aim is where you shoot. The next version will be configurable, as I'm working on the UI right now. The goal is to let people choose the game they want the camera to behave like via presets (GRAW, Gears, and Mass effect are three I have now) as well as customize it further to their liking. That way, everyone can use their own third person camera view while connected to the server, with forced limits to ensure fairness.

    Action Cam is just a base I'm using for a mod that'll be third-person, but I've found it's a lot of fun to play with normal UT3 gameplay, as to me it feels more fun than the normal first person camera.

    After the config stuff is done, I was going to try to get an orthographic camera system working, just for fun. I can't decide if a strategy game in the Unreal engine would play better in isometric or thirdperson, so I'm going to implement both and decide later.
    Last edited by fall; 12-19-2007 at 10:28 PM.

  11. #11
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    The camera for Fleet Wars has two modes - normal and free.

    As you'd expect, free mode allows the player to rotate about their ship, as well as zoom in and out smoothly. Normal mode positions the camera at a per-ship-set distance up and behind the player's ship. When the ship turns, the camera smoothly shifts based on the rate of turning, as well. I'm soon going to be experimenting with modifying this to include dramatic changes in ship velocity to affect the camera's shifting.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  12. #12

    Default

    I keep thinking there is a lot of unneeded features in the base camera class.

    In the default camera class there is support for attaching a CameraActor to the camera class ( is this the basis of matinee? )

    Also included in the default camera class is the ability to render custom view orientations based on the pawn class attached to the camera. (Via the actor function CalcCamera)

    There is a CameraStyle variable that is used to control the differences between behind-view and first-person view (among others).

    There are built-in functions and data structures for doing interpolation between two actors. i.e. Blending in UpdateCamera.

    There is a CameraModifier class that presumably makes it possible to 'mod' the camera however it doesn't seem to be used at all.

    Has everyone been ripping all this out and starting fresh? What are the types of situations in which each of the features above would be usefull?

  13. #13
    Veteran
    Join Date
    Sep 2006
    Location
    Newcastle, UK
    Posts
    6,942
    Gamer IDs

    Gamertag: ambershee

    Default

    They'd certainly be useful dependent on what sort of game you're building. Consider RPGs with fixed cameras, platformers, or cut scenes. Essentially, they're not useless, they're just not useful to you

  14. #14
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    I rather like the structure of the Camera class. I think it's a shame that Epic isn't using it for gameplay view handling for UT3.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  15. #15

    Default

    I'm not trying to criticize, merely elicit some discussion about the different ways to leverage it's power. I'd like to establish where different modifications to the camera should go to achieve minimal impact on the rest of the game's subsystems.
    Last edited by SmokingRope; 12-20-2007 at 10:19 AM.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.