Archived

This topic is now archived and is closed to further replies.

Kentaro

[java] Java as a serious gamedev platform...

Recommended Posts

Doesn''t anyone take Java seriously as a programming language? I understand that its design can sometimes be a little troublesome (casting from Object to pull things out of data structure classes is annoying) and that it might run slower than well-written C++ because of its semi-interpreted nature. However, with computing power increasing at an exponential rate and with a lot of new developments in Java technology, I''m surprised and even a bit offended that I still hear people saying that Java is only good for making tiny game applets. The rest of their words, the way I hear or read them, usually imply that C/C++ is the one and only language for programming games and that anything else is either unacceptable, buggy, slow, or a combination of these three. Do you accept Java as a serious language for programming games in? What are Java''s major strengths and weaknesses as a game development platform? Please discuss. =) (I realize that out there somewhere is a LONG dissertation on Java as a game development platform. I don''t really care to read it though; I post this to see the discussion unfold.) This isn''''t life in the fast lane, it''''s life in the oncoming traffic. -- Terry Pratchett

Share this post


Link to post
Share on other sites
Okay you asked us to discuss. Umm... Java sucks, hows that . Seriously I looked at the java syntax and all and I was just wtf, then again when it comes to programming I''m a control freak and I hate all languages like BASIC/VB/JAVA etc.

Share this post


Link to post
Share on other sites
I think Java is a language to be taken seriously. With well-written code and JIT, Java can have performance on par with C++. There have been studies proving this and I have noticed it in my own work.

But I''m not just saying that. If you want proof, go to http://www.minatrix.com/burningmetal2.html and play Burning Metal 3d, (although unfortunatly you have to sign up for some stupid free account to play).

Anyone who tries to make a blanket statement, like "Java is slow", is just uninformed.

Share this post


Link to post
Share on other sites
Okay, umm... RamboBones, u are an idiot... Comparing Basic to Java, hmmmmmm stfu

On a more serious note, i think that Java has lots of potential for game development, and Java performance is increasing greatly. Theoretically, the JIT has the potential of being even faster than C++ because it finishes compiling code at run-time, and therefore can take advantage of system specific features.

I have written a good number of 3d applications with OpenGL for Java, and performance has not been a problem. Some stuff includes a fractal terrain generator, Quake MD2 and BSP renderer etc. I REALLY want to do a full "port" of Q2 into Java. I say "port" because i dont actually want to just convert the code, but rather try to take a more OO approach to it. I think this will be an excellent project, and anyone with any experience please contact me. I would love to work on this project.

Share this post


Link to post
Share on other sites
They''d be right if they said "Java is slower " though.

There are several critical issues with Java performance right now as a general purpose games development tool:

- the lack of "structs" for NIO buffer access. (If you don''t understand this then don''t comment about it please but at least give us your votes at [url]http://developer.java.sun.com/developer/bugParade/bugs/4820062.html[/url])

- escape analysis to prevent garbage getting created in the first place; works excellently in Jet 3.0 so I should think they''d better get it in Hotspot sharpish

- the lack of "const" (or a design by contract) which enables a whole bunch of excellent compiler optimisations

- A two-stage compiler that does fast client-style Hotspot JIT and then goes on to do server-style Hotspot JITting later. The client VM, like it or not, is really too slow for performance games. The server VM is just fine but takes far too long to start up and it looks pretty unprofessional.

- Fix the bloody floating point performance so it''s as fast as IBMs, at least

- Run that garbage collector concurrently during the vertical blank by default We need a specific gaming VM with specific gaming optimisations for best performance.

All these factors together combine to conspire to give us a relative speed to C++ of between 50% and 90% for the average application depending on fillrate usage. When all of them are done we should see between 90-100% of C++ speed.

So go and vote for structs, NOW!

Cas

ps. Anything qualified with the words "theoretically" and "potentially" essentially means "no, it''s not there yet" to a C++ programmer.

Share this post


Link to post
Share on other sites
quote:
(I realize that out there somewhere is a LONG dissertation on Java as a game development platform. I don't really care to read it though; I post this to see the discussion unfold.)


Why do I want to discuss it with a pretentious ass? Thats how you come off with comments like that. Besides this has been talked to death on this forum and every other java forum even remotely related to game dev.

I like Java the language just fine; its alot easier to get stuff done with than with c++ IMO.

However, I don't like the massive bloat of Suns Java libraries. I don't like the fact if I make a standalone game I have to distribute the latest JRE with it or trust to the user to try to play it on OEM crap vm's. I don't like making applets that run like crap on 50% of computers out there.

I showed with my sidescrolling applet that Java + AWT is more than sufficient to do just about any 2D retro style game you want with a current JRE.

So what have you done?

EDIT: Cas - I vote NO to LWJGL; why must I have a Geforce 2 or better to use it?

[edited by - nonnus29 on March 6, 2003 8:51:20 PM]

Share this post


Link to post
Share on other sites
You think Java is slow?? look at this!!

http://arkanae.tuxfamily.org/en/

100% Java 3D Online Game. And its running on a application server with Java Enterprice Server beans. Find a better technology for c++!!

[img]http://arkanae.tuxfamily.org/screen10.jpg[/img]

[edited by - Eulogy on March 7, 2003 3:33:57 AM]

Share this post


Link to post
Share on other sites
nonnus, the LWJGL works from everything from Microsoft''s shitbag ancient software renderer right up through Mesa and on to Geforce 4 and Radeon9700s! It''s an OpenGL wrapper, not a Geforce wrapper!

So vote yes Actually don''t, go and vote for structs instead! We need another 50 odd votes to get it onto the top 25. Not many people realise what a performance killer this is for games (or even high performance IO in general) so it needs to be brought the the attention of the world at large.

Cas

Share this post


Link to post
Share on other sites
cas, please let me know more about structs. why are they so important? i hardly know any c++ at all. i know how to use structs and how to write them, just not so familiar with what''s going on behind the scenes when using structs.

you can get by just fine in c++ and not use a single struct, right?

Share this post


Link to post
Share on other sites
quote:
Original post by Eulogy
You think Java is slow?? look at this!!

http://arkanae.tuxfamily.org/en/

100% Java 3D Online Game. And its running on a application server with Java Enterprice Server beans. Find a better technology for c++!!


100% NOT WORKING.

10 mins of my life are gone forever.

Share this post


Link to post
Share on other sites
Arkanae works perfectly on my Linux box. Runs at over 30 fps at a resolution of 1280x1024 on my Athlon 1700XP with a GF2 MX400. Sweet When you say 100% not working, did you follow the instructions on the website? You do have at least Java 1.3 installed (for WebStart) and have Gl4Java, right?

But seriously, this subject has been beaten to death many times, on this forums and others. Here''s a link to the "really long dissertation" the OP mentioned. I suggest you read it, as it is far more informative than the usual BS you get on threads like this.

Share this post


Link to post
Share on other sites
quote:
Original post by Ditto Brother Rat
My main concerns are the JRE size, memory consumption and no high resolution timer. Please Sun, make everything better.

Oh, I voted for your RFE, cas. Don''t know if I like those non object oriented structs though...


There''s nothing non-OO about the structs that princec is suggesting. One of the major selling points of OO is abstraction. The interface is separate from the implementation.

quote:
From RFE
The solution I propose is to associate a "struct" with a
Buffer. The buffer''s primitive type then becomes the struct,
i.e a position(n) command on the buffer moves the buffer to
access the nth struct in a buffer of these structs.

A struct should syntactically accessed the same as a normal
object, ie. passed by reference, and so on. Struct field
assignments and reads take place directly to and from memory
with no intermediate copy.


Their implementation will be different from normal objects, but as far as the programmer is concerned, they''re no different. This is how princec sums it up

quote:
The underlying implementation in Java should be identical in
speed to C for the common case (with bounds check
elimination and native byte ordering), yet because a struct
can only be constructed by an existing StructBuffer, it will
have all the safety of bounds-checking and garbage
collection which will prevent illegal writes to memory.


So rest at ease. It is OO, it is safe, but more importantly, it will be fast. Go forth and vote

Share this post


Link to post
Share on other sites
Yes, its serious enough for me to devote my spare time to it

Java being slow is based partialy on truth and mostly on rumors from people having bad experiences with it.

This is the same thing as Linux having a reputation for being difficult to use.
which is not always true anymore.
But myths take a long time to die, especialy if nobody tries it out for themselfs and just take other peoples word for it.

Share this post


Link to post
Share on other sites