Spoofro the fake dragon
Learning Unity by remaking a classic
Intent
Goal
Software
Improve: C# programming skills, developing in Unity3D.
A remake of the original Spyro game.
Skills improved
- Unity Engine
- Visual Studio
- Blender
- Photoshop
- C#
- Animating (Blender)
- Unity engine life cycle knowledge
- Clean project folder structure
- Character controller
- AI & NavMesh
- Physics & Collisions
- Particle Systems
- Unity UI & render textures
- Unity Audio system
- Math for visual animations
- Debugging Unity project
Learning Unity Engine
What better way to learn a game engine than to remake one of your all time favourite games!
With limited knowledge from tinker projects, I started this project intending to learn the
many tools and possibilities Unity has to offer. Creating a full game would be a great way to
learn everything a modern game requires: Programming functionality, characters, AI, UI, audio,
and more.
The main goal: Recreate the 'Spyro' game as close to the original as possible, with all functionality working as intended.
Graphic resources
Game graphics weren't the goal, so I managed to find an old repository that had some of the original game's textures and models for the environment. I plucked a rigged Spyro model from Sketchfab, and created a jump, attack, ram, and glide animation in Blender. I did not animate the run or walk due to time constraints.
I modelled the gems & wooden chest in Blender, and found the oyster chest and statue models
on the web. Using Photoshop, I made up some UI-textures to use for the menus.
The remaining objects were either going to be made from the primitives Unity provides, or
through particle systems.
Programming Functionality
Programming the functionality was the hardest part. To start, I programmed the character controller. I had to ensure gravity, collisions, bouncing back on walls, and smooth surface-walking. The character had to be able to run, jump, charge, flame breath, glide, and land. This took a while, and required debugging with both a live tool and using breakpoints.
Next up were the pick-Ups and breakable chests. These were straightforward: Activate upon
collision with the character. The gems, eggs and statues would make use of a
Bezier formula to
fly their way to the character, whilst the chests would shake and blow up with a particle
effect.
When the character collected a pick-up, it needed to either up the score or collect
the egg or statues. I created the scripts for the collections while I was at it.
Getting the elevator working was something I had to get some help for, to get the math for correctly rotating the character x amount of times while exiting facing forward. When the big dragon statues were hit by 'fire breath', I gave them the function of shaking and slightly levitating up.
Time for AI. After some research, I found that Unity had a useful NavMesh system. This was
easy to set up: Bake a NavMesh from the model of the floor, and add NavMeshAgent components
to the AI prefabs. I programmed the enemy AI to chase the character if it came within range,
and the egg-runner AI to run along a set path, whilst changing direction when the character
was close.
The remaining AI were the sheep, which restored health when 'eaten'.
UI, Audio & Particle systems
All that was left was the UI, audio and particle systems.
Starting with the audio, I added audio clips I found on the web; and used AudioSources,
AudioListener and an AudioMixer to control the audio. The AudioMixer was vital to have the
UI audio volume slider work.
The particle systems were easily done by using the designated component for it, provided by Unity. All I had to do was add activation events, enable the "disable on finish" option, and tweak the systems to look good.
The UI took quite a bit of work to set up. I had to create a start menu, a pause menu and an
end-screen. I really wanted to come close to the real Spyro UI, with some research I
found 'RenderTextures' would enable me to display rotating 3D models on the UI, just like
the original game. I used the same RenderTextures for the rotating letters on the start
menu.
For the pause menu, I wanted it to slide in from the top, while displaying the collected
items. To round up, I added a master volume slider in the pause menu.
Playtesting
To ensure the game came together nicely, and get rid of any leftover bugs, I spent a good 2 hours playtesting. The few bugs I found were dealt with, and the game seemed to be running smoothly, without any major issues!