• Nenhum resultado encontrado

Creating an adaptive camera system for a 3D platformer game : Meeting the requirements of game design and end-user experience

N/A
N/A
Protected

Academic year: 2023

Share "Creating an adaptive camera system for a 3D platformer game : Meeting the requirements of game design and end-user experience"

Copied!
40
0
0

Texto

The purpose of the targeting system is to allow the player to shoot and deal with groups of enemies, as well as to activate elements in the game world. Game cameras are an essential part of the gaming experience, especially in the 3D platform genre. The camera should be able to follow the action with ease while providing the player with the best possible view of the game world.

This chapter will cover an overview of the game project and development tools. The following excerpt describing the game's overall setup is from one of the four design documents: “The game is built around a compelling and colorful story about an intergalactic mail carrier, Bonnie the Brave.

3 CAMERA MODELS

Third-person perspective

The camera usually follows the avatar, but allows the player to see the sides of the character as it turns (FIGURE 1). It also means that the player cannot see obstacles in the avatar's path because they are behind the camera. The player can use the assigned controls to move the camera around the avatar and focus on it in the center of the screen.

First-person perspective

These objects can intrude between the character and the camera, effectively blocking the player's view. This way, the player can see the game world around the character in any situation. The manual control can assist the player and prevent frustration if the camera does not behave optimally.

The first-person perspective with an immersive depth-of-field effect in "The Elder Scrolls V: Skyrim" (11). With first-person cameras, players feel that aiming and using ranged weapons is easier and more convenient. First, the player's point of view exactly matches the avatar's point of view, meaning that the difference between the player's perspective and the avatar's perspective does not need to be corrected.

Second, the avatar's body does not block the view of the player in any way, allowing the player to see clearly. It is easier and more accurate to position the character during combat in first-person mode. The player's sense of the character's personality and mood may be diminished, as her body language and facial expressions cannot be seen.

Platforming and jumping is easier if the player can see the avatar: timing perfect jumps can be a problem in first-person models.

Aerial perspectives

A player preparing to block a melee attack in "The Elder Scrolls V: Skyrim". 11) The model also has its weaknesses. Certain types of gymnastic and athletic movements are also difficult to perform in first-person perspective. An isometric perspective in "Transistor" showing the player and multiple enemies within a limited encounter area.

4 DESIGN REQUIREMENTS

  • Basic gameplay behavior
  • Specific situations
  • Player adjustments
  • User interface elements

It would also limit visibility during gameplay, as minor changes to the character's movement would also move the camera. The camera should provide the best possible view of the direction of movement and the surrounding game world to ensure a satisfying gaming experience. In practice, this means that the camera must be able to see each side of the character when she moves.

In addition to general behavior, the camera must be aware of its surroundings. Sometimes, the player will encounter situations that require the camera to change its behavior. In case of falling, it's good to show this to the player by doing something with the camera in addition to other indicators.

In Bonnie the Brave, if the player falls down, the camera must move from following Bonnie to above her and look directly down as she falls. For example, the platform on one side of a wall can be much better for the player if the camera is further away and shows the entire section from the side. Players will be able to rotate the camera around Bonnie using the right analog stick on the controller.

The player can look at the map and move over it by moving the camera.

5 CREATING THE CAMERA SYSTEM

Scripting the third person camera

  • General logic
  • Camera movement
  • Manual control and interactivity
  • Collision detection

When the character enters a wall-jumping section in the game, the camera switches to a fixed state or a WallsidePlatforming state. The camera continues to pan above the player and look down at the top of the characters head as it falls below. In the normal state, the first thing to set is the target position of the camera.

Because the target position calculation is derived from the character's transformation, the camera will always look at the character's back, resulting in very stiff movement. Visualization of the parameters used in calculating the target camera position in each frame. If the player does not control the camera position manually, the camera is still able to orient in the direction of the character's movement quite well.

To ensure smooth motion, the camera will need to move smoothly to the target position on each frame. This completes the update loop for the main functionality of the normal state camera for movement, rotation and general orientation. For example, the camera looks at the back of a character while they are standing on a ledge facing away from the fall.

To prevent the character's face from being 1 millimeter from the lens and blocking the view, the camera will move upwards (PICTURE 11).

Testing

A visualized cross-section of the camera moving up along the y-axis (left) and a camera view from a similar in-game situation (right). If the player still insists on moving towards the wall, the camera will quickly reverse its position behind the character and normalize the view for the player. This can also prevent the camera from jamming, moving in odd ways, or obstructing the view in tight spots.

When the character descends stairs or a hill, the camera gets very close to the ground, which again does not provide the best necessary view for the player. If the camera gets too close to the ground, it will reposition itself by moving directly upwards. Another thing that was added at the end of the development phase was to disable manual camera movement when the camera collides with something.

In these situations, moving the camera seemed to cause strange behavior and sticky motion. As for the camera, it was difficult to get the specific WallsidePlatforming condition to work adequately. Due to the nature of the levels, operability was not satisfactory and time ran out for the task.

Fortunately for the camera component, it is possible to test without playing the game, so it was well tested in many conditions.

6 ENEMY TARGETING

Design parameters

If the player leaves the gadget active and shoots the target and destroys it, the system should automatically lock onto the second closest target in the group (FIGURE 12). The current locked target is visualized by a beam of light from the character to the target object. In consensus: the targeting system must detect single objects and groups of objects and quickly lock onto the desired target.

The player cannot aim at it manually, but can control the general direction of aiming by controlling the camera.

Choosing the best method

  • Raycast sweeps and SphereCast
  • Triggers

Unity's camera class has a ViewPortPointToRay method that creates a ray through the point of the camera's viewport. However, one simple beam will not be enough, since the aiming system must detect several targets at once. The feature would be the easiest solution to use if the player could aim something manually.

Since it is exactly what the aiming system requires, a number of different functions have been created. All of these raycast-based methods could return usable data, but when targeting was active there was a noticeable spike in performance. If the player keeps the gadget active, the component must emit beams and process the hit data every frame.

This is a better way compared to raycasts due to the nature of the targeting system. Therefore, it automatically moves with the camera and responds to the orientation and rotation of the camera. Regardless of which way the player is facing, the aiming system will now automatically work in the intended direction.

If a potential target enters or is within range of the collider, the targeting system will recognize it and act accordingly.

Scripting the Targeting class

Changing the boundaries of the collider makes it easy to adjust the reach and affecting area of ​​the target. This allows the aiming system to adapt to the character's and enemies' possible movement and will always keep the lock on the nearest target (PICTURE 12). In the case of multiple targets, SortTargetsByDistance does the math again next frame and a new target is locked.

When the object leaves the scope trigger, OnTriggerExit is called and the object is removed from the target list. There were no real problems with development, the only hiccups were a few bugs with null references. Best of all, the previously created camera created a shortcut and acted as the base for the component.

Together, the camera component and the targeting component are part of a larger entity called a camera setup. With a good basic camera, more components and layers can be added to the setup if needed. For the scope of the project and this thesis it was not necessary to add more features.

There were plans for a first-person camera mode, and given the way the camera was built, adding the feature wouldn't pose a problem.

7 THOUGHTS AND CONCLUSIONS

Referências

Documentos relacionados

Krita, no date 4.2 Painting the texture in Krita When creating a skybox texture, it is good to create a big image due to the stretching the image is going to go true.. If an image of