Get a free year on Tuts+ this month when you purchase a Siteground hosting plan from $3.95/mo
The indie gamedev community is awesome: so willing to share tips, tricks, advice, and even detailed tutorials explaining important concepts. Here, I've rounded up a few dozen of my favourite examples from around the internet, covering coding, maths, game design, and being a game developer. This is the quality of content that we aspire to achieve at Gamedevtuts+.
This AI tutorial takes an interesting approach to pathfinding. In the image above, suppose that the green dot is a computer-controlled character, the white E is its target destination, and the brown blocks are impassable mountains. The basic technique is to make the target generate a positive field and the mountains generate negative fields - as if they were positive and negative electric charges. The fields are then added, as represented by the varying shades of blue, and the green dot simply moves to the adjacent position with the highest "pull" (i.e. the lightest shade of blue).
The tutorial dives in to much more detail, showing how to deal with enemy units, local minima, and other situations.
A demo of the final result.
You might have seen Stephane Beniak's tutorial about the classic Game of Life here at Gamedevtuts+. This tutorial, by Mikola Lysenko, discusses an interesting new variant: a generalisation of the Game of Life for smooth spaces, applied to arbitrary curved surfaces.
Mikola doesn't just give the steps required to recreate his version; he dives deep into the maths and concepts required to understand it, gradually building up to the final impressive result.
Video of the live demo.
This is a short and simple tutorial, intended to show off the power of the Nape and Starling Flash libraries, but I really like the result! The actual logic behind the creation of the terrain is easy enough to understand that you could port it to most other gamedev platforms.
Video demo of the final effect.
This tutorial, by Rahul Srivastava of Rotating Canvas games, would perhaps go nicely with Michael Hoffman's Dynamic 2D Water Effects tutorial which we published earlier this year. Rahul explains how to use OpenGL shaders, a sine function, and random noise to create this neat water surface effect.
Okay, this is really more of a straight CS tutorial than a gamedev-specific coding tutorial, but I couldn't resist including it here because I love the presentation. The shuffling animations help to illustrate what's already a clear tutorial.
This article explores one question: how can we detect the silhouette of a 3D object? As is often the case, the first step is to clearly define the problem; once this is done, the tutorial walks through the specific problems and offers some sample code. By the end, you can take an arbitrary 3D model and generate its 2D outline.
This is one of my favourite tutorials of all time. It's comprehensive and very well explained, with plenty of diagrams and demos. Even if you have no plans to generate maps for your games, I think you'll find it a fascinating read.
Remember N? It's a classic Flash platformer, originally released in 2005 and eventually ported to Xbox, DS, and PSP. It really caught people's attention at the time for it's super-smooth motion and collision mechanics.
In this two-parter (part two is here), the developers of N explain the basics of their collision detection systems. If you want to take this further, Shiu wrote a tutorial for us about the same concepts.
The simple AABB (axis-aligned bounding box) method of collision detection is suitable for many games, but in my experience game developers often want to get to a pixel-perfect method as quickly as possible. This tutorial is fairly specific to XNA, but it explains the concepts clearly enough that you could implement them in your 2D development platform of choice.
Demo of the final effect.
This lava lamp-style effect is often used to render liquids, and is fairly straightforward to render with code - no custom shaders required! This tutorial is in XNA, but is easy enough to port to other platforms.
Rodrigo Monteiro breaks 2D platformers into four types - tile-based (pure), tile-based (smooth), bitmask, and vectorial - and succinctly explains how motion can be implemented in each case. This manages to be both an excellent introduction to the concepts and a great reference guide.
It might not be strictly necessary to write your own raycasters these days, thanks to the likes of Stage3D, Unity, and OpenGL, but I think it's still interesting to learn the basic concepts behind rendering a room in 3D. This tutorial explains the rough idea, shows you how to build the solid-colour raycaster pictured above, and finishes by implementing a Wolfenstein 3D-style texture renderer.
You probably shouldn't try to read this on your smartphone. This huge article by Randy Gaul is a wonderful primer, filled with great advice for programming games in C++.
The Source Engine is best known for powering FPS games like Half-Life 2 and Team Fortress 2, but in this tutorial, Ben Evans shows you how to create a basic RPG prototype. He explains how to create quests, add dialogue, and set up an ending condition.
AI for computer-controlled opponents shouldn't necessarily be designed to make them as competent as possible; racing against a set of perfect drivers would be no fun. Here, Eduardo Jiminez explains the "rubber band" AI in Pure, designed to keep the game feeling competitive, and therefore exciting, by preventing the player from falling too far behind (or getting too far in front!).
There are many A* pathfinding tutorials online, but I believe this is the best one to start with. Patrick Lester explains the method quickly and directly, with tips and clarifications, and even provides source code and some suggestions for what guides to read next.
If you have a decent grasp of the maths of mechanics, coding a physics simulator seems like a simple task. On paper, it is. In practice, the discrete nature of any code simulation means you'll run into various problems - for instance, if your simulator's delta time doesn't match your game's display rate, you'll find that the simulation runs faster or slower than you intended.
In this brief but important article, Glenn Fielder explains why the problem occurs, and how to fix it.
Okay, this isn't technically a tutorial, but it certainly deserves a place here. Chris DeLeon has provided a three-level platformer game, complete with a level editor and full source code. As he puts it:
This is not so much an open source project as it is an unusually expansive pile of connected demonstration/example code, though intended to encapsulate as much or more about game design (user experience, tuning, system relationships) and game production (development tradeoffs, efficient authoring, content pipeline) as it is about the underlying programming.
Quaternions are a convenient way to represent rotations in 3 dimensional space. [...] The main advantage they have over Euler angles is that they can be interpolated without looking awful. You can compose rotations by multiplying quaternions, much like with rotation matrices, but a unit quaternion is always a rotation, while a 3×3 matrix could be a number of other types of (possibly undesirable) transformations.
This three-part tutorial from Twisted Oak Studios explains the maths of quaternions. This isn't a paint by numbers post; it assumes you have an interest in learning about these kind of concepts, rather than just putting them to use.
There's a wealth of great content on Paul Firth's site, but this is a post I keep referring back to: a couple of useful methods for working with convex polygons (that is, straight-sided shapes that don't double back on themselves).
Paul explains how to figure out the area inside a polygon, and how to detect whether a certain point is inside a polygon. Hardly exciting, but frequently handy.
Another great guide from Paul Firth. This time, he tackles pretty much everything you need to know, as a game developer, to have a good grasp of vector mathematics. I use this as a reference (it's neatly organised!) but I believe it would serve as a decent introductory tutorial as well.
David Rosen of Wolfire Games goes through the basics of vectors and matrices in this four-part series, with plenty of game-related examples in both 2D and 3D.
Like TVTropes for bad game design decisions. Ernest Adams has been keeping track of "game misfeatures" for over a decade (both from his own experiences and based on suggestions by readers), and has compiled them into a categorised list here.
Big bosses in RPGs should be tough, but it's no fun if they're impossible to beat. Here, Solitayre explains how to structure an enemy's attack patterns to make for memorable, rewarding battles.
In this article, Charmie of FunstormGames passes on Wil Mozell's deceptively simple game design methodology: the "Core Diagram" shown above. As the post shows, this applies surprisingly well to many different games, so it offers an interesting way to think about design.
It's hard to categorise this post: it contains tips on coding, story writing, user interface, and teamwork, all centred around the topic of making platform games. If you are planning on making a platformer, do read this, whatever your role!
Can gameplay skills be broken down into a series of "atoms"? Danc says yes, and presents his method for doing so here. In this way, a game's mechanics can be given a clear structure, which can in turn be used to design the game to keep the player moving forward, always learning or improving.
If you enjoy this, check out Danc's presentation The Princess Rescuing Application, too.
Note: See also the later revised version of this article (PDF).
As game designers, we need a way to analyze games, to try to understand them, and to understand what works and what makes them interesting. We need a critical language. And since this is basically a new form, despite its tremendous growth and staggering diversity, we need to invent one.
The overlapping, interacting states of Super Mario's controls.
Steve Swink, author of Game Feel, discusses the concept of virtual sensation - "the thing that makes your mom lean left and right in her seat as she tries to play Rad Racer" - examining seven different ways of affecting it. To help demonstrate his point, he uses examples of popular games, and simple playable demos that focus on the controls.
Watch the presentation.
Martin Jonasson and Petri Purho demonstrate how a plain Breakout clone can be made much more fun by adding "juice" - little touches of polish. Be sure to check out the various links posted under the video on YouTube.
Thanks to normal mapping, these simple 2D sprites can be shaded lit dynamically based on the light hitting them. Take a look at the skeleton in the pirate hat, in particular: one side is lit blue; the other is lit red. It's a great way to combine retro pixel art with the power of modern 3D gamedev environments.
Demo of the effect.
Inspired by the above post, Matt Greer devised a method for adding dynamic lighting and shadows to 2D pixel art. This tutorial goes into more detail then the former, explaining the maths behind the effect with some sample code.
You can see the effect in the menu transitions in the first few seconds of this video.
Colin Northway explains how he created the ink-bleed fade effect for menu transitions in Incredipede. Aside from explaining the cool effect, this post also highlights the importance of trial and error.
I'll quote from the author, Radek Koncewicz:
Projection basically means taking a three dimensional object and displaying it on a 2D plane (i.e., a screen). There are various ways of accomplishing this, and each technique has a deep impact on a game’s look and mechanics.
Before reading this article, I had never really noticed projection in games - I could tell an isometric game from a true 3D game, sure - but as this article shows, "isometric" didn't really mean what I thought it did...
This is a collection of stellar step-by-step guides to drawing cartoon artwork suitable for games, without needing to actually draw anything. The guides are so simple that it feels more like assembling artwork than creating it - and I mean that as a compliment.
We've talked about palettes at Gamedevtuts+ before: both how to manually choose them and how to let players customise them. This article explains how to let a computer choose a suitable palette for your game - great for anything with procedurally-generated levels!
Although this tutorial is over a decade old, it's still a great guide for programmers with no artistic ability whatsoever to make some decent-looking pixel art quickly.
If you're more artistically inclined, check out Derek Yu's Pixel Tutorial instead.
This is my go-to article for aspiring indie game developers that want to know what they're getting in to. It's full of great little quotes like this:
Game design and level design are different skills: one is designing a system and the other is working out how to present that system in the most rewarding way.
Fun fact: we actually used this article as one of our reference guides when coming up with the plans for Gamedevtuts+.
In our recent poll, the most commonly selection for the hardest part of developing a game was "finishing it".
Here, Derek Yu lists practical advice for actually getting games done. (The post also doubles as a motivational kick up the rear!)
"Creativity is like a snake swallowing a series of tennis balls."
Danc explains his creative process for creating excellent games, including the all-important prototyping process (and the equally important getting-rid-of-bad-ideas process).
I sat down with devs. We talked. I played their games. They told me about their relationships, their trials and their bright hopes. Honestly, it was heartbreaking. So many great games. And yet so many broken business models, broken production techniques and broken philosophies of what matters. Eighty percent of the games being shown will not make back their development budgets.
This is more a guide to what not to do; Danc shares the most common (and devastating) mistakes that indie game studios make. Learn from others.
Don't forget: besides publishing gamedev tutorials here, we also often share the best of the web on our Twitter, Facebook, and Google+ channels. I've also set up a Google+ community for sharing articles like these. If you know of a great tutorial that I've missed, let me know!
(And, naturally, if you've written one of the articles featured above, consider this an open invitation to write for us...)