Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1324903 Posts in 59754 Topics- by 50975 Members - Latest Member: rochmilla

December 13, 2017, 10:52:26 am

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Character Controller + Camera Scope
Pages: [1]
Print
Author Topic: Character Controller + Camera Scope  (Read 240 times)
archgame
Level 1
*


Fresh Builds, Buildings, & Beats


View Profile WWW
« on: June 13, 2017, 07:26:42 am »

CONTROLLER SCOPE:
 
Introduction:
The character controller will be used on multiple playable characters and will therefore need to have variables exposed publicly for easy adjustment in the unity editor as well as booleans for each function to determine if the player has the ability to do them. A controller input script will be provided, from which all input should be derived; This script will format the input variables appropriately so no calibration is needed within the character controller script. Additionally a mecanim tree will be established with animations input (although this is subject to change with programmer input). It should be assumed that whenever “up” is used in the function descriptions, it is referring to a direction vector related to the character's base and center of the sphere. A character is defined as grounded when the character collider is interacting with a groundable surface, which is split into two categories, the first for the sphere (bottom-most ground) and the second for all other platforms. For further clarifications on the desired move functions the programmer may reference Wind Waker for all functions except the Jump function which they should reference Super Mario 64 for the initial Jump and Super Smash Brothers for multiple Jumps. Inverse Kinematics will be used for the feet, legs, and torso. The character’s forward whisker is a raycast defined as the character’s forward direction of a length defined by the Interact Distance Variable. Using the Super Character Controller, the character controller will need to perform with the following functions:
 
Idle: Character enters the idle state when they are grounded, it is the default state. After a certain amount of time as defined by the Wait Variable, the character will cycle through idle animations.
 
Walking: A joystick push of any value less than a full push (i.e. 1.0) will move the player forwards at a rate determined by the walk variable as defined by the direction of the joystick as it relates to the current camera position whereupon the joystick will move the character towards the top of the screen, away from the player. While moving the character should reorient its up orientation each frame.
 
Running: A full joystick push (i.e. 1.0) will move the player forwards at a rate determined by the Run Variable as defined by the direction of the joystick as it relates to the current camera position whereupon the joystick will move the character towards the top of the screen, away from the player. While moving the character should reorient its up orientation each frame.
 
Jumping: When the Jump Button is pressed, the character should move in the up direction by an amount determined by the Jump Variable. While Jumping, the players forward direction will still be derived from the Follow state, allowing for change in forward direction and deceleration, but not acceleration in the forward direction. There will also be included a Number Of Jumps Variable which will determine how many sequential Jump functions a character may perform without returning to a grounded state. If the Jump Button is pressed while Jumping and the maximum number of Jumps as defined by the Number Of Jumps Variable has not been reached the character should move in the up direction by an amount determined by the Jump Variable. When the character reaches the height as determined by the Jump Variable, the character should switch to a Falling state.
 
Falling: When a character is not grounded (as determined by the characters distance to a surface with the appropriate grounded classification), the character should enter the Falling function, unless in the Jumping or Climbing function. While in a Falling state, the character should be moving opposite of the up direction with the addition of any forward movement at a rate determined by a global Gravity Force Variable. When the character collides with a surface containing grounded information, a landing animation should play and the character returns to a grounded state. If the character has any forward movement, the character should immediately transition to either a Walk or Run state depending upon the Joystick variable, and if there is no forward movement, the character should transition to an idle state.
 
Climbing: When the character is within a globally defined range to a surface deemed climbable by tag and the Climb Button is pressed, the character will enter into the Climbing state. The Climbing state is entered into with a Mounting Animation. While in the Climbing state and the Joystick is pressed in an up direction the character should move in the up direction parallel to the mounted surface (not the center of the sphere). If the Joystick is pressed down the character should move in the opposite direction of the up direction parallel to the mounted surface. If the joystick is pressed to the left or to the right, the character should move to the left or right of the mounted surface. The character will exit the Climbing state when the become grounded, reach the top of the mounted surface, reach either side of the mounted surface, or reach the bottom of the mounted surface. All dismounts except for the top surface dismount will play the standard Dismount animation when entered into. The top surface dismount will play the Climb over animation and the character shall be moved in a negative perpendicular direction of the mounted surface into a grounded state.
 
Swimming: When the player enters a surface deemed swimmable and the difference between the ground surface and swim surface is larger than three/fourths the character’s height as determined by the Height Variable the character shall enter the Swimming state. The swimming state is entered into with a Swim Enter animation. While in the Swimming state a joystick push will move the player forwards at a rate determined by the Swim Variable as defined by the direction of the joystick as it relates to the current camera position whereupon the joystick will move the character towards the top of the screen, away from the player. While moving the character should reorient its up orientation each frame and its position on the swimmable surface, the animation will be adjusted to make it look as if the character is below the surface.
 
Floating: When the player enters the Falling state and the Jump Button is held down the player will enter the Floating state. While in the Floating state a joystick push will move the player forwards at a rate determined by the Swim Variable as defined by the direction of the joystick as it relates to the current camera position whereupon the joystick will move the character towards the top of the screen, away from the player. While moving the character should reorient its up orientation each frame and its up position as determined by the distance from the player to the sphere when the Floating state was entered into.
 
Driving: While in the Driving state a joystick push will move the player forwards at a rate determined by the Drive Variable at an acceleration determined by the Acceleration Variable as defined by the direction of the joystick as it relates to the current camera position whereupon the joystick will move the character towards the top of the screen, away from the player. While moving the character should reorient its up orientation each frame. While in the Driving state, joystick presses outside a defined range will have no effect on the characters movement (i.e. the character will not be able to immediately rotate in 180 degrees, but will be forced to turn at a rate similar to a wheeled vehicle).
 
Pushing/Pulling: When the character’s forward whisker collides with an object that is pushable and the Push Button is pressed the character will enter the Pushing state. While in the Pushing state the character will reorient so that the characters forward direction is perpendicular to the nearest surface of the object. While in the Pushing state if the Joystick is pressed up the character and object move in a forward direction as defined by the perpendicular orientation direction. While in the Pushing state if the Joystick is pressed down the character and object move in a backward direction as defined by the negative perpendicular orientation direction. While in the Pushing state if the Push Button is pressed, the character exits the Pushing state.
 
Sitting: After a determined amount of time the character will enter into the Sitting state. The Sitting state is entered into by the Sitting Enter animation, which transitions into the Sitting animation, which is a random series of three animations. When any Button or Joystick is pressed by the player, the character exits the Sitting state with the Sitting Exit animation. The Sitting state is also determined by the proximity of a sit-able surface or ground, which will determine which animations and where the character is located.
 
Interact: While in the Idle state and the Interact Button is pressed the character enters into the Interact State. While in the Interact state the character plays an animation determined by camera targeted object or forward whisker collided object. For example if the targeted object is an NPC, the character will play a Talking animation. For example if the nearest object is a collectable, the character will enter into a Pick-Up animation. If the Interact animation has an exit time, this will determine at what time the character will exit the Interact state. If there is no exit time for the Interact Animation, pressing the Interact Button again will exit the Interact state.
 
CAMERA SCOPE:
 
Introduction:
A camera input script will be provided, from which all input should be derived; This script will format the input variables appropriately so no calibration is needed within the character controller script. It should be assumed that whenever “up” is used in the function descriptions, it is referring to a direction vector related to the camera’s position and center of the sphere. Additionally, the camera will maintain an oblique frustum to frame the character. Next, the camera will maintain a list of proximate objects of a distance defined by the Proximity Variable. Lastly, The camera will have collision detection to prevent the camera from going through certain objects, indicated by a list of tags (“ground”, “building”, etc). The camera controller will need to perform with the following functions:
 
Following: The default camera state is the Following State. While in the Following State the camera will follow the character at a distance in the reverse direction of the character’s forward direction at a length defined by the Camera Distance Variable. The Camera will maintain a lock on the character as defined by the characters Target Position and Height Variable. The character’s Target position will be located with a vector as defined by the character’s forward position with an amplitude defined by the character’s moving speed. The camera Target position will use whiskers (multiple raycasts) to determine proximate obstacles. When the Joystick input vector is within a threshold indication right or left character movement as defined from the screen position, the Camera position will not change while the lock rotation will continue to update (See Legend of Zelda: Majora’s Mask for example).
 
Horizontal Rotation: When the Camera Joystick is pressed in either horizontal direction the camera will rotate around the target in that direction at a rate defined by the Rotation Variable. After a set amount of time as defined by the Wait Variable, the camera will smoothly rotate back to character’s forward direction.
 
Look-Up: When the character is not in a Moving State and the Camera Joystick is pressed up the Camera will smoothly move towards the grounded surface and pivot up. Additionally the camera angle will decrease to give a wider cinematic view. If the character enters a moving state or the Camera Joystick is pressed down, the Camera will smoothly return to a Following State.
 
Above: When the Camera Joystick is pressed up the Camera will smoothly move away from the grounded surface and pivot down. Additionally the camera angle will decrease to give a wider cinematic view.
 
Targeting: When the Camera Target button is pressed the camera’s look at transform will lock onto a proximate targetable object as defined from a list of proximate targetable objects. If the Camera Target button is pressed again, the locked object will change to the next locked object in the list. While the Camera Target button is held down, the Camera will continue to update in the Targeting State. If the Camera Target button is released the camera will move smoothly back into the Default state. If there are no proximate targetable objects in the List, the Camera should smoothly move to a position in the negative forward direction of the character’s forward direction and lock onto the character.
 
Narrow: When the Target Position whiskers detect the character is between two vertical surfaces, The Narrow state will be entered. While in the Narrow state the Camera position will be set at a distance defined by the Narrow Distance from the character in a direction perpendicular to the two vertical surfaces with the camera’s lock position defined by the same vector. Additionally, the camera angle will become larger to create a cinematic sense of compression.
 
Rooftop: When the character is on a rooftop as defined by the tag of the grounded surface, the Camera position will move in a negative forward direction as defined by the Rooftop Variable. Additionally, the camera angle will decrease in size to give a cinematic sense of the sublime.
 
Jumping: When the Jump button is pressed, the camera will enter into the Jump state. During the Jump state the camera should perform the same as the Following State, except the camera’s up position will not change, unless the character leaves a defined screen frame, at which point the camera will return to the Default state.
 
Crawling: When the Crawling Button is pressed the Camera’s forward direction will orient towards the character’s forward direction and the camera’s up position will move towards the ground to be equal to the characters colliders center. Additionally the camera will pivot up and the camera angle will increase to provide a cinematic sense of compression.
 
Swimming: When in the Swimming State the Camera will perform the same as the follow state except the Camera’s up position will be derived from the swimmable surface, not the ground.
 
Waiting: After a set amount of time as defined by the Wait Time Variable with no controller input the Camera will begin to pull out and rotate around the character. After a second set amount of time as defined by the Wait Time Variable, the Camera will jump cut at timed intervals as defined by the Cut Time Variable to certain macro and micro scenes in proximity to the player. These scenes will be predefined with Cameras set up (as a means to give the player direction, similar to the sword light in Shadow of the Colossus).
 
Collision Detected: When the camera collides with an object, the camera should move towards the player to avoid going behind or through the collided object.

PROVIDED MATERIAL:
Unity Project:
   Test Scene:
      Sphere Mesh
      Objects:
         Items, Buildings, Obstacles.
      Character (rigged with Mecanim set up):
         Animations:
            Idle 1, Idle 2, Idle 3, Walk, Run, Jump Enter, Jump Up, Jump Peak, Jump Land, Fall, Climb Enter, Climb Up, Climb Down, Climb Dismount, Swim Enter, Swim Move, Swim Exit, Sit Enter, Sit Idle, Sit Exit, Push Enter, Push, Push Exit,, Crawling Enter, Crawling Move, Crawling Exit, Pick-Up, Talk, Eat, Pull
Logged

archgame
Level 1
*


Fresh Builds, Buildings, & Beats


View Profile WWW
« Reply #1 on: June 13, 2017, 07:28:40 am »

This controller scope originally came about after a discussion on the business thread concerning hiring a programmer; a decision we've come to after going through four rounds of internal character controller design. It became apparent that having as specific of scope as possible would help the process (of hiring a programmer). We are posting the job at the end of the month and I thought it'd be good to give the scope some breathing time in the technical forums.

As programmers having read the scope (either camera or controller) are there items left out that we would need to clarify in order to better understand what we are looking for? Are there technical issues we need to address.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic