Explore Free Adventure Game Tutorials – GameDev Academy https://gamedevacademy.org Tutorials on Game Development, Unity, Phaser and HTML5 Thu, 09 Mar 2023 21:45:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 https://gamedevacademy.org/wp-content/uploads/2015/09/cropped-GDA_logofinal_2015-h70-32x32.png Explore Free Adventure Game Tutorials – GameDev Academy https://gamedevacademy.org 32 32 Best RPG Tutorials – Making Role Playing Video Games https://gamedevacademy.org/best-rpg-tutorials/ Wed, 25 Jan 2023 09:54:00 +0000 https://gamedevacademy.org/?p=15481 Read more]]> One of the biggest reasons that people get into coding is to learn how to make their own games. However, every gaming genre has its own quirks and requirements to learn in order to successfully create your own game, especially when it comes to RPGs.

RPGs are one of the oldest and best-known game genres, taking in the likes of Final Fantasy, Pokemon, The Elder Scrolls and a variety of other famous series. The appeal of creating your own RPG is the ability to craft your own fantastic world and tell an epic story – but to do that, you first need to know how to actually code an RPG.

We’ve compiled some of the best RPG tutorials available to help you start your journey into creating your very own RPG. Whether you’re a novice coder or an experienced game-maker looking to expand your skill set, these tutorials cover all the skills you’ll need to craft your first RPG.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Why Should I Learn To Make An RPG?

Best RPG Tutorials: Beginner’s Guides To Creating Your Own Role Playing Game

The games industry is also an absolutely huge sector and offers a wealth of opportunities for up-and-coming coders – especially when it comes to RPGs. The global RPG market is expected to be worth nearly $22.5 billion by 2023, clearly showing just how lucrative a career in RPG development can be! 

RPGs also happen to be one of the most successful genres for solo and indie game developers – you don’t have to be part of a large studio to create a fantastic and successful RPG. The huge success of indie titles like Undertale, CrossCode and Disco Elysium clearly shows the potential for indie RPG developers to make a huge splash with their games.

Aside from the career benefits of learning to make your own RPG, they also present a great opportunity to expand your coding and game design skillsets. RPGs incorporate many different game mechanics and systems like world design, NPC programming, battle mechanics, quest systems, inventories and more, all of which help you learn valuable transferable skills to use in other game design projects.

More than anything, creating your own RPG is fun! Designing and creating an RPG is a great way to let your imagination run wild, creating fantastic worlds and epic stories to share with others.

The following list includes some of the best tutorials currently available for learning the core mechanics of RPG games and how to code them. 

Most of these are designed for beginners – while some of them might require existing knowledge of certain tools or programming languages, they do a great job of introducing you to the basics of RPG design and providing a step-by-step guide to building your own RPG.

2D RPG Academy & 3D RPG Academy

The 2D RPG Academy and 3D RPG Academy are a set of comprehensive RPG design curriculums from Zenva Academy. The aim of the curriculums is to learn to create your own 2D and 3D RPGs (respectively) from scratch in Unity, teaching you to implement battles, NPCs, dungeons, and more. The RPG Academies cover everything you need to know about building RPGs in Unity, taking you from an RPG novice to a master of the craft by the end of their individual course sets. 

These curriculums are a great option for those who are just starting out with game design, since it covers the basics of game development in general in its first module before moving onto RPG-specific systems in subsequent sections. The curriculums are structured to walk you through world design, core gameplay systems and other essential features for building your own RPG.

Key Topics Covered:

  • Custom avatars
  • Explorable towns
  • NPCs and dialogues
  • Enemy AIs
  • Battles
  • Crafting
  • Game saving
  • Procedural Dungeons

Duration: 25 hours of video tutorials across a wide range of topics 

Learn Unity Engine And C# By Creating A Real Top Down RPG

Created by Unity tutor Epitome, the “Learn Unity Engine and C# by creating a real top down RPG” tutorial is an extensive guide to creating a top-down RPG in Unity from start to finish. 

It’s a comprehensive guide that takes you through absolutely everything you need to know about creating your own top-down RPG, from the initial installation and setup of Unity to implementing core RPG systems. Later sections also focus on improving the player experience by tightening up UI and other features, as well as adding new content to extend the length of the RPG.

This tutorial is slightly older than others on this list, having first been published on Udemy in 2017 before being made available for free on Epitome’s YouTube channel in 2021. However, it still coves a lot of useful subjects that budding RPG makers will find extremely useful when working on their own projects. 

Key Topics Covered:

  • Movement and manual collision detection
  • Tilemaps and creating top-down dungeons
  • Interactive objects and inheritance
  • Saving game states
  • Floating text systems
  • Top-down combat systems 
  • Key animations including weapon swings
  • Character menu and UI systems
  • Adding new content

Duration: A 7 hour, 45 minute-long video broken up into segments focusing on specific areas of RPG development.

Construct A Micro-Farming RPG

If you’re someone who’s already gained some experience in coding and game design and you’re looking for a shorter tutorial to learn some of the core mechanics of RPGs, then the Construct A Micro-Farming RPG tutorial may be the guide for you. 

This slightly shorter tutorial allows you to follow in the footsteps of classic series like Harvest Moon and recent hits such as Stardew Valley by creating your own farming-based RPG. The tutorial delves into various systems and mechanics prevalent in the popular farming RPG subgenre such as crop growing, scriptable objects, tilemaps and resource management.

By the end of the tutorial, you’ll have created your own micro-farming RPG project, which can make for a great addition to your portfolio. The skills you learn in this farming RPG tutorial can also help you to diversify and expand your future projects with new mechanics and systems. 

All you’ll need to successfully complete this course is a basic understanding of Unity and C#, making it an ideal course for game design beginners and pros alike.

Key Topics Covered: 

  • Setting up 4-direction player movement
  • Creating tilemaps with interactable tiles
  • Storing crop data as Scriptable Objects
  • Implementing crop growing and watering mechanics
  • Controlling resources such as money
  • Displaying information with a UI
  • General Unity principles like singleton programming patterns, pseudo-state machines and more

Duration: About 1 hour, 20 minutes of video tutorials covering farming RPG systems

How To Make An RPG In Unity

Another option for those who are looking for a shorter tutorial is the “How to make an RPG in Unity” series from Brackeys and Sebastian Lague. This tutorial series breaks down RPG development into a series of videos exploring core subjects, making it easier to get to grips with the basic skills needed to successfully create an RPG in Unity.

The series is split into gameplay tutorials delivered by Brackeys and Sebastian Lague’s tutorials on integrating graphical elements into your RPG, with further RPG graphics tutorials also available on Lague’s own channel. 

The gameplay tutorials cover subjects like player and camera movement, interactables and items, inventory systems, equipment, character stats and more. Meanwhile, the graphics tutorials teach you how to model, rig and animate simple characters in Blender, then integrate these and other graphical elements into your RPG. 

Key Topics Covered: 

  • Movement
  • Interaction
  • Items
  • Inventory UI and code
  • Equipment
  • Stats
  • Enemy AI
  • Combat
  • Integrating graphical elements
  • Triggering the correct animations in different scenarios
  • Graphics interfacing with the equipment system

Duration: Just over 3 hours of video tutorials organised in a dedicated YouTube playlist, plus additional graphics tutorials on Sebastian Lague’s channel.

Create A 3D Turn-Based RPG

Turn-based combat is a staple feature of the RPG genre, made famous by classics like the early Final Fantasy games, Pokemon, and more. To this day, it remains one of the most popular battle systems used in RPGs, so it makes sense to learn how to implement turn-based battle mechanics if you want to build your own RPG.

That’s where the Create A 3D Turn-Based RPG tutorial comes in. This tutorial helps you to master turn-based battle systems by building your own 3D RPG from scratch, teaching you to program different kinds of attacks and actions, customize enemy encounters and more. 

The project is fairly open-ended, giving the scope to create a larger 3D RPG project off the back of this course or simply to use it to create a smaller project and add new skills to your arsenal. All you need to get started is some existing knowledge of C# and Unity; the course will walk you through everything else.

Key Topics Covered: 

  • Setting up player and enemy sets
  • Managing turns and action displays
  • Implementing different attacks and skills
  • Creating simple, combat-ready enemy AI
  • Adding UI feedback for gameplay
  • Building a map board with encounters 
  • Unity skills such as singleton and observer programming patterns, class inheritance for efficient codebases, and more

Duration: Roughly 5 hours, 20 minutes of video tutorials guiding you through the project from start to finish.

Godot Action RPG Series

Most of the tutorials in this list are for the hugely popular Unity game engine; however, if you prefer to use other engines, then the Godot Action RPG tutorial series from HeartBeast may appeal more to you. 

Godot 3.2 is an open-source game engine specifically designed for use by indie game developers, so solo game designers may find it more appealing than Unity. The Godot Action RPG tutorial series teaches you how to use Godot to create a top-down action RPG in Godot, covering various topics like movement, hitboxes and hurtboxes, stats systems and more. 

The series is intended for beginners but expects you to have some level of coding knowledge before starting. If you’re a complete coding beginner you may need to learn some programming basics before taking on these tutorials, but otherwise, they’re very beginner-friendly with helpful explanations for each new concept or mechanic that’s introduced.

Key Topics Covered: 

  • Setting up Godot 
  • Player movement and animations
  • Autotiles and collisions 
  • Attacking and other actions
  • Hurtboxes and hitboxes
  • Enemy design, stats, variables and behaviours
  • Player stats, health and UI 

Duration: Roughly 8 hours, 40 minutes of video tutorials.

Build A Micro-RPG

If you’ve already gained some game design experience on other projects and want to dip your toes into RPG development to learn some new skills, then you might like the Build A Micro-RPG course. This tutorial takes you through the entire process of building a top-down micro-RPG in Unity, giving you the skills you need to take on bigger RPG projects or add RPG mechanics to other games. 

This course is a great option for beginners and experienced coders alike. It introduces you to a range of essential skills for developing fully-fledged RPGs while keeping the initial project short, simple and exciting. All you need is a basic understanding of C# and Unity; the course will teach you the rest. 

Once you’ve completed the Build A Micro-RPG tutorial, you’ll have mastered a variety of transferable skills that will help you expand and diversify your next project with new mechanics. Whether that means another RPG of larger scope or a completely different genre that you want to add RPG mechanics to is up to you.

Key Topics Covered: 

  • Setting up basic Tilemaps with Unity’s Tilemap system
  • Developing players and enemies that can move and attack each other
  • Implementing a simple experience system
  • Using Unity’s UI elements to display health, money, and other data
  • Controlling Unity’s camera to follow the player
  • Building a dynamic interaction system that works for a variety of objects (doors, chest, loot, etc.)

Duration: Just over 2 hours of video tutorials.

Conclusion

Learning to build your own RPG is a fun and rewarding process that helps you to master a variety of new game mechanics and systems at the same time as practicing and developing existing coding skills. By following the tutorials above, you’ll learn many of the foundational skills you’ll need to craft your own epic RPG – and hopefully, you’ll have fun at the same time!

Don’t forget though – RPGs are a broad genre, so don’t forget to continue to explore around. There are lots of learning resources out there – and the more you learn, the better your games will be!

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Best Puzzle Game Tutorials – Building Games to Test the Mind https://gamedevacademy.org/best-puzzle-game-tutorials/ Wed, 25 Jan 2023 09:41:48 +0000 https://gamedevacademy.org/?p=15510 Read more]]> Who’s not familiar with classic puzzle games like Tetris, Breakout, Snake, Minesweeper, Sudoku, or even recent ones such as Candy Crush and Baba Is You? Now imagine you coding your own version of these games. Wouldn’t that be awesome?

Regardless of where your skill levels lie, puzzle games are a great game genre to explore – not only are they a staple of games in general, but come with some unique coding challenges! In this article, we’re going to strive to showcase some of the best puzzle game tutorials available using famous game engines like Unity, Unreal Engine, and Godot.

Let’s dive into some tutorials on how to implement these puzzle games!

How to Make Minesweeper in Unity

Right off the bat, you’ll learn how to make a minesweeper using Unity with a very detailed approach. Unity is a real-time development platform for game creation, being also used for interactive simulations, animation, and even films.

In this tutorial by Zigurous, he walks you through the creation of the game board and cells using sprites, how to keep track of the state of the game and winning condition, besides all the logic needed for flagging and revealing the cells (with the number of neighboring mines or blank) plus displaying the bombs for those cells corresponding to the mines of the game. And just like that, you’ll have implemented one of the most classic games yourself!

Topics Covered:

  • Project creation
  • Importing sprites
  • Scene setup
  • Cells and game board
  • Flag, reveal, and mine exploding scripting
  • Win state

Duration: 1.5 hours of video training

Access now: How to Make Minesweeper in Unity

Make a Brick Breaker Game in Unity

Based on the Breakout game, this tutorial by Imphenzia brings you a Unity complete implementation of a brick breaker game. Your goal in a brick breaker game is to destroy all the bricks on the screen by hitting them with a ball you bounce back and forth with a paddle.

In this detailed walkthrough especially thought out for beginners, the instructor describes the whole game creation process, explaining what variables and prefabs are, how to create the game objects and apply physics to them, how to go over a state machine for the game, and also how to design the menu screens aiming to make the transitions between states in the game as smooth and sensible as possible for the player.

Topics Covered:

  • Creating the ball object
  • Bouncing the ball
  • Ball velocity and collision logic
  • Paddle movement
  • Positioning bricks
  • Game states
  • UI panels
  • Score and game over
  • Resetting the game

Duration: 2 hours of video training

Access now: Make a Brick Breaker Game in Unity

Block Puzzle Mobile Game – Unity Tutorial

This tutorial series by CodePlanStudio teaches you how to implement a block puzzle for mobile devices with Unity in a thorough step-by-step way. To earn points in a block puzzle game you need to clear lines both horizontally and vertically by filling them with shapes. The instructor shows you how to set up the project, import the needed assets, design the start screen, create the game screen with the shapes being randomly generated for the player to select and drop onto the grid, as well as line completion plus winning condition implementation.

Topics Covered:

  • Importing the game assets into Unity
  • UI/menu screens
  • Displaying the grids and the shapes
  • Random shape creation logic
  • Dragging and dropping the shapes onto the grid
  • Line completion checking to update the score
  • Winning and game over logic

Duration: 8.5 hours of video training

Access now: Block Puzzle Mobile Game – Unity Tutorial

How to Make Tetris in Unity

Here’s another tutorial from Zigurous, where he shows you how to make a Tetris game using Unity. Tetris is a tile-matching puzzle game, where the player’s objective is to prevent the blocks from stacking up to the top of the screen by clearing lines for as long as possible. The completed lines will then disappear, giving room for the player to proceed with moving and placing the blocks around.

In this video, the presenter shows you all the setting up of the sprites and scenes, as well as the spawning of the blocks, and how to move them around and rotate them. As an extra feature, he implements what’s called ghost pieces which indicate where the blocks are going to land before they actually hit that spot, thus helping the player visualize the best place to lay each block down.

Topics Covered:

  • Project creation
  • Importing sprites
  • Scene and tilemap setup
  • Spawning, movement, and rotation of the blocks
  • Locking the blocks on the grid
  • Line clearing
  • Game over restart
  • Ghost pieces

Duration: 2 hours of video training

Access now: How to Make Tetris in Unity

Create 2048 in Unity

In this short tutorial series from Tarodev, you’ll implement a nice-looking 2048 game with Unity. 2048 is a sliding tile puzzle game where you combine tiles with the same number together to sum them up and try reaching number 2048. You can keep playing the game until there are no more blank tiles in the grid, therefore creating even larger numbers. The instructor shows in this 2-videos tutorial how to set up the grid, how to create the tiles, code the logic for shifting and merging the tiles, and also check if the player’s won after each move.

Topics Covered:

  • Creating the grid
  • Dynamic background
  • Spawning tiles
  • Adding a game manager
  • Shifting and merging the tiles
  • Win condition

Duration:hour of video training

Access now: Create 2048 in Unity

Sliding Puzzle Game in Unity

In this tutorial series, BenBonk presents to us how to make a sliding puzzle game in Unity. The game consists of finding your way to the black star while avoiding the red spikes. Over the 3 parts of this series, you’ll see how to set up the project, create the player, obstacles, and goal sprites, plus all the scripting for the player movement and collision with the walls or obstacles. Moreover, the instructor goes over adding an animation for when the player touches the spikes for a more shocking effect, then the game resets. He ends the tutorial by polishing the game up and testing it with you.

Topics Covered:

  • Setting up the project
  • Game objects and sprites
  • Player movement
  • Creating the walls
  • Colliders
  • Obstacles and goal
  • Level logic implementation
  • Animations
  • Win state

Duration: 1 hour of video training

Access now: Sliding Puzzle Game in Unity

Develop a Puzzle Platformer Game – Unity

This Unity tutorial by Zenva Academy walks you through the creation of a puzzle platformer game, where the player has to unlock the colored doors by taking the specified keys that are dispersed around the level scenes, steering clear of the spikes, blades, and acid pits all the while.

The instructor guides you through the creation of the levels, sprites, and collision logic necessary for the implementation of a more puzzle-oriented platformer game full of obstacles. You’re also going to learn how to save your current progress and how to load and move between the scenes of the level you’re in, not to mention that you’ll acquire a lot of game designing skills from this course!

Topics Covered:

  • Designing the levels
  • Player controllers
  • Tilemap collisions
  • Adding ladders
  • Collecting keys
  • Unlocking doors
  • Scene transitions
  • Saving and loading

Duration: 2 hours of video training

Access now: Develop a Puzzle Platformer Game – Unity

Make a Game like Candy Crush using Unity and C#

In this tutorial series, Mister Taft Creates implements a game like Candy Crush in Unity. He’s also got versions of it for two other game engines (Godot and Game Maker Studio 2), in case you want to test it out in a different environment. Candy Crush is a match-three puzzle game where you need to clear as many rows and/or columns as possible in but a few moves.

The instructor covers a lot of features in this comprehensive series, ranging from implementing an opening screen to having wrapped candies and icing tiles, diverse level structures and goals, level selection, a pause screen, a star classification system for each level, and much more!

Topics Covered:

  • Setting up the board
  • Moving the pieces
  • Finding a match
  • Generating bombs
  • Detecting deadlock
  • Scoring system
  • Score bar and goals
  • Level goals
  • End game conditions
  • Animating the sprites
  • Adding icing tiles and chocolate pieces
  • Level selection

Duration: 20.5 hours of video training

Access now: Make a Game like Candy Crush using Unity and C#

Unity 15 Puzzle Tutorial

This brief tutorial series by Kee Gamedev shows you how to make a 15 puzzle game in Unity. The 15 puzzle is a sliding puzzle game having 14 numbered tiles in a 4×4 square where the goal is to arrange a shuffled initial set of the tiles in ascending order, by sliding the tiles around using the only vacant space available on the grid. The instructor goes over all the necessary setup and logic through the 2 videos of this series.

Topics Covered:

  • Grid and sprites setup
  • Logic scripting
  • Moving the tiles
  • Shuffling the tiles

Duration: 30 minutes of video training

Access now: Unity 15 Puzzle Tutorial

How to Make Snake in Unity

With this tutorial, Zigurous guides you through the making of the 2D arcade game Snake in Unity. In this game, the player controls a snake which is basically a line on the screen that grows in length as it eats fruits and its own body is a primary obstacle.

The instructor builds the game scene, makes the snake a rigid body, adds the walls as colliders, implements the logic for eating the food, and he concludes the tutorial by automatically resetting the game each time the player touches either one of the walls or the own body of the snake as that means game over.

Topics Covered:

  • Scene setup
  • Snake movement
  • Placing the food
  • Growing the snake
  • Game over reset

Duration: 45 minutes of video training

Access now: How to Make Snake in Unity

Sudoku Unity Tutorial

This tutorial series from CodePlanStudio teaches you how to implement Sudoku in Unity. Sudoku’s objective is to fill the 9×9 grid with digits from 1 to 9 in a way that there are no repeated numbers in each column, row, and each 3×3 subgrid as well.

In this series, you’ll be guided through the complete implementation of a Sudoku game, from creating and populating the grid to attributing numbers and notes to each cell. Further, he goes over adding the known features to the game, such as timer, pause menu, and difficulty level selection, plus win and game over screens as well as how to place ads in your game and release it on Google Play Store.

Topics Covered:

  • Creating and populating the grid
  • Difficulty level selection
  • Assigning numbers to the cells
  • Game over screen
  • Timer
  • Pause menu
  • Adding notes to the cells
  • Win popup window
  • Ads integration

Duration: 9 hours of video training

Access now: Sudoku Unity Tutorial

Jigsaw Puzzle – Unreal Engine 4 Tutorial

In this tutorial series, Ryan Laley creates a jigsaw puzzle game with Unreal Engine 4. Over the 8 videos of the series, Ryan shows you how to separate each piece from the material pattern he starts with in order to control every individual piece by itself, then how to generate the logic behind the game and set the puzzle screen.

On the left-hand side, he puts all the pieces of the jigsaw in a scrambled order, while on the right the player will be able to place the squares in a grid until they complete the game. Additionally, he tests the game with 3 different images to demonstrate how to switch between the puzzles and restart the game.

Topics Covered:

  • Initial setup in Unreal Engine
  • Controlling each individual piece
  • Creating the jigsaw blueprint
  • Setting up the puzzle screen
  • Clicking and dragging the pieces around the screen
  • Winning logic
  • Reset and progress labels
  • Puzzle selection

Duration: 1.5 hours of video training

Access now: Jigsaw Puzzle – Unreal Engine 4 Tutorial

Make a Puzzle Game in Unreal Engine

Here’s a tutorial from Zenva Academy featuring the process of making a puzzle game in Unreal Engine. In this course, the instructor will show you how to design a turn-based game where the player can collect followers while having to avoid obstacles to reach the end goal. As whenever the player moves all other objects move as well, you have to figure out where to go to steer clear of the red blade obstacle as you go around the room assembling followers.

By implementing this project, you’ll learn about blueprint parenting so to facilitate implementation when moving the player and the other elements of the game. You’ll also go through displaying texts to the player, besides adding the options of restarting and quitting the game.

Topics Covered:

  • Project setup
  • Player blueprint
  • Moving the player
  • Creating obstacles
  • Collecting multiple followers
  • Lighting manipulation
  • End goal

Duration: 2 hours of video training

Access now: Make a Puzzle Game in Unreal Engine

Make Your First 2D Grid-based Game from Scratch in Godot

This tutorial series from Emilio teaches you how to make a 2D grid-based game with Godot, a versatile open-source 2D and 3D game engine. The purpose of this game is to drag the blue boxes onto the red spaces.

You’ll learn how to set up the sprites and camera along with how to make the player, walls, and boxes nodes aside from setting up collisions between them. Emilio explains in detail his choices on the design of the game and continuously tests his progress with you throughout the videos. In the second video of the series, the instructor shows you how to add an animation for the player movement to be smoother and improves upon the UI displays to have a more polished version of the game.

Topics Covered:

  • Setting up sprites
  • Camera and zoom
  • Making the player
  • Boxes and walls
  • Setting up collisions
  • Win condition
  • UI labels and dialog
  • Testing

Duration: 48 minutes of video training

Access now: Make Your First 2D Grid-based Game from Scratch in Godot

I Made Baba Is You in Unity

To close this article, go check Akshay Goel‘s journey in making his version of Baba is You with Unity within 48 hours as an extra motivation to implement a game you like in your own way. Baba Is You is a game where you can change the rules by which you play, as they are blocks you can interact with. By manipulating the rules, you can alter how the game works and thus reach the flag or whatever object you set as goal.

In this video, you’ll see Akshay creating his own assets and sprites, going through the logic of the grid and collision setting, plus the editing of the game levels. You will also accompany him while he’s compiling the rules for the game and making them affect the game world!

Duration: 12 minutes

Access now: I Made Baba Is You in Unity

Summary

And there you have some of the best puzzle game tutorials available. Whether you’re a beginner or an experienced developer, puzzle games are a fantastic genre, and one that requires some interesting coding techniques to achieve. These tutorials should help you take those first steps, and let you discover new ways to make your players think.

However, there are an ludicrous amounts of the kinds of puzzles you can have in your games – so by no means is this list exhaustive. Don’t forget to continue to explore further learning resources – and good luck with your future games!

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Best Roguelike Tutorials – Learning Game Dev Online https://gamedevacademy.org/best-roguelike-tutorials/ Wed, 25 Jan 2023 08:32:40 +0000 https://gamedevacademy.org/?p=15561 Read more]]> Roguelikes are not only a popular genre of videogames, but they’re one of the most interesting as well. Focusing more on replayability and randomized worlds rather than tightly-structured level design, they provide players and developers with the chance to explore a wide variety of interesting mechanics through ever-shifting game worlds.

If you’re interested in creating your own roguelike games, we’ve put together this handy list of online tutorials that provide a perfect starting point for you to learn the essential game mechanics and programming skills you’ll need to succeed. 

Why Should You Learn To Create A Roguelike?

Roguelikes are a slightly more niche genre than others, but they still have plenty to offer to both players and developers. Recent hits like Hades and Darkest Dungeon prove that this genre can be used for extremely inventive gameplay and innovative storytelling, which makes roguelikes a very interesting project for game developers in-training to work on.

Roguelikes are often characterized by a randomized, procedurally generated game world that changes with every new playthrough. Learning procedural generation can be a valuable skill for game developers; as well as roguelikes, it can be applied to survival games, simulations, sandboxes and more. 

In addition to procedural generation, roguelikes give developers a chance to work with a variety of other game mechanics as well. Action-oriented roguelikes can help you to practice character movement, enemy scripting and combat mechanics, while roguelikes with RPG elements can help you to learn more about turn-based combat, stat systems, and game balance. 

Basically, roguelikes are a highly adaptable genre that you can use to practice new mechanics and experiment with systems from different genres, all while creating a fun and highly replayable gaming experience. As such, they make for great projects for beginners and more experienced game developers alike.

Roguelike Game Online

If you’re ready to get stuck into your first roguelike project, then the following list of tutorials will give you plenty of potential starting points. From dungeon-crawlers to survival games, these tutorials cover a variety of niches within the roguelike genre and will help you to build a range of essential skills to make a successful roguelike of your own.

Roguelikes are naturally slightly more complex than other genres, but we’ve made sure to include several tutorials in this list that are perfect for beginners as well as more experienced developers. 

The Complete 2D Roguelike Course

If you’re looking for somewhere to start your roguelike development journey, then there are few better options than this comprehensive tutorial from Zenva Academy. The Complete 2D Roguelike Course is a detailed introduction to the genre, exploring the fundamentals of roguelike development and guiding you through the process of making your first roguelike.

The tutorial walks you through a step-by-step guide to creating your own 2D dungeon-crawling roguelike in Unity. You’ll learn to procedurally generate dungeons, create enemies, code items and powerups, and more, all while learning a variety of skills that can help you to flesh out future projects with all sorts of new features. 

All you need to get started is a basic understanding of Unity and C#, making this tutorial a fantastic option for beginners. Even if you already have plenty of experience with the Unity platform, The Complete 2D Roguelike Course is still definitely worth taking – you’ll learn a range of useful skills for other projects and master a new genre at the same time as expanding your portfolio with a new game.

Key Topics Covered:

  • Creating random dungeon maps through code
  • Generating randomized dungeon room interiors
  • Implementing enemies and a simple battle system
  • Adding health and gold pickups with UI
  • Controlling gameplay flow with keys & doors
  • Setting up a mini-map system

Duration: Just over 3 hours of video tutorials explaining the entire process of building a 2D dungeon-crawler roguelike.

2D Roguelike Project

Another option for learning to make your own 2D roguelike in Unity comes from Unity itself in the form of the Unity 2D Roguelike Project tutorial series by Unity itself. These tutorials guide you through the process of creating a simple 2D roguelike where the player character must search for food and survive a wasteland for as long as possible.

The game project is turn-based and tile-based, with each tutorial teaching you to add new elements like level randomisation, enemies, audio and more. By the end of the series you’ll have mastered a variety of fundamental game mechanics for the roguelike genre and be ready to implement these systems into your own games to create your own roguelike. 

Key Topics Covered: 

  • Animating and moving the player character
  • Using tile prefabs 
  • Board and game managers
  • Moving objects and walls 
  • Player and enemy scripts
  • UI design
  • Level creation and transitions
  • Audio
  • Mobile controls 

Duration: A series of shorter tutorial videos lasting roughly 2 hours.

Build A Roguelike Game With C++ And SFML

Another option for roguelike development from Zenva is the Build a Roguelike Game with C++ and SFML tutorial. This tutorial works along similar lines to the 2D Roguelike Course, except it uses the Simple and Fast Multimedia Library rather than Unity, so if you’re not keen on using Unity then this is an ideal alternative. 

The tutorial guides you through the process of using SFML’s multimedia capabilities to build a 2D action-oriented roguelike where players must dodge moving enemies to reach the exit in each level. By the end you’ll have created your own version of the project, learning various skills such as user interaction, adding graphics, building dungeons and more along the way.

You’ll need some existing familiarity with the C++ language and SFML to get started with this project, but with a simple step-by-step structure, it’s easy to follow and perfect for beginners. It also makes for a fun project for more experienced developers who want to learn to use new tools, since the course acts as a great introduction to both C++ and SFML.

Key Topics Covered:

  • Setting up SFML game projects
  • Drawing sprites to the screen
  • Constructing tile-based maps with C++
  • Detecting user input for player movement
  • Moving enemies to available spaces randomly
  • Implementing logic for ending the game

Duration: 2 hours of video tutorials explaining how to make a 2D roguelike in SFML.

How To Create A 2D Roguelike Game

The How To Create A 2D Roguelike Game tutorial series from Dapper Dino provides another great entry point for game developers who are curious about dipping their toes into the roguelike genre. Like many of the other tutorials on this list, the tutorial focuses on using Unity to implement the various mechanics and systems that are commonly found in roguelike games.

The tutorial takes inspiration from the roguelike game Wizard of Legend, using it as a reference point for which systems to include in your own roguelike. Following the tutorial, you’ll steadily build up your own simplified roguelike in the style of Wizard of Legend, mastering core mechanics like combat, loot drops, class systems, map generation and more.

You’ll need some existing knowledge of Unity and C# to ensure you understand each part of the tutorial, but it does a good job of providing step-by-step instructions at each stage, so it’s fairly accessible even if you’re more of a beginner than a pro. 

Key Topics Covered: 

  • Creating a menu
  • Importing spritesheets and setting up character movement
  • Setting up animations and transitions
  • Creating health and stat systems
  • Programming simple spells and combat actions
  • Camera movement and controls 
  • Dashing mechanics
  • Collectible items including currency and loot drops
  • Currency UI 
  • Class systems 
  • Enemy spawning systems 

Duration: Just under 4 hours of video tutorials, each exploring different mechanics in the roguelike genre.

2D Procedural Maps For Beginners

If you’ve already worked on a few different game projects and want to try your hand at a roguelike next, but don’t want to have to sit through a tutorial covering game design fundamentals you’ve already learned, then this may be the tutorial for you. 

The 2D Procedural Maps for Beginners tutorial is a shorter tutorial series that provides step-by-step instructions for creating procedurally generated 2D game maps in Unity. You’ll learn the expandable programming logic needed to create these maps, plus key systems like noise maps, biome calculations, player controllers, and more.

Once you’ve used this tutorial to master procedural generation, you’ll be all set to implement these systems into your projects, allowing you to build roguelikes from the ground up or add randomized worlds into other projects to give them a roguelike twist. 

Key Topics Covered: 

  • Generating noise maps in Unity
  • Understanding noise settings for different effects
  • Calculating biomes based on noise map data
  • Organizing biome data with Scriptable Objects
  • Instantiating 2D tiles based on biome data
  • Implementing a player controller

Duration: 1 hour, 30 minutes of video tutorials explaining each step in creating procedurally generated maps in Unity.

Roguelike Python Tutorial

If you’re unfamiliar with Unity or C# and would like to learn to make a simple roguelike without using these, then another option is to follow the Roguelike Python Tutorial from Ombarus. This series guides you through the process of creating a very basic roguelike using standard keyboard symbols to represent the map and characters, giving it an appearance similar to the original Rogue game that the genre is named for. 

The tutorial follows the structure of the text-based 2020 Roguelike Tutorial, meaning you can refer to a written guide if you get stuck at any point. Through the course of the tutorial series, you’ll learn to create and control a player character, generate randomized maps, implement a turn system and more, allowing you to get to grips with many of the core mechanics of the roguelike genre.

While this tutorial leads to a much more simplistic finished project than some of the other options on this list, it’s still a fun way to learn more about the systems used in roguelike games, and it provides a fun entry point for coders more familiar with Python than Unity. 

Key Topics Covered: 

  • Setting up and controlling a player character
  • Generating random maps and enemies
  • Adding a field of view system
  • Adding a turn system 
  • Coding combat systems and UI
  • Adding interactable items, spells and other actions
  • Saving the game
  • Creating multiple levels
  • Balancing the game and adding equipment

Duration: Roughly 2 hours, 45 minutes of video tutorials covering each stage of creating a simple Python-based roguelike.

The Complete Procedural Terrain Generation Course

While the majority of the roguelike genre is made up of 2D games, there are no rules against using a 3D environment for your roguelike, especially when blending your roguelike with other genres. Recent hits like Returnal have shown that blending the random elements of the roguelike genre with 3D environments and fast-paced action can be a winning combination.

So, if you want to try your hand at creating your own 3D roguelike, the best place to start is to understand how procedural generation works in a 3D environment in order to craft random levels for your players. The Complete Procedural Terrain Generation Course allows you to do just that, teaching you the fundamentals of using procedural terrain generation to create randomized maps complete with varied biomes. 

The tutorial will help you learn to algorithmically generate a terrain’s shape with C# in Unity, and also provides a guide to performance optimization to ensure a smooth playing experience in your randomised world. You’ll need a basic understanding of Unity and C# to get started, but otherwise, this step-by-step guide is extremely accessible and beginner-friendly.

Key Topics Covered:

  • Generating noise maps to determine the shape of the terrain
  • Utilizing noise maps as height maps to produce terrain
  • Applying gradient textures to a mesh based on terrain shape
  • Setting up heat maps and moisture maps based on the terrain height
  • Combining various data elements to algorithmically determine biomes
  • Using biome types to determine how trees spawn

Duration: Roughly 3 hours, 40 minutes of video tutorials explaining the process of procedural terrain generation using Unity.

Conclusion

Roguelikes provide aspiring game developers with an exciting and unique challenge, tasking them with creating fun and replayable gameplay within randomized levels and worlds. As such, they’re a perfect next step for those who have completed a few different projects and want to tackle a more complex genre next. 

Using the tutorials above, you should be able to master many of the core mechanics found in roguelike games. Whether you choose to create your own roguelike or implement roguelike mechanics within your other projects to give them a new and unique twist is up to you!

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Best Survival Game Tutorials – Making your own Video Game https://gamedevacademy.org/best-survival-game-tutorials/ Wed, 25 Jan 2023 08:17:33 +0000 https://gamedevacademy.org/?p=15486 Read more]]> Survival games offer a challenging and unique niche within the gaming world, tasking players with fighting off hunger and thirst as much as fighting enemies. Survival games are also a popular genre for multiplayer gaming, giving you the thrill of working alongside your friends to survive hostile environments.

Because of all this, survival games are a popular choice as a first project for budding game developers. However, creating a survival game means mastering a variety of skills, concepts and game mechanics, such as base-building, character needs, crafting and more. As such, it’s often helpful to start with a guided project or tutorial.

To that end, we’ve put together a list of some of the best survival game development tutorials to help you learn the foundations of the survival genre and create your very own survival game to add to your portfolio.

Why Should You Learn To Make A Survival Game?

Famous survival games like Minecraft, ARK: Survival Evolved, DayZ and more are hugely popular thanks to their often open-ended game structure and the challenges involved in managing your character’s needs to keep them alive. This popularity means there’s a huge audience just waiting to try out your own survival game!

Aside from the genre’s popularity, survival games are also a great way to learn a variety of game mechanics and systems that can help you to diversify other projects with new gameplay features. Hunger and thirst meters, crafting systems, base-building and day/night cycles that affect enemy spawns and behavior are all great tools for enhancing your future game projects.

Survival games also offer a great deal of freedom in terms of their style and core gameplay mechanics. They could focus on shooter elements like in DayZ or turn into more of a sandbox game like Minecraft, for example. The genre also lends itself well to both 2D and 3D environments, giving you a huge amount of choice when it comes to appearances and playstyles.

Best survival game tutorial

To help you on your journey to becoming a survival game master, we’ve compiled a list of some of the best online tutorials available for making your very own survival game from scratch. 

Many of these are geared towards beginners, with step-by-step instructions to build a survival game from the ground up. However, more experienced developers looking to learn new skills and mechanics they can use on advanced projects will also get a lot of use out of the tutorials below.

Survival Game Development Academy

If you’re looking for a comprehensive guide to the survival genre’s core systems and mechanics, look no further than this comprehensive tutorial from Zenva Academy. The Survival Game Development Academy course provides a detailed guide to everything you need to know to go from a complete novice in survival game design to an experienced pro.

The tutorials in this course explore survival game development in the Unity engine, covering all the key topics you need such as item crafting, base building, player needs, combat and more. As well as equipping you with the skills to make your own fully-fledged survival game, these concepts and systems can also be applied to projects in other genres to add your own unique spin on classic formulas.

This course even covers the very basics of C# coding and using the Unity Editor in its first module, so it’s a perfect starting point even if you have no prior coding experience at all. The detailed guides in this course are also perfect for more experienced coders looking to learn new skills.

Key Topics Covered:

  • Hunger, thirst, health, and sleep needs
  • Day-night cycles
  • Item and inventory systems
  • Crafting mechanics
  • Base building
  • Combat and Enemy AI
  • Game Saving

Duration: 18 hours of video tutorials on a comprehensive range of survival game subjects, split across 6 “levels” (modules).

Survival Game Player Mechanics For Beginners

If you’re looking for a slightly shorter introduction to the survival genre, then this alternative Zenva course may be more appealing. The Survival Game Player Mechanics For Beginners tutorial is a great place to start for those who have some prior coding or game development experience but who are new to the survival genre’s mechanics. 

The tutorial provides a step-by-step guide to creating survival games in Unity, starting with fundamental mechanics like movement and player controls. It then moves onto survival-specific elements like player needs, health, day/night cycles and more to create the foundations of your own survival game. 

These concepts can help you to build out your own survival game or to add new mechanics to other game projects further down the line. You’ll need a basic understanding of C# and Unity, but other than that there are no strict prerequisites, making this a perfect place to start your survival game journey.

Key Topics Covered: 

  • Implementing basic player movement
  • Setting up a first-person camera
  • Creating a needs system for hunger, thirst, and sleep
  • Managing health with damage indicators
  • Building a basic 3D terrain
  • Controlling lighting to mimic a day-night cycle

Duration: 2 hours, 30 minutes of video tutorials covering various key Survival mechanics.

Create An FPS Survival Game In One Video

Another great option for learning some of the basics you’ll need to lay the foundations of your survival game is the Create An FPS Survival Game In One Video tutorial from YouTuber Awesome Tuts

This video provides you with a step-by-step guide to creating your very own FPS survival game, along with all the game assets you’ll need to follow along and build the project yourself. The tutorial focuses on the Unity engine and merges survival with FPS mechanics to teach a wide range of game mechanics and systems at once. 

It starts with world design elements like lighting and ambience, then moves on to basic player controls and movement. After this, the tutorial explores various subjects like weapons, enemy animation and behavior, health systems and more.

Unfortunately, the tutorial does omit certain core survival features like crafting and base building, so those looking to create a more traditional survival game may choose to look elsewhere. However, it’s a great starting point for anyone intending to make a more action-oriented survival game.

Key Topics Covered: 

  • Lighting and ambience
  • Creating a player character and coding movement
  • Programming weapons and shooting/attacking
  • Configuring, animating and coding the behavior of enemies 
  • Enemy spawning systems
  • Healthy and stamina systems
  • Player UI
  • Sound effects 

Duration: One video lasting just over 8 hours, 10 minutes, split into different sections for each subject

Discover Base Building For Survival Games

If you’re someone with slightly more experience with game development who just wants to learn some of the core aspects of the survival genre, then this shorter tutorial may be the one for you. The Discover Base Building For Survival Games tutorial covers the base building mechanics commonly found throughout the survival genre. 

Like most of the tutorials in this list, this one focuses on using Unity to implement base building elements in your games. Since crafting is often a core component of base building (and survival games more generally), the tutorial covers these systems in addition to the building mechanics that will allow your players to set up base structures in the game environment.

There are also guides to common base functions like sleeping in beds to heal or pass in-game time, ensuring your base has all the functionality that players would expect. 

This tutorial is an excellent option for slightly more experienced developers who are looking to add core survival mechanics to their skillset to enhance future projects. It’s equally suitable for beginners, since it only requires a basic understanding of Unity and C#; however some familiarity with the basics of game design and other survival game elements may be helpful.

Key Topics Covered: 

  • Controlling when base-building mode is active
  • Combining crafting systems with base-building
  • Selecting different building objects to be placed
  • Detecting applicable building locations
  • Implementing sleep functionality with beds
  • Creating interactive, light source campfires

Duration:  Roughly 1 hour, 45 minutes of video tutorials.

NPC AI And Combat For Survival Games

One of the key elements of the survival genre is the presence of other characters and enemies that the player can interact with or fight against. The NPC AI And Combat For Survival Games tutorial shows you how to enhance your survival game with animated NPC models that can flee from players, attack them, chase them, drop items and more.

It also includes an additional guide on how to enhance the appearance of your game with post-processing effects that can give your game its own distinctive look and feel. This is a great way to make your game feel more polished and impressive, making it a strong addition to your portfolio. 

You’ll only need a basic understanding of Unity and C# to complete this tutorial, making it fairly accessible for beginners. However, it may be useful to have learned some of the basics of survival game design to provide a stronger foundation to work from in this tutorial.

Key Topics Covered:

  • Creating a multipurpose NPC class
  • Setting up a NavMesh for navigation
  • Controlling NPC actions with a state machine
  • Implementing combat and loot drops
  • Applying animations to NPCs
  • Adjusting aesthetics with post-processing effects

Duration: About 1 hour, 50 minutes of video tutorials.

Conclusion

The survival genre is a unique opportunity for budding game designers to learn new mechanics while merging in aspects from other genres like FPSs, RPGs, and action-platformers. This is part of the genre’s appeal – it allows a lot of creative freedom at the same time as providing a solid challenge and engaging gameplay to players.

By following the tutorials above, you’ll gain a deeper understanding of survival mechanics and learn to implement them in your own projects. We hope you’ll have fun crafting your own unique spin on the survival genre using these handy guides and tutorials!

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Kaboom.js Tutorials – Complete Guide for Easy Game Dev https://gamedevacademy.org/kaboom-js-tutorials/ Sat, 21 Jan 2023 05:11:59 +0000 https://gamedevacademy.org/?p=14977 Read more]]> Do you want an easy-to-use game framework to build your dream projects?

Kaboom.js is a relative newcomer to the game development scene, but it is already making a big splash – especially among indie creators. This JavaScript-based library was made specifically with games in mind, in the same vein of frameworks such as Phaser or Pixi.js. However, there are many aspects that have made it stand above its competitors and worth your time checking out.

In this article, we’re going to introduce you to Kaboom.js and show you how you can get started learning this new tool.

Let’s get started!

What is Kaboom.js?

As mentioned, Kaboom.js is a JavaScript library in the vein of HTML5 games, which use the browser to render games made with it. The library was made with the idea of simplicity, but comes with many important game development features – such as layering, collision detection, input handling, and more. Regardless, though, the goal is to allow novice developers to create game scenes as quickly as possible.

Game objects in Kaboom.js are conveniently rendered with a component-based system. This means they’re extremely easy to manipulate and apply behaviors too. The behaviors can include everything from simple game mechanics like health to basic movement-based animations – so each game object essentially suits object oriented programming principles.

Beyond this, it is worth noting Kaboom.js is also an available template for Replit – a popular, in-browser coding environment. This means its well-suited for developers who aren’t interested in setting up local development environments or just want to play around with the library.

Key Pros of Kaboom.js

Why should you use Kaboom.js? Below, we’re going to explore what makes Kaboom.js stand out and how, as a developer, you can benefit from the advantages Kaboom.js offers.

Screenshot of the Kaboom.js playground

Fast and lightweight

Unfortunately, not everyone has a computer that can run game engines such as Unity or Unreal Engine – which both are pretty process intensive programs. However, Kaboom.js does not require a great computer and can be used even with low-end laptops. In fact, due to its incorporation with Replit, as mentioned above, you really only need a browser if you’re intent on using it – not even a code editor is required.

Likewise, because of how lightweight it is, games made with Kaboom.js run very smoothly as well. This means you don’t have to get hung up too much on optimization. Instead, your games will likely run quickly right out of the box, leaving you more time to focus on what matters.

No dependencies

Many frameworks and libraries out there require several layers of dependencies to be able to run properly. If you forget the dependency, or more tragically, if the dependency has a breaking change, your game isn’t going to work.

Kaboom.js doesn’t require any sort of dependencies. While you certainly can add packages such as webpack, natively you just need to import the Kaboom.js library itself. Once that is added, you won’t have the extra worry of maintaining the dependencies. This helps Kaboom.js achieve its goal of making it quick to setup and allowing you to dive straight into the fun stuff of actually making the game.

Cross-platform compatible

Since Kaboom.js is specifically for creating browser-based games, this means that there are no platform limitations. If the device can connect to the internet, your players can play it from anywhere.

For you as a developer, this means two things. First, this helps you avoid messy setups of needing multiple game versions just to have it available for multiple platforms. Second, this opens you up for a wider audience since you can tap into different sorts of players. All in all, though, this is a boon that makes it much easier for you to get the game into multiple different hands.

Simplicity

If you’ve ever tried to read documentation for frameworks or libraries before, you’ll know they can get rather complicated. If you don’t believe us, just go check out Unity’s documentation. While certainly this is fine for experienced developers, beginner developers are going to find this a nightmare.

Kaboom.js was designed to eliminate this problem and be as simple as possible. Not only does this help with keeping it lightweight, but makes the documentation much, much easier to understand when you’re just a beginner. This, in turn, just makes development itself easier.

Additionally, it comes with the extra benefit that this documentation can more easily be maintained as the library is updated. This means you won’t be reading old information that was relevant five versions ago.

Specifically made for beginners

As you might have seen from the previous points, beginners were at the heart of the design choices for Kaboom.js. Everything about the library is made to benefit beginners who have never made a game before. While there is a need for JavaScript experience before diving in, this is a much lower point of entry compared to heftier engines.

Thus, you’re only going to need a few tutorials to get the gist of how Kaboom.js works – and soon be able to develop your own projects with it.

Active development

Over the years, many HTML5 frameworks have come and gone. For others that remain, the development can often be slow and new versions, bug fixes, and features are few and far between. While many of these frameworks still technically work, the lack of developer support can eventually become a hindrance.

Kaboom.js, on the other hand, is very actively and caringly developed. Though we don’t expect them to break their principles of simplicity, improvements to the library come frequently. Thus, you can be assured the library will be supported for whatever time it needs for you to build your project.

Screenshot of the Kaboom.js GitHub page

What can you make with Kaboom.js?

Being based on HTML5 (i.e. for the browser), projects made with Kaboom.js do have limitations – as our browsers and internet are only so powerful no matter which JS library we’re talking about. So, you shouldn’t expect to make any kind of AAA game with the library. Kaboom.js was also specifically made for 2D development, so 3D graphics are kind of off the menu as well.

Past these two minor limitations, though, Kaboom.js does not put any further obstacles in your way. You can build small games in just about every genre, and only your imagination is there to hold you back. This includes everything from platformers to adventure games to old-style retro games like Breakout, Super Mario Bros.Space Invaders, and so forth.

If you want to explore the full scope of what people have already made, you can check out Kaboom.js made games below:

Kaboom.js & JavaScript Tutorials

Ready to create games with Kaboom.js? Check out the links of tutorials below which cover Kaboom.js, JavaScript for HTML5 development, and the game development process.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
A Guide to Unity’s 3D Game Kit – No-Code Game Dev Tutorial https://gamedevacademy.org/create-3d-games-without-coding/ Sat, 09 Apr 2022 14:00:42 +0000 https://gamedevacademy.org/?p=9421 Read more]]> What if I told you that you could create intricate 3D games, complete with AAA graphics and a third-person character, all without writing a single line of code?

Well if you’re a Unity user and excited about that prospect, let us introduce you to the 3D Game Kit. Made with accessibility for artists, non-programmers, and prototyping in mind, this tool allows you to develop all kinds of games without touching a single bit of C# scripting.

In this tutorial series, we’re going to show you just how to use the 3D Game Kit to build a third-person, adventure RPG-inspired project using only the kit and Unity components.

If you’re ready to explore this no-code solution, let’s start learning.

Downloading the Kit

Open up Unity 2018.1 or later, create a new project (the kit cannot be imported into an existing project), and go to the asset store. This is where we will download the kit. Simply search 3D Game Kit and it should be one of the first suggestions.

Click on it and hit the download button. The entire kit is a couple of gigabytes so be prepared for a long download time (it took me a couple of tries because my internet was timing out).

Once it has been downloaded (hopefully it didn’t take too long), import the package. Now we are ready to have a look at what’s inside.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

The Example Project

To get an idea of what this kit is capable of, go to the newly created folder called “3DGameKit” and open the folder marked “Scenes”.

Double-click the scene named “Start”.

If we hit play we can look at what features this kit possess. It is worth noting first off that this example utilizes high-end graphics to deliver the final image. Because of this, I recommend using a computer with a dedicated graphics card if you want to enjoy what I think is a very slick looking example. For those of you who are using an integrated graphics card (like I was when I first used it), then you’re going to have to turn down the quality settings in order to get decent frame rates. Go to Settings -> Project Settings and choose “Quality”.

Just switch the Quality level from “Fantastic” to “Performance” and you’re good to go. I also recommend just going ahead and exporting the game since it’s a large example and it may take a while to complete. Go to file and hit “Build and Run”.

It’ll ask you for a location to store the demo and then it’ll start compiling. Once it’s done, boot it up and have a look at what can be created with this kit.

Environment creation

Creating a new scene

After you’ve thoroughly gone through the example project, let’s start actually using the kit. First things first, let’s create a new scene. Go to your toolbar and click on “Kit Tools” -> “Create New Scene”.

It’ll ask for a name so just give it a generic title like “Scene1”. Hit “Create” and that will create our new scene called “Scene1”.

You’ll notice that the 3D Game Kit comes with ProBuilder which, if you don’t know what that is, check out this tutorial on the Game Dev Academy to learn more about it: Designing Assets in ProBuilder. We won’t be using ProBuilder much in this tutorial so just close the tab.

You’ll also notice that we have a character in our scene along with a ground. Something to note about this setup is that it comes with a couple of things that you should pay attention to. First, there is an object called “DeathVolume”.

This is simply a collider that will kill the player if it crosses into the collider. You can use this to set up an acid pit or to kill the player if it falls off the world. Its already set up to do the latter so just leave it that way for now. It is important to understand what this does, otherwise, your character might walk somewhere and just die without being attacked.  The second important thing to note is the “Checkpoint” game object.

This is self-explanatory, it is just a checkpoint for the player. You can change the position if you want your character to respawn at a different place. Have a look at the ground that was placed here for us.

If you scale it in either direction, you’ll notice that it tiles nicely for us.

This is a very neat feature since it allows us to easily manipulate the size without making it look stretched. Go ahead and scale this plane up to be as big as you like and then we can start throwing some rocks and architecture into the scene.

Adding some organic and man-made objects

Go back to the 3D Game Kit folder and find the folder named “prefabs”. Open it up and double-click on the folder marked “Environment”.  Here you’ll see all sorts of cool things to add to your scene. From plain ordinary rocks to complex structures, even vegetation is included!

But before we start adding these things to our scene, have a look in the hierarchy and notice that game objects in the scene are under a label.

With things like the EventSystem and the UI canvas under the category “UI”, you can see that the developers have given us a way to organize our game objects. It would be best to utilize this organization technique since it will really speed things up down the road. With this in view, our environment prefabs go under “SceneAssets”. And that’s pretty much it! Now we can start populating our scene with these prefabs. Get creative and make your level. Once you’re done, let’s have a look at a tool that will help us lay down some plants.

The Instance painter

Chances are once you started to lay down some small objects like rocks and grass, you noticed that it quickly became cumbersome to duplicate and rotate each prefab. Well, there’s a tool that can do all this for us. Let’s just say that you want to lay down some vegetation. To do this quickly you could just find the “VegetationPainter” in your hierarchy (it’s under the “Tools” category”) and select one of the child objects (“VegetationSmall” for example).

Now you can paint vegetation straight onto your terrain!

It works the same way for rocks. Find the object “RocksPainter” and select the child object to paint.

And all of the settings for the brush are in the inspector on this script called “Instance Painter”.

So if you don’t like how random the stones are looking, then just change the “Max Random Rotation”. Start laying down some rocks and foliage to complete your scene

Adding Enemies

Now that our environment is completed, it’s time to start putting some non-static objects into our scene, specifically, enemies. In the prefabs folder, there is a folder called “Characters”. Open this up and you’ll notice there are three separate folders which contain the specific enemy’s prefab.

Have a look at each (Chomper, Grenadier, and Spitter). The “Chomper” enemy:

… will run up to the player and attack them. “Spitter”:

… will shoot acid at the player but run away when the player gets too close. And the “Grenadier” is like the “boss battle” enemy:

… it approaches and attacks the player while also shooting it the player; it can only be damaged when the player strikes it in the back. Go ahead and add whichever you’d like into your scene (Enemies go under the “Characters” category).

When you press play, you’ll see that the console will give you an error saying that you need a NavMesh in order to for the enemies to work.

If you want to learn in detail about Unity’s navigation system, check out this tutorial on the Game Dev Academy: Navigation in Unity. To quickly create a NavMesh we can do one of two things, we can just go to the ground and add a “NavigationSurface” component:

… and click “Bake” …

… or we can go to the Navigation tab and bake it there.

Either way works, it just depends on if you like your NavMesh as a component or as a separate entity. Just make sure that you set the agent type to “Chomper” and not “Humanoid”.

With your NavMesh created, hit play and you’ll see your enemies will work now and that you can attack with Left-Click.

You also can customize the enemies (such as, make them see the player sooner or how much health they have) by tweaking the settings in the inspector. As you can see, you can change how wide the enemy’s sight is or how long they will pursue the player.

As an extra feature, you can make the weapon collectable by dragging in the “WeaponPedestal” prefab from the “Interactables” folder into the scene (it goes under the “Gameplay” category).

Select the child object “StaffTakeTrigger” and drag the “Ellen” character into the empty slot. Set the function to “PlayerCharacter.SetCanAttack” and make sure it is set to “true”.

Then just disable “Can Attack” on the player character…

… and you are set to go! You now have enemies in your scene and also a way to attack them.

Interactables: Moving Platforms

If you go to your project folder and open the 3D Game kit folder, you’ll notice that there is a folder named “Interactables”. Open this up and let’s have a look.

When I first had a look at what was inside, I felt like a five-year-old at Christmas! There are so many fun things here! The prefab we are first going to use is the “MovingPlatform” prefab. The title is pretty self-explanatory so let’s just throw it into our scene to see what it does (it goes under the “Gameplay” category).

As you can see, it gives us two gizmos that tell us the start and end position of the platform. Go ahead and place these transforms in the position that you’d like. Now, if you hit play, you’ll notice that it doesn’t go anywhere. The reason is that we need to make sure that the boolean “Activate” is set to true.

Once it is, we can hit play and watch our platform start off at the “Start” transform and then interpolate to the “End” position. But you’ll notice that it only does this once. If you’d like to have it loop through this action or bounce back and forth between transforms, we can do that by changing the “Loop Type”.

With this set to “Ping Pong,” the platform will bounce back and forth between the start and end position. “Repeat” will see the platform translate to the end position and then reset to the start when it reaches the transform. I’m sure you can think of when you’d need to use either setting so just utilize it to serve your purposes. And you can obviously customize how the platform translates by changing the “Duration”, “Start Delay”, and even the way in which it accelerates by editing the curve.

Conclusion

So as I said we would in the beginning, we’ve gone through level creation and how to implement an interactable game object. We’ve also covered how to add enemies into your level (I guess those could count as an “interactable” too). Just from doing those things, you probably already know that we have only covered the tip of the iceberg when it comes to the 3D Game Kit. I suggest that you investigate for yourself the other things that this kit can do. You could do that, or, you could read the second part of this tutorial. Whatever you chose to do, just:

Keep making great games!

]]>
Procedural Maze Creation in C# and Unity – Part 3 https://gamedevacademy.org/procedural-maze-unity-tutorial-part-3/ Wed, 20 Jan 2021 01:00:31 +0000 https://coding.degree/?p=850 Read more]]> When I was in school studying mathematics (like all other students), my favorite problems to work on would be the ones that had some sort of real-world meaning. That is to say, I’d rather calculate how much fence should go around a piece of land than determine whether a transformation in R3 was one-to-one or not (as an aside, the latter is probably easier to calculate). I think the same is true in this instance.

Up to this point in Part 1 and Part 2, we haven’t seen any tangible results from all our programming. It’s been “write this code, try to understand the logic, and it’ll help us later.” This tutorial marks the end of this “era of abstraction” and the beginning of finally putting tangible results to our work. In this final section of our tutorial series, we’re going to be writing the spawner class to instantiate our procedural maze in Unity – achieving the goal we’ve been after all along! So if you’re ready to conquer the final stage of procedural generation, let’s get into it.

Source Code

This tutorial is the third part of a series. You can read the previous tutorial here: Procedural Maze Creation in C# and Unity – Part 2 or you can simply download the source code from the previous tutorial to follow with this tutorial Source Code.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

The Maze Spawner Class.

Create a new C# script called “MazeSpawner” and open it up in Visual Studio:

The new MazeSpawner script in the project files

In accordance with our data-flow strategy, the Maze Spawner class is the final class that takes in all the data given by the Base and Algorithm classes and spits out a complete maze. The logic for the spawner class is very similar to the algorithm class in the sense that we have to check each direction to determine where the walls and open spaces are. The main difference is that the spawner class is not recursive. Most of the action in this class is going to occur at the beginning of the game (in the Start method).

Before we actually code the spawner class, let’s think about what sorts of variables we’re going to be needing. Right off the bat, you can probably already see that we need some game object variables. We’re going to be spawning in the floor, the walls, and some pillars (essentially the corners), so you know we’re going to need at least three Gameobject variables. Also, this is where we can set the size of the maze in the inspector. Remember that the base class takes in the row and column size. We can provide the row and column size by making them a public integer variable that is set in the inspector

Here are all the variables we’re going to be using:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MazeSpawner : MonoBehaviour
{
	public enum MazeGenerationAlgorithm
	{
		PureRecursive
	}

	public MazeGenerationAlgorithm Algorithm = MazeGenerationAlgorithm.PureRecursive;
	public bool FullRandom = false;
	public int RandomSeed = 12345;
	public GameObject Floor = null;
	public GameObject Wall = null;
	public GameObject Pillar = null;
	public int Rows = 5;
	public int Columns = 5;
	public float CellWidth = 4;
	public float CellHeight = 4;
	public bool AddGaps = false;
	public GameObject GoalPrefab = null;

	private BasicMazeGenerator mMazeGenerator = null;

	// Start is called before the first frame update
	void Start()
       {
        
       }
}

Hopefully, it makes some sense why a lot of these variables are here. In this case, we’re including an enumerator which we can use to determine which algorithm we’re going to be using. We’ve only got the recursive algorithm in it but in case we were to add more algorithms, we can switch between them by using this enumerator.

Also, note that we’re using a random seed in this instance. This is going to be tied to the “FullRandom” boolean which is set to “false” by default. If it is false, then we use what’s called “pseudo-random” values. We can tell Unity to use this seed (the 12345 integer sequence) to make it look like it’s random when in fact it’s some form of a preset. Having a seed could be used to prevent the exact same maze from being generated. We aren’t going to be using this too much with the recursive algorithm, but it can be very helpful for different types of algorithms.

The “CellWidth” and “CellHeight” variables dictate the actual size of the cell itself. If this value is too large, it can leave gaps in the maze. We don’t have any goal prefabs but I’ll leave this here in case you want to add it. Finally, we have a private instance of the BasicMazeGenerator (also known as the base class) from which we’ll use the “GetMazeCell” method to grab all the specifics (namely, where the walls are) of that particular cell.

The logic for actually spawning the maze looks like this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MazeSpawner : MonoBehaviour
{
	public enum MazeGenerationAlgorithm
	{
		PureRecursive
	}

	public MazeGenerationAlgorithm Algorithm = MazeGenerationAlgorithm.PureRecursive;
	public bool FullRandom = false;
	public int RandomSeed = 12345;
	public GameObject Floor = null;
	public GameObject Wall = null;
	public GameObject Pillar = null;
	public int Rows = 5;
	public int Columns = 5;
	public float CellWidth = 5;
	public float CellHeight = 5;
	public bool AddGaps = false;
	public GameObject GoalPrefab = null;

	private BasicMazeGenerator mMazeGenerator = null;

	// Start is called before the first frame update
	void Start()
    {
		if (!FullRandom)
		{
			Random.InitState(RandomSeed);
		}
		switch (Algorithm)
		{
			case MazeGenerationAlgorithm.PureRecursive:
				mMazeGenerator = new RecursiveMazeAlgorithm(Rows, Columns);
				break;
		}
		mMazeGenerator.GenerateMaze();
		for (int row = 0; row < Rows; row++)
		{
			for (int column = 0; column < Columns; column++)
			{
				float x = column * (CellWidth + (AddGaps ? .2f : 0));
				float z = row * (CellHeight + (AddGaps ? .2f : 0));
				MazeCell cell = mMazeGenerator.GetMazeCell(row, column);
				GameObject tmp;
				tmp = Instantiate(Floor, new Vector3(x, 0, z), Quaternion.Euler(0, 0, 0)) as GameObject;
				tmp.transform.parent = transform;
				if (cell.WallRight)
				{
					tmp = Instantiate(Wall, new Vector3(x + CellWidth / 2, 0, z) + Wall.transform.position, Quaternion.Euler(0, 90, 0)) as GameObject;// right
					tmp.transform.parent = transform;
				}
				if (cell.WallFront)
				{
					tmp = Instantiate(Wall, new Vector3(x, 0, z + CellHeight / 2) + Wall.transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;// front
					tmp.transform.parent = transform;
				}
				if (cell.WallLeft)
				{
					tmp = Instantiate(Wall, new Vector3(x - CellWidth / 2, 0, z) + Wall.transform.position, Quaternion.Euler(0, 270, 0)) as GameObject;// left
					tmp.transform.parent = transform;
				}
				if (cell.WallBack)
				{
					tmp = Instantiate(Wall, new Vector3(x, 0, z - CellHeight / 2) + Wall.transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;// back
					tmp.transform.parent = transform;
				}
				if (cell.IsGoal && GoalPrefab != null)
				{
					tmp = Instantiate(GoalPrefab, new Vector3(x, 1, z), Quaternion.Euler(0, 0, 0)) as GameObject;
					tmp.transform.parent = transform;
				}
			}
		}
	}
}

First off, you’ll notice that we’re doing everything in the Start method and we’re using for-loops instead of recursion. This makes the most sense since all we need to do is spawn stuff in. Secondly, the logic, though dense, is fairly straightforward. We simply loop through all the rows and columns (notice the nested for-loops) and spawn a wall where there is a wall, a floor at each cell, and pillars later on. Also, note that we’re calling the “GenerateMaze” method on the algorithm class. This is extremely important since we want to make sure there is an actual maze before we start spawning things. A bit of spawning math is done in each wall check (lines 53, 58, 63, 68, and 73). This is to make sure the wall spawns on the edge and not at a corner.

That takes care of the walls, but we also need to add some pillars. In our case, these pillars are simply there to fill in the gaps left by the walls. If you’d like, you can save this out and assign the prefabs. The maze would look something like this with the hard corners:

Α maze with hard corners

It’s a simple bit of code to add pillars in. Very similar to the wall logic except we want a pillar on each corner (lines 78-91).

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MazeSpawner : MonoBehaviour
{
	public enum MazeGenerationAlgorithm
	{
		PureRecursive
	}

	public MazeGenerationAlgorithm Algorithm = MazeGenerationAlgorithm.PureRecursive;
	public bool FullRandom = false;
	public int RandomSeed = 12345;
	public GameObject Floor = null;
	public GameObject Wall = null;
	public GameObject Pillar = null;
	public int Rows = 5;
	public int Columns = 5;
	public float CellWidth = 5;
	public float CellHeight = 5;
	public bool AddGaps = false;
	public GameObject GoalPrefab = null;

	private BasicMazeGenerator mMazeGenerator = null;

	// Start is called before the first frame update
	void Start()
    {
		if (!FullRandom)
		{
			Random.InitState(RandomSeed);
		}
		switch (Algorithm)
		{
			case MazeGenerationAlgorithm.PureRecursive:
				mMazeGenerator = new RecursiveMazeAlgorithm(Rows, Columns);
				break;
		}
		mMazeGenerator.GenerateMaze();
		for (int row = 0; row < Rows; row++)
		{
			for (int column = 0; column < Columns; column++)
			{
				float x = column * (CellWidth + (AddGaps ? .2f : 0));
				float z = row * (CellHeight + (AddGaps ? .2f : 0));
				MazeCell cell = mMazeGenerator.GetMazeCell(row, column);
				GameObject tmp;
				tmp = Instantiate(Floor, new Vector3(x, 0, z), Quaternion.Euler(0, 0, 0)) as GameObject;
				tmp.transform.parent = transform;
				if (cell.WallRight)
				{
					tmp = Instantiate(Wall, new Vector3(x + CellWidth / 2, 0, z) + Wall.transform.position, Quaternion.Euler(0, 90, 0)) as GameObject;// right
					tmp.transform.parent = transform;
				}
				if (cell.WallFront)
				{
					tmp = Instantiate(Wall, new Vector3(x, 0, z + CellHeight / 2) + Wall.transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;// front
					tmp.transform.parent = transform;
				}
				if (cell.WallLeft)
				{
					tmp = Instantiate(Wall, new Vector3(x - CellWidth / 2, 0, z) + Wall.transform.position, Quaternion.Euler(0, 270, 0)) as GameObject;// left
					tmp.transform.parent = transform;
				}
				if (cell.WallBack)
				{
					tmp = Instantiate(Wall, new Vector3(x, 0, z - CellHeight / 2) + Wall.transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;// back
					tmp.transform.parent = transform;
				}
				if (cell.IsGoal && GoalPrefab != null)
				{
					tmp = Instantiate(GoalPrefab, new Vector3(x, 1, z), Quaternion.Euler(0, 0, 0)) as GameObject;
					tmp.transform.parent = transform;
				}
			}
		}
		if (Pillar != null)
		{
			for (int row = 0; row < Rows + 1; row++)
			{
				for (int column = 0; column < Columns + 1; column++)
				{
					float x = column * (CellWidth + (AddGaps ? .2f : 0));
					float z = row * (CellHeight + (AddGaps ? .2f : 0));
					GameObject tmp = Instantiate(Pillar, new Vector3(x - CellWidth / 2, 0, z - CellHeight / 2), Pillar.transform.rotation) as GameObject;
					tmp.transform.parent = transform;
				}
			}
		}
	}
}

If you read through the above code, you might find some confusing characters such as the “?” in a line like this:

float x = column * (CellWidth + (AddGaps ? .2f : 0));

This is what’s called the “Ternary Conditional Operator.” It’s a special operator in C# that evaluates a boolean (like the “AddGaps” boolean) and executes what’s called the “consequent” or “alternative” expressions. In this case, the “AddGaps” boolean is evaluated. If it is true (as in, we want gaps in the maze), then we add a little bit to each x and y variable both in the logic for the pillars and the logic for the walls. This effectively creates gaps in the maze. If we don’t want gaps (which, by default, the “AddGaps” boolean is set to false), then we simply add zero to each x and y variable as we do in the above example. All that can be determined in one line which is a pretty handy trick that can make your programming better.

Setting up the scene

Now we can finally add this element to our scene. Create a new empty game object called “Maze Spawner.”

Adding an empty game object to the scene that will be our Maze Spawner

Add the “MazeSpawner” script onto this game object.

The MazeSpawner Script added onto the maze spawner object

Now we need to go into the “Maze Creation Asset Pack” and drag in the floor, wall, and pillar prefabs.

Placing the wall, floor, and pillar prefabs onto the MazeSpawner script

Now you can just hit play and see your newly created maze!

A complete maze with gaps

If you notice, however, there are very large gaps in the maze. This can easily be fixed by changing the cell size variables. I’ve found that 4 for each seems to close them quite well.

Cell size changed to 4

The brand new, procedurally generated maze!

Just like that, we’ve got a brand new, procedural maze!

A Recap

Let’s say you have to solve a problem or accomplish a task which was similar to this project in many ways. A task whose solution was obviously code-oriented and required a thoroughly logic-based approach. What general practices could be taken away from this project that could help you with that project? Some key takeaways would be drawing a graph or diagramming how your classes are going to talk to each other. Kind of like this:

A graph explaining how the classes will be setup

Just something that shows what sorts of data each class relies on, why it’s there, what it does, etc. This will mostly prevent you from getting lost as you start coding. It doesn’t have to be complicated or polished, but it might be useful.

Secondly, and this may be more psychological, do not be afraid to use all that the language gives you. In this case, part of the reason the solution is so elegant is because of the way C# does inheritance. “Inheritance” describes a language’s ability for things like classes to use or implement methods that have been roughly defined. In our case, we create our own “base” class. Normally, all scripts would inherit from “Monodevelop” but because we knew what we needed to do, we could make our own abstract class to inherit from. This is one of the strengths with C#. Being it’s an object-oriented language, we’re allowed to have multiple classes talking to each other and performing tasks.

Conclusion

This project was pretty dense when it comes to code. There were a lot of complex topics we talked about and it probably was easy to get lost in all of it. Also, it is not the most intuitive and obvious approach when it comes to procedural generation. That is to say, if you had no experience with making a procedural maze (even if you were familiar with recursion), this might not have been your immediate approach.

Nevertheless, I think it is a very effective, elegant, and efficient approach for maze creation. This is not to mention we deeply explored a lot of theory which is sure to help you in the days to come as you experiment and find out everything procedural generation has to offer. Not only are these skills bound to help you with your future projects, but you’ll be able to add even more variety to your games! I hope you enjoyed this topic as much as I did!

Keep making great games!

]]>
Procedural Maze Creation in C# and Unity – Part 2 https://gamedevacademy.org/procedural-maze-unity-tutorial-part-2/ Wed, 13 Jan 2021 01:00:19 +0000 https://coding.degree/?p=759 Read more]]> Computers can handle repetition. In fact, it is one of the things computers are exceptionally good at. As we discussed in Part 1, this ability is a core value that lets us add procedurally generated levels to our games – adding both variety and replayability.

In this tutorial, we’re going to be utilizing this “skill” computers have to make a recursive algorithm. From the last part, we’ve already built the base class with the necessary attributes and set up our Unity project. Now, we’re going to be actually building the algorithm from that base class which we can later use to generate a procedural maze. Recursive algorithms can be very powerful and useful (as you’ll see more in Part 3), and I hope you find this subject equally as intriguing as I do. If you’re ready to take the next step into the world of procedural generation, let’s jump into it!

Starter files

This tutorial is the second part of a series that began with this tutorial Part 1. If you’d like to start off exactly where we left off with that tutorial, you can download the source code here: Source Code.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

An Overview of the Logic

Let’s have a look at our strategy for this project:

A graph explaining how the classes will be setup

In this tutorial, we’re going to be working on the Algorithm Class. Recall that the base class looked like this:

using UnityEngine;
using System.Collections;

//<summary>
//Basic class for maze generation logic
//This is inherited by the recursive Maze Generator
//</summary>
public abstract class BasicMazeGenerator {
	
	//Used to obtain the Row and Column from the private variables 

	public int RowCount{ get{ return mMazeRows; } }
	public int ColumnCount { get { return mMazeColumns; } }

	private int mMazeRows;
	private int mMazeColumns;
	private MazeCell[,] mMaze;

	//A constructor that makes the rows and columns non-zero
	//and instantiates a new MazeCell at that specific rank and range

	public BasicMazeGenerator(int rows, int columns){
		mMazeRows = Mathf.Abs(rows);
		mMazeColumns = Mathf.Abs(columns);
		if (mMazeRows == 0) {
			mMazeRows = 1;
		}
		if (mMazeColumns == 0) {
			mMazeColumns = 1;
		}
		mMaze = new MazeCell[rows,columns];
		for (int row = 0; row < rows; row++) {
			for(int column = 0; column < columns; column++){
				mMaze[row,column] = new MazeCell();
			}
		}
	}


	//called by the algorithm class to start the algorithm

	public abstract void GenerateMaze();

	public MazeCell GetMazeCell(int row, int column){
		if (row >= 0 && column >= 0 && row < mMazeRows && column < mMazeColumns) {
			return mMaze[row,column];
		}else{
			Debug.Log(row+" "+column);
			throw new System.ArgumentOutOfRangeException();
		}
	}
}

Note on lines 32 to 36, a series of maze cells are instantiated. This is important. The cells are generated in the base class. However, it’s not until we get to the algorithm class that we actually get to do something to those cells. Recall that the “MazeCell” is simply a class with a direction and a series of booleans.

using UnityEngine;
using System.Collections;

public enum Direction{
	Start,
	Right,
	Front,
	Left,
	Back,
};

public class MazeCell {
	public bool IsVisited = false;
	public bool WallRight = false;
	public bool WallFront = false;
	public bool WallLeft = false;
	public bool WallBack = false;
	public bool IsGoal = false;
}

It’s pretty easy to see what the booleans do, they determine if the cell has been visited and the location of the walls around the cell. But what, specifically, is the “Direction” enumerator meant to do? This is used to determine where the open spaces are. Part of the logic in the algorithm class is determining a) how many open spaces a maze cell has and b) knowing where those are (i.e, in front, back, left, or right of the cell).

Given the sets of data we’re given in the base and MazeCell classes, what do we need to do to the algorithm class? We already know it has to be recursive, but what is the recursive algorithm going to look like? Well, we are going to need to do the following:

  • Determine the number of open spaces on a maze cell
  • Store that number
  • Move to an open space

We’ve already discussed how to do that part. However, that description seems to be more like a strategy for solving a maze, not building one. What bits of logic can we use to build a maze? Well, we can approach it like this:

  1. Assume we start in a corner, not the center. This could be rank 0 and range 0 (i.e. the cell on the zeroth column and zeroth row).
  2. We know a corner has (at least) two walls and (at least) two open spaces.
  3. Since the cells have already been generated, we need to make sure we haven’t already visited a cell (i.e. !IsVisited).
  4. We know there are no cells outside of the maze, therefore, “IsVisited” would equal false on the edges (this bit of logic is what puts up the two corner walls)
  5. We know a corner has (at least) two open directions.
  6. We can then randomly pick from those open directions to determine where to move next.
  7. We can then put a wall in the open direction we didn’t go (i.e., if we have the left and right directions open and we randomly choose the left direction, why not put a wall in the right direction?)
  8. Once we have moved to that cell, we do another check to see where the open spaces are, and if it has been visited already.
  9. If we know the open spaces of a cell, we can just repeat all the steps starting at step 6.

Believe it or not, that is all the bits of logic we need. This is why I say the recursive method of maze generation, while not the most intuitive at times, is undoubtedly the most elegant. Just a few coding tricks and a bit of discrete math can generate a completely new maze for us.

Coding the Algorithm

Create a new C# script called “RecursiveMazeAlgorithm”

Creating the algorithm script

First off, we need to make sure this inherits from our “BasicMazeGenerator” class and not “MonoBehaviour”

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
   
}

We need to initialize this class and tell it to get all its row and column data from the base class.

using System.Collections.Generic;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
	public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}
}

Now, you’ll probably notice the class name is underlined in red. This is because we need to implement the abstract method “GenerateMaze” that comes from the base class. Implement the “GenerateMaze” method and create a new method called “VisitCell” which is going to be called in “GenerateMaze.”

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
	public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}

    public override void GenerateMaze()
    {
        VisitCell(0, 0, Direction.Start);
    }

    private void VisitCell (int row, int column, Direction moveMade)
    {

    }
}

We’re mostly going to be using an integer value to store the number of available moves and we’ll use an array to store in which direction those possible moves are.

using System.Collections;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
	public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}

    public override void GenerateMaze()
    {
        VisitCell(0, 0, Direction.Start);
    }

    private void VisitCell (int row, int column, Direction moveMade)
    {
        Direction[] movesAvailable = new Direction[4];
        int movesAvailableCount = 0;

    }
}

Most of the action in this class is going to take place within a do-while loop.

using System.Collections;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
    public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}

    public override void GenerateMaze()
    {
        VisitCell(0, 0, Direction.Start);
    }

    private void VisitCell (int row, int column, Direction moveMade)
    {
        Direction[] movesAvailable = new Direction[4];
        int movesAvailableCount = 0;

        do
        {

        } while (movesAvailableCount > 0);
    }
}

The condition for this loop is “movesAvailableCount” being greater than zero. This makes sense since we want to apply our logic for each available move. Also, if you’re not familiar with the difference between a do-while loop and a while loop, for our purposes, the main difference is that a do-while loop is guaranteed to be called at least once. This is very important for recursive functions since we’re going to be calling this “VisitCell” method from within itself.

Next, we need to work on the logic that will determine where an open space is and where a wall is. Since we’re working with cells that have already been made, we can use the “GetMazeCell” method we created on the base class. Also, since it’s a grid, think about moving left or right within the maze as incrementing the “row” and “column” variables. Therefore, to move right, we would increment the “column” variable by one (moving to the cell in the next column), and moving forward would be incrementing the “row” variable by one. It is a fairly intuitive way of moving through the maze but it’s worth mentioning since the code for the logic is going to look like this:

using System.Collections;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
	public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}

    public override void GenerateMaze()
    {
        VisitCell(0, 0, Direction.Start);
    }

    private void VisitCell (int row, int column, Direction moveMade)
    {
        Direction[] movesAvailable = new Direction[4];
        int movesAvailableCount = 0;

        do
        {
			movesAvailableCount = 0;

			//check move right

			if (column + 1 < ColumnCount && !GetMazeCell(row, column + 1).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Right;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Left)
			{
				GetMazeCell(row, column).WallRight = true;
			}
			//check move forward

			if (row + 1 < RowCount && !GetMazeCell(row + 1, column).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Front;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Back)
			{
				GetMazeCell(row, column).WallFront = true;
			}
			//check move left

			if (column > 0 && column - 1 >= 0 && !GetMazeCell(row, column - 1).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Left;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Right)
			{
				GetMazeCell(row, column).WallLeft = true;
			}
			//check move backward

			if (row > 0 && row - 1 >= 0 && !GetMazeCell(row - 1, column).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Back;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Front)
			{
				GetMazeCell(row, column).WallBack = true;
			}

			GetMazeCell(row, column).IsVisited = true;

		} while (movesAvailableCount > 0);
    }
}

It’s a dense bit of code (but not the densest we’ll be dealing with!) but I think it’s reasonably easy to understand the logic of what’s going on. An extremely important part to understand is the difference between an if-statement, an else-statement, and an if-else statement. We’re using if-else in this class which means the “else” condition will be evaluated only if the “if” statement is false. If it is true, the else-if statement doesn’t get checked at all. If it was an “if” statement it would be checked immediately after the previous “if” statement and if it was an “else” statement, the code inside would be executed if the the “if” statement was false (something we don’t want in this case). If you keep that in mind, it should be fairly easy to understand what’s going on here. Also note that once we’ve done all those checks, we mark the cell as being visited.

Now, we need to tell it where to go next. This is where we do the recursive part. The code looks like this:

using System.Collections;
using UnityEngine;

public class RecursiveMazeAlgorithm : BasicMazeGenerator
{
	public RecursiveMazeAlgorithm(int rows, int columns) : base(rows, columns)
	{

	}

    public override void GenerateMaze()
    {
        VisitCell(0, 0, Direction.Start);
    }

    private void VisitCell (int row, int column, Direction moveMade)
    {
        Direction[] movesAvailable = new Direction[4];
        int movesAvailableCount = 0;

        do
        {
			movesAvailableCount = 0;

			//check move right

			if (column + 1 < ColumnCount && !GetMazeCell(row, column + 1).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Right;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Left)
			{
				GetMazeCell(row, column).WallRight = true;
			}
			//check move forward

			if (row + 1 < RowCount && !GetMazeCell(row + 1, column).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Front;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Back)
			{
				GetMazeCell(row, column).WallFront = true;
			}
			//check move left

			if (column > 0 && column - 1 >= 0 && !GetMazeCell(row, column - 1).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Left;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Right)
			{
				GetMazeCell(row, column).WallLeft = true;
			}
			//check move backward

			if (row > 0 && row - 1 >= 0 && !GetMazeCell(row - 1, column).IsVisited)
			{
				movesAvailable[movesAvailableCount] = Direction.Back;
				movesAvailableCount++;
			}
			else if (!GetMazeCell(row, column).IsVisited && moveMade != Direction.Front)
			{
				GetMazeCell(row, column).WallBack = true;
			}

			GetMazeCell(row, column).IsVisited = true;

			if (movesAvailableCount > 0)
			{
				switch (movesAvailable[Random.Range(0, movesAvailableCount)])
				{
					case Direction.Start:
						break;
					case Direction.Right:
						VisitCell(row, column + 1, Direction.Right);
						break;
					case Direction.Front:
						VisitCell(row + 1, column, Direction.Front);
						break;
					case Direction.Left:
						VisitCell(row, column - 1, Direction.Left);
						break;
					case Direction.Back:
						VisitCell(row - 1, column, Direction.Back);
						break;
				}
			}

		} while (movesAvailableCount > 0);
    }
}

A fairly simply switch-case that calls this “VisitCell” method from within itself. Note that we’re still upholding the method of navigation through the cells (i.e. incrementing the column by one moves right and incrementing the row by one moves forward). Also, note that we’re choosing a random direction by using “Random.range” and “movesAvailableCount.” Even though we’re not going to be able to see it (everything we’ve written still needs to go through the spawner class), you can add a couple of debug lines that will help you see how the logic works when the maze is spawned in.

for (int i = movesAvailableCount; i>0; i--)
{
        Debug.Log("Maze Cell has " + movesAvailable[i] + " Open direction");
}

Conclusion

Congratulations – you’ve just built an algorithm to generate our maze! It was an intensive and elusive process, but through some solid foundations, you’ve seen how we can get it done. That being said, everything until this point has been fairly abstract in the sense that we haven’t done anything in the game world. This is tutorial ends this “era of abstraction.”

In the next tutorial, we’re going to be taking the cells and walls we’ve made and instantiate floors and “actual” walls. If you thought this tutorial was fun, we’re going to be doing even more fun things in the next lesson. The logic for spawning a maze is very similar to how we handled the algorithm class. In this sense, you are already familiar with the approach and so I can’t wait to see you there. Until then…

Keep making great games!

]]>
Make Games without Coding – Free Unreal Engine Ebook https://gamedevacademy.org/make-games-without-coding-free-unreal-engine-ebook/ Mon, 28 Dec 2020 01:22:48 +0000 https://gamedevacademy.org/?p=2044 Read more]]> We are excited to announce our latest eBook: Unreal Engine Game Development for Beginners

Authored by Unreal Engine expert Daniel Buckley, this eBook explores all there is to know about getting started with Unreal Engine development. You’ll learn not only how to work with the foundations of the engine itself, but also develop several projects from scratch including an FPS game, an action RPG, a road-crossing game, a platfromer, and a puzzle-like game! In addition, you’ll do all this while using the Blueprints Visual Scripting system – meaning no prior coding knowledge is required or needed to create your game projects!

Whether you’ve always wanted to learn Unreal Engine or want to start putting knowledge into practice, this eBook will help you gain the in-demand skills necessary to start building your dream game projects!

Download the eBook here

]]>
Procedural Maze Creation in C# and Unity – Part 1 https://gamedevacademy.org/procedural-maze-unity-tutorial/ Wed, 09 Dec 2020 01:00:21 +0000 https://coding.degree/?p=520 Read more]]> The great advantage computers have when compared with their human counterparts is the ability to perform the same task over and over again with the same level of precision. They do not tire like humans often do when faced with crunching mathematical equations over and over again. Further, given decent hardware, a computer can execute several mathematical operations in a matter of milliseconds – which is far beyond what the normal human is capable of.

What does all this mean for you as a game developer, though? It means that things like procedural generation are possible to add variety to your games – as computers are more than capable of generating a level on the fly in seconds! In this tutorial, we are going to show you how to harness this aspect of computers to procedurally generate a maze level before runtime. We will be using C# and Unity to explore not only the details of the C# data structure, but also a handy programming trick called “recursion.” We’re going to be looking at how an ancient math problem can help us build this maze generating tool.

Because of this, it is recommended that you have some familiarity with Unity and programming in C#. This could be considered an Intermediate to Advanced tutorial. However, I will be explaining everything in detail so if you are not completely confident in your C# skills, simply follow along anyway. Let’s get started!

Download Assets

We are going to be making use of some prefabs that we will be spawning into the scene. You can download these assets by using this link: Source Files. Download the assets and import them into an empty Unity project.

This project was inspired and based on an asset by “styanton” on the Unity Asset Store which you can check out here: Maze Generator

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

Designing an Algorithm

Before we begin, let’s talk about designing an algorithm for our maze which we’ll use in Part 2 of this tutorial. This section will be adapted from and inspired by the book Advanced Topics in C by Noel Kalicharan – so if you’d like more details go check that book out. Here, however, I will strive to explain this topic in a more condensed, bite-sized form to suit our purposes.

If you wanted to write some code that would generate a maze for you, how would you start? Figuring out where to start can be extremely helpful for a problem such as this, mostly because it is likely a solution has already been found and we simply need to search it up. When it comes to maze creation, there are a couple of different approaches. Certain approaches worth mentioning might be having a computer generate an image texture that consists of white and black spaces that form the outline of a maze. Then we simply spawn a wall at either a black or white space (whichever color represents a wall). This method may be a bit easier to visualize but it would be a bit more difficult to write out in code.

The approach we are taking is a more mathematical approach. You might think of it as the “Recursive Method.” When we think about mazes (as in, how they are made), we can see there is a pattern to them, namely, there is a certain set of steps that, if executed exactly, will always solve the maze. Think of it like this: if you’re placed in a maze and you have no prior knowledge about how it was constructed (i.e., no map or “birds-eye view”), you could finish the maze by simply noting where you can’t go (i.e., where a wall is) and where you can go (i.e. where an empty spot is). Assume you’ve got a way to keep track of all the places you can and can’t go, then it’s a relatively simple task of checking each spot that you can go to. Eventually, you’ll end up at the exit.

Now that probably doesn’t sound like a very solid plan if you’re stuck in a maze. It would take much too long to check each possible path. Naturally, we would get quite tired if we attempted this strategy. But a computer wouldn’t get tired. As we’ve said before, a computer can execute the exact same task over and over again with much more precision and much more speed. Here’s where we can use that aspect to solve our problem. Here’s where the subject of recursion comes into play.

In computer science, “recursion” is where a method or function is defined in terms of itself. A way it sometimes crops up is when a method calls itself. This would put the method into a sort of infinite loop. Usually, some condition is set up inside of the method that prevents it from being called an infinite amount of times (it wouldn’t be particularly useful if that was the case). To illustrate the usefulness of this method, we can turn to the classic example of the Towers of Hanoi, a puzzle game with simple rules. It involves a number of disks (let’s say 3), those same disks on a number of poles (let’s say 3 again), and two rules: 1) you can only move one disk (the disk on top) and 2) you can’t put a larger disk on top of a smaller one.

An illustration of the tower puzzle

How would you go about moving the entire stack of disks to another pole while abiding by those rules? The answer isn’t intuitively obvious and I certainly wouldn’t be one to give you an answer right off the bat. Nevertheless, we can write a recursive function that would solve this for us. Further, we can write a program that could solve much larger puzzles than three discs and three poles.

Let’s have a look at the solution to this particular puzzle. Let’s assume we know how to move the top two disks to pole B by using poles B and C.

Moving the top two disks to B

We could then move the third disk to C and (assuming we can move the top two as we did before) we can move the top two disks on top of the third on C.

Moving the bottom disk to C and the top two to C

The actual specifics of how we did the intermediate steps are not particularly complicated. Based on this solution, we can abstract this process to design a recursive algorithm to solve this puzzle. Notice that we did the following:

  • Moved n-1 disks from A to B using C
  • Moved the nth disk from A to C
  • Moved n-1 disks from B to C by using A

(in this case, n = 3)

Writing this in code looks like this:

void Hanoi (int n, pole start, pole end, pole intermediate)
{
	if (n > 0)
	{
		Hanoi (n - 1, start, intermediate, end);
		print("Moved disk from " + start.name + " to " + end.name);
		Hanoi (n - 1, intermediate, end, start);
	}
}

Assume that “pole” is a previously defined object that has a string attribute called “name”. Notice that this method calls itself twice. In each case, it goes to the n – 1 disk until n = 0 at which point the method becomes invalid.

I hope you can see a way we can do something similar to generate a maze. Let’s assume a starting point and that it has four sides with either a wall or an open space in each spot. We could check if there’s a wall and record it as not being a walkable space. We could check if there’s an open space and record it as being a walkable space. Starting off with a set number of columns and rows (basically the size of the maze in x and y coordinates) we can then do a final check to make sure we haven’t gone past either of those boundaries. If there’s a walkable space adjacent to the point we are currently at, we can move to that spot and repeat the process all over again. It may sound like we’re trying to solve a maze rather than generate one but, when you consider it more closely, those two activities are essentially the same.

Before we close out this section and begin coding, I hope you realize another important aspect of recursive functions namely, that they are not the most efficient when it comes to memory or processing power. Naturally, if we have a maze with very large boundaries, it will take a good deal longer to generate than one that is half the size. Keep this in mind if you intend to use this technique in your own projects (as I sure hope you do).

Building the Base Class

Let’s be programming optimists. Let’s assume that our code is going to work (every programmer’s dream) and that we’ll add more algorithms and techniques to this maze generator. Since we’re behaving as optimists, we can take a more abstract route when it comes to constructing our classes. Before we start coding, let’s get a plan as to how we should structure our classes. I propose the following data structure:

A graph explaining how the classes will be setup

We can feed the base class some information about the characteristics of a maze cell and the dimensions of that maze. The base class will then take that data, format it to prevent any out-of-range errors, and set up some abstract methods to be implemented by the algorithm class. The algorithm class is where we can put, among other things, our recursion algorithm to generate the maze. This class will run through the algorithm and spit out the “coordinates” (for lack of a better term) where the spawning class will instantiate walls, floors, and other objects that will make up the physical parts of the maze.

We can start implementing this plan by recognizing the need to break the maze up into “cells”. If we break it up into cells, we can have discrete positions from which we can determine if there is an empty space or a wall (just like we mentioned in the previous section). If you haven’t done so already, create a new folder in Unity called “Scripts” and create a new C# script called “MazeCell.”

A screenshot of the newly created C# script

This will be an extremely simple script that we will mainly use for storing some information about what is surrounding a cell in the maze. To tell if there is a wall or an open space, we need 6 booleans; one to tell if the cell had been visited before, four to determine if there is a wall or not on each of its four sides, and a 6th boolean to determine if we should spawn a collectible at that point. This works out in the code like this:

using UnityEngine;
using System.Collections;

public enum Direction{
	Start,
	Right,
	Front,
	Left,
	Back,
};
public class MazeCell {
	public bool IsVisited = false;
	public bool WallRight = false;
	public bool WallFront = false;
	public bool WallLeft = false;
	public bool WallBack = false;
	public bool IsGoal = false;
}

Notice that we are not inheriting from Monobehaviour and that we are also defining an enumerator. The reason we do this is to determine which direction we should go after we have checked this cell.

Having defined the MazeCell class, we can implement it into a slightly more complicated base class that our algorithm script will inherit from. In the base class, we need a check to make sure the dimensions of the maze aren’t zero (these dimensions are supplied in the Unity Editor). We also need a method that will return any cell of the maze if its rank and range are supplied (essentially, it’s x and y position on the maze). Finally, we need an abstract class that will be implemented by the algorithm class to start the recursive algorithm. Create a new C# script called “BasicMazeGenerator” and write the following lines of code in it:

using UnityEngine;
using System.Collections;

public abstract class BasicMazeGenerator {
	
	//Used to obtain the Row and Column from the private variables 

	public int RowCount{ get{ return mMazeRows; } }
	public int ColumnCount { get { return mMazeColumns; } }

	private int mMazeRows;
	private int mMazeColumns;
	private MazeCell[,] mMaze;

	//A constructor that makes the rows and columns non-zero
	//and instantiates a new MazeCell at that specific rank and range

	public BasicMazeGenerator(int rows, int columns){
		mMazeRows = Mathf.Abs(rows);
		mMazeColumns = Mathf.Abs(columns);
		if (mMazeRows == 0) {
			mMazeRows = 1;
		}
		if (mMazeColumns == 0) {
			mMazeColumns = 1;
		}
		mMaze = new MazeCell[rows,columns];
		for (int row = 0; row < rows; row++) {
			for(int column = 0; column < columns; column++){
				mMaze[row,column] = new MazeCell();
			}
		}
	}


	//called by the algorithim class to start the algorithm

	public abstract void GenerateMaze();

	public MazeCell GetMazeCell(int row, int column){
		if (row >= 0 && column >= 0 && row < mMazeRows && column < mMazeColumns) {
			return mMaze[row,column];
		}else{
			Debug.Log(row+" "+column);
			throw new System.ArgumentOutOfRangeException();
		}
	}

As you can see, the constructor checks to make sure the data coming from the Unity Editor is greater than zero. This is important because the recursion algorithm will only run if it’s greater than zero (we’re going to set up a condition that ensures this). The “GetMazeCell” will be used by the recursion class to determine and set the booleans on the MazeCell class; it will also be used in the spawner class to instantiate the floor and walls of that cell. There’s not that much code that is going into this class but as you will soon see, we’re going to be using this base class extensively in the next few tutorials.

Conclusion

I don’t know about you, but I find this approach to procedural maze generation quite elegant and in some ways, beautiful. In this project, we are taking advantage of the unique way C# handles inheritance. For some odd reason, it seems quite satisfying to use C# in all its glory. The other C languages can produce similar results – but in my opinion, C# does it best. Regardless of how you feel, you’ve taken the first step with procedural generation by getting the foundations and data structures sorted!

In the next tutorial, we’re going to be building the recursion algorithm from the ground up. We’re going to be utilizing both the base class and the Maze Cell class to craft the algorithm class. We’re going to be exploring even further into the C# system of inheritance, start using some neat syntactical tricks to speed up your coding, and begin implementing the methods we’ve just created. I’m looking forward to seeing you in the next lessons where we’ll really hit the ground running with procedural generation!

Keep making great games!

Resources:

]]>