Slashdot Mirror


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!"

46 of 326 comments (clear)

  1. Erm, link: by medgooroo · · Score: 5, Informative

    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
    1. Re:Erm, link: by bpatinifurtado · · Score: 3, Informative

      It is awesome what they have did!

      I have a real good computer (memory, processor and video card) but I must tell you, the game runs really fast, you dont have the feeling of running a java application with all those 3 dimensional objects flying around you. You cant tell thats a program being interpreted.

      Great job folks! The Java community has only to earn with this proof of concepts works :)

      I have been there

      --
      "Minds are like parachutes, they work best when open"
    2. Re:Erm, link: by bentcd · · Score: 3, Insightful

      You cant tell thats a program being interpreted.
      Java programs don't get interpreted on modern VMs, they get JITed. In some cases, this can result in more effecient code than a precompiled binary such as one created by a C compiler.

      --
      sigs are hazardous to your health
    3. Re:Erm, link: by The+Other+White+Boy · · Score: 3, Informative

      it has mirrors in the dropdown, i'm getting 120k/s from the german one.

    4. Re:Erm, link: by CowboyBob500 · · Score: 3, Funny

      La, la, la, I can't hear you...

      Bob

    5. Re:Erm, link: by MartinG · · Score: 5, Insightful

      This is a bullshit argument that generally presumes a substandard optimization by the binary compiler.

      No it assumes that the compiler cannot know the most common runtime code paths (which is true). A JIT engine can of course.

      Even with compilers that read seperately collected profiler data (such as recent gcc which can take gprof output) can only work on that one profiler measurement. Lots of software is highly dependent on usage patterns and so different paths will be run depending on how the user uses the software. Only runtime optimisation can take this into account.

      --
      -- MartinG To mail me: echo kewyjlcxyzvjfxbqwh | tr bcefhjklqvwxyz .@adgimnoprstu
    6. Re:Erm, link: by TwistedSquare · · Score: 2, Interesting

      >>In some cases, this can result in more effecient code than a precompiled binary such as one created by a C compiler. This is a bullshit argument that generally presumes a substandard optimization by the binary compiler. I believe the theory is that the compiler can optimise for, say, Athlon XP, but cannot assume that anything above a 386 (or a Pentium, depending on settings) is being used, so it can't use XP-only instructions/tricks. Whereas the JIT compiler can optimise for the exact processor it is running on - it doesn't need to be able to run the programm on any other machines. This is particularly the case in Windows, and for Linux binary packages (obviously gentoo can do what I described when installing packages). Whether this actually makes an appreciable difference is another matter.

    7. Re:Erm, link: by CowboyBob500 · · Score: 5, Funny

      Exactly. In real life I found that there are 3 types of people who perpetuate the myth that Java is slow:-

      1) .NET developers
      2) People who's last experience of Java was rollover applets in 1996 and who have refused to install a JVM since
      3) Crusty old Unix hackers with beards and rainbow jumpers for whom Window Managers are eye candy and whose idea of a IDE is vi

      Bob

    8. Re:Erm, link: by tedgyz · · Score: 3, Interesting

      Right on, brother! The C/C++ bigots just can't accept that a Java program might run as fast as, or (gasp!) faster then a C/C++ program.

      I worked in a compiler group for 10+ years. Profiling was definitely the best way to optimize a program. The challenge was that the compile-profile-compile loop was cumbersome and was hard to account for all use cases. JIT profiling deals with YOUR use case. If it's really good, it will even adapt and re-profile as your use pattern changes.

      --
      "No matter where you go, there you are." -- Buckaroo Banzai
    9. Re:Erm, link: by LWATCDR · · Score: 2, Interesting

      I have developed code in java for a few years now and you are over simplifying the case.
      Where Java has been or still is slow.
      1. Start up. It takes a good bit of time to start a java program because it takes a good amount of time to load the JVM. Not an issue on a sever where the JVM is probably in use all the time but a pain on the desktop. It also makes small utilities a pain in java. The latest version of java seems to start quicker.
      2. Swing. Swing has been slow. The latest version of java seems much better.
      I here all the time how Java can be as fast as c++ but I have to admit I have never seen it. I would put Java in the class of fast enough for most tasks.

      I use Java because I like OOP and I really like how Swing is laid out. It fits my mind set a lot better than MFC which I hate with a passion or GTK which while object oriented is not in c++. You can use GTKmm but the number of dependencies is just over the top IMHO. Everyone is different so what I like may not be what someone else likes.

      I don't do VB because I will not learn a programing language that only runs on one OS. I also have not bothered with c# yet because I see little benefit over Java unless you are going to stick to just Windows. I have to develop for Windows and Linux so that is not an option.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    10. Re:Erm, link: by gcauthon · · Score: 2, Informative
      Java programs don't get interpreted on modern VMs, they get JITed

      Question, how does the Java program get "JITed" without getting intepreted first? Does the VM use ESP to read the mind of whoever wrote the program?

      This argument is so old and ridiculous. The only benefit of JIT is that it prevents having to reinterpret the same piece of code over and over if it's executing a loop or procedure multiple times. JIT just makes Java an efficient intepreter rather than a crappy one (which it used to be).

    11. Re:Erm, link: by laffer1 · · Score: 3, Insightful

      I fit category 1 and 3 above and I still think java runs very fast for server based code. Running a java servlet container is very fast. A few applications like jedit, intellij idea and limewire seem fast on the graphical front. Someone can write a slow .NET, C++, or objective c app too.

      Java's benefit is its age and portability. Its fairly mature and very fast when running under the server vm for some time. Quick command line apps are best served with C code. Compile C code with g++ instead of gcc sometime. Not only will your code run slower, but it will be larger as well. Likewise time a Visual C++ app vs a .NET gui app starting up. The advantage of Java and .NET is the massive amount of libraries that are guaranteed to be there. The STL in C++ is not implemented consistently across compilers or platforms. My big complaint with java isn't speed, but organization. I find the namespaces cluttered and confusing compared to .NET. Think about it. They have io and nio. Try to write XML code sometime! Oh god. Java is more portable than .NET though. The price is a consistant namespace layout. Maybe someday if Mono matured to a point it was portable and at least .NET 1.0 compatible we'd see a real shift in software development. I'd use c# in bsd for example. Its great for web development compared to the servlet api.

      If your vision of java is applets think again. No one uses java for applets anymore. If you do, you missed DHTML and its recent variants. Client side code is ignorant anyway. Browsers aren't standarized enough for that yet. Java is good for server side code and if written properly, desktop gui applications.

    12. Re:Erm, link: by Keebler71 · · Score: 4, Funny
      Exactly. In real life I found that there are 3 types of people who perpetuate the myth that Java is slow:-

      Don't you mean that there are 11 types of people?

      --
      "It takes considerable knowledge just to realize the extent of your own ignorance." - Thomas Sowell
  2. Works pretty well by Anonymous Coward · · Score: 5, Informative

    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.

  3. If I was Sun CEO... by should_be_linear · · Score: 5, Insightful

    ... 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
    1. Re:If I was Sun CEO... by TheRaven64 · · Score: 5, Insightful

      Java already has an OpenGL interface (presumably what this is using). I don't know what this guy is using for sound (although the Java Media Framework might work), or input, but presumably all of the pieces are already there. What Sun really needs to do is market Java better as a game development platform. Add some code for loading models as OpenGL display lists, and a few other convenience methods and start plugging the platform better. Oh, and relax the licensing so I can run Java on my FreeBSD box without jumping through hoops.

      --
      I am TheRaven on Soylent News
    2. Re:If I was Sun CEO... by realinvalidname · · Score: 2, Informative

      Java already has an OpenGL interface (presumably what this is using). I don't know what this guy is using for sound (although the Java Media Framework might work), or input, but presumably all of the pieces are already there.

      Yes, probably JOGL for the OpenGL. For sound, core Java can handle raw PCM, and JOAL (Java Bindings for OpenAL) can sit on top of that. Java Media Framework is useless and effectively dead. Input can be handled by JInput.

    3. Re:If I was Sun CEO... by should_be_linear · · Score: 2, Interesting

      Still, there are things that needs to be addressed:
      - Multiplayer should allow voice and webcam communication.
      - There should be Servers and bandwidth available for Multiplayer games.
      - All parts of this library must be able to run on Windows/Linux/Mac/Playstation (including JRE and SPU support on PS3)
      - There should be new graphic instructions in Java JRE (based on OpenGL API) that directly maps to OpenGL driver and don't need RMI layer.
      - There could be "iTunes for games" service that provides all games and previews on a single place (money generator)

      --
      839*929
  4. Yes, but does in run by Kj0n · · Score: 2, Interesting

    in Firefox?

  5. works on a mac by Anonymous Coward · · Score: 2, Informative

    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.

  6. Quake 2 seminal? by Malc · · Score: 3, Insightful

    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.

    1. Re:Quake 2 seminal? by Antonymous+Flower · · Score: 5, Insightful

      Quake 2 was the first game designed for and supporting 3d acceleration out of the box. In this way it is certainly seminal. So much so, in fact, that 3d acceleration is no longer a part of the collective consumer consciousness :)

    2. Re:Quake 2 seminal? by Chrontius · · Score: 2, Interesting

      If you consider Quake2 as the first game to really make it while introducing proper mouselook to the masses, yes it is. Duke3D had it, but it was wonkky enough to make me seasick so it never got used. Quake2 gave you the ability to do much more with it than anything prior, even Quake, where it was not really needed and played by the best gamers I know with pure keyboard.

  7. dupe by tduff · · Score: 2, Informative
  8. Re:"...performance is similar to original C versio by steevc · · Score: 4, Informative

    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.

  9. Performance myth. by adolfojp · · Score: 2, Informative

    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

  10. Re:Get ready for some low FPS! by Anonymous Coward · · Score: 3, Interesting

    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.

  11. Comparisons with the .NET version of Quake2? by Numen · · Score: 2, Interesting

    Can we get a comparison of the Java and .NET ports of this?

    The .NET port can be found at http://www.vertigosoftware.com/Quake2.htm

  12. The Java Version uses accelerated 3D by Anonymous Coward · · Score: 2, Interesting

    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.

  13. Re:"...performance is similar to original C versio by sprins · · Score: 2, Interesting

    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.

  14. The Slowness Of Java by Lagged2Death · · Score: 4, Insightful

    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.

    1. Re:The Slowness Of Java by FatherOfONe · · Score: 4, Insightful

      "Rather than railing against the Java-haters, why not point out some useful, slick, fast Java-based applications? I'd love to see some."

      Um, you did see what the article is about didn't you? Perhaps you should try it out.

      I have used quite a few Java programs and most perform well.

      --
      The more I learn about science, the more my faith in God increases.
    2. Re:The Slowness Of Java by Anonymous Coward · · Score: 4, Insightful

      A port of Quake 2 that is slower and uses more memory than the native client that was released seven years ago?

    3. Re:The Slowness Of Java by locnar42 · · Score: 2, Informative
      Having picked up Java after using C/C++ for about 10 years, I find the biggest irratation to be the speed (or lack of) that programs run. The language itself is great. The UI is usually the worst part. I highly recommend checking out SWT from Eclipse. I think a lot of the hardcore Java freaks don't like it because it's not true Java and goes direct to the OS, but it can produce a great UI that isn't painful to use.

      In theory, the JIT should be able to produce code that runs as fast or faster than C/C++. The JIT compiler has much more knowledge of the execution environment (CPU, memory, graphics) and should be able to optimize the program exactly for this one computer. It has't happened yet though. I'm waiting for it though because Java 5.0 is a fantastic language and I would love to drop C++ for it.

      Right now, SWT is the only thing I've found that makes Java UIs bearable for the majority of programs. There are always exceptions to the rule and I'm sure there are some applications where the developers have been able to get decent speed with Java, but the typical C++ program has a considerably more responsive UI than the equivalent Java program when written by programmers of similar talent.

    4. Re:The Slowness Of Java by SComps · · Score: 2, Insightful
      Either you don't know one end of a computer from another or you're deliberately spreading FUD.


      Or he might be a normal non-evangelical java junkie that runs it out of the box. Like me. It runs like shit on my sytems too, and everyone else I know that runs it.. runs like shit. Of course they're not going to tweak the VM, the applications or run around in a handful of config files or whatever else you've done to manage to get it to perform reasonably. Fact of the matter is that it works file for you, and doesn't for him (or me et al)

      It doesn't mean he's unable to determine the linear end points on his computer any more than it determines you're able to recognize the difference between your posterior and a pitch fork.

      notice, I was able to state my opinion without backing it up with a bunch of useless output from a console. (which mind you is dubious in that I'm sure you can use vi. You're the kind of person that loves vi right?)

    5. Re:The Slowness Of Java by Anonymous Coward · · Score: 3, Informative

      The benchmarks clearly show that the java version is as fast as the original C version.

    6. Re:The Slowness Of Java by GileadGreene · · Score: 2, Informative
      Rather than railing against the Java-haters, why not point out some useful, slick, fast Java-based applications?

      I've had a pretty good experience with jEdit, a Java-based programmer's editor on both Linux and OS X. It's mostly replaced emacs for me now. Although I've only tinkered with Eclipse so far, it's been pretty responsive for everything I've tried. On the Mac, NeoOffice/J (the OS X port of OpenOffice.org, which relies on Java for access to the Cocoa API) seesm to run pretty well. Granted, these are all editing apps, but they're all produced by different dev teams, and all seem to work well.

    7. Re:The Slowness Of Java by Alban · · Score: 2, Insightful

      You sound like an armchair general talking about how it is in the trenches (posting as an AC, no less).

      John Carmack is not the greatest programmer, but he is a damn fine programmer. He has shipped tons of games, and shipping games is an incredibly difficult thing. You also have to keep in mind that until quake2 included, he handled almost all major programming tasks (rendering, networking, architecture). Doom is one of the first games I've seen to cleverly use the same client/server architecture whether you are playing a single player or multiplayer game. Carmack is an extremely focused and fast programmer that ships games.

      It is just soooo easy to look at code and call out its flaws. Would you like to release some of your code online for all of us to scrutinize?

  15. Nice to see a full port, not just the game logic by FerretFrottage · · Score: 2, Insightful
    Q2Java was a port of the Q2 game logic and used JNI IIRC to interface with the game engine since 3D graphics support and serious sound support for Java was still nascent if existing at all. I wonder how hard it will be to port my "grapple the head mod" over to this version?

    --
    "Look Lois, the two symbols of the Republican Party: an elephant, and a fat white guy who is threatened by change."
  16. Good morning, Already there in Mustang by Anonymous Coward · · Score: 3, Informative

    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.

  17. C and profile feedback optimization. by bored · · Score: 4, Interesting

    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?

  18. How is it bigotry? by chaboud · · Score: 2, Insightful

    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.

  19. Re:How fair is this Java vs C comparison? by sbrown123 · · Score: 2, Interesting

    There is no way to write and read from lots of memory quickly in java is there?

    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 .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 ;)

    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.

  20. and the worse is... by A2GS · · Score: 2, Interesting

    "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!)

  21. Well of course it runs great by rsilvergun · · Score: 3, Funny

    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/