• Advertisement
Sign in to follow this  

Getting Started

This topic is 3583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Previously a lot of my experience has been with programming websites and game design, but I am looking to start programming games myself. I have prior experience with the Game Maker software, but want to do something more 'professional'. I was wondering what language people would recommend, I would be looking to make 2d games, possibly moving to mmorpgs, still 2d, when I have enough experience with the language. I have some knowledge of javascript if this sways your recommendation. Thanks in advance, Robert.

Share this post


Link to post
Share on other sites
Advertisement
I'll give it a try.

You could start by using a high level language that abstracts things like memory management. Python is used by many newcomers (and not only new) around here.
Once you have the fundaction running you can "speed up" things by moving portions of your code to C/C++.

It all depends on your background also.

Hope it helps

Share this post


Link to post
Share on other sites
Thanks, I was thinking I would probably go for something like Python or Java, but I looked at some Java (from a tutorial on this site) and got rather disheartened! I'll have a look at Python. I know that certain languages only run on certain OSs *Microsoft*, so are there any problems like this?

Share this post


Link to post
Share on other sites
Quote:

I know that certain languages only run on certain OSs *Microsoft*, so are there any problems like this?

If you're thinking of C#... you're wrong.

I'll second Python as a good choice, though.

Share this post


Link to post
Share on other sites
Java is not a difficult language, you've been reading the wrong tutorials, if you think it is, and there are a lot of resources for it. The standard Java2D API is quite good for making 2D games, even real time games with rather impressive graphical effects, especially if you remember to switch on the 3D acceleration. You've got facilities for loading all kinds of image formats, playing sounds is easy, etc. All of that is part of the standard package and it's also quite well documented.

Share this post


Link to post
Share on other sites
I like to recommend C as a starter language. It's very simple to learn (there are millions of excellent free tutorials online), yet very powerful at the same time. Once you're proficient in it, you can pretty much do anything you could ever dream of, which includes learning other languages if you need to. It's not platform independent, but code is very portable. Virtually all games nowadays are written in C++, not because it's an arbitrary standard, but because it really is what you want to be using for maximum performance and ease of programming in one package.

As for cross-platform compatibility... Hrmm... Hate to sound like a downer, but gamers are on Windows... If you make a game cross platform, you'll be really lucky if more than 1% of your customers are on linux or mac... It's not that they don't make excellent gaming platforms; it's just that the market is what it is, and most game developers view them as a waste of time (unless they have a religious reason to think otherwise). Linux and mac users also know in advance that their choices will be very limited. I personally wouldn't bother.

Share this post


Link to post
Share on other sites
Quote:
I like to recommend C as a starter language. It's very simple to learn
Something as simple as user input can become very tricky in C. C is an example of a difficult language. it's only simple if the most one does is ridiculously trivial programs. Which aren't real world robust anyway (I'm guessing no one checks for errors on user input, etc. in the basic programs).

Quote:
yet very powerful at the same time
I wish people would define powerful. It's tempting to distill choosing between languages into simple evaluators like "power" but, practically it's a useless term in programming.

Quote:
Once you're proficient in it, you can pretty much do anything you could ever dream of,
Like string manipulation. Pity those fools who use Perl and Python and shell scripts to do work. They just need to use C.

Quote:
It's not platform independent, but code is very portable.
The language is not platform dependent. Try going on the C usenet lists and asking a platform specific question. You'll be sent off with a curt explanation.

Quote:
Virtually all games nowadays are written in C++, not because it's an arbitrary standard, but because it really is what you want to be using for maximum performance and ease of programming in one package.
Another vague statement. "Performance" and "ease of programming". The usual flamewar statement is that C triumphs C++ in performance (not necessarily true). And I don't think you'll get a consensus on C++ as easy to program in.

Share this post


Link to post
Share on other sites
Wow, thanks for the response guys.

mystb - Thanks, I'll take a look but the comment oler1s made about 'Pity those fools who use... Python... to do work' rather put me off.

jpetrie - i was actually thinking of VBScript, not knowing much more about 'proper' progamming languages than their names.

SnotBob - Thanks, I was rather thinking of Java, I'll have another look around.

kiwibonga - I'll have a look at C as well. I come from an open source, albeit on Windows, background, but agree with your sentiments. I was just thinking that if there was a choice between two otherwise equal languages and one went cross OS and the other one didn't then I might as well go for the first.

oler1s - Thanks for your comments, it certainly seems to have put a first negative mark by many languages!

I'll look around and see what tutorials are on offer.

Thanks again.

[Edited by - robertusrex on April 3, 2008 4:21:01 AM]

Share this post


Link to post
Share on other sites
Quote:
Virtually all games nowadays are written in C++

A hell of a lot of very good, if small, games are written in ActionScript (Flash) these days. That might not be a bad platform to start with, if you're more into designing games than programming them.

Share this post


Link to post
Share on other sites
If your goal is to make games rather than to use game programming to learn how to program, there's no reason not to keep on using GameMaker. Well, if you have the registered version anyways.

Share this post


Link to post
Share on other sites
Quote:
Original post by oler1s
Something as simple as user input can become very tricky in C. C is an example of a difficult language. it's only simple if the most one does is ridiculously trivial programs. Which aren't real world robust anyway (I'm guessing no one checks for errors on user input, etc. in the basic programs).

I'm not sure I follow.. Are you saying that checking for keypresses and ensuring strings are safe is non-trivial and difficult?

Quote:
I wish people would define powerful. It's tempting to distill choosing between languages into simple evaluators like "power" but, practically it's a useless term in programming.

A programming language is powerful when it is versatile.

Quote:
Like string manipulation. Pity those fools who use Perl and Python and shell scripts to do work. They just need to use C.

EDIT: Are you being sarcastic here? Not sure whether it's helpful advice for the OP or a sarcastic remark about string manipulation in C :S

Quote:
Quote:
It's not platform independent, but code is very portable.
The language is not platform dependent. Try going on the C usenet lists and asking a platform specific question. You'll be sent off with a curt explanation.

Yeah, sorry, I used a weird sentence structure there... Swap "code" and "it."

Quote:
The usual flamewar statement is that C triumphs C++ in performance (not necessarily true).

C and C++ triumph over everything else performance-wise, hence why it's a good idea to use them in any situation.

Quote:
And I don't think you'll get a consensus on C++ as easy to program in.

Unless I was some kind of child prodigy when I learned, I'd say C++ is so easy to program in that even a 13 year old can do it.

Share this post


Link to post
Share on other sites
I won't argue about C or C++ being hard to get basic stuff up and running, but I'm still going to say I'd very much rather work in python, as I'm lazy and don't like doing more than I need to when I write robust programs. I also have more of tendency to have a willingness to refactor my python code, which often results in my python programs going faster than my C/C++ ones.

Share this post


Link to post
Share on other sites
Quote:
Original post by kiwibonga
A programming language is powerful when it is versatile.


I can't think of a popular modern language that doesn't meet this criteria. As such, it is kind of a pointless definition. One would have to go out of ones way to write a language that isn't versatile.

Quote:

Quote:
Like string manipulation. Pity those fools who use Perl and Python and shell scripts to do work. They just need to use C.

Nobody *has* to use C. And I don't know what char arrays did to you, but they're really not that difficult to manipulate, even for a beginner.

In small doses. In large applications, they become awkward. When you have to write the same kind of code over and over (nul termination), you are bound to make an error. Compared to alternatives though, they are nightmarishly difficult.

Quote:

Quote:
The usual flamewar statement is that C triumphs C++ in performance (not necessarily true).

C and C++ triumph over everything else performance-wise, hence why it's a good idea to use them in any situation.


April fools, I get it.

Quote:

Quote:
And I don't think you'll get a consensus on C++ as easy to program in.

Unless I was some kind of child prodigy when I learned, I'd say C++ is so easy to program in that even a 13 year old can do it.

In a non-trivial way, of course. Large applications and C++ tend not to mix well with beginners. When a beginner programs in C++, they typically experience two types of problems: basic programming errors (that happen in any language) and C/C++ errors (these only happen in C and C++).

Share this post


Link to post
Share on other sites
Quote:
I can't think of a popular modern language that doesn't meet this criteria. As such, it is kind of a pointless definition. One would have to go out of ones way to write a language that isn't versatile.

Well, there's not a single platform that doesn't have a C compiler for it. It adapts to any architecture with minimum overhead. If you want to move on to GBA, Nintendo DS, Gamecube, Wii programming or other console, you'd better know C.
And if you ever need to go into more advanced stuff than game programming, like writing a device driver for instance, you'll be able to use C/C++ for that.
Think versatile in terms of the programmer's freedom to accomplish what he wants to do. You can really take the hardware to its limits, which is not something that can be said of Java or python.

Quote:
In small doses. In large applications, they become awkward. When you have to write the same kind of code over and over (nul termination), you are bound to make an error. Compared to alternatives though, they are nightmarishly difficult.

All languages have security pitfalls... Personally, I'd rather have the bug in my application than in an interpreter I didn't write...

Quote:
In a non-trivial way, of course. Large applications and C++ tend not to mix well with beginners. When a beginner programs in C++, they typically experience two types of problems: basic programming errors (that happen in any language) and C/C++ errors (these only happen in C and C++).

It's true that the C standards are pretty much a quagmire, but usually, there's always an expert around to tell you what's wrong... It's only a matter of time before you know all the common programming problems, and the ones that are compiler specific are usually easy to google and fix.

One thing that I like a lot about C as a beginning language is that it's strict -- anyone with a C background will have an overall better idea of what good programming practices are, and why their code doesn't behave the way they expect it to. It encourages not taking system resources for granted. It's a very, very solid base, and it's really something you can use for years to come, when you become proficient enough to write very complex things that require lots of optimization. Most importantly, it's pretty much the key to landing a programming job in the game industry, if that's what you're aiming towards.

Share this post


Link to post
Share on other sites
Quote:
Original post by kiwibonga
One thing that I like a lot about C as a beginning language is that it's strict -- anyone with a C background will have an overall better idea of what good programming practices are, and why their code doesn't behave the way they expect it to. It encourages not taking system resources for granted. It's a very, very solid base, and it's really something you can use for years to come, when you become proficient enough to write very complex things that require lots of optimization.

C is a wonderfully pure language which is both lean and mean.

It forces people to really understand all the low-level computer-science concepts, such as manual memory management, string manipulation, and so on. This is good in terms of education, but horrible in terms of productivity.

C++ offers more expressivity with it's standard library containers and algorithms, and beginners can benefit from these. Unfortunately, after a short while, you get into bed with it and one realises it has some ugly facets lurking about under the covers; such things are frustratingly difficult for beginners to grasp and are sometimes even so unintuitive that they cause occasional twangs in the backside for the seasoned C++ programmer.

Higher level languages are easier to pick up for a beginner; Java is taught as a beginners language at Universities, and a beginner can concentrate more on actually making something useful instead of suffering with undefined behaviour or forgetting to free some previously allocated memory. Java itself doesn't have a particularly great reputation for promoting good programming practices however.

Very high level languages like Python or Lua are perfect for beginners; they completely hide all the annoying intricacies of lower level languages, with a high level of expressivity but without being so simple that they get in the way of actually you learning real programming skills. Furthermore, they can be multi-paradigm so programmers can get a proper experience of, say, both functional and object oriented code from just one language.

The future probably lies in these super high level languages, perhaps with them geared more towards stream processing to make efficient use of mutli-core parallelism. Mid-low level languages like C will one day be relegated to aspects of academia only.

Share this post


Link to post
Share on other sites
Quote:
Original post by robertusrex
Wow, thanks for the response guys.

mystb - Thanks, I'll take a look but the comment oler1s, about 'Pity those fools who use... Python... to do work', made rather put me off.

Thanks again.



The problem with this forum is that after the third reply everybody stops answering the original question and start to discuss about their own visions of what is a good language.

About your comment, olenr1s was being sarcastic to kiwibonga answer. The real thing is that string manitulation in pyton/perl is way much easier to perform then with C.

Never the less, my opinion is still the same. Choose any language, and start to learn the specifics of it. Once you're confortable with one, you'll see that they're much alike, and you can choose the one where you can code your ideas faster. And that one will be the most efficient and powerfull language to YOU.

Share this post


Link to post
Share on other sites
I haven't done any python, but I hear its a good starter. I started with Java, and that worked for me. C++ is a versatile/powerful language, but it has memory management to learn, which is good to know, but makes things more complicated for a beginner.

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-offWhen a beginner programs in C++, they typically experience two types of problems: basic programming errors (that happen in any language) and C/C++ errors (these only happen in C and C++).
As a relative beginner in C++, I'm curious, what's an example of an error that could only ever happen in C or C++? (Knowing being half the battle and all.) [smile]

Share this post


Link to post
Share on other sites
Quote:
I'm curious, what's an example of an error that could only ever happen in C or C++? (Knowing being half the battle and all.) [smile]

I'm assuming this is C/C++ compared to Java, C#, Python, etc. First, manual memory management in C/C++ easily leads to errors that just can't happen in those other languages. Second, they don't have pointers and arrays have automatic bounds checks, so no buffer overflows or other funky pointer stuff. Additionally, in C++ you can strangle yourself with templates, operator overloading and stuff like that.

Share this post


Link to post
Share on other sites
Quote:
Original post by NowSayPillow
Quote:
Original post by rip-offWhen a beginner programs in C++, they typically experience two types of problems: basic programming errors (that happen in any language) and C/C++ errors (these only happen in C and C++).
As a relative beginner in C++, I'm curious, what's an example of an error that could only ever happen in C or C++? (Knowing being half the battle and all.) [smile]


I am going to talk about C++ here, but most of the points will probably apply to C as well.

Most modern languages have some kind of layer under the programmer that prevents common C++ errors. The main offender is the pointer. First of all, the language doesn't default-initialise pointers to 0. This can cause all sorts of headaches. Once a pointer to an object created with new has been deallocated with delete there is no guarantee that the (now invalid) pointer will not be used again. There are no language checks to prevent array bounds errors. Not returning a value from a function may only be flagged as an error when the user manually increases the warning level. In addition, these will only be warnings (unless the user intervenes again to set warnings as errors) and will only be output when a particular source file is compiled, if it compiles without actual errors, the user may not notice the warning. Expecting beginners to know the existance of these warning settings is not reasonable.

Worse (in some ways), debuggers frequently insert consistent patterns into memory. This can sometimes cause uninitialised variable errors to act in a working manner in debug mode (even when the code is wrong!), but to crash or produce strange results when compiled in release mode.

In addition, there are language issues such as passing and returning arrays from functions not working as one might intuitively expect. Beginners have difficulty understanding the C++ compilation model. For example, why are header files required? Why are inclusion guards required? Why can't template implementations go in source files?

Many beginners learn C style casts, and see no need for the more correct C++ casts. They quickly learn that casting can suppress compiler error messages. Frequently I see questions like "why isn't this working", where the beginner has cast something to an incompatible type (such as casting a member function pointer to a window procedure function pointer, or casting between pointers to objects not related via inheritance).

Abuse of macros (when they don't yet know or understand the alternatives). Trying to work out the error message when the code has been pre-processed is not easy. Understanding how macro arguments evaluation can cause unintended results.

Template error messages are horrendously verbose and difficult to read. Template monstrosities aside, I have found that most other languages I've used have much better compiler errors.

All of this discourages the "test and see" approach that humans work well with. You can write horrible code that is plain wrong and get correct results. For example, returning a temporary char array from a function often appears to work at first but will fail later. Contrast this to many modern languages that not won't allow such an error, but provide a huge convenience feature to test and see coding, an interpreter.




Quote:

Well, there's not a single platform that doesn't have a C compiler for it. It adapts to any architecture with minimum overhead. If you want to move on to GBA, Nintendo DS, Gamecube, Wii programming or other console, you'd better know C.
And if you ever need to go into more advanced stuff than game programming, like writing a device driver for instance, you'll be able to use C/C++ for that.

Ok, so you seem to be defining flexibility in terms of source portability. Non-trivial C tend not to be portable: dependencies would also need to be ported to various platforms. Also, I doubt anyone posting in "for beginners" is going to be writing a device driver.

Part of programming is picking the correct tool for the job. For a device driver, C might be. For a commerical game engine's inner loop, C++ might be. For a hobbyist developer looking to write a 2D game, C probably isn't.

Quote:

Think versatile in terms of the programmer's freedom to accomplish what he wants to do.

I feel more freedom in Ruby than I do in C++.

Quote:

You can really take the hardware to its limits, which is not something that can be said of Java or python.

Modern Java proves you wrong.

Quote:

All languages have security pitfalls... Personally, I'd rather have the bug in my application than in an interpreter I didn't write...


I like it when the interpreter (frequently more accurate for modern languages: JIT compiler) manages to catch potential bugs in my program, instead of the alternative.

Besides

# bugs I've discovered in my own code: beyond count
# bugs I've discovered in interpreters: 0

Classic NIH syndrome. Why do you trust your C compiler then, or your OS?

Quote:

One thing that I like a lot about C as a beginning language is that it's strict -- anyone with a C background will have an overall better idea of what good programming practices are, and why their code doesn't behave the way they expect it to. It encourages not taking system resources for granted. It's a very, very solid base, and it's really something you can use for years to come, when you become proficient enough to write very complex things that require lots of optimization. Most importantly, it's pretty much the key to landing a programming job in the game industry, if that's what you're aiming towards.


Algorithmic optimisations are the best way to optimise most programs. The 80/20 rule applies, optimisations are frequently only applicable to relatively small portions of code. Also, now and in the future we are looking at scalable, multi-core friendly algorithms for speed increases.



If you are experienced enough to know better, then by all means use C or C++. You know what you are getting yourself in for. I have no problems with either language, applied to the right problem. But don't recommend it for beginners.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement