starting a game

Started by
22 comments, last by GameDev.net 18 years, 9 months ago
I am having trouble comprehending how to actually start coding a game. I am reading beginning c++ game programming and i understand pretty much everything alright, but it's hard to see how one would start programming a game like what to actually do first. So any light would be appreciated.
Advertisement
Before you start coding, write your ideas down. Thinking your project through will make programming a lot easier later on. Also, try to get something running right away, if you see your game running in front of you and ou can play it, it gives you a lot of motivation to continue. I typically write the resource management (sprites, textures , levels, etc) code first so that when I get some graphics running I have something to display, but thats just a personal preference. Also, just to let you know, it will probably take you a couple of projects before you really start to get the hang of it , so dont get discouraged. Good Luck on you projects, and welcome to Gamedev!
My Current Project Angels 22 (4E5)
Old carpenters rule of thumb: Measure twice, Cut once.

You start with design. Figure out what you want the game to be (if its your first, make it something simple).

Research ways of how the program would do what is needed.

Use existing resources if possible, APIs, Libraries, Tools for game data.

Start coding. Get parts actually running in stages (helps motivate you if you see actual progress). Get basic features running and elaborate on them later.

Hey, mastermind04! On behalf of everyone here, welcome aboard! The first question you should ask yourself is: do you have a grasp on programming such that you can code your own projects from scratch? You could, for instance, code some text-based games and see how that turns out.

After that you must decide on what platform your games will be playable. Your options are Win32 / DirectX, Win32 / DirectX / OpenGL, SDL / OpenGL and other choices too. If I were a starter, I would go for the last combination I mentioned there. Try to get a handle on SDL (the basics like window management and input) - it's pretty simple and intuitive, you'll see. Then when you are ready to try 3D graphics, move to OpenGL and be amazed at all the brilliant stuff you will begin to churn out! Check out NeHe's tutorials. After that, you will need to sort out other avenues such as sound and storylines.

It sounds like a lot, and I won't say it isn't either. Just start, and encourage yourself to keep going. If you have trouble, you'll know where to post for help!
Design is always key but you have to have a good understanding of the language you want to make the game in. You mentioned the book beginning c++ game programming. That is a great book and you should keep all the info that it gives. Learn the basics like pointers, arrays, and vectors. You might not think you will need it, but you will.
As stated above, SDL would be a nice place if you want to start programming graphics using c++. Cone3D has some great tutorials aimed at beginners. Good luck on the game programming.
Well everyone does things a little bit differently, but I'll give a quick rundown of what normally works for me:

1. Pick your target platform. Will the game be for PC, or for some other piece of hardware, and what OS(es) would you like to support.

2. Write down a very loose overview of your game in dot-point form (or whatever best works for you - the point is to have a quick and rough but descriptive summary). I like to use a whiteboard for this, other people use notepads, or jot it down in a text-editor. What sort of game will it be, and what are the very important features. Details are unimportant at this stage, you just want the big picture. An example might look like:
- Platform Scroller
- Ninjas
- Multiplay

Now, that example is very simple, and you'll probably have a few points, but I think you get the idea.

3. Figure out what sort of features you'll need to include what's listed in step 2. Using the example above again, you can immediately tell that you'll probably want some kind of tiling engine and that you'll need networking. Write down what you figure out in this step.

4a. Look at libraries/APIs/languages (if you know more than 1) or even potential engines that will suit your needs. Decide if you want to use an existing engine, and find it, otherwise you're picking the language, libraries and APIs you'll want to use.

4b. If you don't know how to use a library/langauge/API/engine that you chose in the previous step, take a little time to familarise yourself with it.

5. Start coding. Get a window on screen, and get some kind of placeholder character in there. Get basic keyboard (and mouse if you like) handling implemented, and do anything that's neccesary for all programs on your chosen platform (such as handling window messages in C++ on windows).

6. Implement something that's pretty basic and very crucial. In a 2d game this for me will normally be either a tiling system or some other kind of terrain system.

Build from there. Think about what you want as you design things. Constantly write down notes about what you're trying to do and how you think it needs to be done. Try to design things so that they'll work well with whatever else you're planning to use.

Other people like to do more design first, and others still prefer to just get to the basic coding immediately. You'll have to figure out what works well for you, but I do recommend making at least basic notes on your design, especially as things get more complicated. As you get some practice, you'll get better at coming up with good designs the first try, but expect to do plenty of re-writes at first to make things work well - this isn't a bad thing, it teaches you a lot, and means you end up with a high quality product.

Oh, and do think about using existing engines and/or libraries where possible, it's usually more productive once you get good at it, unless you really want to do things yourself.

Hope that helps. [smile]

- Jason Astle-Adams

Thanks all for your replies, i'm wondering again (sorry do this a lot), when i start coding say i'm doing a game about oh let's see like a simple game like the old zelda game for example, i just threw that out there, how would i begin the actual coding process?

AIM - Lilhavs, i know it's faster to explain that way
Quote:Original post by mastermind04
Thanks all for your replies, i'm wondering again (sorry do this a lot), when i start coding say i'm doing a game about oh let's see like a simple game like the old zelda game for example, i just threw that out there, how would i begin the actual coding process?


Well, normally what I'd do is I'd write the main() function, and make sure that my compiler is set up right. Then, I'd compile it just to make sure that it works. Then, I'd probably write a wrapper class for SDL video (I use SDL a lot), which does things like plot pixels, blit stuff, etc. Then, I'd write a simple test demo (still using my main project) that plots pixels and blits stuff. Then, I'd write a tile class and a map class, and get those working and being displayed. Then I'd do characters, and take it from there.
ok well how would i go about creating the map and tile class, see i've never actually done this before so idk what it would look like
Really, you should start making outlines and plans for the game and fully decide, develop and agree on what it will bring to the user.

From there you can start thinking about code and I'd then recommend breaking things down as simply as possible before you start writing the script. By this I mean identifying the functions you will use and what they will perform and so on. From there I would start putting in the script.

It's hard to say though because I'm not sure if this game will be text-based, graphical, using a lot of click buttons and so on, which would also effect the best way to go around making the game. For example, a game that I'm looking to make it a football management game. There will be a lot of button and user interactivity through mouse clicking. I'm therefore going to sort the design of the game out first and then code what the program is to do if buttonA is clicked.

I hope this helps.
My favourite:" Hi, I'm John Doe Jr. I am 14 years old and I know Perl, PHP, HTML, Java, C, C++, Basic, Fortran, Pascal, Ada, SmallTalk, Lisp/Scheme, Python, Modula, Algol, Simula, Haskell, Forth, Curry, Prolog, SQL, Tcl,..... ..... Sed and Awk. Now I am getting bored, and want to learn another language. Which one should I learn now? "

This topic is closed to new replies.

Advertisement