Office Hours: If you need help finding the right resources for your skill level, set up an appointment with me. I'm here to help you succeed!
Course Textbook & Attribution
📚 Primary Reference
Game Development Patterns with Unity 2021 Second Edition
By David Baron
How to Access
📖 Purchase: Available from major book retailers
🏛️ Library: Available at Dulaney Browne Library
💻 Digital: eBook versions available
Note: All course content is adapted and heavily modified from Baron's work. His book provides the foundation for our pattern implementations, customized for the Blade Racer project.
Next Class: C# & Unity Crash Course
What We'll Cover
Quick review of static, events, delegates, and generics
Unity-specific patterns and best practices
Prefabs, ScriptableObjects, and Coroutines
Setting up your first project structure
⚠️ Important Note
We won't spend extensive time on basic programming concepts after this. Make sure you're comfortable with fundamental C# and Unity before Week 2!
✓ Best-in-class Unity integration - Purpose-built for Unity development
✓ FREE for students - Full professional license with your OCU email
✓ Advanced debugging - Built-in Unity debugger and profiler
✓ Intelligent code completion - Unity API autocomplete and suggestions
✓ Powerful refactoring - Rename, extract, and restructure with confidence
VS Code Alternative: While I'll be demonstrating with Rider, VS Code is also acceptable.
Both will work fine for this course - choose what works best for you!
Go to Edit → Preferences (Windows) or Unity → Settings (Mac)
Select External Tools in left sidebar
Click dropdown for External Script Editor
Select Rider from the list
If not listed: Click "Browse" and navigate to Rider installation
Windows: Usually C:\Program Files\JetBrains\Rider\bin\rider64.exe
Mac: Usually /Applications/Rider.app
Enable "Regenerate project files" (recommended)
Click "Regenerate project files" button
Test It: Double-click any C# script in Unity - Rider should launch automatically!
Our Project: Blade Racer
Game Overview
A futuristic arcade racing game where the player controls a turbo-charged motorcycle across an obstacle course.
The race track is built on a railway system where players can steer between rails to avoid obstacles and collect power-ups.
Core Gameplay Elements
🏍️ High-speed motorcycle racing on a rail system
🎯 Dodge obstacles and collect power-ups
⚡ Turbo boost system with risk/reward mechanics
🔧 Vehicle upgrade system
🎮 Third-person camera following the action
Blade Racer: The World
Year 2097
Humanity has mastered Earth and set sights beyond the solar system. With peace and technology solving all challenges,
collective boredom sets in. Enter Neo Lusk, a tech entrepreneur who invents a dangerous new sport:
turbo-charged motorcycle racing through deadly obstacle courses.
Only those with nerves of steel and reflexes as sharp as a blade can master this sport.
Even arcade games benefit from narrative context - it gives meaning to gameplay and triggers player imagination!
Blade Racer: Core Systems
🛤️ Rail System
Four-track navigation system with dynamic obstacle spawning
🎲 Risk System
Rewards close-call dodges with bonus points
⚡ Turbo Boost
Speed system with reduced handling trade-off
🔧 Upgrade System
Weapon attachments and vehicle modifications
Each system will be implemented using professional design patterns!
What Are Design Patterns?
Design patterns are reusable solutions to common software development problems.
Origin Story
Architect Christopher Alexander originated the concept for building architecture.
In the late 1980s, software engineers adapted these concepts to programming.
The classic "Gang of Four" book Design Patterns: Elements of Reusable Object-Oriented Software
became the foundation of modern software patterns.
Our Focus: Practical application in Unity game development, not academic theory!
Why Design Patterns Matter
✅ With Patterns
Code is reusable and modular
Easy to maintain and debug
Team communication is clearer
Scales to larger projects
Professional-quality architecture
❌ Without Patterns
Spaghetti code everywhere
Bugs multiply with changes
Hard to explain to others
Breaks at large scale
Difficult to extend features
Bottom line: Patterns help you write code that doesn't make you cry when you revisit it 6 months later!
Design Patterns This Semester
Foundational Patterns
📋 Core Patterns (Chapters 4-8)
Singleton - Game Manager implementation
State - Character state management
Event Bus - Managing game-wide events
Command - Replay system implementation
Object Pool - Performance optimization
Design Patterns This Semester
Behavioral & Structural Patterns
📋 Intermediate Patterns (Chapters 9-13)
Observer - Decoupling components
Visitor - Power-up system implementation
Strategy - Enemy AI behaviors
Decorator - Weapon system upgrades
Spatial Partition - Level editor optimization
Design Patterns This Semester
Alternative Patterns
📋 Alternative Patterns (Chapters 14-16)
Adapter - System integration and compatibility
Facade - Simplifying complex subsystems
Service Locator - Managing dependencies
Real-world Application: Each pattern will be implemented as part of the Blade Racer game system!
How This Course Works
Weekly Structure
Lecture: Learn a design pattern and its use case
Implementation: Code the pattern in Unity for Blade Racer
Testing: Verify the pattern works correctly
Iteration: Refine and integrate with other systems
Theory (30%)
Understanding the pattern's purpose and structure
Practice (70%)
Hands-on implementation in Unity/C#
Example: Singleton Pattern
// Without Singleton - messy!public classPlayer : MonoBehaviour {
GameManager manager; // Have to find this everywherevoid Start() {
manager = GameObject.Find("GameManager").GetComponent<GameManager>();
}
}
// With Singleton - clean!public classPlayer : MonoBehaviour {
void Start() {
GameManager.Instance.StartGame(); // Direct access!
}
}
Result: Cleaner code, easier access, guaranteed single instance
Assessment Overview
Weekly Assignments
Implement patterns in your Blade Racer project
40% of grade
Midterm Project
Integrated game systems with multiple patterns
25% of grade
Final Project
Complete Blade Racer with all patterns
35% of grade
Portfolio Bonus: This project will be a strong addition to your professional portfolio!
Before Next Class
Required Setup Tasks
Install Unity 2021.3.45f2 LTS from archive builds
Apply for free JetBrains educational license (use @my.okcu.edu email)
Download and install Rider
Configure Unity to use Rider as external script editor
Create a Unity Hub account (free)
Review C# basics if needed (learn.unity.com)
Optional Preparation
Browse the Unity Junior Programmer pathway
Review delegates and events in C#
Explore the Unity Asset Store
Familiarize yourself with Rider's interface
Using VS Code instead? That's fine! Just make sure you have the C# extension installed and configured for Unity.