Fear not! I was in the same position a year ago, but all you need to break is the psychological barrier that youâ€™re missing years of experience necessary to do anything.
The only prerequisite is the ability to think logically.
Part 1: I donâ€™t know how to code!
This is fine. Throughout my teenage years, I would occasionally decide Iâ€™d learn to code, follow some guide, and get struck by a wall of text just to get a console to display â€śHello Worldâ€ť. It wasnâ€™t until on my degree (Physics), when I had a compulsory module of C and was forced to sit in a room and code that I could actually be sufficiently motivated to learn.
The course was perfect though, because all the â€śwalls of textâ€ť were covered in non-compulsory lectures. The actual exercises were extremely brief, assuming youâ€™d attended the lectures and essentially only saying â€śThis is a double, this is a function, this is a conditional; go make a relativistic kinetic energy calculatorâ€ť.
And, if you want to learn quickly, thatâ€™s all you really need! You certainly donâ€™t need to take a uni module to do it. You just need to know where to start.
Recently my housemate chose a dissertation topic which required knowledge in C#. He didnâ€™t know C# at all, and he was wasting hours reading tutorials. I told him the same advice I followed myself when learning it: Think about how you would do the operations yourself, break it into steps, and if thereâ€™s any step where you donâ€™t know some key technique, google it. Someone has had your problem before, and some helpful person has uploaded a solution to it, and itâ€™s easy for you to find it.
Now, itâ€™s all well and good me saying this, but you still donâ€™t have any idea where to start. You need to know some key things to make a simple game in a command prompt (which is a great place to start):
- Conditionals (if, else, switch)
- Loops (for, while)
- Variables (ints, floats, bools, strings)
- How to use an IDE.
Not only is Visual Studio incredible, but switching language will be a great way to get you out of your comfort zone. Youâ€™ll be at a point where youâ€™ll need to be googling lots of basic things to work them out for yourself, and this is probably the best way to learn. These skills will really be required later on.
VS has something called, â€śIntellisenseâ€ť, which is an absolute lifesaver. If youâ€™re typing a variable name, it will optionally autocomplete your word. Later on when youâ€™re typing things like GetComponent frequently, this saves huge amounts of time. You can also hover over a variable and itâ€™ll tell you what kind of variable it is.
And, perhaps, the best thing about Visual Studio 2010: When your code isnâ€™t going to compile, you donâ€™t have to wait until you click the compile button to be struck by 10 error messages. It underlines your errors for you as soon as you make them! Iâ€™m currently analysing data from the Tevatron for lab, and Iâ€™m forced to use notepad2 with CERNâ€™s own compiler, Root. I spend half my time fixing compiler errors from stupid mistakes.
So first of all: come up with a game idea thatâ€™s simple enough for you to code - something whose core game mechanic doesnâ€™t have any physics. It can even be a simple clone of something that already exists if youâ€™re out of ideas. Anything that you will find compelling and will reinforce what you know, and teach you some new ideas will do.
To start, it would probably be easiest to code one basic mechanic from an RPG or a puzzle game.
For example, the first thing I coded was a very simple RPG overworld system in an MS DOS console. Itâ€™d generate an ASCII map from a 2 dimensional integer array (where, e.g. â€ś-1â€ť would be a wall, â€ś1â€ť would be the player etc.), in which you could move your player around, and bump into walls. This is a good exercise for learning basics, and there will be some things you need to google (like how to take keyboard input, how to wipe the console and publish the map again whenever an action is taken, etc.).
One important command youâ€™ll need to learn for this, for instance, is Â Console.Write(), which will print to the console.
I then added a system for mana diffusion. An invisible 2D float array of numerical mana values was present, and mana would diffuse from areas of high concentration to areas of low concentration, so when you absorbed mana there was less left around you to absorb. It was also a nice visualisation of the Zeroth law of thermodynamics in action too.
After that I coded my first version of my game, Rotation Station. Back then, it was just a simple connect-4 game, but you could choose how many pieces youâ€™d need to connect to win and every n turns the whole grid rotated 90Â°, letting gravity contort the playing field. Next I added some simple powerups like rowblitz, gravity shift, the ability to spawn blocks etc.
Make a new project. Make it a C# Console. At this point, if youâ€™ve never used an IDE, you wonâ€™t really know what youâ€™re doing. This is where looking at a hello world tutorial might help, but remember: if youâ€™ve done Codecademy, you already know loops, conditionals, variables and functions!
First, turn on displaying line numbers:
Now work in â€śmainâ€ť. Youâ€™ll need to work out how to use Console.Write() and Console.Read(), in order to get some input and output, which Google will assist with. Once your code is ready, compile it and itâ€™ll run in the command prompt. To stop the console from flashing and immediately disappearing, press Ctrl+F5 to compile, rather than just compiling. This way it wonâ€™t immediately shut down after itâ€™s finished.
Once youâ€™ve fiddled about, try using 2D arrays (i.e. int[,] arrays) to make your own system of displaying a game map or board in ASCII with cout. You should be able to build some kind of basic game functionality.
Once youâ€™re happy with this, itâ€™s time for the next step up: Get Unity3D.
Unity3D is an incredibly intuitive game engine. It takes all of the difficulty out of representing things graphically, and has lots of incredibly convenient built in classes.
Iâ€™ll go into more detail on starting out in Unity for the first time in a later blog.
If you encounter any issues along the way, feel free to contact me; Iâ€™ve been there. But for the most part, you should be able to troubleshoot any issues or gaps in your knowledge with Google. Youâ€™ll learn to love Stack Overflow and Unity Answers.
ETA on learning all this? A couple of months, tops, if youâ€™re motivated. Itâ€™ll take a bit longer once you start working in Unity, and Iâ€™ll discuss timeframes you can expect for that too.
Also, stay tuned for the next installment to this series, where Iâ€™ll discuss in depth where to start if you have real difficulty creating your own 2D artwork, how to use motion to make static gameplay more aesthetically pleasing, where to begin if you want to write your video game music and getting started from coding in a console to coding in Unity3D. The next article will be about art, where I'll show how to go from the previous screenshot to have something that looks more like:
with no prior knowledge of 2D art design within a month.