Where to start to program a game

Started by
24 comments, last by yuminig 11 years, 10 months ago
Hello, first post here.
Let me introduce myself, I'm a 15 years old teen who lives in Italy and has the ambition to make a game.

Now, i know that i need to use a programming language, but I'm not sure at all which one. I've had some experience with Squirrel and Pawn mainly in scripting for SA-MP and IV-MP, from which i believe i learned a lot. I developed a few complex functions and also made a small programme that would tell me the number of multiplies needed to reach a certain number with exponential growth ran by the server, but that was pretty easy.

In any case, that was about 2 years ago but now I'd like to start programming again, I've already got a few ideas for games but I simply don't know where to start. My objective is a common 3D computer game, maybe with online support, but I understand that i need to have some experience in 2D game development first.

So, some bullet points to make answering to me easier:

-What language suits my needs best?
-What do I need to make the graphics part of the game?
-Is there any good tutorial that gives info on every step of game development?

I hope this is a friendly community, I'm just a wandering soul wishing to find my path :)
Advertisement
Since you did some programming already even if it was just some scripting. I recommend you skip things like game maker and rpgmaker or similar. I think you are ready to learn a language.

You have 2 choises:

-Game oriented language
-General purpose language

If you choose first you can easily dive in game development. They are usually easy to learn and to use. Also they have everything you need to make simple/comlex games. But they do lack in performance and some advanced tehniques such as good 3d graphics,portability,third party libraries,ussualy have poor multhithreading support or don't have it at all. All in all when you mature past good 2d games you will simply want to skip this one. It is the best for learning but sooner or later you will leave it behind.

If you choose a general purpose language it wont be so easy. Main reason is that you have to learn the language first before even attempting to make a game.Even WHEN you learn it you usually have to choose and learn a game library/engine to use in making your game. There is a lot of work to do just to get anything started. However when you DO learn all those things and learn it well. You will find yourself capable of using amazingly powerfull tools and you will have great freedom on what you can do with your game. They give the best control to you on what you want to make the downside is usually YOU have to make it.

The choise is yours. I will give you some examples of general purpose languages:

C - great starter. Everything you learn will be useful when advancing to the next step. (see below)

C++ - Industry standard and with good reason. Very powerful,fast,full of features. Amazingly well supported,BIG communities,Countless tutorials,books,A lot of third party useful libraries,etc.. Downside IT IS ARGUABLY THE HARDEST THING TO LEARN (to a professional level) but worth it.

C# - Great one. Somewhat easy to learn. Very nice standard library,Very nice modern features,reasonably fast well supported and somewhat elegant to some people.

Java - Also a great one. Very feature rich standard library. Easy to learn and use. Runs on a lot of hardware. Great for mobile development and/or web development. its on;y somewhat good for 3d though. A good example would be Minecraft (it was done in Java)


Python,Fortran,Delphi(free pascal),...

List goes on and on...

Since you did some programming already even if it was just some scripting. I recommend you skip things like game maker and rpgmaker or similar. I think you are ready to learn a language.

You have 2 choises:

-Game oriented language
-General purpose language

If you choose first you can easily dive in game development. They are usually easy to learn and to use. Also they have everything you need to make simple/comlex games. But they do lack in performance and some advanced tehniques such as good 3d graphics,portability,third party libraries,ussualy have poor multhithreading support or don't have it at all. All in all when you mature past good 2d games you will simply want to skip this one. It is the best for learning but sooner or later you will leave it behind.

If you choose a general purpose language it wont be so easy. Main reason is that you have to learn the language first before even attempting to make a game.Even WHEN you learn it you usually have to choose and learn a game library/engine to use in making your game. There is a lot of work to do just to get anything started. However when you DO learn all those things and learn it well. You will find yourself capable of using amazingly powerfull tools and you will have great freedom on what you can do with your game. They give the best control to you on what you want to make the downside is usually YOU have to make it.

The choise is yours. I will give you some examples of general purpose languages:

C - great starter. Everything you learn will be useful when advancing to the next step. (see below)

C++ - Industry standard and with good reason. Very powerful,fast,full of features. Amazingly well supported,BIG communities,Countless tutorials,books,A lot of third party useful libraries,etc.. Downside IT IS ARGUABLY THE HARDEST THING TO LEARN (to a professional level) but worth it.

C# - Great one. Somewhat easy to learn. Very nice standard library,Very nice modern features,reasonably fast well supported and somewhat elegant to some people.

Java - Also a great one. Very feature rich standard library. Easy to learn and use. Runs on a lot of hardware. Great for mobile development and/or web development. its on;y somewhat good for 3d though. A good example would be Minecraft (it was done in Java)


Python,Fortran,Delphi(free pascal),...

List goes on and on...


Thank you for your answer, I suppose i'll stick to C++. Is there any good guide for it that you recommend to me? Also, is there any uncompiled game code that allows me to analyze the structure, libraries and so on? I find that the best way to understand a language is to analyze, experiment with it, coupled with a good manual of course biggrin.png
I would highly recommend Mike Dawson's 'Beginning C++ through Game Programming'
First off, learning C is not a great starter language, and learning C to learn C++ is like learning Dutch to learn German. Sure, it may help your understanding, but what a terrible waste of time and resources. C is a very domain specific language these days and for most people is of little relevance. For new C++ programmers, they should be encouraged to stay the hell away from C and instead learn idiomatic C++.


Second, C++ is a horrible first language, period. Don't believe me, read this scenario and be completely honest with yourself, "could you have found the problem?". That's because C++ is rife with this kind of crap and you will be dealing with it from day 1! People say it's stuff like memory management that make C++ difficult, but it's not, not really... it's stuff like this. The horrible linker, the lets support every single bloody edge case even if nobody is ever going to use them mindset, the piss poor standard libraries, the fact its actually 4 languages smashed together, the weight of a thousand legacy mistakes. All of those negatives may eventually be a positive ( except the linker, which just sucks ), but to someone starting out they all work together to make C++ a terrible terrible starting language.


EDIT: Never actually answered the question:

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]-What language suits my needs best? [/background]

[/font][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]There are many languages that fit your needs, but a lot of it come down to personal tastes. For example, Python is a highly regarded started language and is a good recommendation, but I personally don't like it. That doesn't make it a bad fit for you, but it does for me. Generally the big 4 recommendations are Java, C#, Python and (ugh) C++. This guide goes into a heck of a lot more detail than I can here and was written to basically answer this question. Beyond that guides recommendations, JavaScript/HTML5, Flash and LUA are also quite common and appropriate to a beginner.[/background]

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]-What do I need to make the graphics part of the game?[/background]

[/font]
A graphics library in most cases. Although Java and C# have graphics routines built in, they are horrifically slow. That guide link has recommended 2D graphic libraries for each language, but it all comes down to which language/platform you decide to go with.

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]-Is there any good tutorial that gives info on every step of game development?[/background]

[/font]
Yes, tons, and loads of books too. Need to pick a language and platform first though.

Well all open source games put their entire code on the internet. So you can start there. Also while it is good to learn from web tutorials (there are a lot of good ones) there is nothing like a good book that you can put on your desk and read from while you learn. You can chose from basic C++ stuff books, to game design , graphics library books, game physics books,... Start small. Really small. Like a simple text console question game. Then move to 2d static graphics simple games,then 2d animated games,...3D can be hard really hard.

For C++ there are some nice libraries for games:

SDL - Simple elegant easy to learn has some books on it, a lot of tutorials , a lot of games use it,..
SFML - Simple well designed powerful easy to learn.
GLUT/OpenGL - Ranging from very simple to extremely comlex. Good start to 3d programming. Easier than DirectX and very cross platform. (Very good books/tutorials)
DirectX - Only for Xbox and windows. Great game library in general. Has all you need for sound,3d graphics,networking,... (Very good books/tutorials)

As for engines i can't really say. Since i usually only use libraries (write simple engines from scratch).

First off, learning C is not a great starter language, and learning C to learn C++ is like learning Dutch to learn German. Sure, it may help your understanding, but what a terrible waste of time and resources. C is a very domain specific language these days and for most people is of little relevance. For new C++ programmers, they should be encouraged to stay the hell away from C and instead learn idiomatic C++.


Second, C++ is a horrible first language, period. Don't believe me, read this scenario and be completely honest with yourself, "could you have found the problem?". That's because C++ is rife with this kind of crap and you will be dealing with it from day 1! People say it's stuff like memory management that make C++ difficult, but it's not, not really... it's stuff like this. The horrible linker, the lets support every single bloody edge case even if nobody is ever going to use them mindset, the piss poor standard libraries, the fact its actually 4 languages smashed together, the weight of a thousand legacy mistakes. All of those negatives may eventually be a positive ( except the linker, which just sucks ), but to someone starting out they all work together to make C++ a terrible terrible starting language.


I told him not to bother with a graphics library until he learns the language. And for that almost all IDE's that are out there thay are all set for the go to do such stuff. No linking problems, no library incompatibilities, no stupid stuff like that. By the time he learns the language. He should be reasnoably competent to understand what a library is ,what is a dll, what do the warnings mean. And most importantly he should know HOW to ask the right questions on the internet to solve his problems. There is nothing wrong with that. A person that doesn't know this basic stuff SHOULD not dive in to use third party libraries or yes i do agree hes in a world of pain. So yes C++ CAN be a begginers language. But C++ with a third party library is definetly not.

[quote name='Serapth' timestamp='1337431887' post='4941421']
First off, learning C is not a great starter language, and learning C to learn C++ is like learning Dutch to learn German. Sure, it may help your understanding, but what a terrible waste of time and resources. C is a very domain specific language these days and for most people is of little relevance. For new C++ programmers, they should be encouraged to stay the hell away from C and instead learn idiomatic C++.


Second, C++ is a horrible first language, period. Don't believe me, read this scenario and be completely honest with yourself, "could you have found the problem?". That's because C++ is rife with this kind of crap and you will be dealing with it from day 1! People say it's stuff like memory management that make C++ difficult, but it's not, not really... it's stuff like this. The horrible linker, the lets support every single bloody edge case even if nobody is ever going to use them mindset, the piss poor standard libraries, the fact its actually 4 languages smashed together, the weight of a thousand legacy mistakes. All of those negatives may eventually be a positive ( except the linker, which just sucks ), but to someone starting out they all work together to make C++ a terrible terrible starting language.


I told him not to bother with a graphics library until he learns the language. And for that almost all IDE's that are out there thay are all set for the go to do such stuff. No linking problems, no library incompatibilities, no stupid stuff like that. By the time he learns the language. He should be reasnoably competent to understand what a library is ,what is a dll, what do the warnings mean. And most importantly he should know HOW to ask the right questions on the internet to solve his problems. There is nothing wrong with that. A person that doesn't know this basic stuff SHOULD not dive in to use third party libraries or yes i do agree hes in a world of pain. So yes C++ CAN be a begginers language. But C++ with a third party library is definetly not.
[/quote]

Did you read the scenario in the link I provided? It was using Visual Studio, which probably has the easiest to configure linking settings, and it still was a massive failure. An IDE does not shelter you from the linker, not in the slightest. In fact, it adds "Yet another thing you have to learn" to the long list of things you already need to learn.

Again, to your example of asking the right questions... the error in the scenario I provided was "Unhandled exception at 0xBlahblahblah in Pang.exe 0XC0000005: Access violation reading location 0xBlhabblahba". Good luck asking for help on that problem on the internet. At best someone *might* be able to tell you it's a linker problem, maybe. Especially when the IDE says "THIS IS THE LINE WHERE THE ERROR OCCURRED", which is exceedingly misleading. Simply put,this is one of those problems you would have to puzzle out on your own and I don't think a new developer has a hope in hell of figuring this out.

As to using C++ without libraries... good luck with that. The standard libraries are crap in their scope and probably the single biggest strength of C++ IS the third library support. You take that part out and frankly there are even less reasons to use C++.


Also, don't get me wrong, C++ *CAN* be a beginner language. It just can't ever be a good one.
You know what i agree. I never started big either. I tried learning C++ and fell to just C. Then mastered it and suddenly C++ and Java was a breeze. Yes the standard library is really really bad. If anything you cant really make games with it. I tend to avoid it completely. I only use C library for File input/output and that's it.

But i do not understand why would you bash C. Yes it is outdated. Yes it is not really object oriented (C++ also isn't really). But it is very easy, very well supported,very useful and it makes learning C++,C#,Java much much easier later. Where almost everything that you learned will be used with almost the exact same synthax in these languages.
Functions become methods,Structures become Classes,Bit operators remain,...

The only problem i see is that some people get too much into C and start programming Java as they would C. They will make bad OO decisions and so forth. But most people that i know are very flexible and is easy to them to change the design of their code and approach to problems.

But i do not understand why would you bash C.


I didn't bash C, I said it was a domain specific language and learning C to learn C++ was a waste of your time.

C for games is a pretty poor fit though for a number of reasons. The community is quite small now, and C as is represented in C++ is a 28 year old language. C has evolved massively since then, but the user base has dwindled. Many game libraries are moving to C++ only. As well, C++ came to be because of the inability ( arguable I know ) of C to scale to large projects; this fact hasn't changed.

As to the direct reasons why C is a fairly poor beginners language, again the standard libraries are downright anemic even compared to C++! Then we get into the matter of safety. I've not much followed the evolution of C as a language so I don't know if they've fixed the myriad of exploitable language features, but that was a major downside the last time I used C.

I agree that learning a language in advance of C++ will make the task easier, but there are better choices than C.

This topic is closed to new replies.

Advertisement