• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
NewBreed117

Viability of Java For Video Games

18 posts in this topic

Is Java viable for graphic intensive video games. More specifically could I recreate a game like Halo or Call of Duty where you need to have quick

input and output? Thanks in advance to your answers smile.png

0

Share this post


Link to post
Share on other sites


Is Java viable for graphic intensive video games.

 

Yes.

 


More specifically could I recreate a game like Halo or Call of Duty

 

Doubt it. (Not that that has nothing to do with Java)

 


where you need to have quick input and output?

 

Yes.

2

Share this post


Link to post
Share on other sites


The Java standard library is pretty awful for games so you will have to rely on third party libraries quite a lot
What do you mean with that?
1

Share this post


Link to post
Share on other sites

Ohh I see, I asked because "Java for games" in my mind is Java + LWJGL, not Java2D precisely. By "standard libraries" I thought he was referring to the usual collections, networking, threading, and so on.

0

Share this post


Link to post
Share on other sites

Ohh I see, I asked because "Java for games" in my mind is Java + LWJGL, not Java2D precisely. By "standard libraries" I thought he was referring to the usual collections, networking, threading, and so on.

 

networking, threading, etc are included in the java standard library, LWJGL and JOGL are not. (They are third party wrappers around native, platform specific libraries).

Neither LWJGL nor JOGL are really optimal choices due to the JNI overhead (a proper engine will allow you to minimize the number of calls made through the JNI) but they are still significantly better than the Graphics classes provided by Java.

1

Share this post


Link to post
Share on other sites


networking, threading, etc are included in the java standard library, LWJGL and JOGL are not. (They are third party wrappers around native, platform specific libraries).

 

But then OpenGL and DirectX are not part of the C++ standard library either and are also third party wrappers around native platform specific code.

 

I get what you are saying about the JNI overhead but then this isn't really a performance bottleneck that would prevent somebody writing a game like HALO or COD which are several years old and when released ran on much slower PCs than the average budget Dell that somebody can buy nowadays.

1

Share this post


Link to post
Share on other sites
I have some experience of using Java / OpenGL for Android development. It was fast enough but since the Java garbage collector does not extend to the graphics card buffers, I found it to be really fiddly to manage the memory manually.

C++ has RAII for memory management which works great with vertex buffers, textures etc.. whereas I found the Java code needed to be spammed with try catches. Java was not great here.

All in all, I suggest that unless you know that you have all the Java wrappers required to do your project, Java is fine. If you feel you may need to wrap native libraries, not only will you need to write the native side of the Jni layer in C/C++ anyway but you will be spending time writing bindings rather than games.

I recommend Java shim and the rest in C++ any day of the week smile.png
2

Share this post


Link to post
Share on other sites

Java can be compiled to native machine code with GCJ, so then as long as you use the right libraries it would have the same performance as C++.

1

Share this post


Link to post
Share on other sites

Java can be compiled to native machine code with GCJ, so then as long as you use the right libraries it would have the same performance as C++.


I don't think I have ever seen a game written in Java and compiled using GCJ. Probably because GCJ is not very actively developed and still only supports ~Java 1.4.

Either way, since standard Java will very likely need to be using native libraries to create a game (OpenGL, OpenAL, ODE, Bullet, etc..), the speed is very unlikely to be an issue since much of the processing is done by native code (in the .dll or .so) anyway. Edited by Karsten_
1

Share this post


Link to post
Share on other sites

Is Java viable for graphic intensive video games. More specifically could I recreate a game like Halo or Call of Duty where you need to have quick

input and output? Thanks in advance to your answers smile.png

 

 

Hi,

 

World class games and simulations continue to be made based on Java, but often in conjunction with another language for specialized development needs such as gameplay scripting language (sometimes invented in house), hardware cross-platform, operating system cross platform (actually targeting a major Runtime such as .NET, Java, or Mono), or as an excellent development environment for mobile device games.  Java is also used sometimes for scripting gameplay or for GUIs and UIs over another language for lower level coding.

 

Java has multi-threading and multi-core capabilities via libraries, can go high or low level coding, and is often preferred for server heavy software development.  It plugs well into OpenGL (better than some languages) and has mature libraries to support any level of software development.  Some developers find it more efficient in cost and labor to develop in Java than C or C++, for example.  Java just in time (JIT) and post processing libraries combined with the previous mentioned cause the performance gap between Java and C++ or C to be more a matter of skills than the language.

 

Preference can trump every other consideration for any language, so keep that in mind.

 

" Good code written in Java performs better than bad code written in C++ "

 

Military and corporate developers in the many thousands settle on Java for the above reasons.  They create some simulators in Java which are more complex than the biggest entertainment games written in C++, but with competitive performance with the C++ games.

 

Some libraries of code, such as C++ game engine components, can be ported to Java or work inter-operatively in a virtual machine such JVM or a game engine.

 

The jMonkey game engine is a good one, so have a look.

 

Many thousands of games per year are developed based in Java.

 

The main languages to handle low level graphics with excellent performance are C, C++, and Java, in my opinion.   Since skill and preference weigh heavy in the quality of the end product, these are more important than the language itself.

2

Share this post


Link to post
Share on other sites

[EDIT: Pardon if I'm coming off as rude or anything but I really think you're being a bit overzealous on Java's merits here, especially in the realm of game development. It simply really annoyed me to read a huge paragraph of "Java does everything" without even giving any actual base to the claims.

Overall he is quite correct.

For his server side comments, Java for servers is very common in the business world, and I have seen it used in backends of several games. Look on job search boards like Dice or Monster for JSP developers, and thousands of jobs looking for Java+SQL experience.

As for games, well, he is right.

There really are thousands of games written in Java. Most of the 'dumb' cell phones starting in the late 1990s through today, aka feature phones, have the apps developed in Java, and there were LOTS of them. They still have a market and games are being made for them. Today, in addition to the feature phones, the Android environment is Java-centric. Many games do provide minimal Java code preferring to develop in C++, but quite a large number are written entirely inJava. Then there are still Java applets on the web (visit sites like Pogo for many active examples), and Java-built PC games like the ever-popular Minecraft.

So with Android being out for five years and recently hitting the one million app mark, saying many thousands of games per year are written in Java seems like a small number. I would say that the current rate is several tens of thousands of games per year use it. (Again, yes, many do jump quickly to C++, but I believe they are in the minority.)

While it is true that you won't be able to completely optimize everything at the lowest level with a Java code base, the number of games that need to do that are vanishingly small. Java is more than adequate for just about any game an individual developer or even a small team of developers is able to create.

So yes, Java can realistically do everything you need for a game. It is safe to estimate that hundreds of thousands of games already use it successfully.
1

Share this post


Link to post
Share on other sites

For his server side comments, Java for servers is very common in the business world, and I have seen it used in backends of several games. Look on job search boards like Dice or Monster for JSP developers, and thousands of jobs looking for Java+SQL experience.

Yes I'm well aware the business world is still pretty steeped in Java but that is a different sort of ballpark realistically, industry tends to be very slow to change to new languages and Java has been kind of the "awkward mainstay" fora very long time. It's the same reason extremely dated languages like fortran are still used in quite a few areas.
 

There really are thousands of games written in Java. Most of the 'dumb' cell phones starting in the late 1990s through today, aka feature phones, have the apps developed in Java, and there were LOTS of them. They still have a market and games are being made for them. Today, in addition to the feature phones, the Android environment is Java-centric. Many games do provide minimal Java code preferring to develop in C++, but quite a large number are written entirely inJava. Then there are still Java applets on the web (visit sites like Pogo for many active examples), and Java-built PC games like the ever-popular Minecraft.

To be honest I would consider phones to be a unique variant, for a lot of phones Java may have been the ONLY choice available, for Android, Google has pushed the language far above others and so most people default to it, even then C# through mono has a rather devoted following. I wouldn't really compare languages when you flat out get more out of using one on a certain platform, that's a bit silly.
 

So with Android being out for five years and recently hitting the one million app mark, saying many thousands of games per year are written in Java seems like a small number. I would say that the current rate is several tens of thousands of games per year use it. (Again, yes, many do jump quickly to C++, but I believe they are in the minority.)

Yes and mobile is a gigantic industry now, that said cell phone games are rarely performance centric and even simple 3d is pretty rare in a market dominated by 2d puzzle games and other 99 cent distractions. My personal opinion is that I really don't see how something being a used a lot means it has much merit as a language, keeping in mind the entire discussion here is viability for games(in which the OP specifically mentioned feature sized games like AAA industry.)

Again, I'm not saying Java "can't do this or that" I'm saying "there's no real reason to do this or that with Java." Of course that argument changes based on platform, on Android there actually is merit to considering Java as your language because its so often used.
 

While it is true that you won't be able to completely optimize everything at the lowest level with a Java code base, the number of games that need to do that are vanishingly small. Java is more than adequate for just about any game an individual developer or even a small team of developers is able to create.

I wouldn't say they're vanishingly small, in my opinion the same number of big games are coming out as before, if not more. If anything the game industry is just expanding because things like mobile games have started to capture all the "normal" people out there. But we're talking about things that are galaxies apart here really, a game like Battlefield 4 does not even entail remotely the same decisions as a bejeweled clone on a cellphone. The bigger you get, performance tends to become more of an issue as well.
 

So yes, Java can realistically do everything you need for a game. It is safe to estimate that hundreds of thousands of games already use it successfully.

My main issue was that was he says is superfluous, he makes the language sound like its amazing and used for everything and a direct competitor to languages like C++ or even C# while in reality, as a language, I still don't see much merit to it being used on PC in particular, or even on consoles unless its the preferred language.

My opinion is that C# is very similar to Java but it makes a lot more design decisions that are intuitive, and as a language it just feels better developed. Obviously mileage may vary there. On the flipside I would say a language like Java or even C# is going to have an extremely hard time being able to optimize down to the metal. If you do make those optimizations they will likely take longer, and for less payoff. Java is just kind of the ugly duck in the room when it comes to games, but then again why shouldn't it be! Java was designed to be totally generic. Edited by Satharis
1

Share this post


Link to post
Share on other sites

The libraries whch Java can access lead the industry in many categories.

Edited by 3Ddreamer
-1

Share this post


Link to post
Share on other sites

The libraries whch Java can access lead the industry in many categories.

Okay?.. Whats your point? What kind of libraries are we talking about?

If we're talking about native libraries, Java would be, if anything, just adding overhead to their performance. If we're talking about Java specific libraries like the standard library then.. what advantage do they have over other standard libraries?

You're being really vague.
0

Share this post


Link to post
Share on other sites

Thank you for all the responses I am starting to get a good picture of what I am looking at :) Thanks again everyone!

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0