Question

C++ or Java for game developing?

Asked by: erwins

Hi,

I am interested in writing computer games first as a hobby, and then maybe later for commercial purposes.  Is C++ or Java the better language to use and why?  My biggest concern will be game performance, and a professional looking game.  I don't mind if one is much harder to learn over the other.

I am a programmer by trade, but mostly in business and financial apps, so game programming is new for me.  I know how to program in C, but have to learn the OOP aspect of C++ and Java.

Thanks in advance,
Erwin

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-01-01 at 22:35:49ID20838801
Tags

game

,

programming

Topics

Game Programming

,

Gaming World

,

3D-Studio 3D Graphics Software

Participating Experts
6
Points
250
Comments
11

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Stock Trading Application
    Background - Hopefully I am presenting this correctly ... I have a computer engineering degree, which means I understand a lot of the fundamentals but definitely do not have an expert level knowledge of coding required for the project below. Overview - My company has recent...
  2. Game Dev
    Hi all, As we discussed with some experts... The rules of this question are: - NO questions asked - any such will be deleted and if an expert start to answer here, they may have some troubles :) - No mails and personal accusations and insults - No points here or through a &...
  3. Get the finance chart from finance yahoo
    I need to get the Finance chart from http://finance.yahoo.com/ I managed to get the Stock Last Trade now i need to get the chart and the News Headlines data. Thanks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: DatsmePosted on 2004-01-02 at 17:30:30ID: 10032043

This is a report evaluating Java Game Dev as compared to C and C++

http://www.rolemaker.dk/articles/evaljava/

 

by: sunnycoderPosted on 2004-01-02 at 23:56:06ID: 10033035

>Is C++ or Java the better language to use and why?  My biggest concern will be game performance, and a professional
>looking game.  I don't mind if one is much harder to learn over the other.

Had there been a silver bullet, other languages would have been out of the trade :o)
What is best depends on what you need it for ? If you are planning a small web browser based game, may be you can program it lot more efficiently in flash ... If you are looking for something like warcraft or half-life or quake, neither of these languages alone is sufficient to help you ... Generally a library like opengl or direct3d is used in order to provide high quality efficient graphics ... google will find you plenty of resources for either of them.

What you are embarking on is an interesting field where sky is the limit ... take it step by step and you will soon be there.

good luck

 

by: erwinsPosted on 2004-01-03 at 23:46:34ID: 10036493

Thanks for both of your replies.  

The thesis in the link www.rolemaker.dk/articles/evaljava is VERY weill written and will help me answer my questions. So far, I have read about 33% of it.

Happy new year!

Erwin

 

by: NightBladerPosted on 2004-01-26 at 13:56:34ID: 10204564

I dont know for sure but I think that commercial games(half life, quake...) are all written in C++ using the OPENGL or DIRECT X libraries and other stuff.
If you want to make this type of games, go for C++ of course.
Also all small games and old games like dave, pacman etc.(working out of the explorer) are written fully in C++.
All console games as well, C++ is THE language to make modern programs and games, not java.
Take Java only if you want to make explorer, internet games.

 

by: Ansur-Posted on 2004-02-01 at 08:39:13ID: 10247196

The SUN Java3D SDK (OpenGl & DirectX !) may prove to be useful when wanting to develop games in Java.

Ofcourse, C++ (combined with eg. OpenGL) still is the best language for as far as I know.
I though this was because Java doesn't allow you to directly locate memory (since it has no 'real' pointer system). There was a backdoor to this, but then the stability the Java platform provides would disappear.

Myself, I'm looking into making maybe some sort of a platform game, or some sort of a 'scorched earth' like game in Java. The language just feels better to me, compared to C++

 

by: www_SMR_co_uk_was_too_offensivePosted on 2004-02-09 at 04:00:25ID: 10309194

Actually a lot of last generation games programming was done in a mixture of C (or C++) and assembler. The assembler was usually written by hand so as to give the hardware driving portions (particularly graphics) of the engine as much of a boost as possible. The original Quake worked this way. Nowadays, a lot of the graphics, sound etc are driven using DirectX or OpenGL, which generally separate the programmer from the specific details of the hardware. I don't know if there's still a lot of call for the assembler stuff, though it wouldn't surprise me if most of the big game companies keep at least one competent ASM guru in reserve for code optimisation and so on. Anyway, my point is that from a speed point of view, C and ASM would be the best combination. C++ is helpful if you can make it work for you, but it's not really necessary. I tend to see OOP as important only really from a 'serious' (ie not fun) software point of view.

 

by: nuno89Posted on 2004-03-08 at 20:28:38ID: 10547183

I am a professional game developper and in our industry C++ is king.
In game development you the maximum performance as well as a perfect control over the memory allocations. Java does not address any of those.

On the playstation 2 we also use assembly to code the vector units. But C and C++ are the main languagues. In fact even C is fading out because of the superiority of C++ to handle large code bases as well as big programming teams.

For the graphics API directX is rules for Xbox and Pc platforms.
The ps2 and gamecube have proprietary api's to access their graphics chip.

 

by: erwinsPosted on 2004-03-08 at 20:56:17ID: 10547344

Hi nuno89,

what C++ vendor would you recommend me using?
I'm guessing the choice more depends on the features and ease of use of the development tools that the vendors provide than the actual compiler, since they should in theory all compile the same.

Thanks for your advice!

Erwin

 

by: Ansur-Posted on 2004-03-09 at 00:13:16ID: 10548182

Hi nuno89

maybe a bit off-topic, though last I read an interesting interview with SUN's Chief Gaming Officer, Chris Melissinos.
Especially this passage:

"Benefits of moving to the Java platform from C++ include accessibility to more platforms, decreased development time, automatic garbage collection, and not having to track down bugs and memory leaks. These benefits allow a faster time to market and enable you to run your game on more than one platform. And again, the key point is that the performance is there. Roughly 90% of all the PC games that were released in the past year could have been done with existing Java technologies."

Sadly I don't know anything about game development, so I can't say whether he's right or you are right, or nobody really is right here.
Though it might be interesting to hear a comment from you on this.

Best Regards,

Ansur

 

by: nuno89Posted on 2004-03-09 at 11:06:01ID: 10553342

To Erwin
I would use the latest compiler from microsoft for pc and xbox develpment.
For the PS2 use SN systems and for the Gamecube Codewarrior from metrowerks.

To Ansur
SUN is trying hard to push the java platform into as many areas as possible...so it is normal that they present it like the "dream platform". Unfortunately this is far from beeing true. His message is clearly aimed at non professional game developpers since when you do it for a living the platforms that you develop for are PC, XBOX, PS2, Gamecube. Since java is not available on all of this machines the "accessibility to more platforms" argument does not make any sense. Honnestly the only area, java for games, might be a good alternative is to create small web games that you want to run on pcs and macs. But even then....flash, Wildtangent or virtools are probably a better option.

Then his next argument:
"decreased development time" : why does it decrease dev time? because it is an easier language than c++ and does not have pointers? This is a small part of the language and C++ offers you the possibility to abstract them. In practice, when you create a game you have a development framework than  (should) provide you with smart pointers, memory managers, high level functions...Only a small group of people worksd on the infrastructure while others focus on the game logic. Java does not really have a big advantage here.

"automatic garbage collection, and .... and memory leaks."
This is a false argument. While garbage collection is a nice feature to have for general programming, it takes cpu time which causes drops in your frame rate. So you absolutely need to control how the memory is managed and when you are going to allocate and free memory blocks. Also do not forget that you can have memory leaks even in java.... dangling references.

"...not having to track down bugs..." well I guess I really do not need to discuss this one. No language provides you with that. Java might limit some type of bugs but might also introduce new ones.

Also there are problems with Java for games that Chris Melissinos does not address:
- access to graphics API is not easy.
- access to low level for high performance tasks is not easy in java.
- how do you use 3rd party commercial middleware? (sound, physics, AI, animation, etc) they are all interfaced with C/C++.
- Java support from machine to machine changes. You have to deal with different behaviours on different platforms...so the develop once and run everywhere is not yet a reality.


Regards,
Nuno89

 

by: erwinsPosted on 2004-03-09 at 23:04:48ID: 10558452

From the research I have been doing so far, it seems like if you need pure performance and complete control of memory then C, C++, and assembler are the way to go.  This is especially true of applications such as operating systems, action/animation games, and low level control of hardware such as writing drivers.  If you need a higher abstraction level and performance is not as critical and you don't need to control machines via drivers, other languages such as Java and Visual Basic seem more appropiate. I work in the IT department of a bank, and the web developers  favor Java for user interface developing, and VB for desktop application developing.  I normally do report writing, and the vendors of the report writer use C++ to create their application.

I think the other issue is comfort level.  If you are an expert C++ programmer and a novice Java programmer, it probably takes as much or less time to write an application in C++ vs Java with potentially fewer bugs.

I think I will use C++ if I am going to write action games with lots of animation, and Java if I am going to write games that require less performance, such as card and board games.
I personally like the fact that C and C++ compile neatly into 1 true executable, whereas Java is a bit more messy with more components.  I heard Java is also easier to reverse engineer by hackers.

Thanks to all for your input to my questiion.
Erwin

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...