RPG Creation Tutorial For Beginner Programmers

Charles Brant


Complete Guide To Game Design: Free Tutorial About How To Code A Game For Beginners

For some people gaming is just not enough, and they shift interest in direction of creating games instead (and profiting on it). After that they give a try to their little dream and as you guessed, they fail. They don’t pick best tools, they code in wrong language, they pay for things that have free alternatives, and this chain of mistakes quickly builds up till frustration exceeds motivation. Then they give up on their ambition, even if they were smart or talented or their game idea was really good – they gave up so nothing of that matters anymore.

However, what if they didn’t give up? This free, huge, over 20000-words 3D RPG development guide is targeted specifically at ambitious beginners who want to start with the highest chances of creating a successful game, acquiring players, and making sales. But especially to create a game that will satisfy both them and their players.

If you follow this regularly updated tutorial, you will learn how to make a game using best free modern tools, frameworks and systems. And if you also follow the rest of articles on the site, you will learn how to acquire players through marketing channel, keep them for long, and indirectly gain an edge over your competition.

That along with discipline and effort can result in profiting on coding games as independent developer, in creating a brand, being recognized and making even more sales. But there’s a long way before all that happens, so lets get started from the basics!

Small note, I’ve began developing 3D role playing game recently, in space-fantasy setting (actually more like indie MMORPG). You can check the progress and details at devblog.

Chapter 1: Introduction To RPG Development

RPG Creation Tutorial For Beginner Programmers 1

Perhaps when you came to this site you had many game ideas in mind, maybe you wanted to make 2D clone of Terraria, maybe a mix of Roblox and GTA V, maybe some MMO or Battle Royale. Truth is, I can’t cover all of these in this tutorial, so I went with the most effective choices for our game.

Not only genre, but also the tools that we will use to make this game, our camera perspective, and most important features – are all chosen with having their importance and effectiveness in mind.

This tutorial is long, and that’s why I want you to know why I prefer RPG genre over the others, same about tools and other factors. So read this introduction to making games before we start. It covers all most important factors that will lead you to creation of a game that has the biggest chances of attracting and retaining players, while saving as much money and time as possible, and while not cutting on quality.

After you are done reading it, we will do the first step in game design – install best game engine and set it properly. If you really want to make a game that will at least brush against the competition (and without spending your whole life on it), then you absolutely need to use game engine.

Chapter 2: Getting Unity Game Engine & Account

RPG Creation Tutorial For Beginner Programmers 2

Unity is our choice because of it’s outstanding performance, easiness, limitlessness, C# support and many more. There’s no reason to pick other engine or code the game from scratch instead.

Unity is just perfect so don’t think about changing the tool, which would just reduce your time. Our first step is downloading Unity, installing it and registering an account. So read post about getting Unity engine and account, this is not something complicated, the important part is about how free this engine really is.

If you already installed Unity and know everything about royalties, then its time to create 3D model for our player!

Chapter 3: Modeling First Humanoid Character

RPG Creation Tutorial For Beginner Programmers 3

We could just move the 3D cube around and code movement for it. But that’s boring. Why would someone do that? Blender is like Unity of the modeling world. It’s free. It’s popular. It’s great.

Especially after version 2.8 came out – it’s hard to not love this software. Lets instead model our humanoid player character in Blender so we can work on something that actually resembles a game. Read this chapter about modeling character in Blender, because an indie developer, you will do a lot of things on your own, including modeling, and Blender can really speed up your asset creation.

Not only that, but models made in free Blender aren’t any worse than these made in paid alternatives! But character model alone is useless. What do you want to do with it without animations? So we need to create the most basic animations for running, jumping and being idle before we code the movement.

Chapter 4: Character Movement Animations

RPG Creation Tutorial For Beginner Programmers 4

If you thought gamedevs hate to create models, then you were wrong. What indies truly hate is making animations, and most especially character animations. That’s because the time investment required to make a-not-painful-to-look-at running or jumping animation is very huge comparing to writing a code or doing other parts of our game.

Lets not wait any longer and get to creating run, jump & idle animations for character model in a way that’s much faster and perfect for beginners who already have a lot of stuff to learn. Head to chapter about character animation design, its a small tutorial that uses Mixamo as main source. You can do all your animations this way and in other cases you will have to use Blender – which is just as great at animating as it is at modeling.

So we have movement animations of our character, what we need to do now before we write the code is to hook them to Unity’s Animator.

Chapter 5: Importing Animations & Setting State Machine

RPG Creation Tutorial For Beginner Programmers 5

Creating a 3D character is tough. Not only we need a model, but also an animation, that we later need to set properly in Animator, and all these things need to be done before we can code our movement.

This is why so many people prefer creating 2D games – they are easier. But 3D is just beautiful and limitless. Follow this lesson about Unity Animator and animation, in this chapter we will be creating state transitions & parameters in Unity’s Animator to later interact with our animation via code, and of course to have smooth transitions between each of our clips (e.g. from running to idle or from jumping to running).

This chapter is quite easy (it just looks like its not) so after that is done we will encounter first problems in our programming journey – writing player movement code that interacts with clips via Animator API and character object via Character Controller API.

Chapter 6: Coding First Scripts & Player Movement In C#

RPG Creation Tutorial For Beginner Programmers 6

Coding is the funniest part of game design. Coding is also one of main reasons why people chose Unity instead of other engines. That’s because people absolutely love C#. C# is an amazing, well thought, multi-purpose language.

Coding in C# or even rewriting our code (when something goes wrong) feels more than great. In this chapter we will code 3D player movement, animation & rotation via API of Animator & Character Controller components to later create a camera script that will be great fit to out movement. So head to chapter about coding Unity C# scripts to make our character movement, if you don’t know C# then that’s an issue, however I explained C# basics as well.

What you need for now is to just understand the basic syntax like variables, methods, functions and if statements. If you understand that, further learning of both C# and Unity’s API will go very smooth.

If you test the changes you can see we can already run around and jump but camera doesn’t follow our player. Such gameplay doesn’t make sense so in our next chapter we code a camera script that follows players and orbits him.

Chapter 7: Making Following, Rotating & Orbiting Camera

RPG Creation Tutorial For Beginner Programmers 7

Creating a camera script that will work for 3D FPS, MMO and RPG video games is huge challenge. That’s because it involves messing with complex properties such as quaternions that represent 3D rotation data.

However, you only need to do it once. In this chapter we will create a player-orbiting & player-following camera control script that will be assigned to camera object. Head to chapter about creating Unity camera control script, it can do many things at once, you can decrease or increase the zoom, you can make it look at mouse cursor (it happens by default), or invert axes. It’s great for any 3D single player RPGs, MMORPGs, and is similar to default Unreal Engine camera.

What makes this script different from typical camera is that it’s orbiting the player rotating around him, while looking at mouse. So you can run in one direction, but look with your mouse wherever you want and it won’t change where we are running.

Wouldn’t it be annoying if we had to rotate our character just to rotate our camera? In our next chapter we will be creating RPG inventory system that works for any kind of games, even multiplayer, 3D and 2D.

Chapter 8: Creating Drag & Drop UI RPG Inventory System

RPG Creation Tutorial For Beginner Programmers 8

Whatever game you’re creating, you need an inventory system. Without it, players don’t really feel like they are getting any better, and character development (along with collecting items, weapons and upgrading them) is huge psychological entertainment and game addiction factor.

Not only such inventory is required in all game genres, like RPG, MMO, MOBA, FPS and other kinds, whether multiplayer or singleplayer, but also it is really interconnected with other parts of the game, such as character equipment window, quick-use item bar, skill window, and so on. So inventory system needs to be done wisely.

In this chapter we will create simple 3D inventory for our RPG game (but can be used in other genres and 2D games as well). It’s built on Unity’s canvas UI objects, and items are hold in slot elements. So read chapter about Unity RPG inventory system tutorial, it has drag and drop feature, you can rearrange items in inventory, and pick them up from ground or drop them. It has clean, optimized code, and not much of it, so it’s really easy to read, understand and extend it.

One of good things about this inventory performance-wise is that we use triggers instead of update function, so collision code is not checking if conditions are met all the time, but only during collision.

After you are done creating our inventory we will make an enemy, health-bars and artificial intelligence so our enemy knows when to chase us, when to attack us, and when to stop and go back to his base. We will also implement combat system.

Chapter 9: Coding Unity Enemy AI & Combat System Scripts

RPG Creation Tutorial For Beginner Programmers 9

One of reasons why people prefer multiplayer games from singleplayer is because NPCs are boring and easy to trick, while real players behave in most unexpected ways. One way to fix it is to add multiplayer to your game, but even multiplayer games need smart monsters, enemies and NPCs in it.

In this chapter we will be creating very basic Unity’s artificial intelligence enemy script, combat system, health bars, chasing and attacking, and going back when target is out of sight. So read tutorial about coding Unity AI enemy & combat, enemy will hit in fixed time intervals, and after each attack player HP will be removed.

Whats good about this combat system is that it has clean code, not much of it, it’s easy to understand and extend, just like our inventory. Its also optimized performance-wise.

Nowadays players get bored by static, passive enemies that are easy to run from and won’t attack until you come close. So it would be smart to create more entertaining system for our game, perhaps enemy could attack our village from time to time, or track us in the forest.

Will Your Game Be Successful?

RPG Creation Tutorial For Beginner Programmers 10

If you’ve made it this far, then it means you finished the tutorial before I finished creating it. However, you already know how to make RPG that will really stand out, which tools are best, how to code and make models.

From this point, if you want to make a successful game you just have to constantly work on your Unity project, fix things that aren’t alright, and continue chasing the plan you had for your game.

As your game becomes bigger and better, as you’re learning the ins and outs of programming games in Unity, making sales on your game will become much more realistic option.

Comments (Guests Allowed)

Write A Comment