File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Game Development and the fly likes Which programming language to choose for game development? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Which programming language to choose for game development?" Watch "Which programming language to choose for game development?" New topic
Author

Which programming language to choose for game development?

Anmol Mahatpurkar
Greenhorn

Joined: Oct 23, 2013
Posts: 10

I have been learning java for quite a while now, and I am clear with most of the basics of Java Programming. I love programming in java.
I also love game development and want to get into the industry for developing high end 3D games, like Assassins Creed, Call of Duty, Battlefield, etc
I tried to gather information on this field, and found out that java is not used by most of the companies for game development. They use C++. I know that java is an internet based programming language.
Thus, I am confused whether I should learn C++, or stick to java. I love both game development and java but they seem to be contradictory in way. Please let me know what should I do.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
I know that java is an internet based programming language.

What do you mean by that? In which way is Java different from C/C++ to make it so?

Java certainly is not the right language if you're interested in desktop games. While there are desktop games written in Java (like Minecraft), Java's presence on the desktop is just not at a point where it makes a compelling choice.


If, on the other hand, you're asking about browser-based games, then Java might well be your language of choice for implementing the server side.


Ping & DNS - my free Android networking tools app
Anmol Mahatpurkar
Greenhorn

Joined: Oct 23, 2013
Posts: 10

I have heard that Desktop games require the use of pointers. This is not supported by java.

Also, is C++ is the only language for game development or are there other options?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38497
    
  23
This discussion would fit better in the games forum. Moving.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Anmol Mahatpurkar wrote:I have heard that Desktop games require the use of pointers.

Better check with whoever said that; it is patently false.

This is not supported by java.

Java absolutely has pointers - hence the NullPointerException. They're generally called "references", though. What Java does not have is pointer arithmetic - which is on balance a good thing, IMO, given how frequently those result in crashes and security problems in the C/C++ world.

Also, is C++ is the only language for game development or are there other options?

The .Net languages come to mind.
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
You'd do better with C++

The original idea with Java was that it could be written once and run anywhere with complete safety. The reality is that even converting a game from a Java application to a Java applet requires all sorts of changes. Then there's the problem that end users most often don't have Java on their PC's. They also see Java security scares and now see Java as a risk rather than as a safe option. I'm currently trying to turn a Java program into an exe because end users feel safer running an exe than they do installing Java (go figure). Next there's the performance side of things - Java is actually pretty quick these days but it can't compare with a natively compiled program. The overriding reason to use C++ though is simply because the gaming industry tends to use C++ with just a few exceptions (minecraft).

A different option is to stick with Java, get a job in banking etc and then do game development as a hobby in Java. The advantage of this approach is that you'll get paid better in banking and you'll be able to develop whatever games you please.

Mike


Arcade : Alien Swarm
Board : Chess - Checkers - Connect 4 - Othello
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7711
    
  20

Mich Robinson wrote:The reality is that even converting a game from a Java application to a Java applet requires all sorts of changes.

Although why you'd choose to do that is beyond me. Applets are very "old-hat".

Then there's the problem that end users most often don't have Java on their PC's.

Really? I can't think of anyone I know who doesn't have Java on their phone, let alone their computer.

They also see Java security scares and now see Java as a risk rather than as a safe option.

Then IMO, they're mistaken. And even if they weren't, the language at least safeguards you from the literally thousands of ways you can crack/misuse C/C++.

Next there's the performance side of things - Java is actually pretty quick these days but it can't compare with a natively compiled program.

Actually, in many cases it can outperform them, since modern JIT compilers are very smart.

The overriding reason to use C++ though is simply because the gaming industry tends to use C++ with just a few exceptions (minecraft).

Now there you may well have a valid point. No point in using "bleeding edge" technology if you don't have to.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Winston Gutkowski wrote:I can't think of anyone I know who doesn't have Java on their phone

You must move in well-defined subsets of the general population - I find it hard to avoid iPhone users in real life

They also see Java security scares and now see Java as a risk rather than as a safe option.

Then IMO, they're mistaken. And even if they weren't, the language at least safeguards you from the literally thousands of ways you can crack/misuse C/C++.


Since we're talking about the client-side, I think anyone would be justified in regarding the JVM sandbox as insecure at this point. While running an applet or WebStart app from a particular company is mostly a question of how much I trust that company, the fact that once I enable the Java/browser integration I trust the code governing the security implementation to work correctly (when in fact it has been shown repeatedly to be vulnerable over the years) is a leap of faith that I can easily see people not wanting to take. The same goes for Flash and similar technologies. So unless there is a technology that allows C/C++ code served over the web similar levels of access to a client systems, I'd say this is a valid criticism. (The point is moot if one considers non-browser means of getting Java apps to run on desktops.)
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7711
    
  20

Ulf Dittmer wrote:Since we're talking about the client-side, I think anyone would be justified in regarding the JVM sandbox as insecure at this point. While running an applet or WebStart app from a particular company is mostly a question of how much I trust that company, the fact that once I enable the Java/browser integration I trust the code governing the security implementation to work correctly (when in fact it has been shown repeatedly to be vulnerable over the years) is a leap of faith that I can easily see people not wanting to take.

I take your point, but the fact is that most computers have a JVM (and if you don't, you'll be asked pretty soon if you want to download one or not); what we're discussing here is whether you trust it in a browser setting or not.

Winston
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
Winston Gutkowski wrote:Although why you'd choose to do that is beyond me. Applets are very "old-hat".
It was simply an example of how Java isn't write once even within it's own system. Perhaps I should of chosen web-start?

Winston Gutkowski wrote:Really? I can't think of anyone I know who doesn't have Java on their phone, let alone their computer.
Ulf mentioned Iphones but I don't think any apple products have Java (or you need to jump through hoops to install it). PC's aren't supplied with Java as standard so non technically literate users are unlikely to have it. Even the technically literate who read the recent security scares might be wary. If I run an applet (written by myself, requiring no special permissions and that I've run countless times before on my PC) I get a big warning message telling me I'm about to run a (unsigned or self signed) Java applet. If it was an exe then I'd get a warning when I first run it and then never again. Go figure.

Winston Gutkowski wrote:Then IMO, they're mistaken. And even if they weren't, the language at least safeguards you from the literally thousands of ways you can crack/misuse C/C++.
These users may well be mistaken but that's still their belief. When trying to get people to install an arcade program I'd written onto their PC's and arcade cabinets, the overriding response I got from people was to ask me to release it as an exe.

Winston Gutkowski wrote:Actually, in many cases it can outperform them, since modern JIT compilers are very smart.
The JIT compiler is certainly impressive but it still needs to read the Java byte codes and then selectively compile these codes into native code before running. A normal compiler does the translation once and you just get native code to run and this is why native code is faster. Obviously there are good and bad compilers out there but the basic truth is unchanged.

The best way of answering the OP is to simply look at what languages games writers actually use and for state of the art 3D games it's mostly C++ though Minecraft and Runescape are Java. Whether these are state of the art is another question. Most advanced 3D games use graphics engines like the CryEngine for Crysis and these engines tend to be written in C++. I recently looked into releasing a Java game on Steam but it's a pain as you need to wrap everything in C++ wrappers.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Mich Robinson wrote:Ulf mentioned Iphones but I don't think any apple products have Java (or you need to jump through hoops to install it).

OS X always had Java preinstalled, up until the recently released Mavericks version. Now it will prompt you whether you want to download and install Java (automatically) the first time a browser hits a page with an applet or WebStart app. It's quite painless for the user.

PC's aren't supplied with Java as standard so non technically literate users are unlikely to have it.

That depends on the manufacturer. My impression is that most of the major manufacturers ship their Windows machines with Java preinstalled.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7711
    
  20

Mich Robinson wrote:It was simply an example of how Java isn't write once even within it's own system.

Erm ... I'm not sure how. WORM simply refers to the idea that the same source code can be copied and run on many different systems. Whether it behaves the same or not (or even runs) is something entirely different. There are plenty of "system-specific" methods, even in Java.

The JIT compiler is certainly impressive but it still needs to read the Java byte codes and then selectively compile these codes into native code before running. A normal compiler does the translation once and you just get native code to run and this is why native code is faster.

Ah, but it isn't necessarily. What you're saying is probably true of largely static, number-crunching programs (and I suspect there's a fair bit of that in games), but the simple fact that running a Java program is a two-stage process, allows both the compiler and the JVM to make optimization decisions. Indeed, I believe there's a whole family of "late-linking" options (Linux .o's spring to mind) for C-type languages that are designed to harness exactly that power.

The best way of answering the OP is to simply look at what languages games writers actually use and for state of the art 3D games...

And there, as I said before, you're probably right.

Winston
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
I don't have an apple PC though a good friend tells me that running Java apps on his imac is a pain in the @rse - it's not just the enabling of Java but the changes to security as well. I'm pretty sure ipads can't run Java at all. I did go to this page to see what the current state of affairs was. I'll admit I wasn't too sure what was going on after reading the page but a couple of the user comments on the 1st page seemed very enlightening:

JerryMacPC: OK, I'm confused. I thought Java was bad, due to security holes, and should be left disabled. All of this jargon about runtime environments and applets loses me every time, and I consider myself fairly tech literate, although I am not a programmer, just a skilled user.

pcampagna: Everytime I change my Java, the programs that use it, stop working. So then I spend many hours trying to get the program to run again because I keep getting (update java message) Even after I updated from the Oracle multiple times. - I'm just not updating Java an more at this point. It works and that's it.

RranXeroxx: As a configuration manager at a company with 4000+ client endpoints I would just like to say how much I hate Java. Its not Java itself but how its used and misused by vendors and how departments in my company will buy a program and simply not update it for years and years. This causes differentiating Java requirements on the same endpoint and some of those Java runtimes can't be updated or they break the app. We have to work on isolating the runtime from the internet. But then you have webapps with the same problems, wanting to do things on a endpoint that a browser really should not do. Then there are apps like Adobe Reader that allows embedded Java scripts to run. Yes, I would like to lock that down and I do by default but then there are enduser requirements to have that on and working.

Java, along with all Adobe products, is currently my biggest security hole. I feel like the little dike boy.


I actually like Java but I just find the current state of affairs a bit discouraging.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7711
    
  20

Mich Robinson wrote:I don't have an apple PC though a good friend tells me that running Java apps on his imac is a pain in the @rse - it's not just the enabling of Java but the changes to security as well. I'm pretty sure ipads can't run Java at all.

So presumably that means you have to learn yet another language to write apps. Seems a bit odd to me, when Android's success seems to be piggy-backed on the fact that you can write Java apps for it. Maybe Jobs got that one wrong.

Winston
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Mich Robinson wrote:I don't have an apple PC though a good friend tells me that running Java apps on his imac is a pain in the @rse

I don't know what your friend did to jack up his system, but on every Mac I've set up, it's one click to say "Yes, please install Java". End of story. (Prior to Mountain Lion, it was no click.)

Unless of course, by "java apps" he means applets in the browser. That's a whole different story.

I actually like Java but I just find the current state of affairs a bit discouraging.

Oracle has done a really bad job of messaging the differences between browser sandboxes for applets, and Java as the JRE.

Applets need to die, and do so quickly.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
@Bear, Winston
I'll bow to your knowledge of Apple - I'm really only repeating a friends experiences and have no first hand experience.
And to answer the OP's question - would you recommend Java, C++ or some other language?
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7711
    
  20

Mich Robinson wrote:And to answer the OP's question - would you recommend Java, C++ or some other language?

That would depend on all sorts of things, including target platform, how much you want to do yourself, and whether you're interested in learning a new language or not.

From what you've said - and I have no reason to doubt you - it sounds like C++ may well be the most "mature" development environment. On the other hand, if the target is an IOS device, or I was particularly interested in learning Objective-C, I might choose it.
I'm afraid that after 35 years and 7 languages, the "thrill of discovery" has kind of dissipated for me though, so I'd probably choose Java/Android.

Winston
Ben jamin
Greenhorn

Joined: Nov 16, 2013
Posts: 2
Depends on what kind of game. For simple games, you can use python.
But if performance is an issue, then C# might be better.
Recently I have read an article about python.
I think it'll help you. Have a glance at it. enjoy...

Article: http://www.articlethinks.com/5487/python-web-based-games-have-a-better-3d-rendering/
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
Ben jamin wrote:Depends on what kind of game. For simple games, you can use python.
But if performance is an issue, then C# might be better.
The OP was interested in "developing high end 3D games" so I don't think Python is a good fit. C# certainly has more promise but a quick google showed that no well known games have been written in this language either.
Jimmy Ho
Ranch Hand

Joined: Jul 31, 2007
Posts: 61

I'm not sure the original poster ever clarified what platform was preferred? (I could be wrong; a lot of posts here.)

If we're talking about Xbox, Playstation, etc., then I doubt they're running a Java Virtual Machine and are doing low-level system stuff to optimize their games, which lends to C++ (or whatever system programming language they're using--raw assembly for all I know, though I'd be surprised if that).

If Internet games where you go to a website and do stuff, then server side stuff could be Java because a lot of servers use Java, and there isn't the intense graphics/physics calculations that pushes people towards C++.

Then again, the games could be done in Python, or whatever use the Internet uses (Ruby on Rails, etc.)

If iPhone/iPad games, then it must be Objective-C, because, well, Apple....

If Android games, then it's back to Java, since Java is the Android programming language.

If iPhone or Android game that talks to a central server that the game company has deployed, then the language on the server could Java, Python, Ruby on Rails, etc.?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which programming language to choose for game development?