Space Flight

SPACE FLIGHT

Gameplay Scripting

Game Design

Engine: Unity


Timeframe: 4 weeks


Platform: XBox

Team:

Designer: 1

2D Artists: 1


Date: August 2018

GAME SUMMARY

Is a 3D, full 360 space shooter. Purpose of project was to build a combat space craft that felt good to control and shoot with.

MY ROLE

Gameplay Programming


The challenge of this project revolved around using quaternions and getting the ship to move and rotate 360 in a way that felt natural for the player. I was also heavily focused on game feel and player feedback with controls and general gameplay

THE TEAM

Design: John Walden

UI Artist: Emmanuel Axelsson

INPUT & MOVEMENT

Ship movement was split into 2 systems. PlayerInput and PlayerController. I found this to be an easier way to manage the code and avoid bugs. 

My input script took care of all input, including shooting. 

It was important for the controls to feel intuitive. While playtesting, it felt like both sticks should be used to move the ship. For pitching, I inverted the left stick but kept the right stick as default. This meant that to pitch up or down, the sticks could be moved in opposite directions (left stick pitch overrides the right stick). Somehow this felt more natural rather than moving them both in the same direction.


Of course, after much playtesting, different people required different settings I.E. inverted or not inverted. I think the best way to tackle this would be to provide controller settings.

PLAYER CONTROLLER

Controller script takes values from player input script and sets the desired rotations (yaw, pitch and roll). Each axis was then lerped from current rotations to desired rotations. The lerp values are then used to set rotations on FixedUpdate.

USER INTERFACE

Player ship always fires from the front in the forward direction. I used a raycast to pin point that direction (at large distance). For the aimer UI I used a raycast to find the point of contact (if any)

UI Pivots tilt with the ships as it moves along yaw and pitch. This was kept very subtle.

ENEMY EXPLOSION

Foreach loop through rigidbodies and sets kinematic to false. Because the objects are inside each other, they automatically shoot out in different directions due to collision overlap.