• 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
killingdjef

Java for game development?

44 posts in this topic

Aldacron, that may be the best post ever written on GameDev. Just sayin'.
0

Share this post


Link to post
Share on other sites
I started off fiddling with java and moved to c++/assembly.

I would never look back. I have absolutely no idea why you would want to write something 3d in java. There is just no compensation for not having direct access to memory, apis, etc. And i found the JNI help to be particularly pathetic.

Not that java isn't nice, and an excellent choice for anything that isn't going to need to run REALLY fast. By the way, java IS slow, but only in the same way that everything is slow compared to c++/assembly.

They used assembly in Roller coaster tycoon? Wtf??
0

Share this post


Link to post
Share on other sites
Quote:
Original post by DaBookshah
I have absolutely no idea why you would want to write something 3d in java.


There are a lot of reasons to use Java. Which one is most important depends on who you talk to. Cas at PuppyGames has posted many times that he chose Java for the increased productivity it brings him. That's not going to hold true for someone who isn't experienced, though, so that's not a blanket reason. The guys at Oddlabs have mentioned Java's portability. When you use cross-platform bindings like LWJGL, JOGL, JOAL and so on, your Java app works out of the box on Windows, Mac and Linux. If you don't need access to OpenGL, you can use Java's 2D API without needing any JNI bindings (like Three Rings did with PuzzlePirates.

Quote:
There is just no compensation for not having direct access to memory, apis, etc. And i found the JNI help to be particularly pathetic.


Java has had access to native memory (i.e. memory outside of the VM managed heap) since Java 1.4 with ByteBuffers. That's what makes the OpenGL bindings usable. Anywhere a C API takes a pointer to an array of floats, ints, or what have you, you can use a ByteBuffer. As to JNI, I don't understand the problem C programmers have with it. It's C, after all. It's a well defined API that isn't that difficult to get up and running with. Besides, with the automation tools available these days you can autogenerate most of what you need.

Quote:
Not that java isn't nice, and an excellent choice for anything that isn't going to need to run REALLY fast. By the way, java IS slow, but only in the same way that everything is slow compared to c++/assembly.


This really is a tired old horse now, but once again, Java is NOT slow. Either way, I refer you to my post above. There are vastly different requirements between the AAA game industry and the downloadable games space. Java's performance does not preclude it from either space, but other factors do. People are writing 3D java apps all of the time that get hundreds of frames per second. You can find some of them at javagaming.org.

Look at the topics around these forums, or the Game Programming Gems Books, or books like Code Complete. You will find topics relating to buffer overlow prevention, memory management, garbage collection, and a lot of mundane plumbing work that game programmers implement again, and again, and again, and again ad infinitum. They worry about compiler optimizations for specific processors and porting their code to multiple platforms. All of that costs in terms of time and maintenance. Sometime it's the only answer. But when there is an alternative that handles all of that for you (including runtime optimization for the current user's processor), is available on your target platform, and might cost you a few frames, doesn't it make sense to use it? That's why some people prefer Java or C# for their games. It's not a panacea, it's not always the best choice (I prefer D most of the time to anything else, really), but those who know how to get the most out of it (i.e. Java programmers who program Java and not C++ programmers who use Java like they use C++) will use it.

But enough with the Java is slow stuff, already! Try out Tribal Trouble or Puzzle Pirates (linked above) and let me know how slow they are.

Quote:
They used assembly in Roller coaster tycoon? Wtf??


Actually, not they but he. Chris Sawyer independently developed RCT (the first one) and used assembly for 99% of the game.
0

Share this post


Link to post
Share on other sites
Aldacron, your the man(woman?) :) All your posts in this thread were awesome.

killingdjef, you really picked the wrong board to ask this question on. As most people on these boards program in C/C++, you will get a lot of biased answers against Java, or any other language for that matter. Most people here do not work in the games industry, but are just hobbyists, so you can their opinions very lightly. As a hobbyist, you should choose the langauge that works for you, not one that works for other people. As other people have said, since you already know Java, why complicate things further by trying to learn another language at the same time. Just write a few games in Java, then go learn C++ and write a few games in C++, or just rewrite the same ones in C++, then you can make your own comparison of the pros and cons of each.

Lots of people say that you can't do things in Java that you can do in C++, or have to write in a hack way to do it. Well I am supprised these people learned to program at all. Anytime you learn a new language, you also have to try and learn to think in that new language. Most people moving from C++ to Java on their own try to write like a C++ programmer using Java instead of a Java programmer using Java. That's what bites them in the a@@. I have never had a problem doing anything I wanted to acheive with Java. Program the way the langauge is meant to be programmed in and you do not have to write hacks to get it to work.

I am not saying that Java is the perfect choice either, but to get real answers to game programming with Java, head over to JavaGaming.org: http://www.javagaming.org/forums/index.php.

As most level headed people say, choose the best tool for the job you are trying to do. Part of making that choice is determining what you know and what you have time to learn, as well as what you are trying to make. And unless you are make Doom 4 or Halo 3, use Java until it doesn't solve the problem you are trying to solve. Or at least until you want to give C++ a try, just to see what is like.
0

Share this post


Link to post
Share on other sites
*sigh*. I'm going to be ranked down for this, I just know it(Lost 11 points already). But It's bugging me that I might be wrong.

Logic:
<Insert Language Here> - has overhead/inefficiencies, whatever
Assembly - No overhead.

So: Assembly is faster than <Insert Language Here>. Which is all I meant when I said java was relatively slower, obviously. Might mean next to nothing in practical terms(Seriously, who writes in assembly these days), but doesnt stop it from being true.

I hope that's right.

[Edited by - DaBookshah on May 5, 2006 9:20:50 AM]
0

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
Additionally, there is a performance difference between Java and C# (C# is 2 to 6 times faster )and especially between Java and C++ (C++ is generally 10 times faster).


C sharpers are geeting worse and worse everyday! hahahahahahahhahahaha
Are on drugs or something?

Quote:
Original post by jwalsh
Its a managed language and has all the benefits of Java, in addition to which it has really nice reflection, which can be useful for dynamic coding (a replacement for scripting).


Java HAS REFLECTION since day one. You know nothing about Java, could you please study a little, at least to know what you are talking about?

0

Share this post


Link to post
Share on other sites
I agree all Aldacron said
and some games (one at least) use what he said :
Quote:
Original post by Aldacron
Java has had access to native memory (i.e. memory outside of the VM managed heap) since Java 1.4 with ByteBuffers. That's what makes the OpenGL bindings usable. Anywhere a C API takes a pointer to an array of floats, ints, or what have you, you can use a ByteBuffer. As to JNI, I don't understand the problem C programmers have with it. It's C, after all. It's a well defined API that isn't that difficult to get up and running with. Besides, with the automation tools available these days you can autogenerate most of what you need.


This game, www.astronoid.net, uses Nebula Device (an native 3d engine)
and all network and game programmings are in Java,
And the game is good, really.

Just use language you need and you really know :
Some C++ application are worse than Java ones and vice versa and this is not language-dependant.
0

Share this post


Link to post
Share on other sites
Thanks for that -excelent- post, Aldacron! It cleared up everything for me. You should make an articale out of it.

Looking at this from the bigger perspective I think Aldacron really did hit the nail on the head. It's not about language X versus language Y but its more what you're capable of doing with it.

@ CaptainJester
I don't entirely agree with you, this being the wrong board. The huge amount of replies and points of view give me alot of insight. Posting this on javagaming will bring me biased oppinions in favor of Java. On this board it apparantly gave me biased oppinions in favor of C++/C# but i'd rather hear false statements getting un-myth'ed by users such as Aldacron than to hear its an excelent choice and that I couldn't have picked a better language; something i'd image I would've got at javagaming.
0

Share this post


Link to post
Share on other sites
Aldacron... excelent! When I first saw this thread I was thinking... ahhh flame war here we go.


In the spirit of a flame war...
English is slow and only good for simple tasks. You should use french because it is much faster. But if you want blazing speed use Latin.

(btw english is my primary language and gets the job done)
0

Share this post


Link to post
Share on other sites
For what its worth... based purely on the number of "Java for Game Development?" threads over the last week, Java is soon going to claim its title as King of Game Development.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by smitty1276
For what its worth... based purely on the number of "Java for Game Development?" threads over the last week, Java is soon going to claim its title as King of Game Development.


[lol]

Im just glad to see a (somewhat) civilized discussion on the matter. At the first job I had my boss showed me a program he had written when he was in his 20s. The opcodes were written on paper. He used a hex editor to 'compile' the program.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by smitty1276
For what its worth... based purely on the number of "Java for Game Development?" threads over the last week, Java is soon going to claim its title as King of Game Development.
I've lost count, but I'm fairly certain I have seen no less than 5 and perhaps as many as 10 threads over the past week discussing Java or C# for game development.
0

Share this post


Link to post
Share on other sites
Greetings All,

I feel obligated to post one final time on this topic. First of all, Aldacron made a great post. He indeed hit the nail on the head, and for that he gets a rating++ from me. But be careful about dismissing what other people have posted on here. All is relevant, just not posted as eloquently as Aldacron, perhaps.

killingdjef: I'm not fully aware of your background, or your goals for the future, but as Aldacron pointed out, if you're interested in becoming a hobbyist game programmer then definitely use whatever language you're most comfortable using. Indeed, Java is a great language to learn on, and there are many shareware, indie, and commercial (not as much retail) games made in java.

But if your goal is to "get into the industry," then as I posted earlier, do yourself a favor and learn C++. Regardless of who says what about which language, the simple fact of the matter is game companies are not currently hiring Java programmers. They are, however, hiring C++ and C# programmers. This is not a "guess"...this is information obtained by reviewing Gamasutra, Gamedev, Monster, and Gamejobs job postings. Again, if you just want to be a hobbyist, then this is a non-issue.

As Aldacron pointed out, this is largely just a trend. Ten years ago people were not hiring C++ programmers either. Over the next 10 years we're likely to see a shift from C++ to some other language - what that is, no one can say. But if you're interested in getting into the industry "today"...then you'll need to know C++.

And the C++ bias which you've encountered on this forum is not local to this forum. The bias you are experiencing is a pervasive reflection of the culture for which you're getting involved. Similarly, when you go to France you *expect* a bias towards French. Does this mean there are not English, Chinese, Spanish, Italian..etc...speakers in France? No. There are a vast number of languages spoken in France, but as French is the defacto language in France, there is an acceptable and obvious bias towards French.

Another way to look at this is this: You wanted to know "how does java compare to languages like C# and C++ with regards to game development and how widely is it used?" That's like going to France and asking how French compares to Spanish. You will get biased answers because you're IN France.

What's my whole point? You've come to THE #1 resource for game development on the Internet and there's a bias towards C++. That should tell you something in and of itself. Game developers speak C++. Just like the French speak French. You can still get around just fine as an indy or hobbyist developer, but the majority of people in this industry speak C++.

As for Aldacron's comment: "People on these forums tend to give advice from a AAA perspective (particularly those who aren't actually developing any games, AAA or otherwise)."

Be very careful with comments like these. Do not discount people's opinions just because they're "lofty." We get a lot of people on this forum who are going to "...make the next big MMO that will rival World of Warcraft." And they're planning to do it by themselves or with a few friends after school. ;)

But the point is, both people "who aren't actually developing any games" as well as those who ARE actually developing games are both entitled to lofty opinions. So when someone says "If you want to get into the industry, and work for Blizzard you must know C++," don’t assume they're saying that because they DONT work for Blizzard. Every once in a while you'll hear that from someone who IS from Blizzard. And since its impossible to tell without notice who IS from Blizzard and who ISNT, take everyone's advice seriously.

Cheers and good luck!
Jeromy Walsh
0

Share this post


Link to post
Share on other sites
Quote:
Original post by killingdjef
@ CaptainJester
I don't entirely agree with you, this being the wrong board. The huge amount of replies and points of view give me alot of insight. Posting this on javagaming will bring me biased oppinions in favor of Java. On this board it apparantly gave me biased oppinions in favor of C++/C# but i'd rather hear false statements getting un-myth'ed by users such as Aldacron than to hear its an excelent choice and that I couldn't have picked a better language; something i'd image I would've got at javagaming.


You do have a point, but I find there is less bias there than there is here.

Quote:
Original post by jwalsh
But if your goal is to "get into the industry," then as I posted earlier, do yourself a favor and learn C++. Regardless of who says what about which language, the simple fact of the matter is game companies are not currently hiring Java programmers. They are, however, hiring C++ and C# programmers. This is not a "guess"...this is information obtained by reviewing Gamasutra, Gamedev, Monster, and Gamejobs job postings. Again, if you just want to be a hobbyist, then this is a non-issue.


You are correct. However if you have a portfolio of games in several different languages, you would be a more attractive prospect.
0

Share this post


Link to post
Share on other sites
Quote:
They are, however, hiring C++ and C# programmers. This is not a "guess"...this is information obtained by reviewing Gamasutra, Gamedev


hmmm just had a quick browse of gamasutra + it doesnt really back up what youre saying its like
10 jobs of c or c++ -> 1 job c# (or java)

in fact i just done a search c# returns 19 matches, java returns 23!
try yourself if u dont believe me http://www.gamasutra.com/php-bin/jobs_display.php
fwiw c++ is 137 and c is 361 (might be some false hits there though with that term)



0

Share this post


Link to post
Share on other sites
The java specification states that the garbage collector is never guarenteed to run at any time during execution of the program.
This means that any heap allocated memory (e.g. any object you create) might never get deleted, depending on the VM implementation.
I think that fact alone is a good enough point to use a real language for writing games.

Also, ive speed tested newer versions of java, and in many cases it is exactly the same speed as C - but this is only on simple tests, like looping and adding numbers. Function calls, object creation, pointer usage, array usage all have much more overhead in java.
To everyone that says java is fast enough to make AAA titles, try it. No, really, i'd love to see you prove me wrong, but something tells me you wont. Java is just way too inefficient at managing every computer resource...
0

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
Java isnt used on XBox, Xbox360, or PS2 (though neither is C#)

I just wanted to clear up some misinformation located in this line. Obviously XBox and PS2 do not have support, but the XBox 360 currently has a CLR implementation and managed DirectX ( an internal Microsoft implementation and not yet released). It is actually one of the targetted platforms for future development work with the XBox 360.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
The java specification states that the garbage collector is never guarenteed to run at any time during execution of the program.
This means that any heap allocated memory (e.g. any object you create) might never get deleted, depending on the VM implementation.

So what? Why would you care if your objects get deleted?

Quote:

Also, ive speed tested newer versions of java, and in many cases it is exactly the same speed as C - but this is only on simple tests, like looping and adding numbers. Function calls, object creation, pointer usage, array usage all have much more overhead in java.

Take a look at this article:
http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html

Quote:
from the article
Pop quiz: Which language boasts faster raw allocation performance, the Java language, or C/C++? The answer may surprise you -- allocation in modern JVMs is far faster than the best performing malloc implementations. The common code path for new Object() in HotSpot 1.4.2 and later is approximately 10 machine instructions (data provided by Sun; see Resources), whereas the best performing malloc implementations in C require on average between 60 and 100 instructions per call (Detlefs, et. al.; see Resources). And allocation performance is not a trivial component of overall performance -- benchmarks show that many real-world C and C++ programs, such as Perl and Ghostscript, spend 20 to 30 percent of their total execution time in malloc and free -- far more than the allocation and garbage collection overhead of a healthy Java application (Zorn; see Resources).


Quote:
from the article
But allocation is only half of memory management -- deallocation is the other half. It turns out that for most objects, the direct garbage collection cost is -- zero. This is because a copying collector does not need to visit or copy dead objects, only live ones. So objects that become garbage shortly after allocation contribute no workload to the collection cycle.

It turns out that the vast majority of objects in typical object-oriented programs (between 92 and 98 percent according to various studies) "die young," which means they become garbage shortly after they are allocated, often before the next garbage collection. (This property is called the generational hypothesis and has been empirically tested and found to be true for many object-oriented languages.) Therefore, not only is allocation fast, but for most objects, deallocation is free.


Quote:

Java is just way too inefficient at managing every computer resource...

So you believe most programmers can handle computer resources smarter than Java? Escape Analysis (Java 1.6) to the rescue:

Quote:
from the article
JVMs are surprisingly good at figuring out things that we used to assume only the developer could know. By letting the JVM choose between stack allocation and heap allocation on a case-by-case basis, we can get the performance benefits of stack allocation without making the programmer agonize over whether to allocate on the stack or on the heap.

0

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
But if your goal is to "get into the industry," then as I posted earlier, do yourself a favor and learn C++. Regardless of who says what about which language, the simple fact of the matter is game companies are not currently hiring Java programmers. They are, however, hiring C++ and C# programmers. This is not a "guess"...this is information obtained by reviewing Gamasutra, Gamedev, Monster, and Gamejobs job postings.


Actually Java has a significant foot hold in the cell phones market.
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