Creating a Zombie Apocalypse Action Driving Game In Unity – Devlog #1

Tom McDonald
Updated on:
Action Driving Game

Growing up, I loved watching the classic TV show The Dukes of Hazzard with its high-speed car chases and stunt driving. I also love zombie games and fiction. So, for my new game project, I decided to combine zombies with driving mechanics inspired by my childhood memories of shows like The Dukes of Hazzard and make a zombie apocalypse action driving game.

I stumbled upon the Ultimate Asset Bundle by Ilumisoft and was impressed by their Skill Drive template. Although it didn’t quite have the driving feel I wanted, it piqued my interest in basing a game around fun vehicle physics. After researching options on the Unity Asset Store, I built the core driving mechanics using Arcade Vehicle Physics by Ash Dev. This asset had the movement system I was looking for and worked well with the style of game I wanted to create.

With the idea in my mind for a game centered around mowing down hordes of zombies in a post-apocalyptic setting, I was excited to dive into development. I wanted to capture the exhilaration of running over swarms of zombies in a souped-up muscle car. I also added a timed delivery objective that would give the game purpose to the high-speed runs between cities overrun with the undead.

Task 1: Implementing the Vehicle Controller

One of the first steps in development was finding a starting point for the vehicle physics. I acquired the Ultimate Asset Bundle by Ilumisoft, which featured their Skill Drive template. It provided a good base but didn’t have the driving feel I was going for. I wanted more realistic physics with drift handling, torque, and advanced control options.

After researching options, I decided to use the Arcade Vehicle Physics asset on the Unity Asset store. This provided the robust vehicle physics I was looking for, while still allowing for customization and extension. In particular, I liked how you could adjust the car settings, which let me get the slippery drift look of the car when turning at high speeds.

Overall, the Arcade Vehicle Physics gave me the flexibility I needed while providing solid out-of-the-box vehicle controller. The documentation made it easy to understand and extend the behaviors too. I didn’t have to waste time writing every aspect of driving physics from the ground up. This lets me focus on customizing the feel and control scheme for the high-action stunt driving I envisioned for navigating the terrain.

Arcade Vehicle Physics

Skill Drive – Game Template

Task 2: Adding Rewired Support

I integrated Rewired into the project early to provide robust input options. This middleware allowed me to add multi-platform controller support with minimal effort and provided the key benefits.

  • Support for a wide range of input devices
  • Easy-to-use input mapping system
  • Support for multiple players and controllers
  • Intelligent Hot-Plugging

This makes it trivial to set up various gamepads, wheels, and other devices to control the player’s vehicle. The flexible API also means I can expand to new platforms or input methods without changing the game code. Rewired streamlines input handling through an intuitive mapping system and device-agnostic architecture. This saved significant development time over handling myself or learning Unity’s new Input system.

Task 3: Creating Zombie Damage Mechanics

One fun aspect I wanted to include was the ability to plow through crowds of zombies in a souped-up muscle car. To visualize running over zombies, I implemented ragdoll physics. When the player’s vehicle collides with a zombie, I take a snapshot of the zombie’s current position and rotation. This captured state is passed to a ragdoll prefab that gets instantiated at the collision point. The force from the car collision gets applied to propel the newly spawned ragdoll zombie away appropriately.

By spawning in the ragdoll on demand, I avoid the performance cost of all zombies having active rag-doll components simultaneously. This creates a dynamic, physics-based effect of zombies ragdolling upon impact with the player’s vehicle.

I did run into a small bug that had me going crazy for about 30 minutes, where the rag dolls were not being spawned in the correct location. This was because I was passing in a reference to the ragdoll prefab instead of the instantiated ragdoll.

Task 4: Implementing Boost and Slow Motion Mechanics

I implemented a boost mechanic for temporary speed bursts to add more high-speed excitement. This gives players a fun option to blast through zombie crowds when they need a quick surge. To make the boost feel more powerful, I added an impulse force that gives the car an extra kick forward when activated.

I also developed a Time Manager system that can dynamically slow gameplay speed. This also gets used for cinematic effect when the player’s car goes airborne off ramps or hills. Triggering slow motion coupled with a horn sound effect makes jumps feel climactic.

The Time Manager smoothly blends regular timescale and slowed time for boosts or jumps. This centralized system will allow me to easily tweak the durations and slow down values to dial in the perfect feel. Proper use of timescale effects goes a long way in making mechanics like jumps feel polished and dynamic.

Task 5: Adding Timer, Minimap, and City Gates

I implemented a countdown timer for each delivery mission to add challenge and urgency. This timer displays prominently during gameplay, pressuring players to reach the destination city within the allotted time. If the timer hits zero before arriving, the mission fails.

Getting the minimap right is crucial for navigating between cities quickly. After evaluating options, I chose to use Kronnect’s Compass Navigator Pro. It provided an efficient implementation out of the box. Customizing the visual style and behavior took very little time compared to developing a minimap from scratch.

The cities are brought to life using modular pieces for walls, gates, and buildings from the Simple Apocalypse asset. I can swiftly block off areas or construct new cities by snapping together combinations of prefabs. Arriving at a new city triggers the closed gate to open, enabling the player to drive inside and complete objectives. This gives a nice sense of progression and discovery when traveling the world map.

Simple Apocalypse

Compass Navigator Pro

Task 6: Enhancing the Game’s Atmosphere

To complement the zombie theme, I wanted an ominous, eerie atmosphere. I achieved this by placing barrel fires and makeshift lights along the roads and city boundaries. These will act as safe zones by keeping the undead at bay, preventing zombies from swarming the player’s path completely. The lights contrast strongly against the inky blackness beyond their circle of illumination.

I also added functional headlights to the player’s car. This not only looks appropriate on a classic muscle car, but also impacts gameplay. The headlights cut through the darkness, helping players discern hazards and zombies ahead at night. But reckless players can destroy the headlights through too many collisions, reducing visibility and increasing the tension.

The scattered barrel lights and the car’s headlights create pockets of respite and visibility against the murky, zombie-infested world. This enhances the game’s foreboding mood and atmosphere.

Final Thoughts

Through this project so far, I’ve made great progress in bringing my vision for a stunt-driving zombie game to life. Implementing satisfying vehicle physics and zombie damage mechanics were key technical hurdles to overcome. Performance optimizations like ragdoll pooling will continue to be important as I expand the scope.

I’m really happy with how the overall atmosphere and gameplay are shaping up. There’s something immensely fun about plowing through crowds of zombies in a classic muscle car! I have plenty of ideas for new mechanics and gameplay scenarios to add in future development. Optimizing the huge zombie hordes through ECS is one challenge I’m looking forward to tackling soon.

If you’ve made it this far, thanks for reading! I welcome any feedback on my work so far from the game dev community. Game development can sometimes be discouraging, so hearing your thoughts, impressions, and ideas would be fantastic.

I plan to share more frequent updates here documenting my progress. Let me know what aspects you find interesting and what you hope to see in the future. With your support, I know this project will continue to gain traction toward an eventual launch.

Thanks for following along on this journey with me!

Photo of author

Author

With over two decades of experience in technical and developer support, Tom has expertise in troubleshooting APIs. Over the years, he has built a many websites and tools with a primary focus on web development technologies including C#, ASP.NET, Blazor, HTML, and CSS. Last year, Tom starting to learn game development and is currently working on his first game "Last Stand," a zombie base defense game designed in Unity 3D.