Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Which language to use?  (Read 4170 times)

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Which language to use?
« on: April 22, 2011, 10:45:30 am »

I was going to post this in another (ancient) thread but I had a warning message advising me to consider starting a new one. So I'm sorry in advance if I should have added to the other one.

I wanna get into game programming, I know my way around some basic coding principles (loops, conditionals, etc), I programmed for commercial ERP applications before using SQL and SAP/ABAP, but nothing overly graphical.

I want to make the most of my time spent for this endeavour, meaning I don't want to waste it learning Game Maker Language or something like that. If I'm going to be spending time, I might as well learn the proper way of doing things. The question is, which language should I follow? C++ or Java or Python or what? What are the pros and cons of each? Which one is the most prevalent? I see people recommending this one or that, but it is not clear to me why one is better than the other and to what end. Can you help?
Logged

Toaster

  • Bay Watcher
  • Appliance
    • View Profile
Re: Which language to use?
« Reply #1 on: April 22, 2011, 11:34:18 am »

What kind of game do you want to make?  That really drives the answer.

If you're wanting to do this as a career, the big-name languages are the places to start.  C and C++ are used for a huge number of mainstream games out there.  Java also has a fair number.

If you're wanting to be an indie developer, you have a wider range of choices.  ActionScript (Flash) is a solid choice due to its wide support and ease of user use.  Any of the scripting languages (Python, et al) are decent choices, though any interpreted language will be slower than a compiled one.

If you're doing it for the hell of it, pick one you want to learn.


C / C++ are the big daddy languages that very many other languages base themselves off of.  You should have no trouble finding a job if you're good at these.  They're fast, but dangerous: they let you get deep in the nitty-gritty, but you can also shoot your foot off if you're not careful.

Java is the other "big" language that you hear a lot out of.  It'll do more to try to keep you from doing something stupid (it's garbage collected, strongly typed, etc), but it has more overhead in exchange.

I don't know Python, but it's very popular for scripting as well as larger projects.  It is interpreted, meaning it's easier to test on the go and will run on anything that has a python interpreter written for it (which is practically any system.)  You'll see a performance hit, though.

Ruby is an up-and-coming language that's said to take the best features of Python and Perl with a few improvements of its own, and with Ruby on Rails has strong web support.

I've seen several smaller freeware games in FreePascal, which is reminiscent of C, and not too hard to learn.

I'm going to throw in a plug for D.  It's not mainstream, but it's a successor to C written by a compiler writer.  It has all the strong features of C and C++, without the legacy issues of C++, plus more modern language features that C/C++ lack.
Logged
HMR stands for Hazardous Materials Requisition, not Horrible Massive Ruination, though I can understand how one could get confused.
God help us if we have to agree on pizza toppings at some point. There will be no survivors.

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Which language to use?
« Reply #2 on: April 22, 2011, 11:44:02 am »

wow... I just posted this thread over in creative projects. I totally didn't see this thread.

C/C++: its fast and in wide spread use in gaming because you can optimize for specific hardware more easily. It also requires a lot of expertise in order to avoid memory leaks and corruption. It is fairly cross platform if you use the right libraries.

JAVA: its almost as fast as C/C++ and sometimes even faster when run in the hotspot JVM with optimizations, plus it has managed memory and a ton of libraries. The language itself has some annoying faults though. It is by far the most cross platform engine for games.

C#: its like java with most of the annoying faults smoothed out, but it runs on a slightly less stable, slower and less cross platform VM (Microsofts CLR).
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

diamok

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #3 on: April 22, 2011, 01:33:27 pm »

Logged

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Which language to use?
« Reply #4 on: April 22, 2011, 02:20:58 pm »

What kind of game do you want to make?  That really drives the answer.

Thanks for your in-depth answer, Toaster. My goal is to get to a point where I can code 2D strategy or RPG games with simple graphics by myself. I guess it would also be sweet if I could get to a point where I can make a game like Mount & Blade, but I'd be happy enough with 2D. I'm not thinking of this as a career as I already have a good one I'm well into. Then again I can get quite obsessed with my hobbies, so that's why I wanna pick a route that can get me far.


Quote
Java is the other "big" language that you hear a lot out of.  It'll do more to try to keep you from doing something stupid (it's garbage collected, strongly typed, etc), but it has more overhead in exchange.

Can you explain what you mean by overhead?

Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Which language to use?
« Reply #5 on: April 22, 2011, 02:35:14 pm »

What kind of game do you want to make?  That really drives the answer.

Thanks for your in-depth answer, Toaster. My goal is to get to a point where I can code 2D strategy or RPG games with simple graphics by myself. I guess it would also be sweet if I could get to a point where I can make a game like Mount & Blade, but I'd be happy enough with 2D. I'm not thinking of this as a career as I already have a good one I'm well into. Then again I can get quite obsessed with my hobbies, so that's why I wanna pick a route that can get me far.


Quote
Java is the other "big" language that you hear a lot out of.  It'll do more to try to keep you from doing something stupid (it's garbage collected, strongly typed, etc), but it has more overhead in exchange.

Can you explain what you mean by overhead?

The only significant overhead for java a couple hundred megs of memory usage for the JVM, and that isn't much of a factor for most modern systems. The JVM can be as fast as c to within +/- 10% in almost all circumstances.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Tilla

  • Bay Watcher
  • Slam with the best or jam with the rest
    • View Profile
Re: Which language to use?
« Reply #6 on: April 22, 2011, 02:48:09 pm »

~ath is the only respectable way to code. MDickie used it for his game quit functions apperently :P
Logged

Toaster

  • Bay Watcher
  • Appliance
    • View Profile
Re: Which language to use?
« Reply #7 on: April 22, 2011, 03:19:16 pm »

What kind of game do you want to make?  That really drives the answer.

Thanks for your in-depth answer, Toaster. My goal is to get to a point where I can code 2D strategy or RPG games with simple graphics by myself. I guess it would also be sweet if I could get to a point where I can make a game like Mount & Blade, but I'd be happy enough with 2D. I'm not thinking of this as a career as I already have a good one I'm well into. Then again I can get quite obsessed with my hobbies, so that's why I wanna pick a route that can get me far.


Quote
Java is the other "big" language that you hear a lot out of.  It'll do more to try to keep you from doing something stupid (it's garbage collected, strongly typed, etc), but it has more overhead in exchange.

Can you explain what you mean by overhead?

Nadaka explained the overhead pretty well.  In other words, extra system resource usage.


For what you describe, you might want to give Flash a try, assuming you want them to be fairly graphical.  If you know what a game similar to what you want, you can always figure out what it's in and use that. :)

3D engines are a lot to code.  You might want to check out Unity for that- I've heard some good things about it.
Logged
HMR stands for Hazardous Materials Requisition, not Horrible Massive Ruination, though I can understand how one could get confused.
God help us if we have to agree on pizza toppings at some point. There will be no survivors.

diamok

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #8 on: April 22, 2011, 03:30:26 pm »

It's probably to much to get into and learn, but I just saw this.

http://www.indiedb.com/engines/cryengine-3/news/be-free-be-creative-be-the-developer

Take care,
Logged

Tres_Huevos

  • Bay Watcher
  • All I want for Christmas are your two front teeth.
    • View Profile
Re: Which language to use?
« Reply #9 on: April 22, 2011, 05:35:02 pm »

Microsoft's XNA Game Studio (uses C#) might be another thing to look at. I've only played around with it a bit, and that was some time ago, so I can't say it's good for sure, but still, it's free. Window's only, though.
Logged

DJ

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #10 on: April 22, 2011, 06:04:02 pm »

C++ has the widest selection of tutorials and libraries relevant to game development.
Logged
Urist, President has immigrated to your fortress!
Urist, President mandates the Dwarven Bill of Rights.

Cue magma.
Ah, the Magma Carta...

Chandos

  • Bay Watcher
  • bork bork bork!
    • View Profile
Re: Which language to use?
« Reply #11 on: April 22, 2011, 08:11:30 pm »

What kind of game do you want to make?  That really drives the answer.

Thanks for your in-depth answer, Toaster. My goal is to get to a point where I can code 2D strategy or RPG games with simple graphics by myself. I guess it would also be sweet if I could get to a point where I can make a game like Mount & Blade, but I'd be happy enough with 2D. I'm not thinking of this as a career as I already have a good one I'm well into. Then again I can get quite obsessed with my hobbies, so that's why I wanna pick a route that can get me far.


Quote
Java is the other "big" language that you hear a lot out of.  It'll do more to try to keep you from doing something stupid (it's garbage collected, strongly typed, etc), but it has more overhead in exchange.

Can you explain what you mean by overhead?

Nadaka explained the overhead pretty well.  In other words, extra system resource usage.


For what you describe, you might want to give Flash a try, assuming you want them to be fairly graphical.  If you know what a game similar to what you want, you can always figure out what it's in and use that. :)

3D engines are a lot to code.  You might want to check out Unity for that- I've heard some good things about it.

Umm.. ok stupid question maybe but... how do I figure out what language a game was written in? For instance, let's consider Introversion's Uplink. What language is that in?
Logged

olemars

  • Bay Watcher
    • View Profile
Re: Which language to use?
« Reply #12 on: April 22, 2011, 08:46:52 pm »

Quote
Umm.. ok stupid question maybe but... how do I figure out what language a game was written in? For instance, let's consider Introversion's Uplink. What language is that in?

C++, and apparently using SDL for audio and MFC for UI.

You can usually tell from the contents of a game folder, as long as you know what to look for there.

As for the original question, if you have to ask then your first priority should be just in building up some general programming experience and then start thinking about what language you prefer to work with. There are no shortcuts.
Logged

nenjin

  • Bay Watcher
  • Inscrubtable Exhortations of the Soul
    • View Profile
Re: Which language to use?
« Reply #13 on: April 22, 2011, 09:36:21 pm »

It's important to know what kind of game you want to make because it will determine what additional utilities you're going to need.

For example, you're mentioning graphics. Which means you'll probably want to use an engine. You could write your own engine....but you don't sound like you want to get that hardcore. Figuring out what engine you want to use (full 3d, 2d, physics capable, yadda yadda) will guide you on what languages are available for that engine. Although it's probably better to settle on a language first and find the engine to match it.

But the nice part about engines is they'll streamline a lot of the graphics integration, where building something from scratch will be much, much more of a learning experience.
Logged
Cautivo del Milagro seamos, Penitente.
Quote from: Viktor Frankl
When we are no longer able to change a situation, we are challenged to change ourselves.
Quote from: Sindain
Its kinda silly to complain that a friendly NPC isn't a well designed boss fight.
Quote from: Eric Blank
How will I cheese now assholes?
Quote from: MrRoboto75
Always spaghetti, never forghetti

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Which language to use?
« Reply #14 on: April 22, 2011, 09:41:20 pm »

You probably don't need the power and complexity of c/c++.

You don't need a crap language like vb.

Java and C# are good places to start, with plenty of room to grow. They both have a good basic syntax, they both can produce GUI's easily, they both have reasonable performance. Java is faster but with some annoying quirks in some areas, C# is slower but less rigid. Java has decent libraries for OpenGL graphics, C# has libraries for DirectX graphics.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.
Pages: [1] 2 3