Unity RPG Course - Section 3 - Modifiers And Abilities
Welcome to Section 3 of the Unity RPG course – the full course is part of a Kickstarter campaign which was over 200% funded. You will benefit from the fact we have already taught over 360,336 students game development, many shipping commercial games as a result.
Customise character abilities, weapons, characters and enemies. This includes multiple damage types, modifiers, sounds, animations. By the end you can create your core combat experience.
You're welcome to download, fork or do whatever else legal with all the files! Please note that future sections contain assets with commercial use restrictions. The real value is in our huge, high-quality online tutorials that accompany this repo. You can check out the course here: Unity RPG
In This Section
How To Build / Compile
This is a Unity project. If you're familiar with source control, then "clone this repo". Otherwise download the contents, and navigate to Assets > Levels
then open any .unity
file.
This branch is the course branch, each commit corresponds to a lecture in the course. The current state is our latest progress.
Lecture List
Here are the lectures of the course for this section...
1 Section 3 Introduction
- What’s coming in this section.
2 Design Planning And Decisions
- Review and update your WBS
- CHALLENGE
- Decide on next priorities
3 Your Game Design Document
- GDD Template And Our GDD
- CHALLENGE
4 Unity 5.6 And VS Community 2017
- My chosen options for upgrading to Unity 5.6
- Review Unity's release notes
5 Using Namespaces In C#
- What a namespace is and why it's useful
- How to use namespaces in C#
6 The Animator Override Controller
- Fixing a possible projectile bug
- What is an Animator Override Controller?
- How to override animations at runtime
7 Protecting Our Interfaces
- The hidden dependency in our asset pack
- How to prevent animation events breaking code
- Challenge: Apply animations to weapons.
8 Untangling Standard Assets
- Taking control of our animations
- Drawing out our dependencies
- Taking control of Standard Assets
9 Trigger Animations From Code
- Refactor our Player class
- Move properties from Player to Weapon
10 Triggering Audio On Radius
- Review AudioTrigger.cs from Gist
- Set-up and test sound trigger prefab
- How to source your audio clips
11 Terrain Optimization
- Performance issues from terrain
- Challenge: Tune terrain settings
12 Our First Dialogue
- Our level's requirements
- Pitch shifting a character
- Challenge: create your dialogue
13 Tasks And Bugs
- Our bug fixing workflow
- Bug tracking and task scheduling
- Challenge
- Lets fix some issues
14 Placing Props
- Tidy up scene and import new assets
- Challenge: Place props in your scene
15 Weapon Design
- Quick look at visual improvements
- Weapon damage design
- Prototype requirements for weapons
- Adding a third weapon and tuning all three
16 Changing Your Skybox
- Lets investigate our scene lighting
- Import and set up a new skybox
17 Bridges And Navmesh
- Desired bridge look and navmesh issue
- Create your bridge
18 Enemy Mesh Antics
- Import and set up new character meshes
19 Adding An Energy Mechanic
- Unity 5.6.1 upgrade, Mac differences
- Extending the player by composition
20 Extension By Composition
- Setup a new delegate in CameraRaycaster
- De-bounce the right-click button with
GetButtonDown
- Subscribe to event in new
Energy.cs
class - Reduce energy on each right click
- Update the energy bar.
21 Detecting By Layer In 3D
- How to use source control to keep refactors honest
- Our new
CameraRaycaster
architecture
22 Simplifying Click To Move
- Adding
onMouseOverPotentiallyWalkable
event - Removing our custom editor script
- Ensuring click to move still works.
23 Simplifying Click To Attack
- Remove
CursorAffordance.cs
altogether! - Remove the
CameraRaycasterEditor
editor script - Implement move to enemy on power attack
- Simplify the
CameraRaycaster
,Energy
andPlayerMovement
24 Player Choice In Combat
- What are the choices the player can make in your combat?
- Types of Special Abilities
- Where to start with implementation
25 RPG Special Abilities System Overview
- Abilities require serialisable data AND behaviour
- We can only serialise MonoBehaviours via prefab or scene
- This causes more contention on those files, and is wrong place
- A ScriptableObject moves ability config data to a .asset file
- ... but SOs cannot interact with the world
- so the Ability also needs a MonoBehaviour
- One ability can have multiple configs
- Therefore make the config add the behaviour component at runtime.
26 Storing Special Ability Config data
- Setup an 'ISpecialAbilty' interface
- Use an abstract class to create
SpecialAbilityConfig
- Inherit 'PowerAttackConfig' from this new abstract class
- Provide right-click asset menu to create new special ability.
27 Making A Class Single Purpose
- Remove
pointsPerHit
from ourEnergy
component - Move right-click handling to the
Player
- Prepare to read energy cost from special ability.
28 Implementing Power Attack Behaviour
- Fix a bug with our AudioTrigger component
- Make it possible for the player to equip several abilities
- Use a protected property to reference
behaviour
component - Use this property to forward calls to
Use()
to the component.
29 Using Structs For Parameter Sets
- Combine top-level special ability code into one file
- Create a struct to pass ability use parameters
- Finish Power Attack behaviour inc energy cost.
30 Create An Area Of Effect Ability
- Describe your challenge
- Introduce
Physics.ShpereCastAll()
API - Demonstrate my Area Of Effect solution.
31 Regenerating Energy Over Time
- Why we're not using coroutines yet
- Challenge: make energy regenerate over time
- Fix enemy sliding bug (and extra animator).
32 Game Feel Intro
- The importance of game feel
- What things to look for with your audit
33 Game Feel Audit
- Words to describe your game feel
- Examples of poor game feel
- Tuning of player to enemy collision
34 Spreadsheet Strategy
- A structure for approaching your spreadsheet design
- Specific implementation of some "Soul" aspects
35 Spreadsheet Spine
- Different options for progression
- Progression theory and preferences
- Populating our spreadsheet's spine
36 When Mouse Leaves Game Window
- Detect when the mouse is in the game rectangle
- Stop raycasting when the mouse is over Unity editor UI.
37 Coroutine For Death Sequence
- How to test if the player is dead
- Use an
IEnumerator
coroutine for timing - Use
WaitForSecondsRealtime()
method.
38 Player Damage & Death Sounds
- Add an array of damage sounds
- Add a single death sound (for now).
39 Player Death Animation
- Fix health bug
- Implement death animation
- Projectile firing rate variation?
40 Using Image Fill In UI
- Import brand-new HUD graphics
- Make liquid effect health and energy
- How a "Filled" image works
- Use "Fill Amount" property to animate UI.
41 Adding Special Ability UI
- Adding special ability icons to slots
- Fixing bug with game window resizing.
42 Level Design Paradigms
- Discussing our current Linear approach
- Introducing a range of level design paradigms and what they could mean for your game.
43 Level Design Choice
- Challenge: add choice to your level
- Review our current level for ideas on how to add more choice.
44 Assets And Improvements
- Updated grass textures
- New free assets as part of student pack from Synty
- Synty particle pack
45 Particle Effects Intro
- Particle effects overview
- Where to use particles - a review of Torchlight 2
- Where we will add particles to our game
46 Glowing Dust Effect
- Create an ambient particle effect in the world
- Have the particle effect follow the character
47 Spawning Particles At Runtime
- Create particle system prefabs for special abilities
- Access prefabs from our scriptable objects
- Trigger particle systems at runtime in C#
- How to destroy a particle when it has finished playing.
48 Self Heal Special Ability Challenge
- Create a self-heal special ability yourself.
49 Triggering Special Abilities From Keys
- Adding key affordances to the UI
- Scanning for number key presses
- Triggering and tweaking special abilities.
50 Finishing The Self Heal Ability
- Separate damage and healing methods
- Add sound triggers to all abilities
- Tantalise idea of changing interface to inheritance
- Parent healing particle system to player.
51 Critical Hit And Weapon Bonus
- How to count lines of code added
- Adding additional weapon damage
- Adding critical hit calculation & particles.
52 AOE Particle Effect
- Creating particle systems within particle system
- Alter rotation of emission
- Use burst emission
- Tune and tweak particles
53 Self Heal Particle Effect
- Create plus symbol texture for a different look
- Implement self heal particle system
54 Section 3 Wrap Up
- We now know what our game will be, so its time to shift gears.
- Well done on your great work so far!
That's it, in the next section we will be adding the final features, refactoring and making our core combat fun.