Deliverone

TEAM
Deliverone FutureGames Game Project 1
Category

Team Projects

Year

2020

Context

FutureGames Game Project 1

Tools

Unity, C#

My Responsibilities

Pickup System, Weapon System, High Score System

Team Members

Artists
Samantha Baqvel
Lena Fredén
Roberto Marcos Söderström

Programmers
Oliver Lebert
Henrik Nilsson
Jupiter Thulin

Designers
Robert Arnborg
Damian Becedas
Sean Falk

Music
Robert Arnborg

TL;DR

Deliverone was my first ever project at FutureGames, and also my first team project. For the knowledge I had at the time, I’m really impressed how well everything went. The game turned out great, we had amazing teamwork as well as great game design. I worked mainly on the weapon systems (used for both players and enemies) as well as the pickup system, which includes the spawn points for the pickup, the attachment to the player, the drop mechanic and the scoring system.

Project Breakdown

Introduction

Deliverone is a third-person, delivery, dogfighting game where the player needs to deliver packages quickly and safely to various customers. While transporting goods between skyscrapers in the futuristic city of Botham. The player must protect their cargo from incoming enemy fire while still living up to the customer’s extremely high delivery time expectations. (Because who in the future can afford to wait for more than a couple of minutes to receive their online orders?).

The player will have to switch between two widely different movement systems to complete the task at hand: A swift, jet-style movement to traverse the city quickly and engage in dangerous dog fights with rivaling drones, or a hovering, helicopter-like movement style to be able to carefully pick up and drop off packages. Essentially, mimicking the functionality of a VTOL-aircraft.

The player scores more points by delivering the packages in good condition and as quickly as possible. Additionally, the player can rack up bonus multipliers if they take down enemy drones in the process. If the package takes enough damage or is not delivered on time, then the player receives a “strike”. Three strikes and the game is over.

I worked on this project together with 8 other very talented teammates as our first game project at FutureGames over a period of two weeks. I learned a lot during the project, but above all, I had the honor of experiencing a project where the teamwork worked really well. Because I felt that most team members cared about the end product and were motivated throughout the project.

The Gattling Gun

A system that I spent some time deciding how to solve was the gattling gun, more specifically when the gattling gun is attached to the player. Since we were using a third person camera, how would I make sure that the bullets got fired where you actually pointed your mouse even though the bullets get spawned at the ships barrels and not the camera? Henrik had actually already made a system that converted the mouse position to a world position by raycasting against a sphere that was attached to the camera. So I based the shooting logic of of that.

Ship target Edit

The blue wireframe sphere is the sphere that Henrik used for the player movement (to decide which way to turn depending on where the mouse is on the screen). The transform gizmo is the “new target”, the new target has the same position as the “target” but with a forward of the vector between the camera and the target as opposed to the player and the target. The red line represents the delta between the target and the camera while the green line represents the delta between the player and the target.

The problem now is that these two lines shoot off in two different directions. The red line is the actual direction the bullet should be shot in, but the green line is where the bullet will come from (as to not look weird if it just spawned from the camera). So what I came up with is to use MoveTowards to move the bullet to the new target, and once there I shoot it in the direction of the new target forward.

It worked out great in the end, it looks good and it shoots out in the correct direction. It can however be a bit hard to aim correctly so if I would revist it in the future I would add some form of aim assist to make it easier to hit enemies.

[code lang=”csharp”] // In GattlingGun.cs
public void Awake()
{
_target = GameManager.Instance.playerTarget;
_cam = GameManager.PlayerCamera.transform;
_newTarget = new GameObject().transform;
_newTarget.name = "New Target";
_newTarget.parent = _target;
_newTarget.localPosition = Vector3.zero;
_newTarget.rotation = _target.rotation;
GameManager.Instance.newPlayerTarget = _newTarget;
}
void Update()
{
Vector3 forwardDirection = (_target.position – _cam.position).normalized;
Vector3 upDirection = Vector3.Cross(forwardDirection, _target.right).normalized;
_newTarget.rotation = Quaternion.LookRotation(forwardDirection, upDirection);
if (fire && Time.time – _timeOfLastShot > cooldown)
{
_timeOfLastShot = Time.time;
GameObject currentShot = ProjectilePool.Instance.GetPooledObject(ProjectileType.GattlingProjectile);
currentShot.transform.SetPositionAndRotation(gunBarrel.position, Quaternion.identity);
currentShot.SetActive(true);
currentShot.GetComponent().Initiate();
}
}
// In Projectile.cs
public void Initiate()
{
_newTarget = GameManager.Instance.newPlayerTarget;
_transform.parent = _newTarget;
_correctCourse = true;
StartCoroutine(DelayedDeactivate());
}
void FixedUpdate()
{
if (_correctCourse)
{
if (Vector3.Distance(_newTarget.position, _transform.position) > minDistanceFromRay)
{
_transform.position = Vector3.MoveTowards(_transform.position, _newTarget.position, correctCourseSpeed);
}
else
{
Debug.Log("Course corrected");
_transform.parent = _projectilePool;
_transform.rotation = _newTarget.rotation;
_rb.velocity = projectileSpeed * transform.forward;
_correctCourse = false;
}
}
}[/code]