Video games are now more popular and have penetrated a wider range of platforms, such as on mobile phones, browsers, computers or consoles. You can now find more tutorials, asset collections, game-building software, and expert advice than ever before. Programming your own games still requires skill and patience, but the available resources will be sufficient for programmers of any level.
Step
Part 1 of 2: Getting Started
Step 1. Use a game engine
Some game developers design their own games from scratch, especially early games. If you want to make it easier to design games but also want to program them, use a game engine. Game engines usually have higher-level tools for tweaking 3D models, writing event scripts, and other things that are common to games, but still provide a way for you to program with them.
- Popular heavyweight programming engines include Unity, UDK, Unreal Engine 4, and CryENGINE.
- If your programming experience is minimal, consider GameMaker from YoYo Games. The software allows you to create code-free games with just a "drag-and-drop" method, but provides access to complex code languages if you want to change some of the code.
Step 2. Use frameworks and other tools
Frameworks are a step below game engines, but still provide a range of tools and APIs (application program interfaces) to save time and streamline your code projects. Minimize the level of software you used for your first game project, then tinker with the code yourself, or take advantage of the built-in functions and features of the game engine. Depending on the framework and/or game engine you are using, you may still have to work on additional special APIs, such as the popular OpenGL for creating 3D graphics.
Polycode, Turbulenz, and MonoGame are examples of frameworks for 2D and 3D games
Step 3. Use an IDE
The Integrated Development Environment is a common compiler and collection of source files that makes it easy for you to build complex programming projects. An IDE will make programming a game much more convenient, especially if it comes with a built-in way to interact with the graphics and audio system.
Examples of IDE are Visual Studio and Eclipse, or many others. Look for an IDE based on a language you are familiar with
Step 4. Learn a programming language
Most of the tools above are based on popular programming languages, so it's a good idea to follow the included tutorial first. While almost any programming language that is sufficiently powerful can create games, the most commonly used languages are C++ or C# for all devices, Flash ActionScript or HTML5 for browsers, and Java or Objective C for mobile devices. All of these are good choices if your goal is to get hired by a game development studio. In addition, many independent games are created using Python, Ruby, or JavaScript.
Part 2 of 2: Making Games
Step 1. Create your game plan
Refine the concept of the game as much as possible before starting, including the genre, atmosphere, and type of tactical aspect (gameplay). If you start programming with a vague concept, you may have to rummage and rewrite things. This may still happen, but a solid plan will minimize it.
All but the most experimental games have progress levels, so start your planning here. Progress usually occurs in one or more of the following: discovering more plots and characters, making decisions that affect the storyline, acquiring new abilities or higher stats, exploring new areas, or solving complex and more complex puzzles
Step 2. Collect your art assets
Collect or create all the textures, sprites, sounds and models you need for your game. There is also a collection of free game assets that you can search for. If you're making a 2D game but no artists are there to help, you can create your own pixel art.
Step 3. Write your game script
The script will tell the engine what to do and when to do it. An open-source engine will most likely already have a scripting language, and have tutorials that tell you how to use it. If you're building the machine yourself, you'll need to create a scripting language as well. Whichever you choose, you'll need at least the following key components:
- A game loop that keeps running and checking user input, processing the results, processing other events, calculating what needs to be displayed, and sending this to the graphics card. It must run at least 30 times per second.
- An "active listener" script that will check for events and respond to them when they occur. For example, one script could watch a player interact with a door, then run an "open" animation and keep the door from crashing. Other scripts could watch for a hitbox (an invisible form for detecting collisions in games) of a weapon when it hits a door, and run a "shattered" animation instead.
Step 4. Create individual levels
The level design - which is usually "level 1", an area the player can explore, or the next round of a fighting game - will test skills unrelated to programming. Start by featuring the game's simple tactical levels, followed by the basic guidelines for the genre that involve traveling around the environment:
- Create a basic outline for the area.
- Determine the player's base path that is most often taken in the area. Add challenges and useful items along the way. Bring it all together for an adrenaline rush and fun, or move it apart for a more relaxed atmosphere.
- Start adding graphic elements. Place light sources along main roads to encourage players to follow them, and keep side lanes or less important areas dim.
- Match tactical, style and setup aspects. For example, a suspenseful horror game will develop on the exploration of an empty environment, interspersed with surprise attacks. On the other hand, the never-ending waves of enemies will fill players with adrenaline, while battles that require careful tactical planning can distract players from the emotional atmosphere.
Step 5. Test the game
Now you can see the results of all your hard work. Test each level and polish it while you're at it or after it's "finished". Create awareness to play in a way you didn't intend to, such as playing through a more difficult area first. Or, better yet, find game testers as "fresh eyes" on the game, and ask them for advice as much as possible.
- Watch someone play without giving him advice, unless your game doesn't have basic tutorial information yet. Errors and frustrating points that pop up that players "get stuck" are signs that you need to include more guidance.
- Once the game (or at least the level) is complete enough, invite someone else to help test it. Your friends are likely to be more optimistic, and are great for motivating, but not helpful in predicting how a player will react.
Step 6. Take the next step
If you complete a project, you can release it free or paid, but make sure you read the terms and conditions for each game engine or software used. Whether or not the game works as you envisioned it, you can "pick-up" some of the game's assets and ideas for use in other or more ambitious projects, or summarize everything you've learned and start programming all over again!
Tips
- Always write down the things you need now, not the things you "may need" or "will need later".
- Don't do unnecessary work. If you can import an existing library that fits your needs, that's better than creating it again. Or, make sure you have a good reason why you should build it again.