Timeframe: 4 weeks
2D Artists: 1
Date: August 2018
INPUT AND MOVMENT
Is a space flight sim. Purpose of project was to build a combat space craft that felt good to control and shoot with.
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
Design: John Walden
UI Artist: Emmanuel Axelsson
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.
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.
Camera rotation matches ShipMover's rotation (at a lerp) and location. The camera is then placed beneath the main GameObject but offsett at a distance behind the player ship (so kind of acts like a spring arm in Unreal).
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.
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.