Java Game ?

Started by
7 comments, last by Lummet 22 years, 7 months ago
Hi, Just wondering why there is not game(s) made with Java? or is it not so good for that, to write a game ? ie, like quake / black&white game´s on JAVA?. it seem´s that all the games are made on C/C++ & openGL, that are on the market now. is there any games yet that has been made on JAVA? (not applet´s on www) standalone game i meen.
Advertisement
java is way too slow for games like q3.
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Try running this game and you will know why.
The game looks sweet, and is really done well.
But it is in java, and so it is SLOOOOOOOW.

http://www.babeloueb.com/arkanae/
Java doesn't make your program slow, programmers make your program slow. Any critical section can be set as native, so you can program it in a language which is percieved as being faster. Besides, any java program can be run on a virtual machine with a just in time compiler, or it can be compiled the same as c++ can to an executable. Java is just a language, languages are not fast or slow. GCC can compile java to an executable just like c, c++, etc.

Edited by - Dog_Food on September 5, 2001 3:16:24 PM
I disagree with Dog_Food. You could write your native methods in assembly and then claim Java is as fast as hand-coded assembly, but this clearly defeats the purpose of a higher-level language.

Java can be considered a slow language because
a) it checks for invalid indexes when using arrays
b) casts are checked at runtime
c) all methods are virtual
d) all objects are created using new (no objects on stack)
e) because of flaws in the language you have to program inefficiently
f) garbage collection
g) synchronization happens per-class, not per-object
h) and so on
For the most part, a well-written Java app is going to be marginally slower than a well written C/C++ app. C++ code runs directly on the processor of the machine, while Java runs inside the virtual machine, which in turn runs on the processor. This makes Java not so good for the intensive number-crunching involved in rendering 3D scenes like Q3 & Black & White.
Java has a 3D api, but it isn''t ready for prime-time.
Java does have advantages outside the realtime 3D scene. For instance: with the new version 1.4 coming out, Java will be able to suspend the OS and go into full-screen mode at the desired resolution, as well as store image data on the machines video card with the new VolitileImage class. I''ll bet we see some lightning-fast 2D games with Java soon.
"There is no reason good should not triumph at least as often as evil. The triumph of anything is a matter of organization. If there are such things as angels, I hope that they're organized along the lines of the mafia." -Kurt Vonnegut
i don''t know why they aren''t written in java. You can naitive compile java code on one OS. It loses it''s portability but then having a game like black and white compiled normally would run to slow to my knowledge. But i did find a game compiled normally using java and opengl. here''s the link if anyone is interested
http://www.babeloueb.com/arkanae/en/index.html
it looks really nice. Haven''t downloaded it yet.
phesto
Unfortunatly some of the people responding to the question don''t have a clue.


lets start with

Java can be considered a slow language because
a) it checks for invalid indexes when using arrays
- 1.4 has added very aggressive array optimizations to
remove most of the problems here
b) casts are checked at runtime
- dynamic casts are checked at runtime with almost 0 overhead
c) all methods are virtual
- with hot spot this has almost 0 overhead
d) all objects are created using new (no objects on stack)
- Generational garbage collection means this is signifigantly faster now
e) because of flaws in the language you have to program inefficiently
--- WTF --- Programming in propre OO is inefficient?
f) garbage collection
- See d)
g) synchronization happens per-class, not per-object
- syncronization happens at whatever level you want it to, so this statment is just wrong
h) and so on


WafarerX has a clue and is up to date on some of the new advances in java. With the final release of 1.4 we should start to see some interesting things out of the java camp. Unfortunatly sun has really not had games in mind when they were designing java ( before 1.4 ) graphics really suffered, you could do it, but it wasn''t easy. Sound and timing is where the system really lacks currently and we will see how 1.4 helps there.

Many people associate applets with "java". This type of ignorance is hurting the whole platform because m$''s version of java is going on 4 years old without an API update. Unless you are using Java Web Start or the Java Plug-In you are missing out on the real power of java.

I know that I could get faster code writing it in straight C or C++, but the advantages to writing code that is OO clean and efficient ( even in java ) that can run on any Java2 capable platform with minimal additional testing is a huge benifit. What you loose in raw spped you easly make up for in debugging and platform porting. With both the VM''s and processors getting faster every day the slight spped loss is becoming less and less of an issue daily.

Why are there no games in java then...

Commercial games take 2 years to produce. Java is just now starting to hit a real stride. There are a bunch of 99% pure ( some native code ) games already out there including roboforge, red storm''s tom clancy game, and several that used the VM within their game for engine control. I would expect to start seeing more commercial game exploration of java over the next 2 years or so. Expect to find out after the fact they were written in java as most commercial games will probably try and hide that fact from the consumer.

For those in the know the Java Gaming Profile is around the corner, it will specify a set of API''s that when included with a JRE will make it compliant. The set of API''s will be talored to game writers and the standard will be targered for release on console systems ASAP. This will allow you to develop on windows and deploy your game on consoles. If that doesn''t give you some reasons to think about java nothing will.

If you want to engage in a discussion with java gaming enthusiasts I recommend heading over to ...

http://www.javagaming.org/

It''s run by a couple of sun people that are interested in gaming.

Good luck
Check out www.runescape.com its a online MMORPG made in Java I believe. Its a decently fast online game with 3 servers and around 1k players on each server. Check it out, its free to play, and a good example of workmanship.

This topic is closed to new replies.

Advertisement