Jump to content
  • Advertisement
Sign in to follow this  
BigGame22000

Creating games in Java?

This topic is 4432 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

Hi all, First post by yet another aspiring game designer here. I'm just curious as to what people's feelings are here about creating games using Java vs. C++? I haven't been successful yet in doing either, but I'm interested in knowing what people think is good and bad about picking Java as a programming language of choice for creating games. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Both have their ups and downs. Java is more portable and works good for web based games. C++ offers more direct control of the PC but can be a bit more convoluted (spelling?). Basically just pick one that suits the type of games you want to work with.

And sadly, these threads arn't welcomed around here. Apperently they all end badly. Oh well. I hope I have helped a little.

Share this post


Link to post
Share on other sites
Java works fine for all but the most intense games. You'll read that it is 'slow'.

it was 'slow', but these days for most things, the difference won't be noticed.

Java isn't that hard to do dev work with, dealing with things like memory for you.

Either works. My view is, flip a coin if you don't know which way to go with things like this.

Share this post


Link to post
Share on other sites
If you're smart about your choice of libraries (aka, LWJGL [wink]), even a 3d-intense game can be done in Java these days (case in point, Tribal Trouble, and Bang! Howdy).

What I consider advantages of Java in this domain are:

no pointer management

no explicit memory management but included garbage collector (this also has some bad moments, see below)

large standard library (partially offset by the C++ stdlib these days, but Java offers a LOT of functionality, so it's easy to get started on high level functionality right away without having to write or incorporate other libraries first) examples: encryption, xml, serialization, networking, optimized containers

the latest virtual machines from sun are very fast. additionally you can trade in a slower start-up time to make stuff run even faster.

java syntax is generally speaking somewhat easier to learn, read, and write than c++ syntax. this means that you can spend less time writing code (still more than in python and the like though)

Pitfalls: right now you are basically stuck doing OpenGL. This isn't bad by itself, but if you wanted to learn DirectX and break into the industry, that won't be happening.

No explicit memory management also means that it's no longer trivial to destroy an object (often you need to track down and null all the references to that object, and even then you still need to wait for the garbage collector to run) so it's possible to run out of memory if you're not careful.

garbage collector could potentially result in hick-ups.

unpredictable garbage collection (can be alleviated by using the incremental collector. general consensus is that System.gc() is only a suggestion and if acted upon triggers a full gc so not a good idea.).

object management (see above).

Essentials:

You need these if you're serious about Java development.
LWJGL - OpenGL, DirectInput, OpenAL bindings for Java, optimized for games
Eclipse - IDE with great refactoring capabilities
NetBeans - alternative to Eclipse, I'd wait for the latest beta to become stable though
JME - scenegraph and kitchensink for LWJGL and JOGL. this could save you some time if you happen to be working on a 3d project.

Share this post


Link to post
Share on other sites
Now that's what I like to see, someone who knows their stuff! You are correct though, if you want a job in the industry C++ is gonna help you a liitle more. But as some have said, knowing a little bit about alot of languages can be better than knowing everything for only one.

Share this post


Link to post
Share on other sites
Nah, I barely know anything heh. Perhaps just enough to defend Java [smile]

Basically, from what I understand, it's all about math and physics and graphics algorithms these days. Java is imho easier to get started with (I've scrapped enough C++ engines - maybe I'm just too stupid for C++), but C++ still remains the games industry standard due to widespread use.

Share this post


Link to post
Share on other sites
I use both C++ and Java. The only reason I started learning Java at all in the first place is that it is what is used at my University. It's only been recently (last few months) that I started to think about actually using it for game programming. There were a few reasons for this.

The first was that it seemed "easier" to use than C++. While I am in no way very proficient in either langauge, I seemed to be able to do things faster in Java than C++.

I also liked the fact that I could create web based games, and standalone games that would run on any computer that had the Java Runtime installed.

As mentioned before with the LWJGL makes it possible to create some great games. Take a look at the LWJGL projects page to see some of the games that have been done with it.

In short I would recommend giving it a try. I believe that you will be able to create games faster than using C++ and if your a beginner, it's probable that your not going to need any of the high performance aspects that C++ may offer you until later. Going from Java to C++ isn't a *huge* step, so it won't be like learning a completely different language.

Other Java references:
Java Tutorial
Killer Game Programming in Java
LWJGL



Somewhat Structured Thoughts :: Delusions of Grandeur

Share this post


Link to post
Share on other sites
Quote:
Original post by caseyd
The first was that it seemed "easier" to use than C++. While I am in no way very proficient in either langauge, I seemed to be able to do things faster in Java than C++.


Very good point, I forget who said it first, but the line goes "you can waste YOUR time, or your COMPUTER'S time. Which do you prefer to have free time?"

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!