Quake2 Ported to Java, Play Via the Web
casemon writes "Quake2 fans unite! Thanks to German software developer ByTonic software, you can now play Quake2 via the web with Jake2 a java port of ID Softwares seminal Quake2. ByTonic claims performance is similar to original C version. From the Jake2 website;
"Jake2 is a Java 3D game engine. It is a port of the GPL'd Quake2 game engine from idSoftware. To use the Jake2 engine you need either the data files from the original game or from the demo version available for download from ftp://ftp.idsoftware.com."
You actually don't need to get the data files, they've set it up to automatically download the 38Mb demo assets using WebStart. Just click the Play Now button and away you go. Most features supported, even multiplayer server!"
http://www.bytonic.de/html/jake2.html just thought it might be, you know, handy?
Brain(s): 0.0% user, 1.3% system, 0.1% nice, 98.6% idle
I saw it at swing sightings. I tried it with the original game files and didn't notice any difference in speed with the original binaries.
And this with a not so fast computer: PIII 800, TNT 2, 384 MB RAM.
Anyway if you wanna see benchmarks with older computers look at their web.
... I would give this guy research lab and resources to create java-based DirectX library. For game developers, it would be just great to write once and sell on Windows on Linux on Mac on Playstation (don't know about XBox). Even without Sun's support, it would be great fot 3rd party to sell such engine/framework.
839*929
in Firefox?
Runs great on my 1.2 GHz G4 with 640 MB of RAM in OS X 10.4.3. Running the web start version downloads a file which starts up as a separate java program.
This is the coolest use of Java I've ever seen.
No, I don't think so. Perhaps if you were born after 1985. Wolf 3D and Doom were the seminal games, or perhaps even Ultima Underworld, although nobody seems to remember that one. There were many games in the genre making it appear tired and unoriginal long before Quake 2 came along with a bit more of the same.
I've played Quake 2 than all the rest put together, but that doesn't make it seminal.
dupe
Check out the benchmarks. Similar frame rates to the C version on the same hardware.
I've not tried it myself yet. Might get in trouble at work.
Jvm apps can be faster than their compiled counterparts, specially when compared to those made with non specialized compilers like GCC. The "virtual machine = slow" myth is no longer true.
The real issue is startup time and initial memory consumption. Java is not suitable for applets that run in the background because your basic app will require about 20 megs of RAM minimum to start. Another issue is swing. You can disagree with me, but please wake me up when it gets clear type fonts on windows.
Cheers,
Adolfo
Actually, it runs pretty quickly, although not quite as quickly as the original. Something like 85-90%. That's mostly because of the overhead of calling into the OpenGL libraries from Java, and because Quake 2 was written at a time when 3D games were fillrate limited, not CPU limited. Back then, the extra overhead of sending models one vertex at a time was essentially zero, because you were still sending the data faster than the graphics card could render it. With modern graphics cards, Quake 2 becomes CPU limited. The extra overhead of all those unnecessary OpenGL calls is even greater in Java than it is in C, so it ends up running slower.
It'd probably be better if the game were designed as a Java program, rather than a C program. The Java code is a fairly close port of the original C, so it does quite a few things which aren't optimal for a Java program.
Can we get a comparison of the Java and .NET ports of this?
.NET port can be found at http://www.vertigosoftware.com/Quake2.htm
The
Most users that played Quake2 did not have hardware with builtin 3D acceleration. So the folks at idsoftware improved their already outstanding software rasterizer for Quake2, which provided almost identical rasterizing performance on then-highend machines compared to modern 3d cards at that time.
If the Java version would do the same, then I would take my java performance prejudices and dump them.
Don't underestimate the execution-speed of Java in a decent JVM. For example: My Java-based HTTPD outruns Apache HTTPD for static file serving.
Don't be a luddite. The port runs really well.
- It's not the Macs I hate. It's Digg users. -
Even with 512MB of RAM, Azureus (the hugely popular Java-based BitTorrent client) takes forever to start up, responds sluggishly to user input, and sucks down so much RAM that the Windows PC it's running on is nearly useless for any other task. This isn't simply the nature of BitTorrent - other clients run far more smoothly.
Maybe there are reasons for this that aren't directly related to Java. Maybe Azureus just isn't very well-written, or maybe it's just feature-bloated. Maybe the Windows JVM just stinks.
But in any case, the common perception of Java applications as being slow and ponderous is one that Java applications have earned - there are actual reasons, based on real-world experiences, that cause people to feel this way. That has nothing to do with some pig-headed resistance to change.
Rather than railing against the Java-haters, why not point out some useful, slick, fast Java-based applications? I'd love to see some. Every one that I've tried so far has been a disaster in one way or another. I honestly want to like Java. I like the language, I love the concept - it's the real-world experience with it that I have a problem with.
"Look Lois, the two symbols of the Republican Party: an elephant, and a fat white guy who is threatened by change."
Born in 77.. Quake GL was arguably the first eye-opener to 3D gaming, but Quake 2 was the first full experience with 3D cards. It holds a special place in my heart with Wolf 3D and Doom.
-Stu
Mustang (Java 6) which is under Open development (not quite open source license) already has wider support for clear type than Microsoft... So you are right its a bit late but people have invested work into that.
Swing is not slow or bloated, it just can't be compared to the native OS size since it duplicates its functionality so its memory usage seems high in the task manager. Startup time and cold start is improving with every release and building serious client side Java applications is becoming a very real option.
4) People who actually run benchmarks
5) People who write lower level libraries
You may argue all day long because most people don't care about a 10 or even 50 percent performance difference. As long as the GUI responds in a time that approximates "instantly" people are generally happy.
Does this JAVA version of Q2 run so well on a Pentium?
Wow, the guy criticising Java performance got modded "troll" even though the benchmarks you linked to support his assertion that the port doesn't run well on the hardware quake2 was designed for. On the K6 2 350, the native version gets 56 fps, while the java port got 21 or 31 fps with the two different java packages. Even on modern hardware the java version is 25% slower in 2 of 3 cases. And yet the java contingent still flames anybody for re-asserting the "old myth" of a java runtime penalty. Wow.
https://joal.dev.java.net/joal for Sound according to his site.
https://jogl.dev.java.net/jogl for OpenGL
http://www.lwjgl.org/ Light Wieght Java Game Library
Man this guy is good, he won't even let you copy paste his web text.
Seriously, good work, Are you aware Q3 has been liberated?
OSGGFG - Open Source Gamers Guide to Free Games
In Quake 1 multiplayer, players who tried to play with the keyboard were called "targets." They were ridiculously easy to circle strafe and they couldn't dodge and aim at the same time.
Here are some screen shots, coz that's most important and what people really want and shit...
I have two points.
Comparing a static C binary, with a JIT is sort of silly. Logically comparing a JIT with a C binary compiled with profile based feedback optimization is probably more legitimate.
Secondly, the released Quake engine had a couple of assembly routines. Proving that C wasn't always the best choice, even back then. My understanding is that the versions of quake with assembly loops are roughtly 30% faster than the C only version they are comparing this with.
In the end these sound like good results, I'm continually amazed at how fast java has gotten. The fundamental arch is pretty much broken for generating fast binaries, and it speaks volumes about the quality of the coders writing the JIT engines that they can make a stack based compilation target run fast on modern processors.
Oh, one final thing, did anyone see what C compiler they used for those numbers? I'm currious if it was the same compiler ID originally used, or one of the more modern intel compilers?
Okay, please show me these instances of where the Java version of an app is faster than the C version. That's not a troll: I'd really like to see it. Because I'm now just as tired of the "Java is as Fast or Faster than C Now" myth as I am the "Java is Slow" myth. Time for a reality check: task-for-task, Java is slower than C, period.
Just take a look at some benchmarks. There is only 1 test out of 26 where Java beats C (compiled with either gcc or vc). One!!!
The original Quake2 had a software rendering mode as well as OpenGL. If Jake2 attempted software rendering (does it? I played a Jake2 build from several months ago and I didn't check) I seriously doubt it would come near the performance of the C version.
Does this mean that C is "better" than Java? Certainly not. I am currently writing a JSP/Servlets for a financial web app, and I'd sooner chop off my arms than try to do the same thing in C. However, I am sick of language zealots who try to argue that the [fill in the blank] language is The One True Programming Language. Java is pretty cool but when you try to sell "your" language as all things to all people you're just asking for a backlash.
Ruby is the worst offender -- I'm sure it's great but in 5 years the proponents of [some cleverly named gem or mineral] will try to link Ruby with global warming... you just wait.
Please use real comparisons. I could just as easily say that my OpenGL-compatible library renders faster than NVIDIA's on Linux for some random routine. What I fail to mention is that my OpenGL-compatible library happens to implement only a subset of the functionality, and hacks around the standards for speed. /not saying Java is slow, only that your example is broken
The only reason that this posting is news is that, up to now, Java programs haven't been as fast as C++ programs in the general case. Given the overwhelming experiential evidence, it would seem that the Java bigots are the ones who need to make more of a case than "it is faster because I say so." Quake 2 running on Java is a start. Quake 4 having shipped as full Java would have been a big win. That this post isn't being brushed off as non-news bears out my point.
This is really the conflation of two orthogonal arguments, though, and we should take care to avoid treating languages and their compilation/execution mechanisms as locked behaviors.
When the Cell takes over, we'll all be stuck writing for SPEs in straight C.
There is no way to write and read from lots of memory quickly in java is there?
.NET being better than Java. Even newer reports show that Ruby is better than .NET. I guess Ruby is the best there is. Expect a Ruby port of Quake that runs faster than the original C version ;)
Yes, Java came out with Native I/O API (NIO).
All benchmarks that I have looked into that show that Java runs faster then C/C++ are extremly heavily biased towards making Java look good.
I've read similar reports of
Correct me if I am wrong, but in order to get towards the original C code, they have had to change the quake rendering code, and in doing so, have made Quake2 more optimal for modern video cards with modern drivers.
Yes, they optimised with vector arrays and how memory is allocated in some loops. Vector arrays meant Java sent fewer calls to OpenGL since one performance issue with Java to OpenGL is calling virtual functions (JNI). Its unlikely that using vector arrays in the original C port would do anything for performance. The memory allocation is a bit more tricky since Java works with memory differently than C and this may not be an improvement to the original C code. I haven't read the source code and have to take the developers word on all this.
But to be fair of Java, it has to go through an extra layer of interfaces to make the calls (On the other had this is always another argument why java is actually slow)
Most Java applications do not use JNI code which would make that argument rather rare in usage.
Is it true java needs more memory, does this therefore this can cause more cache thrashing?
No, the garbage collectors in Java do a pretty good job at making sure the cache is not thrashing. But, if you read some Trolls here on Slashdot they would state that Java not only ate all their computer memory but also kicked sand in their face at the beach and stole their lunch money. Depends if you WANT TO BELIEVE that Java takes 600 megs to run. It won't match reality but might make a "Java Hater" fan club member sleep easier at night.
I've actually had the experience of writing java games on mobile phones, its really sad that the performance of java has become hyped to the point where people think giving developers no other choice but java on these machines is a good idea.
This reminds me of when I was writing PalmOS apps. I was writing them in C using a modified Cygwin compiler on Windows. Some time later I came across SuperWaba and dropped the C code in a heart beat. Main reason? It was cross platform. With SuperWaba I could support all types of PalmOS platforms AND Windows CE. Seems to be the #1 reason phone companies use it too. Theres just too many different types of phones out there with different chips, operating systems, memory sizes, screen resolutions+colors, buttons, etc. Seems smart to give developers the capability to hit more devices rather than fewer. C may give you sweet access to performance for a particular machine/device but it will also lock you to it.
I do like GTK. I don't like GTKmm. I am actually using GTK for a project right now but I am writing my own object wrapper for it. It is not as complete as GTKmm so it doesn't use all the extra libraries that GTKmm does. C# is a none starter because the project I am doing can not afford the Mono framework overhead. It is an embedded device. I am not using Java for that project for the same reason.
My Java programs predate mono and they work so I see no reason it porting them right now.
I am not going to learn c# anytime soon because it has no benefit for me.
1. Java works for the current application I have. I may need to add some features but there is no reason for a complete rewrite.
2. We already have around 200,000 lines of C++ code in house and when we take our flagship product cross platform we are going to buy QT for that.
3. I have to learn Python since we are going to embedded that as the macro language for our multi platform version.
4. I have to pick and choose what I learn. I don't have time to learn every new language that comes out. I would love to learn Ruby, Scheme, Smalltalk, and Lua but I have only so many hours in a day. As I said just because I dismiss it doesn't mean that it is a bad choice for everyone, just for me.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
"Some simple optimizations" ? does "simple" optimizations in Quakes C/C++ 'Original C Code' too little kid... (how many java programmers knows/owns JVM/JIT/JSuck optimizations vrs. how many C/C++ programmers knows C/C++ standart code? I will not never pay $100/hour for a Java expert programmer, but $200/hour for a C++ semi-expert programmer!)
I admit that I was being harsh...
They actually did nice work. It is refreshing to see something in Java that is not a bore-me-to-tears enterprise J2EE framework.
Unplayable on my monitor. Brightness???
640 mb of ram should be enough for anyone.
Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
The first secret level is taken out. There are other small differences.
I usually run a few more apps alongside with games.
The benchmark does not show how much memory is used - likely, they installed an ungodly amount of RAM on all machines so it's overkill for the C version and adequate for the Java version.
I'd like to see the benchmark on the minimal hardware requirements.
Oops. Non of the above
Let me guess your profile then...
and yet JAVA IS STILL SLOW.
So you're a programmer using a language that you percieve to be going out of fashion and therefore feel threatened by what's new and current and respond by churning out these "facts" to anyone who may listen.
1)Java developers trying to pull the wool over their management's eyes to continue being paid outrageous salaries for working with a flawed language at the wrong abstraction level.
So you're a wage slave who's been hacking away in their chosen language for years and is jealous of the success of others and the fact that your career seems to be passing you by.
2)People who's last and ONLY experience has been "Java"
You may as well admit it, you've never programmed in Java (or any other next-generation language for that matter) have you?
3)Immature college weenies whose idea of a regexp match is a for-next loop stepping through each character of a string.
So you've been in your career for probably about 10-15 years but haven't kept up with the times, so you have to resort to mocking others who have more knowledge than you of the latest technologies.
Bob
Listen to my latest album here
This is code copied from the C source. Most of the source code files say ".java" in their filename, but I hope that no JAVA developer from the 21th century writes code this way.
The effort should be saluted, but the time spent really is not worth the effort.
The benchmarks show, by the author's own admission, that the java version runs at about 60% of the C version's speed. That's to be expected, and one must keep in mind that the only part that java slowed was the part that runs on the CPU. All the work that is offloaded to the GPU would not suffer from that drop in speed.
I would like to see performance benchmarks done on an older platform where there is not huge amounts of L1 and L2 instruction caches.
Also, a 40% drop in execution speed is very significant. While Quake2 may run at "only" 200 instead of 300 on a modern machine, if we were looking at a more complex game that was barely making 30 fps on an average machine by today's standards, that 40% drop in performance would be much more noticeable.
I am wary of benchmarks that are done on machines that totally overpower the app they are running.
Dungeons of Daggorath on the TRS-80 was the first '1st person' game I ever played.
I think it could make a legitimate claim to the title "Original First Person Shooter". Even though it wasn't a shooter. All subsequent 1st person kill 'em all games are derivatives of what they did on that game.
Circa 1982, 8K.
It's worth pointing out that pre-releases of Java 6 (Mustang) are showing in the order of 10-20% speed increases for many Java apps
1 1422.0
see: http://www.javagaming.org/forums/index.php?topic=
I got 20% increase on a ray-tracer. AFAIK this is still without having implemented optimisations based on escape analysis - which are expected to be a huge win for Java, so Java performance is set for another big jump again.
Mobile phones and Java don't mix. Read Carmack's (creator of Doom, Quake) blog. A game he was developing needed a seperate port for each phone, because of variations. Write once run everywhere? Ha.
#1, don't you have some slide presentations to makeup for your boss or something?
I am the boss, as well as lead developer. I run my own software company.
Bob
Listen to my latest album here
Its amazing how well this runs. But there's no kick-back when you fire the machine gun.... so in my view it fails completely! They might as well scrap the entire thing now!! :D
Perhaps my example is somewhat broken, it however illustrates that a decent JVM can keep up with (or even outperform) a (perhaps not all) similar function of a C compiled product. And since in my example it applies to most of the functions of the Java product in comparison to the C product (i.e. serving HTTP and the like) I dare to state: "Don't underestimate the execution-speed of Java in a decent JVM.". Nothing more, nothing less.
"But, if you read some Trolls here on Slashdot they would state that Java not only ate all their computer memory but also kicked sand in their face at the beach and stole their lunch money."
;-)
The same Java that surrendered West Point to the hated British?*
*
I've been doing Java applications since 2000. If you know what you are doing they are not slow. A simple Java application has a minimum footprint of around 3MB regardless. Ever looked out how much ;-)
;-)
/0x00 value.
;-)
;-)
MS Windows Messenger takes up without you using it? About this much idle but if you click on the icon in the status bar it jumps as high as 8MB doing nothing.
There are ways to cache a JVM so if the JVM has already been loaded the needed system files to bind with the native windowing system you can't tell if it is a Java application or a native application.
This should come standard with 1.6 Mustang but it is pretty easy to do. I had code that did this with 1.3 and xMotif folks were shocked when my Swing applications loaded just as fast.
I've been doing GUI applications since VB 2.0 and have used lots of GUI builder tools on various platforms.
The part that really gets me is when people are shocked to see a Java application like this. Why is it that everyone thinks Java is still slow when it used to be embedded in a browser as an applet?
Doesn't everyone know that the JVM/JRE is written in C? If you run 'javah' from the command line you can easily create a C style header to load your system library into the JVM.
So JOGL which is the JNI version of Open GL has bindings for the different platforms.
If I told you I could write a system in C with garbage collection, threading and networking built in that was almost as fast as standard ANSI C wouldn't you believe it?
The reason Java is slower is because it is DOING MORE. It isn't THAT much slower either. I'm sure everyone out there could write a generic IP stack and garbage collector that will run all CPU platforms and scales well.
Gosling had a quote that I really love. "C has small problems, like what is an int?"
Not to mention always having to memset your heap data or run into a very big chance of ghosting values or worse yet not null terminating a string and it just run off into the kernal looking for a
The HTTP loader and ability to auto load and install your application across a hetrogenous network (WebStart) is a pretty nice feature. I'm sure a lot of developers out there will miss having to use REGEDIT to figure out why their application didn't install correctly.
I don't know anything else that comes close to Java Applications. C# is the next coolest language and the author is a genious. The problem is MS has chosen to poor cement from this very cool language into the kernal. Since it makes native calls to the OS and it is a closed system. I can run a java application on Windows 98 with no problems. Can't do that with C# because it needs system dll calls that MS doesn't want to make virtual or share with anyone else. You will need to buy yet another OS upgrade from MS.
For the Mono folks out there has it shipped yet? Is anyone using it to develope anything with? I've been shipping Java appications professionally since 2000.
The JIT is the cool part that makes the JVM almost seem like magic. It dynamically profiles the code at run time. Translates the java bytecode that is used the most into native assembler on the fly. There is some overhead for this but it is a one time charge once optimized.
For those out there that say Swing doesn't do multiple threading they should google on 'Swing worker thread'. I've been using that for 5 years as well.
For those out there that have only cooked with the mirco-wave oven Java is gourmet style cooking. If popcorn is all you need then by all means stick with VB, C# or some other tool. If you want to be able to write a very cool looking GUI that will run on any platform then learn Java Swing.
Swing is the real deal. SWT is another option popular by the IBM/Eclipse community. This is a native peer JNI type call which works a lot like C#. It requires some knowledge of the native widget set
Ok, for us NON-Java learned programmers (yes, I'm that old...) what the blazes is JIT? Other than the acronym for "Just In Time" as in a delivery methodology used in some industries I used to work with.
I'll think of a really good SIG just before I die.
First off, he was modded troll because the latest version, .9.4, is VERY comparable and does not require a machine that is vastly greater than the the C version, they are very close.
Secondly, his comment adds nothing useful. he is just bitching pointless. Many trolls do that.
More importantly, even if your numbers are taken as meaningful, look at what we are talking about: A 3d java FPS that is ONLY 25% slower than a compiled C program. 3d and java were never in the same sentence, now they are.
Talking about taking a hit with java now means A LOT less than it used. It is likely java will ALWAYS be slower in most cases then C, just like C is slower than assembly. Yet for some strange reason most people rarely complain about that hit.
As with everything, right tool for the right job and java is becoming more capable of being the right tool more often every year.
could never been considered
I mod everyone down who says "I'll get modded down for this." I hate to disappoint.
The Java program is delivered as Java Bytecode. The ancient sort of VM would interpret these as some sort of half-digested shellscript and run them one by one. A JIT compiler will do this the first time, but then it may choose to remember the machine code equivalent of the bytecodes and run it directly next time. Over time, it might collect statistics on how the code is run and introduce various optimizations to make it run faster. It will also typically do some classical optimizations on its first compilation of any given code block.
It's a JIT because bytecodes aren't compiled until they're about to be run anyway. It's a compiler because it may choose to remember the machine code that results from the bytecode interpretation.
sigs are hazardous to your health
I've found this thread "by accident" and i didn't know about Jake2, so there may be other Java games or similar apps to show off what's possible and what's not (which i'm very interested in). What i do know is the stuff from Puppygames, Oddlabs and Paradroidz. And now this one. Is that all there is?
www.eclipse.org
www.clarke.ca
Can this really provide fast buffer acess conpaired to C/C++?
Yes
Isn't it going to require bounds checking in the JVM?
No.
Otherwise it would be a security problem wouldn't it?
Yes. So is giving people your credit card number to people you don't know or running with scissors.
and the java is significantly less cache friendly,
That is your earlier assumption which, apprently, you have concluded is a fact. Must have been a real scientific endevour on your part.
Back on mobile phones, I think there are mostly arm processors, and C is actually a pretty portable language.
Oh, geez, mostly? We will ignore the likes of Motorola, MIPS, and Intel to name a few? And theres like, what, only one ARM processor out there with cellpones not including any third party chipsets (ASIC's)? Seems like your steering here. Right now I post from a computer that has the only RISC processor, with the one and only type of memory, running the one and only operating system, by using the one and only web browser.
How is doing java support for different screen sizes, colous, buttons, and memory different to a C API?
What is the name of this C API that goes across multiple chipsets and does these things? I take it it only supports ARM processors right (the one and only)? Might as well make use of your platform here and tell the world of this C API. I sure would like to check it out.
We called it write once run away code.
Thats a really bad joke. Does that actually get laughs where you come from?
So, you believe there is an interface in java where I can write quickly and read quickly to memory, with out needing any bounds checking to see if you are righting out side of it? Wouldn't this mean It isn't that hard to right a java app that can take control of somebodies computer because there is no security?
Hmmm. Okay, you are probably thinking unsigned Java applets. Those types of applications run in what is often called a "security sandbox" which limits their capabilities. While in these, Java is unable to use NIO APIs. But, as a standalone or signed (and accepted by end-user) applet Java can use these APIs and thus get full powered input/output control.
"C is actually a pretty portable language".
True. And C++ is pretty standard too. Its only when you use APIs like ATL or DirectX that you get into trouble with cross platform capabilities. Ofcourse, unlike Java, you have to have your code compiled into various binaries. No biggy in the PC world but a real headache with phones because of the variety of chipsets.
If all phones allowed C/C++ apps, I would definatly choose to avoid java for games.
Or, even better, just have a tool that compiles the Java bytecode to a target machine code. This is how they did it with SuperWaba. And there are many advantages for doing this. Another approach is Qualcomm's BREW.
If you say so, some peoples sence of humour may actually differe from you. Some people my clame there is right or wrong when it comes to taste but I dissagree.
Sorry, I was in a pissy mood yesterday.
I was killing time on an old IBM StinkPad with W2K and a whopping 256MB of RAM. Did the Jake Webstart, downloaded the 38MB Quake files, and I was rocking. It actually plays well. Had one lock-up during the initial session, but none since.
I am my own gestalt.