Phantom Focus

Keyfacts:

Engine: Unity
Platform: PC (Windows)
Controls: Keyboard

Genre: FPS / Spooky Combat
Perspective: First person
Setting: Haunted mansion
Style: 3D cartoon-stylized


About the Game:

Assuming the role of a trapped photographer, players must document and banish all ghosts residing in a spooky mansion. While exploring the villa and examining various pieces of furniture, different types of ghosts will begin to roam the rooms. 
As they seek to keep their human-free home, battles will ensue and dodging attacks can be tricky due to the layout of the environment. To fight back, players align with the photographer’s nature, as each photograph retains some of the ghost’s essence, weakening them, depending on the image’s quality.
Players can rely on the ‘Paran-O-meter’, containing a minimap, displaying the actively roaming ghosts in close proximity and number of active ghosts, to keep an overview of the situation. Their own health is reflected via battery percentage in the top right.
The game is won when all the ghosts are defeated, and lost when the tables are turned!


My tasks:

Ghost spawning & adjustable randomization:
To meet the game designers request for a maximum of adjustability in level design and securing a seemingly random experience on each play through, multiple scripts were adjusted accordingly.
Each room’s minimum and maximum number of ghosts can be set, also containing an automatically populating list of all objects able to spawn specters.
The GhostSpawnManager enables the game designers to set the allover amount of ghosts, that automatically corrects in comparison to the rooms sums of min and max numbers, if need be. To lower performance, implementing the object pooling pattern was necessary. The different furniture prefabs contain the Interactable script, containing a list of potentially spawned ghost types as well as their local relation to the object.  In the level, the potential to spawn ghosts can then be manually adjusted with a simple toggle for each item.
All this allows varying numbers of ghosts per room,within the limits, as well as objects randomly choosing the ghosts they contain from a list- and thereby different playthroughs.

Damage & score calculation:
To assure that damage increases the closer a ghost was to the photos center and facing towards the camera, meant comparing the specter’s transform against the players.
Therefore, the CameraFlash script takes the current position and rotation of the player and ghost when the picture is taken, analyzing it in two steps.
First, it checks if the ghost’s on-screen position is within the visible limits of the camera.
If so, it then checks the y-angle of the player and ghost relative to each other, and adjusts the damage multiplier according to different increments of difference.
Finally, it calculates the amount of damage done and applies it to the ghost, and score.
This is done for all active ghosts, so multiple ghosts can be damaged with one snapshot.

Ghost movement & restrictions:
In order to ensure that the spirits neither leave the rooms in which they reside, nor fly invisibly into the players, their navigation had to be restricted.
To do this, they the room provides them with randomly generated targets within the allowed areas when they reach their last set destination. 
When invisible, they will also check their distance to the player – and if they get too close, they will choose another target until they become visible again.

Adjustment manual of GhostSpawnManager & related scripts for game designers

Paran-O-meter:
To keep track, the Paran-O-Meter includes a minimap showing the positions of active ghosts within a certain distance and indicates the number of banished ghosts via a varying number of icons above.
A second camera was set up to hover above the player and rotate y-wise with them, to ensure that the minimap accurately reflects the situation, no matter the direction. A radar image, background and ghost icons were added and set to only be visible on the second camera’s special layer. The ghost icons were placed on top of the ghosts and will rotate to match the angle of the second camera in each frame. They activate according to the number of active ghosts and gray out with each banishment.
Projecting this view onto a UI element guarantees that no miscalculations will occur.


Changed plans:

Photo album:
Originally, the idea was to have an album of the photos taken, with a score and a ranking of the best three. It would also have included a lexicon of sorts, with information on the different types of ghosts, their attacks and where to find them. Due to the limited production time, this feature was cut early on.

Shop System:
Because the game can be played with a keyboard and dance mat, it was limited to the supported platforms. To expand and make it accessible on mobile devices, touch controls would have had to be added, as well as a regular controller.

Varying difficulty:
To prevent players from getting bored, different difficulty modes should offer more challenges. This would not only increase the number of ghosts in the mansion, but also determine the types of ghosts that would spawn to combine in different formations. Again, time called for the feature axe.

Call to action:
As the game is very relaxed and does not put any pressure on the players to complete the task, ideas arose to encourage them to act. The first was to implement a time limit, to set a deadline by which the players would have to banish all ghosts.
Another idea was, that if the ghosts were not defeated within a certain timeframe, they would go back into hiding and regain their full strength, while players would not be able to heal.
There was also discussion about having ghosts spawn without player interaction, a certain time after entering a room.
As it was not easy to agree on the method and implementation, the issue was postponed and eventually declared a nice-to-have, which ultimately did not make it into the realized scope of the current game.