Slashdot Mirror


Sun Pushes Java For Games Market

mysterious_mark writes "Sun has a new initiative promoting Java for game development, according to a story at CNET News." Interestingly, the company is trying to convince game makers that you can make state-of-the-art titles in Java as easily as simpler browser or phone games: "Java also has been used to build a number of simple online PC games, such as card games, but the language can be used to create sophisticated graphics for A-list games, Melissinos said. 'Some people may have the misconception that Java can't do great, high-performance graphics, and that's absolutely not true.'"

19 of 76 comments (clear)

  1. TO the metal by adamy · · Score: 4, Interesting

    It seems lately that most games are using a combination of C to the metal for the heavy ligfting, and Python or some other scripting language for lighter stuff. It seems to me that Java might be a good replacement for the scripting side. Take a game engine that is already portade (Unreal. Doom, Quake) and allow it to be customized using Java may make sense.

    Heavy lifting highly optimized code/ OTOH would still be in C or something else that goes to the metal.

    --
    Open Source Identity Management: FreeIPA.org
    1. Re:TO the metal by Golthar · · Score: 2, Informative

      Yes, in fact there are some libraries available that will do the bare metal stuff for you.
      Also, a lot of the runtime code swapping capabilities will make it easier/nicer to create mods by the community.

      Try looking at the Java gaming online forum

    2. Re:TO the metal by dimator · · Score: 2, Informative

      Check out this article about "Dirty Java." (Sorry, it requires a registration at gamasutra.) It's a little dated, but I think it still applies.

      --
      python -c "x='python -c %sx=%s; print x%%(chr(34),repr(x),chr(34))%s'; print x%(chr(34),repr(x),chr(34))"
    3. Re:TO the metal by gl4ss · · Score: 3, Interesting

      with the change from dos to windows and then with the modern directx's, opengl and sdl people write less and less to the metal themselfs, if at all (afaik most modern games use c++ and then directx for the gfx, sure, 2d games still do lot of the dirty gfx manipulation themselfs but they shouldn't need to really).

      most of the heavy gfx work are supposed to be done by the gfx card and it's drivers, most of the heavy sound stuff are supposed to be done by the soundchip and it's drivers. they can't do game logic, loading, deciding where to look, glue and all that (though, it looks like the cards are pushing to be possible for that too) and that would be pretty fine for coding in java.

      --
      world was created 5 seconds before this post as it is.
  2. Re:It's a hardware problem by Kethinov · · Score: 4, Insightful
    hardware doesn't exist to run them at any reasonably acceptable speed.
    You forget that not all games are first person shooters. A good game of chess online can be done just as fast in Java as it can be in C++ if you're running a reasonably modern computer. Take it a step further and consider empire building games such as Civilization. Those are also easy on the system. Java can handle it quite nicely. Java was built with crossplatform compatability in mind. It's slowness is minimal and a wonderful tradeoff for the fact that I can run a java app in Windows, Mac, Linux, Unix, or any other major OS.
    --
    You're right, I wouldn't steal a car. But if it were possible, I sure as hell would download one!
  3. Java3D not available on Mac by str0be · · Score: 2, Interesting

    For whatever reason, Sun haven't gotten around to making the Java3D libraries available for the Mac. This is a shame, as Java in the games industry needs all the help it can get, and cross-platform Java3D could have been a real benefit.

    1. Re:Java3D not available on Mac by halfnerd · · Score: 2, Insightful

      Actually Sun should spend much more time reviewing the Java3D architecture. It is much slower that for example the GL4Java bindings (which should be available for pretty many platforms). I don't know if this has changed, but this information is based on this report.

  4. Re:It's a hardware problem by Golthar · · Score: 4, Insightful

    Obviously trolling.

    When you are creating a full feature game in Java, you will steer well clear from things like Swing/AWT and libs that will slow down a lot.

    Also, as you can't manipulate hardware from Java, you will always need a library which can do some of the really high speed work for you.

    Java3d can be used, but recently a very popular lib named LWJGL" has come out to deliver direct bindings to OpenGL/AL

  5. I wrote a simple RTS engine in Java... by harborpirate · · Score: 2, Interesting

    A couple of years ago a friend and I wrote a simple RTS engine in Java.

    It was a tile based 2D game. Now, we weren't experts at writing super speedy display code, but we did preload all the images into memory, double buffer the frames, and crop areas of the map which would not be shown before displaying them.

    It got a whopping 8 frames a second. With 1 moving unit on the screen. Needless to say we quickly abandoned the project.

    Machines have gotten faster. The Java display engine is undoubtedly slightly improved. My guess is its still got a long way to go.

    --
    // harborpirate
    // Slashbots off the starboard bow!
    1. Re:I wrote a simple RTS engine in Java... by metalpet · · Score: 2, Interesting

      Obligatory counter-example:
      Frag Island, a veyr impressive quake-like FPS, written in late 1997. ( so quake-like that they ripped off a bunch of quake graphics and let you play in multiplayer in an authentic quake map with an authentic rocket launcher. ID lawyers didn't like, although Carmack was reportedly impressed.)
      You would get more than usable framerates on 320x200. Keep in mind that was on way old 1.1 JIT runtimes. Things have gotten better.

      On a sad note, it seems the page/applet is still dead. I wish they'd have done something with their fast java 3d engine coded over AWT, which looked like nothing short of a small miracle.

  6. MMORPG and server side programming by _wintermute · · Score: 5, Interesting

    Although I think that it remains a very long way off before ID will be developing the 'next big 3d thing' (tm) in Java, there is perhaps room on the server side end of things, particularly as MMORPGs start to garner more attention.

    No matter what the marketeers at Sun tell you, Java will never perform as well as C/C++ and when it comes to creating realtime 3d environments, every bit of speed is crucial. That said, Java has some pretty extensive graphics APIs and hooks into OpenGL and DirectX, which can be useful. For games that are not graphics intensive (and they do exist), Java may well be useful, particularly as you get all sorts of libraries and memory management for free. With JDK 1.4, Java is actually pretty fast on the client-side these days, you mat be pleasantly surprised if your experience is with older versions of Java. Coupled with modern processors (gHz!!) you can end up with a pretty responsive system. But client-side Java was never my cup of tea and it is still not even close to your C++ 3d engine.

    However, many modern games are moving online, and the possiblities of Java are much better here. MMORPGs are interesting because you connect graphical clients with servers. The servers are essentially gigantic rule engines and state machines - client input is taken, processed, perhaps things are stored in databases (this is essentially what you do when you save your character) - . The system may have to integrate with payment engines and credit card processing facilities provided by third parties. None of this stuff is graphical at all, it is all about pure data processing and distributed computing.

    Funnily enough, this architectural model actually coincides with what the Java people call 'Enterprise Applications' and there are incredible facilities in Java to implement this type of application. And the thing is, raw system performance is only part of the story in this type of application, scalability is perhaps more important (the ability to serve a large volume of clients), amny of the limitations of such systems are actually the I/O level of the application, trasmitting through sockets, writing to disk, communicating with the RDBMS. There are also server-specific implementations of the Java Hotspot JIT compiler, with optimisations for the particular tasks required of server applications and the best thing about this is that as the application runs it gets more and more optimised (and as the server is designed to run indefinitely ...) You can purchase or download an Open Source Application Server which will give you things like clustering and failover for free (meaning that you can leverage of this system to provide multiple 'shards' or servers or such things for your game).

    DISCLAIMER:
    I am a server-side Java programmer with a loathing of swing, so I amy be a bit biased.

    --
    technoshamanic resistance within hyper-transgressive ontology
  7. More Information by halfnerd · · Score: 2, Informative

    Check out this

    I read it just yesteday and must day that I'm impressed with all the information in this report. Certainly a good resource on this subject.

  8. Re:It's a hardware problem by p2sam · · Score: 4, Informative

    Nitpicking...

    As you mentioned Java3d, you must know that Java3d can either use software or Direct3D or OpenGL, therefore your assertion that Java can't manipulate hardware is only true in the sense that ANSI C can't manipulate hardware.

    Also see gl4java at http://www.jausoft.com/gl4java.html

  9. Sucess in Mobile games? by idries · · Score: 5, Insightful

    Java has already caught on as the dominant format for making games for mobile phones, but the language has yet to be widely used for PC-based games.

    Not so. Mobile games are still an evolving area, and J2ME is already dying out in favour of C++ SDK's for specific platforms. The limited kind of games that J2ME has given us are not products that people are willing to pay for.

    This is because *real* games need platform specific assets. Sounds that match the sound playback hardware, graphics at the right sizes and colour depths, models with the right LOD for the renderer etc.

    Once you're providing a platform specific set of assets, there's very little benefit in having platform independant code. Mobiles don't have alot of CPU or RAM, and if you're not going to have platform portability anyway, then there's really no point in using Java. You're much better off programming on the metal. Native phones like the SPV and the N-Gage already allow this, and offer C++ SDK's, which mobile game developers are using.

    SDK's like this are not available on phones without operating systems (because they don't have memory protection so you can't let 3rd party executables onto them, an issue neatly side-stepped by J2ME). However this problem will be overcome by implementations like BREW or by just adding memory protection. It just a matter of time.

    Having said all that, I now write PC games and I think that Java could have a bright future there. Not in games written entirely in Java, but with Hybrid games. Java will never compete for speed. It's a fact, live with it. But 90% of a games' CPU time is spent curring around 20% of the games' code (i.e. the renderer, routefinder etc.). If that 20% is written in C/C++/asm and some percentage (large)of the rest in Java, the speed issue will of little consequence.

    The real question here is why? C++ works very well thank you and the tools and API's required to create a hybrid game such as this are a real pain (when compared to just hitting F7 in VC++). No kind of marketing speak from Sun is going to make programmers go through that pain, just for the sake of 'using Java'. If the tool's were better and Sun put alot of effort into supporting this kind of deployment then game developers might well take it up. Not for platform independance, but for memory managment and the other *real* benefits of Java (simplified inheiretance, useful RTTI, serialisation etc.). That's were Java can be useful and that's what Sun should be talking about.

    Also, if you really want game developers to use your technology, it's got to work on X-Box and PS/2. FACT. So get to it Sun, you've got plenty to sort out before you start nagging us with your marketing hounds.

  10. it has been done ! by elrolas · · Score: 4, Interesting

    A couple of years back I played a full 3D game made in Java and using GL4Java to get hardware acceleration: Arkanae (google for it, the site is still there somewhere). It was based on a Java 3D engine named Opale.Soya, which sadly has now disappeared (the original developpers are now doing the same in Python).

    It really convinced me that real 3D games are not just a pipedream. You can really get quite impressive results! And so now a friend and I are working on our own Java 3D engine. It's been a great learning experience sofar (I can recommend it to all 3D newbies).

    Anyway, you could say I'm a believer! :-)

  11. Re:It's a hardware problem by the+eric+conspiracy · · Score: 2, Insightful

    You're right, Java can't compete with stuff like C++ for overall power.

    The problem with C++ is that it cost twice as much to develop the same program in it, and it is far more likely to have memory leaks, double frees, stack overflows and so forth when you are done. Clearly the correct solution is to go low level only when you need max performance through external libraries that are hand optimized mixtures of assembly/C.

  12. Sun: Put up or shut up by metamatic · · Score: 3, Insightful

    Show me three good games written in 100% Pure Java.

    As of today, I've only seen one decent application written in 100% Pure Java, and that's a text editor.

    My yardstick here is that the software has to be good enough that you'd never guess it was written in Java if you didn't know.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  13. The biggest problem I have with this... by mstorer3772 · · Score: 2, Informative

    ...is garbage collection.

    Unless they develop some new GC system that lets you give specific time slices for processing, you'll end up with the occasional random crater in your framerate.

    I notice a second or two's pause while using IntelliJ's IDEA (a java IDE built in java), when the GC system wakes up and pokes around to free up memory. This is on a DUAL 2.6ghz machine, fer crying out loud. Nothing against the IDE, I love it... lots of cool little features to make life easier.

    So even if you have the best 3d API in the world, sooner or later the GC is going to wake up and brutally maim your framerate. Nothing you can do. Most JVM's ignore explicit GC calls too (in my experience).

    So until someone comes up with a GC system that can play nicely with others ("here's 50ms, go to town"), 3d games in java strike me as a lost cause.

    I don' know... maybe someone could precache everything, and not release anything except between maps, so the GC never wakes up during actual game play. It still strikes me as a royal PITA, and an unnecessary memory hog.

    --
    Fooz Meister
  14. Addition to the above telegraph by Dolemite_the_Wiz · · Score: 2, Funny

    Dear Sun Microsystems STOP

    Please let us know STOP
    When you finally decide to stop scotch taping code within code STOP
    and write Java from the ground up STOP
    Finally, please make sure STOP
    that the new Java STOP
    does not have the built-in security STOP
    of swiss cheese STOP
    (full of holes) STOP
    Until then, please stop with these news releases STOP
    which only bump your stock price up one Penny (Canadian) for a day STOP
    and release a real language that isn't the STOP
    electronic form of molasses STOP

    Sincerely,

    ME

    Another customer who has to use another laggedy product from Sun. STOP

    --
    Save the World! Use a Quote!