Skip to main content
gamedev.net
🔒 Locked

Java 1.5 Game programming

Started by Iwod 54 replies 4.5k views
Original Post
Iwod
Iwod
I am a non pro programmer compare to a lot of you in here. I do a bit of C / C++ / Java. And i am wondering what are your thoughts generaly on Java 1.5 with its new ablity and features. And its potential using it as game programming. ( i am not saying it currently can''t be done. it is just the fact that Sun doesn''t seems to care much about using java to program games )
Aldacron
Aldacron
Time for my Java advocacy

I''m not actually using Java for games atm, but I know others who are. The only thing 1.5 adds that is really needed (that I''ve seen so far) is access to a high res timer. Other than that, 1.4 is suitable for games right now without the parameterized types and whatever else is in the pipe for 1.5 (although I''m sure there will be even more improvements in the HotSpot compiler by then).

The thing that''s stopping me from going Java right now is distribution. I want to get shareware titles distributed on the net, and the currently there are issues with making sure the customer has the JRE. There are various solutions (including compiling to a native executable format, but that raises even more issues). Several folks are forging ahead already.

Check out:
YoHoHo! Puzzle Pirates (a really neat game!) - they have chosen to include the JRE in the client download.
Alien Flux - Puppy Games has experimented with different method of distribution for this game (native exe, WebStart)

Other games to check out through Google would be Wurm Online, Magicosm, and Tribal Trouble.

I think all of these games show that Java is viable for game dev, and 1.5 can only make it moreso. As far as Sun not caring, that''s not true anymore. They got on the ball a while back with the Java Gaming Initiative. As a result we today have javagaming.org, which has been folded into Sun''s new www.java.net site. There you''ll find 3 Open Source APIs designed for realtime multimedia(JOGL - OpenGL interface; JInput; JOAL - OpenAl interface), you''ll find forums for LWJGL (another OpenGL/OpenAL/system input interface - but specifically for games, with no dependencies on AWT/Swing - from Puppy Games) and Xith3D, a SceneGraph that can set on top of JOGL or LWJGL, designed to be a replacement for Sun''s Java3D.

If we can get the distribution issue solved, get the kinks worked out of OpenAL on Mac & Linux, and get that JRE installed on most of my target market''s machines (something that Sun is actually making headway with), then I''ll definitely make the switch (providing it all happens before D reaches maturity ).
Lorenzo
Lorenzo
quote:
Original post by Iwod
I am a non pro programmer compare to a lot of you in here. I do a bit of C / C++ / Java.

And i am wondering what are your thoughts generaly on Java 1.5 with its new ablity and features.
And its potential using it as game programming. ( i am not saying it currently can''t be done. it is just the fact that Sun doesn''t seems to care much about using java to program games )


Java? ah ah ah! Nope. Do you want graphics in your game?
Lorenzo
Lorenzo
quote:
Original post by OrangyTang
Already exists in both LWJGL and Jogl, both of which work great and are very fast indeed


This is relative... you can achieve with java NOW the some performance as in 1997... about 20 times slower.
Raghar
Raghar
Slower than in java in xxxx thats astonishing we have JIT now.
__fold
__fold
quote:
Original post by Lorenzo
This is relative... you can achieve with java NOW the some performance as in 1997... about 20 times slower.


You never tried the direct3d-driver did you? In fact, you haven''t tried java at all, have you?
Aldacron
Aldacron
Lorenzo, wake up Go out and download some of the latest 3D Java games. The language has come a long way since 1997. It isn''t slow anymore and is more than suitable for games.
Cyberdrek
Cyberdrek
quote:
Original post by Lorenzo
This is relative... you can achieve with java NOW the some performance as in 1997... about 20 times slower.


I''d recommend that you learn to respect others and their choices.




[Cyberdrek | the last true sorcerer | Spirit Mage - mutedfaith.com][ Administrator & WebMaster GuLSE]
[Cyberdrek | ]
Cyberdrek
Cyberdrek
quote:
Original post by Iwod
I am a non pro programmer compare to a lot of you in here. I do a bit of C / C++ / Java.

And i am wondering what are your thoughts generaly on Java 1.5 with its new ablity and features.
And its potential using it as game programming. ( i am not saying it currently can''t be done. it is just the fact that Sun doesn''t seems to care much about using java to program games )


It is more than possible to code games in Java. It supports the same APIs as other languages heck, even SDL exists for Java. And it''s even simpler to use than it''s C/C++ counter-part. I''m not involved in game programming at the moment but I did have a chance to try out the java version of SDL for a graphical interface I was building for an internal projet.


[Cyberdrek | the last true sorcerer | Spirit Mage - mutedfaith.com][ Administrator & WebMaster GuLSE]
[Cyberdrek | ]
snk_kid
snk_kid
I''m about to start a project in Java to do a remake of the 2D Gauntlet for my final year project, i''ve been doing a lot of research on Java''s viabiltiy, 1.4 is more than viable especially with the NIO packages for low - level high preformance block & stream I/O really sugest you check it out and ImageIO packages for advanced imaging. I''ve been doing some messing around with JOGL i done a little test with applets. I checked how much CPU was being used first with Java3D and then with JOGL. Java3D used about 70 - 80% of the CPU was used but when i used JOGL only 5-10 % was being used! it was to 3D Object repeatedly spinning around, i couldn''t even believe i got it to work in an applet.

So i thinking of ways to do this game using JOGL, JOAL, etc and applets cos i have some ideas i wanna try out the only problem is trying to get the jar and .dll files on to the client.
snk_kid
snk_kid
quote:
Original post by OrangyTang
Bleah, no one writes applets anymore - Webstart is a more flexible and powerful alternative (and runs direct from a webpage as well ).


I know that, but like i said above, i have some ideas i wanted to try out. I''ll most probably be using webstart so you can switch into fullscreen mode
Damage_Incorporated
Damage_Incorporated
Java will probably never match native C/C++, but if you can write something in Java then do so, altho the step from Java to C/C++ isnt THAT big. Yeah we have JIT so what? JIT still requires more CPU then native C code trust me.

- Damage Incorporated.
Raghar
Raghar
Step from C to Java is big. Just dont forget all that code that would be much easier to transform to v3 of your program after few years when you''d like to do sequel.
JIT need just more computer power on start and it''s in just millisecond range. Possibility to get rid of windoze at any time is nice thing, you know.
I have seen program in Java that was considerably faster than C one. It did something with a graphic... Just don''t forget if you''d like to be really fast you should try hand optimised IA64 assembler.

I think that major advantages of Java were getting rid of: h files, preprocessor, and ugly syntax.
fodd3r
fodd3r
The problem with many of these discussion is that most folks forget optimisation lessons they should know.

In C/C++ or any other lowish level language.

Algorithmic optimisations can get you running order of magnitudes faster (linear vs binary search). Unless you''re doing something seriously stupid in your code it is highly unlikely that you can get this much from a assembly optimisation.

This carries forward with languages such as Java. In Java chances are you can develop your program much faster and have it up and running and tested well before the C/C++ equivlent and I mean EQUIVALENT! That means cross platform compatibility and so on.

The thing is that you could spend a lot of that extra time optimising if you have issues, rather than hunting bugs down and so on. IN the SAME amount of time you could likely make many gains that would either come close, on par or much further than your lower level language counter part.
Lorenzo
Lorenzo
quote:
Original post by __fold
quote:
Original post by Lorenzo
This is relative... you can achieve with java NOW the some performance as in 1997... about 20 times slower.


You never tried the direct3d-driver did you? In fact, you haven''t tried java at all, have you?


I have tried java, and I have tried C# and c++ too. C# is decent, due to its support from microsoft with managed DirectX. java... well, maybe for cell-phones
Lorenzo
Lorenzo
quote:
Original post by Aldacron
Lorenzo, wake up Go out and download some of the latest 3D Java games. The language has come a long way since 1997. It isn''t slow anymore and is more than suitable for games.


Give me a link, then, please...
Aldacron
Aldacron
I already posted 2 earlier in the thread, but I''ll recreate them here along with some more:
YoHoHo! Puzzle Pirates
Alien Flux
Wurm Online
Magicosm
Tribal Trouble
RuneScape

You can find more at the java gaming forums

Several commercial games have been released over the years that use Java in one capacity or another - from scripting, ''dirty java'' engines, and 100% Java games. Law & Order falls into the 100% Java category.

SO please, check these out, try them out, and whether you use Java or not - stop spreading that tired, old, Java is too slow myth!
Captian Goatse
Captian Goatse
quote:
Original post by Lorenzo
quote:
Original post by Aldacron
Lorenzo, wake up Go out and download some of the latest 3D Java games. The language has come a long way since 1997. It isn''t slow anymore and is more than suitable for games.


Give me a link, then, please...



Well, my terrain engine pushes only around 15 fps slowe in Java(C++ from 170, java 155), so it is not that bad.

Thats actually pretty good when taking into amount that I''m pushing the max triangles with my graphics card.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.