what are some good tips for someone new to game development?

I am newer to unity and was wondering some tips that will make my time using unity easier.:slight_smile:

Start with Tutorials. Not just to learn how to code (if you don’t already know), but you will learn little tips and tricks for how to organize a project, deal with certain types of objects, animations, etc. Unity can do so much that its overwhelming at first with all the drop downs and buttons you can mess with.

Also, try different tutorials from different YouTubers. Reason being is that you will learn what is common and everyone does, and then you will also learn nuances from each on how to do certain things that the others don’t do or do as efficiently.

Another, start with a game. I don’t recommend just messing around and having a “sandbox” type of project. If you follow a full tutorial and complete a small game, finish it. You will need to learn about making UI and menus, connecting scenes, saving/loading, and more.

Once you have a few tutorials under your belt, try making your own basic game. Keep it very small (don’t try to make your dream game) and try to finish it. Tutorials are amazing but eventually they get stale and you will want to do your own thing.

Lastly, when you start making your own games and have a general understanding of Unity, get GOOD at prototyping. What that means is focus on the mechanics and making the game fun before adding in your own art, animations, sound, etc. You don’t want to waste time with art and such if the game isn’t even any fun. However, when doing tutorials, DO focus on these and use free art from the Unity Asset Store or OpenGameArt.org or such. You will need to learn how to import and work with art, but when making your own, use basic sprites like squares and circles or w/e free art you have to get the game down. If you make something fun with squares and circles, imagine how much fun you can make it with better art.

Lastly lastly, here are some good YouTube channels to try out for tutorials. Circled ones are my recommended but the rest (besides crossed out) are all good too in their own way.

1 Like

@Cornysam is spot on. To the above I would add the usual commercial dev suggestions:

I. Get the coding fundamentals down:
If you are new to code, don’t rely on Unity tutorials alone or even Unity tutorials that just focus on teaching you C#. There is a lot to be said for actually doing some language fundamentals. For this purpose I would highly recommend The design patterns tutorials of Derek Banas which are available on youtube. (You could start with his Java tutorial if you’re absolutely starting from scratch.) Now, ok he uses Java, but:

  1. Java and C# are relatively similar and pretty much everything you can do in modern Java is almost syntactically identical in C#. If you’re even vaguely aware of C# it wont be a hassle to figure out what he’s teaching.
  2. The reality (as I hope you’ll see very quickly) is: the same principals will apply in any Object Oriented language.

With a good basis in design patterns, polymorphism, closures, etc. you will be able to build more efficient, reusable code that saves you mountains of time and helps you avoid coding yourself into corners. Using Unity as the basis for learning is an awesome idea as well because so much of the language is based around configuration. Unless you’re really nailing something the engine can’t handle (and, frankly, if you are you’re probably using the wrong engine), effectively all the algorithmic work you’ll ever need is done for you.

II. Learn to use version control:
If you have been writing projects without git and are serious about developing a game: Start now. your homework is:

  1. Learn about git and how to use it with a demo project. Get good at understanding branches, checking out, etc.
  2. setup a gitlab/github account
  3. find and add a .gitignore file to your project (trust me, this is absolutely essential with game projects)
  4. push your build to your gitlab/github repo.
  5. setup ssh to your gitlab account so you can push to the repo without having to enter a username/password the whole time.
    I appreciate that this process is tricky for newbies, but you should absolutely cut your teeth with it. Backing up your projects with a comprehensive history of every commit you’ve made to git will save your project. I don’t know when or why, but trust me as a commercial dev: one day you will lose code for whatever reason, and if you’re in the habit of saving your projects regularly: git will give you back what you lost. Thanks to git, I can fire up unity on another machine with hardly any configuration, clone my project and I’m good to go again. No faffing around with backup hard drives etc. or praying I find a usb stick down the back of the settee!

III. Get good with coroutines
and be prepared to find them hard to get your head around! they take practice!

2 Likes

Isn’t git and unity a nightmare to work together? I am all for backing up your commits, but someone just starting out doesn’t really need to get this deep. Even just glancing over what is required to set up git and unity properly, it is far too advanced for a new user. Shit even I am confused.

Its not that difficult once you get past the learning curve, which is pretty steep. While it isn’t for a brand new beginner (< 3-6 months), I would argue that it should be learned within the first 6 months - 1 year.

1 Like

Git is super easy if you start with something like GitHub Desktop. It’s also not about “backing up your commits”. It’s about a clear trail of changes and the ability to rollback changes that are more important as a beginner.

It’s also trivial to experiment with a few text files on a local repo to create branches, switch between them, merge them etc. An hour of experimenting and you’ll have 75% of what you might need for day-to-day covered.

1 Like

EXCELLENT question. You will learn by doing, and it will require time, doing again and again, patiently, and more and more of it will make sense, as long as you learn properly (see below).

Almost everything you learn falls into these three broad areas:

API buckets: you may find this helpful to organize your learning:

  • C# language syntax (organization, structure, grammar, punctuation)
  • the .NET API (all the tools that come with C#: lists, dictionaries, file IO, etc)
  • the Unity API (everything in the using UnityEngine; namespace)

When you are doing tutorials there are two steps. Step 1 is trivial, but Step 2 is CRITICAL. Read on:

Tutorials and example code are great, but keep this in mind to maximize your success and minimize your frustration:

How to do tutorials properly, two (2) simple steps to success:

Tutorials are a GREAT idea. Tutorials should be used this way:

Step 1. Follow the tutorial and do every single step of the tutorial 100% precisely the way it is shown. Even the slightest deviation (even a single character!) generally ends in disaster. That’s how software engineering works. Every step must be taken, every single letter must be spelled, capitalized, punctuated and spaced (or not spaced) properly, literally NOTHING can be omitted or skipped.

Fortunately this is the easiest part to get right: Be a robot. Don’t make any mistakes.
BE PERFECT IN EVERYTHING YOU DO HERE!!

If you get any errors, learn how to read the error code and fix your error. Google is your friend here. Do NOT continue until you fix your error. Your error will probably be somewhere near the parenthesis numbers (line and character position) in the file. It is almost CERTAINLY your typo causing the error, so look again and fix it.

Step 2. Go back and work through every part of the tutorial again, and this time explain it to your doggie. See how I am doing that in my avatar picture? If you have no dog, explain it to your house plant. If you are unable to explain any part of it, STOP. DO NOT PROCEED. Now go learn how that part works. Read the documentation on the functions involved. Go back to the tutorial and try to figure out WHY they did that. This is the part that takes a LOT of time when you are new. It might take days or weeks to work through a single 5-minute tutorial. Stick with it. You will learn.

Step 2 is the part everybody seems to miss. Without Step 2 you are simply a code-typing monkey and outside of the specific tutorial you did, you will be completely lost. If you want to learn, you MUST do Step 2.

Of course, all this presupposes no errors in the tutorial. For certain tutorial makers (like Unity, Brackeys, Imphenzia, Sebastian Lague) this is usually the case. For some other less-well-known content creators, this is less true. Read the comments on the video: did anyone have issues like you did? If there’s an error, you will NEVER be the first guy to find it.

Beyond that, Step 3, 4, 5 and 6 become easy because you already understand!

Finally, when you have errors…

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.

Less of a nightmare than the typical post here of “I opened my game today and nothing works anymore… HELP!”

“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards

Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

As far as configuring Unity to play nice with git, keep this in mind:

https://discussions.unity.com/t/736093/3

Here’s how I use git in one of my games, Jetpack Kurt:

https://discussions.unity.com/t/807568/3

Using fine-grained source control as you work to refine your engineering:

https://discussions.unity.com/t/826718/2

Share/Sharing source code between projects:

https://discussions.unity.com/t/719810/2

Setting up an appropriate .gitignore file for Unity3D:

https://discussions.unity.com/t/834885/5

Generally setting Unity up (includes above .gitignore concepts):

https://thoughtbot.com/blog/how-to-git-with-unity

It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place.

I completely agree with this statement and I need to be better about it. I guess this will be my project for the weekend.

Here’s something you’ll need along the way:
https://github.com/github/gitignore/blob/main/Unity.gitignore

:wink:

I appreciate that it’s a commercial coder’s tool, but for a single developer you should be able to get to grips with it if you read through some of the tutorials (and it being Linus T’s toy, the documentation is easily available, fairly newby friendly and utterly comprehensive). yes, if you’re working with multiple teams and multiple dev branches, my god, it gets HARD (I have had the unenviable task of rebasing dev/stage branches… if I go to hell, I know what’s waiting for me in the pits!)

But, quite honestly, with a single indie dev cutting their teeth with their first proper project, my advice is: download the free “Git kraken” client and you’ll have a pretty painless time and everything you need. https://www.gitkraken.com/

spot on. A good example of what MelvMay means by rollback here would be: let’s say you wanna try something ambitious with your lovely functioning project and the result might lead to drastic issues or complications that are near-irreversible if you get things wrong. Yes, you can save a copy of your project, zip it, paste it on Drive or a hard drive. But all that takes ages and it doesn’t keep a blow-by-blow account of what you’ve done where and why (unless you’re zipping iterations of your project and storing them every hour or evening or session or whatever). In git, you primarily create branches for your “features”. once the branch is finished and you’re happy with the output, great, commit it back into the master branch. If it doesn’t work out, leave it or delete it. And even if you merge it back into master and decide you weren’t happy with it, you can still fetch back and cherry pick stuff from earlier iterations of your project. Git is designed to be very slim with its storage of your history so unlike 300 backups of your entire unity project, it’ll only ever represent the cumulative variance in your project stored in its own discrete database.

useful things:
git stash, for when you don’t wanna commit something but wanna sanity check how your current stage is behaving alongside some commit or other: https://www.atlassian.com/git/tutorials/saving-changes/git-stash

If you really screw up your branch while it’s not been committed and want to undo all your recent changes: git reset --hard HEAD is your life blood and your saviour (obviously, use it wisely)

2D is also a good place to start learning the craft. With Unity’s 2D physics, you can do most things and see a stable, well polished result.

I started learning with 2D, totally recommend it.

1 Like

Tutorials are great. Besides from some recommended YouTube ones, there are also great Lessons on Skillshare that helped me a lot. Easy to follow.

Thank you

When I start on my next project I will make sure to do this first and get familiar with it.

1 Like