0% found this document useful (0 votes)
17 views5 pages

Tank Game Development Assignment Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

Tank Game Development Assignment Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MSIM 408/508 & ECE 407/507

Introduction to Game Development

Programming Assignment Four


Tank Game
Assigned March 20th, Due 12:00 PM April 17th

1. Overview
Realistic 3D objects and interactions are perhaps the most appealing elements of
contemporary video games. Modeling and representation of complex 3D objects and
their interactions require in-depth understanding of many theoretical concepts, such as
linear algebra (especially affine transformations), game physics, and particle systems.
Affine transformations, such as scaling, rotation, and translation, are implemented as
matrix operations in 3D graphics libraries. Quaternions are used in Unity extensively to
represent rotations. Game physics including collision detection ensures game objects
move realistically and maintain proper distance against each other. Particle systems are a
computer graphics technique to simulate phenomena that are difficult to model using
conventional techniques, such as fire, smoke, and explosions.
In this programming assignment, you will create an engaging 3D battle game that
involves a tank controlled by the player and other still or moving objects (e.g., vehicles,
buildings, or soldiers) in a battlefield. The player controls the tank's steering, moving,
turret rotation, cannon angle, and firing. The overall goal of the game is to avoid enemy
fire and destroy enemies. You must create at least two cameras: one for the entire scene
and one third person camera following the tank. For extra credits, you can create moving
enemy tank(s) that are controlled by the computer.

2. Objectives
Upon successful completion of this programming assignment, you shall possess the
following new skills in addition to the ones you have learned so far in this course.
 Understand 3D models and their structures, local and world (global) coordinate
systems and conversions between them.
 Understand 3D model formats and conversions.
 Understand the overall architecture and operations of Unity game engine.
 Use the physics engine in Unity.
 Create multiple cameras.
 Use customized collision detection.
 Use quaternions to compute rotations and orientations.
 Generate prefabs.
 Generate particle systems.
 Use sound effects.
 Generate terrain in Unity.
 Write scripts in C# using the following classes.
o MonoBehaviour
o GameObject
o Vector3

1
o Rigidbody
o Transform
o Quaternion
o Input
o AudioSource
o Collider
o Camera
o Application

3. Tasks
The following tasks are required.
1. Design a battle scene that has at least the following objects.
a. Terrain. Use the Terrain tool in Unity to generate the terrain with a
minimum size of 200 m × 200 m. Attach texture(s) to the terrain.
b. Tank. You must use the tank model provided by the instructor. You need
to generate a collider for the tank. A box collider is recommended for the
tank.
c. Still objects such as buildings and trees and your enemies are hidden in
these objects. You can generate the models in Unity or obtain the models
from other sources as described in next task. Generate necessary colliders
for most objects in your scene.
2. Obtain free or paid (at your own cost) 3D models from various sources. The
following are some suggestions.
a. Unity Asset Store
b. [Link]
c. [Link]
3. You need to use standard exported 3D files. Unity supports FBX, dae (Collada),
3DS, dxf, and obj files, you need to convert your 3D models to one of these
formats if necessary. You can use the following tools to convert your 3D models.
a. Google SketchUp Pro (You can have 8 hours of trial use)
b. Autodesk Maya (free for students)
c. Microsoft Visual Studio
4. Generate an overhead camera that captures the entire scene and a third person
camera for the tank controlled by the player. The two camera views can be
switched by pressing the F(f) key.
Game play
5. The overall goal is to shoot your hidden enemies, which can also shoot you from
different locations.
6. The player controls her/his own tank using the following keys: W (move
forward), S (move backward), A (turn left), D (turn right), Left (rotate turret left),
Right (rotate turret right), Up (raise cannon), Down (lower down cannon), Space
(fire).

2
7. Write a script to control the tank movement. Note that front and rear wheels have
different sizes and thus they must rotate at different speeds. The front (steering)
wheels must not deviate from their central positions for more than 45 degrees.
Similarly, the cannon must move in the range from its reset position to 90 degrees
vertically. The tank’s orientation is controlled by the front wheels and the tank’s
movement is very similar to that of a car, e.g., the tank can only turn when the
tank is moving, while the front wheels can turn when the car is still. The tank’s
longitudinal movement must be in synchronization with the wheel rotation. In
other words, the tank must not appear sliding without enough wheel rotation or
stalling with too much wheel rotation.
You need to attach a Rigidbody to the tank and move the tank using
[Link]() and [Link]() methods in the
FixedUpdate() in the tank controller. Using Rigidbody instead of Transform to
move the tank produces correct physics interactions between the tank and other
objects. Also, do not move the tank by adding forces. Note that you cannot use
the Wheel Collider provided by Unity in this assignment. Refer to the Unity
Tanks! Tutorial for the overall movement of the tank.
8. The shells fired by your tank (by pressing spacebar) should follow a trajectory
determined by a projectile motion. Enemy fires can follow projectile motions or
straight-line motions depending on their ammunitions. Add sound effects for the
shells and enemy ammunitions.
9. Write a script to control the enemy fires. Enemy fires occur only when your tank
appears within a certain range from the enemy in terms of distance and direction
(angle). Enemy fire speed and frequency should be adjustable as well.
10. When an enemy fires a bullet, the orientation of the bullet must be consistent with
its traveling direction, i.e., its motion must be longitudinal.
11. Generate a Unity prefab for the tank shells and use that prefab in your game.
Similarly generate prefabs for other necessary game objects.
12. Use particle system to simulate the fire and smoke in shell explosions.
13. Your tank has a life of 20, that is, it will die after being shot for 20 times. Your
enemies only have a life of 3, that is, they will die after being shot three times.
14. Display the lives of the player (tank) remaining and press key R(r) to restart the
game.
15. Generate different folders for different types of assets in your games.

The following tasks are required for students registered in MSIM 508/ECE 507.
16. Design and implement at least two scenes with different levels of complexity and
difficulty.

The following tasks are optional for extra credits and the exact number of points is
dependent on the complexity of your implementation.

3
17. Moving enemy objects (including at least one enemy tank) than move and fire and
are controlled by the computer.

4. Code (65 points)


Exercise good coding practices, such as naming variables meaningfully and properly,
including comments of key classes, variables, functions, and code segments, and using
proper indentations and spacing between tokens (e.g., variables, operators). Points will
be deducted for lack of comments or bad formatting (e.g., no indentation or large blank
spaces in the code). The following is the grade allocation for different tasks or
functionalities of your program.
 Tank movements: 25 points
 Collision detection: 10 points
 Camera views: 5 points
 Shell projectile motion: 5 points
 Enemy fire: 5 points
 Particle systems: 5 points
 Game scene: 10 points

5. Report (35 points)


The report should contain at least the following sections and use the same formatting in
this assignment description or other professional formats. Points will be deducted for
improper formatting.
 Introduction (2 points): overview of the assignment, such as background,
objectives, and brief summary of what you have done for this assignment. Don’t
repeat the assignment description verbatim.
 Game Design and Implementation (10 points)
o Briefly describe the key components in your game.
 Scenes
 Key 3D models, animations, and prefabs
 Other key assets or elements in your game
o Use doxygen to generate the documentation (help) file for your code,
including all classes, class variables, class methods, and internal
implementations of critical methods, for all types of access modifiers
(public, protected, and private). Your documentation should include
source code, class diagrams, call graphs, and caller graphs. Your
documentation should be contained in a single .chm file.
 Results (15 points): Describe what you have done for each task specified in
Section 3: Tasks. Include results and necessary screen captures for each task.
Answer the questions in the task if any.
 Conclusion and Discussion (3 points): Discuss your accomplishments, learning
outcomes, and difficulties and how you can do better for this assignment. Feel
free to discuss other relevant topics (e.g., the numbers of hours you have spent on
this assignment).
 Recorded Videos (5 points). Produce a video that demonstrate a full play of
your game.

4
6. Deliverables
You need to compress your entire Unity project, report, and screen recording videos and
compress them into one single file and name it following the requirement specified in the
lecture "Course Introduction", Slide 42. Submit the compressed file to Blackboard.

Common questions

Powered by AI

The assignment's guidelines are structured to incrementally build a comprehensive skill set in game design and programming by covering multiple aspects of game development. By guiding students through creating 3D models, applying physics through Unity's engine, and implementing interactive gameplay elements, the assignment provides a hands-on learning experience . Tasks like designing scenes, scripting behaviors, and managing resources like cameras and sound effects are reflective of real-world game development scenarios. The emphasis on using quaternions for rotations, particle systems for effects, and prefabs for object management ensures that students gain knowledge in both theoretical and practical aspects of game design . Additionally, the requirement for proper documentation and coding standards prepares students for professional industry settings, making the experience holistic and preparative towards a career in game development .

Integrating sound effects into the tank game assignment aims to enhance realism and immersion by providing audio feedback and atmosphere. Sound effects serve several crucial functionalities: they provide immediate, contextual feedback to actions such as firing shells or receiving enemy fire, helping players gauge the impact of their actions and the presence of threats . Ambient sounds and explosions also contribute to the mood and atmosphere, manifesting the chaotic and tense environment of a battlefield, thus enhancing the player's emotional engagement . Proper use of audio guides player focus and can serve as cues for events occurring outside the player's line of sight, such as approaches from enemies, offering critical gameplay information . This multifaceted role of audio significantly bolsters a game's intuitive and immersive experience .

Scripting is crucial in game development as it defines the behaviors and interactions within the game environment, allowing for dynamic and responsive gameplay. In the tank game assignment, scripting is employed to manage tank movements, turret rotations, cannon firing, and enemy behaviors . Player controls are scripted to ensure that tank movements, such as steering and wheel dynamics, follow realistic physics . Enemy actions are scripted to react based on player proximity, ensuring an engaging AI that adds challenge to the game . This scripting enables gameplay mechanics that are both complex and realistic, significantly enhancing the player's experience and interaction with the game environment .

The strategic placement of enemies and the design of terrain significantly influence gameplay by introducing various elements of challenge, strategy, and engagement. In a tank battle game, the location of enemies can dictate the player's movement and tactical decisions, encouraging strategic thinking to avoid ambushes or find advantageous positions . Complex terrain designs can provide cover, create choke points, or offer high ground, influencing not only visibility and line-of-sight but also the player's navigation and maneuverability. These factors can enhance tension and excitement in gameplay, requiring players to adapt to environmental challenges while planning their engagements with enemy forces . Thoughtful design in these areas can thus lead to a more rewarding and immersive gaming experience .

Using Rigidbody in a Unity-based game, like the tank game assignment, enables the application of realistic physics by allowing objects to respond to physics forces in a realistic manner . The Rigidbody component can calculate interactions such as momentum, gravity, and collisions, which are fundamental to a believable game physics environment. The FixedUpdate() method is specifically designed for rigidbody updates to maintain consistent physics simulation, as it runs at a consistent tick rate that is independent of the frame rate . This results in smooth and accurate physics calculations, such as the rotation and movement of the tank without introducing jitter or inconsistencies .

Particle systems are used to simulate complex visual effects in games that are difficult to achieve with traditional modeling techniques, such as fire, smoke, and explosions . In the tank game design assignment, a particle system can be utilized to create realistic visual effects for shell explosions, adding a layer of realism and dynamism to the game's environment . This not only enhances the visual appeal of the game but also contributes to the overall immersive experience for the player .

Quaternions are important in 3D game development because they provide a way to represent rotations that is free from gimbal lock, a problem encountered with Euler angles where two rotational axes can become aligned and cause a loss of a degree of rotational freedom . Additionally, quaternions allow for smooth interpolation between rotations (slerping), which is beneficial for creating realistic animations in games . Unity uses quaternions extensively due to these benefits, ensuring smoother and more realistic rendering of 3D rotations .

Implementing collision detection in 3D games involves ensuring that game objects interact realistically by preventing them from passing through each other and resolving their interactions when they come in contact . In the Unity game engine, this is addressed by using colliders, which define the physical boundaries of objects, and the physics engine to calculate interactions . For the tank game assignment, a box collider is recommended to ensure efficient collision detection for the tank while generating necessary colliders for other objects in the scene . Proper implementation of collision detection enhances the realism and plays a crucial role in gameplay mechanics, such as responding accurately to hits and impacts .

Prefabs in Unity are useful for reusing objects with defined properties and behaviors across a game, promoting efficiency and consistency. In the context of the tank game, utilizing prefabs for tank shells and enemy projectiles ensures that these objects maintain uniform characteristics such as appearance, physics behaviors, and interactions . By using prefabs, developers can instantiate multiple copies of shells or projectiles efficiently, ensuring they behave consistently upon firing or impacting other objects. This reduces repetitive work and helps manage the game's resource consumption, improving performance . Prefabs also simplify updates and changes, allowing developers to modify a single prefab that globally affects all instances throughout the game .

Switching between two camera views, such as overhead and third-person, provides players with different perspectives that can enhance strategy and immersion in gameplay. In a 3D tank game, the overhead view allows players to see the entire battlefield, facilitating strategic planning by understanding the spatial layout and enemy positions . Conversely, the third-person camera follows the player's tank, offering an immersive experience by allowing players to see their controlled unit's immediate environment and focus on direct maneuvers. This flexibility in perspective can improve a player's ability to adapt to various game scenarios and enhance overall engagement .

You might also like