Slashdot Mirror


Quake2 Engine In Java

An anonymous reader writes "Ok, so the game is old and there was a really poor web version some years back, but some guys at Bytonic Software in Germany have done a full source port of the Quake2 engine from C to Java. It's cross platform, performs just about as fast as C and has room for further improvements according to the developer. Also, there was another game engine that ran Q3 maps that was shown recently at JavaOne. Are first generation Java games that far behind?"

5 of 123 comments (clear)

  1. Java != Slow by kannibal_klown · · Score: 5, Insightful
    But I used java once, and it took forever to print Hello World. Java is slow. Java is stupid.


    Maybe this will lay waste to claims that java is slow, bloated, and sucks.

    I've only recently started doing heaving Java programming, and I have to say that the language is a dream to code with (provided you use a decent IDE). There're so many classes in place already, there's nothing you can't do. I'll take it over C++ any day, and MS's MFC is horrible on comparison.

    My only problem with it is the deployment; screwing with class paths and what not.

    People need to realize that most of the overhead they experience with their "hello world" experience has to do with loading the classes in the beginning. Once that is done, Java performs nicely.

    Sure, straight C is faster, but Java isn't the turtle everyone makes it out to be.
    1. Re:Java != Slow by blackbuddha · · Score: 5, Informative

      http://classworlds.codehaus.org/ will make your class path issues go right away. No more messing with the environment settings, no more screwing around with file paths, and only 29K of code.

  2. But do we care? by Turn-X+Alphonse · · Score: 5, Insightful

    I don't care if it's running in Java C D E or bloody Z, as long as the game runs well and looks playable (AKA not shooting green blocks to make red blocks appear with a black block and various brownish walls. ).

    No gamers is going to go "Doom 3 running on Java!? I'm so not buying that!" or "Doom 3 is running only on C++ I'm not playing that!". No one but the coders themselvs and the modders will truely care what it's written in as long as it runs okay and looks good.

    So gonna get modded Troll..

    --
    I like muppets.
  3. The language does not always matter by Alban · · Score: 5, Interesting

    The important thing to know is that the majority of your performance gains are obtained by scheduling the hardware intelligently, keeping the CPU and GPU well balanced, i.e. busy at all times. And of course, that your tight loops are really optimized, that you do not fragment memory, etc. That, for the most part, has nothing to do with the language your using, but simply with your programming skills.

    By the way, what hardware have they tested on to claim that performance is similar? If it's modern hardware, then of course it will run at 60+ fps no matter what.

    What's more, I would guess the bulk of the work on the CPU for quake2 consisted in traversing the BSP tree, building the scene (with transforms still being performed on the CPU at that time) and collision detection. The rest is taken care by the graphics hardware so that's totally independant of the language you've used.

    There is one thing that bothers me with Java though. You never know when the garbage collection will be performed. Sure, recent virtual machines make it possible to perform garbage collection in smaller but more frequent iterations so you don't halt the system for a few seconds like early virtual machines would do. But still, if you're in a tight loop with your data and instruction cache perfectly populated, and all of a sudden the garbage collection kicks in, then your cache is toast and data will have to be refetched to it when execution resumes. That would result in a horrible performance loss provided you are already really close to the machine's limit. Also, what I'm saying is only pertinent on a console with no (or almost no) OS, because on any PC operating system, your process can be interrupted at any time by the various system tasks that are running, so the garbage collection interrupting your tight loop would only be one of many possible interruptions.

    I don't believe java can be as fast as native code, although probably extremely close. And sure, a good java compiler will generate faster code then a crappy C++ compiler.

    Another thing I don't like about java is that you have no control over memory (not that i know of, maybe some recent VM extensions allow you to have some control over that?). I really like to be able to give different sets of alloc/dealloc routines to the different subsystems in a game. A subsystem that is known to perform very small allocations/deallocations very often could be passed alloc/free routines that are customized to its use so that memory fragmentation is kept to a minimum. If such a component was allowed to get memory from the same pool then your other subsystems, it would wreck havoc on your memory.

    Anyway, it's not such a good idea to compare java and C++ (or whatever other languages) on a system where resources are abundant (PCs).

    By the way, Jak & Daxter for the ps2 is written in a lisp derived language (GOAL), yet that game outperforms and looks better then almost everything else on the ps2. Yet lisp is not perceived as a high performance language. But the people at Naughty Dog have developed their very own compiler that is extremely specific to their needs (see their gamasutra post-mortem, very cool read) So, it goes to show that the notion of performance shouldn't be tied with a language, but rather with that language's runtime & compilers.

    Ok enough ranting!

  4. Turtle language by John+Harrison · · Score: 5, Funny
    Sure, straight C is faster, but Java isn't the turtle everyone makes it out to be.

    No, that is Logo.