why isnt java been used to write major game titles?

Discussion in 'Programming & Software Development' started by MadOnion87, Mar 30, 2006.

  1. theexec

    theexec Member

    Joined:
    Dec 28, 2005
    Messages:
    50
    I have a very strong (unfair) bias against Java.

    Java is slow. (not as much of an issue now as a few years ago)
    When a java app is horrendously slow, it is partially due to many (excessive) layers of abstraction ppl use in OOP.

    Java is a memory hog. (similar to above)

    Automatic garbage collection sux.

    I have really tried to avoid the langauge in the past few years, even tho a lot of my uni courses require me to use it. I had to use it a few days ago after 1+ years of absence, and I was shocked to discover Java doesn't have typedefs, #defines or enum. I was disgusted that I had to create many classes instead.

    I have not built any large Java apps, but I did some casual work in a company a few years ago testing a large Java app.. and OMFG.. it took like 30 minutes to startup...
     
  2. Grit

    Grit Member

    Joined:
    Jun 11, 2003
    Messages:
    361
    Location:
    Bris Vegas
    Or at least you could, if the X360's processor knew what to do with x86 instructions (it a custom PowerPC chip). I do agree though - I don't see consoles running a VM anytime soon for one reason: because console hardware is on the market for 5+ years with the same hardware, towards the end of the system's life, programmers need to optimise heavilly to make games that look as good as what they used to. The best example of this is the PS2. That hardware is almost 7(?) years old, yet developers are still able to produce incredibly pretty things on it.

    However, I think there certainly is a place for VMs in games on the PC. Independant developers could make a perfectly fine RTS in a shorter period of time in a managed environment like Java3D of managed DirectX.

    I have no problems with Azureus, NetBeans Eclipse. Azureus is probably the worst of that bunch too. Thing is, its easy to to write slow apps in any language and anyone here could rattle off heaps of native compiled apps that suffer from the developers lacking design and coding skills.

    Someone mentioned before that some Sun servers had hardware to accelerate Java applications. Sun did produce two lines of chips (PicoJava and MicroJava) that executed Java byte code. However, they flopped so much that they never produced their high-end product called SomethingJava (well, not actually called that, but you get the idea). To the best of my knowledge, no Sparc actaully has Java accelleration in them, but you can bet your bottom dollar that Java apps running on Solaris 10 on massively parallel Sun hardware perform extremely well. Azul Systems do sell extremely expensive systems based on their on processor design (up to 24 cores, from memory) that can execute native Java byte code. Being a new company though, it remains to be seen if they can successfully cater to a niche that may not even exist.

    -Grit.
     
  3. OP
    OP
    MadOnion87

    MadOnion87 Member

    Joined:
    Jul 10, 2002
    Messages:
    3,232
    Location:
    Old Trafford, Manchester
    is netbeans written in java?
    if it is then it does feel a bit sluggish
     
  4. rtscts

    rtscts Member

    Joined:
    Jun 28, 2001
    Messages:
    2,946
    Location:
    Sydney
    Obviously I'm hardly alone in this experience.

    It's claimed that Java can be "almost as fast" as native code, yet it is rarely anything close to it, even if the claim is completely true. Why? There must be some reason. Whatever that reason, do you really want that over your head as well when you're already investing millions into your game's development, with no guarantees of success?

    Remember, we're talking about a market very sensitive to mere milliseconds of latency and frames per second, and in which most games are "failures."
     
    Last edited: Apr 2, 2006
  5. MetalSkin

    MetalSkin Member

    Joined:
    Sep 24, 2002
    Messages:
    856
    Location:
    Brisbane, Australia
    That is fine saying that for an FPS, but RTS's and puzzle games are not as sensitive to performance, you dont try and get 60fps for a puzzle or rts game. Some people think that FPS's and car racing style games are the only games, however there is a big market out there for RTS's and puzzle games. I would admit that RTS's are dying off, just dont see as many of them as i used to, same goes for empire/city building games. Puzzle games however are on the increase, specialy in the female market.

    So based on that I would say that I see a future for java based games. Just like java based games are big on mobiles and that convergence will see a melding of different devices which will increase the advantage of java based development.

    No one so far commented on the above points I have raised so far (more than once), every one seems fixated on intense graphical experiances like Doom, Quake or Unreal. Anyone have any comments to make about my observations about convergance of hardware features with mobile, portable gaming and portable computing solutions? anyone have any comments I have made about the nature of the games and what requirements they have?
     
  6. Ze.

    Ze. Member

    Joined:
    Sep 13, 2003
    Messages:
    7,871
    Location:
    Newcastle, NSW
    You've gotta know a few tricks with swing to be able to get performance out of it. The sad fact is that there a lot of programmers out there that can't handle threads and concurrent programming.
     
  7. OP
    OP
    MadOnion87

    MadOnion87 Member

    Joined:
    Jul 10, 2002
    Messages:
    3,232
    Location:
    Old Trafford, Manchester
    rts is kinda dying coz every rts feels the same
    but if you look at say aoe3 the graphics isnt that bad, needs a decent comp to run it too
     
  8. Daemon

    Daemon Member

    Joined:
    Jun 27, 2001
    Messages:
    5,471
    Location:
    qld.au
    Java / .NET will never be as quick as a C/C++ application, but you're talking about a law of diminishing returns here. With all processors in the multiple Ghz ranges now there's a lot of extra CPU grunt spare to use anyway.

    What I normally see is a Java GUI but still using C / C++ in the background to do any time sensitive or cpu intensive work. Using .NET and Java like this is quite powerful, as it allows for rapid development.

    Yes your Java interface isn't as quick, but it does allow for quicker development (and hence lower costs / quicker turnaround).

    I still think they can do better, using more of the native toolkits makes a big difference but it can be much better. Even using Mono and GTK for a Windows application has a much more responsive "feel" and it's JIT based.
     
  9. rtscts

    rtscts Member

    Joined:
    Jun 28, 2001
    Messages:
    2,946
    Location:
    Sydney
    GC and OO would probably have an impact on unit limitations.

    Mobile phone games are 15 years behind cutting edge, they're hardly indicative of the next generation of gaming. Portable units just don't have much processing power to waste on either the game nor the JVM. Unless you're predicting a renaissance comprised of cheesy arcade/puzzle games comparable to those from the late 80s/early 90s era and the downfall of Flash in that market.
     
  10. bugayev

    bugayev Whammy!

    Joined:
    May 15, 2003
    Messages:
    4,093
    Location:
    Melbourne
    Don't take your bias against Object-Oriented Programming out on Java!

    No typedef - its OO, it doesn't need it!

    No enum - http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html would seeem to disagree with you.


    You can't compare C programming to Java programming. The two are completely seperate beasts and are for two completely seperate tasks. A well-written Java program will be broken up into a set of classes, each performing a different business function, with properly designed interactions. This will not cause any performance hit (unless OO is taken to the nth degree and *everything* becomes an object).

    It sounds as if the last time you touched Java was 1.3 or ealier days - the language and VM have improved dramatically since then and I suggest you try again rather than spreading unwarranted claims because Java doesn't have features of one specific language (It's kind of like saying "Oh no, Ford don't make an SS therefore they don't have a performance sedan").
     
  11. HumbleBum

    HumbleBum Member

    Joined:
    Feb 3, 2002
    Messages:
    16,771
    Location:
    United States
    i use a program at work where the front end is written in java.. its soooo bloddy slow its pointless..

    :thumbdn:
     
  12. Luke212

    Luke212 Member

    Joined:
    Feb 26, 2003
    Messages:
    10,041
    Location:
    Sydney
    lol

    From www.newstoyou.com:

    There is a huge conspiracy in university, where existing programmers have devised a cunning plan to keep themselves in the job by teaching java in universities - thereby eliminating the risk of graduates having skills to compete in the workplace.
     
  13. MetalSkin

    MetalSkin Member

    Joined:
    Sep 24, 2002
    Messages:
    856
    Location:
    Brisbane, Australia
    As we can clearly see from the mobile phone market, the ability to write once run anywhere has massive advantages, specialy when dealing with hardware that can vary two a large degree between different vendors, makes and models. This is the key reason why java has taken off on the mobile phone market. It is designed around the concept of different spec's for different hardware and how to manage such an environment.

    Obviously a native written app for each OS and each handheld would increase performance, but when you have so many different spec'd units then thew cost of taking such an approach would be far too expensive.

    Latest figures for mobile phone statuation is incredible. And the statuation is a lot higher than PC's, Game Consoles and the like. The ability to charge a monthly fee for the use of games, the ability of telco's and the hardware manufacturer to make money from the games as well means there is a big push in this area to adapt and advance the abilities. I'm sure the revenue doesn't approach the level of the console market, but at least the hardware vendor doesn't depend on game sales to turn a profit.

    To dismis the mobile phone/portable computer market for games I beleive is very shortsighted... the ability to make money with low risk will always lead the area for consumer development.
     
  14. Grit

    Grit Member

    Joined:
    Jun 11, 2003
    Messages:
    361
    Location:
    Bris Vegas
    I thought I wrote something last night regarding the fact that stratergy and puzzle games should be able to be written in Java with no impact, MetalSkin, but I obviously did my famous trick of nit hitting the send button :) I agree with you though. Hell, even MMORPGs could be written in Java - what's another millisecond or two going to matter when you're already pinging 500ms?

    I remember reading somewhere that there are something like 700 000 000 (yes, 700 million) Java enabled mobile phones out there, making it the largest software platform in the world to target. DIsmissing Java for games on that front alone is a mistake.

    -Grit.
     
  15. theexec

    theexec Member

    Joined:
    Dec 28, 2005
    Messages:
    50
    i think it said on john carmack's blog that platform independentness of java for mobile phone games is pretty crappy..

    Java is so slow, a lot of the games gotta have hundred + versions optimised for specific phones
     
  16. fox1

    fox1 Member

    Joined:
    Jun 28, 2001
    Messages:
    3,086
    Location:
    Brisbane
    Aye, I think this is generally known, its just that he was one of the 1st big names to actually say it.
     
  17. foxmulder881

    foxmulder881 Member

    Joined:
    Nov 17, 2004
    Messages:
    5,884
    Location:
    Gold Coast, QLD OS:Linux
    Not to pick on anyone in particular, but really, that statement should be in the newbie forum. Have I made my point?!? Silly question really.
     
  18. akashra

    akashra Member

    Joined:
    Apr 25, 2003
    Messages:
    3,910
    Location:
    Melbourne, AU
    Java is usually identically as fast as native code when it comes to primitive operations, however the memory management related with dealing with references (as opposed to pointers which are more common in, say, C), and and having them managed, is the slow part. Java method calls are reasonable fast after retrieving the object.

    The fastest language around still remains Delphi, though only very slightly. If game developers really wanted those few extra percent of CPU cycles, they could go and write all their stuff with Borland's Delphi compiler - however the language syntax makes writing applications slightly slower and more difficult/less managable, which combined with the lack of a difference in language syntax to the APIs they're often working with is largely why C and C++ have remained the most popular choice (aside from the obvious speed concerns).


    Now on the other hand, if your games were running on a Solaris box, you would most certainly want to write them in Java :)

    As already said in another comment/reply, Java, desipte its intent to be, is nowhere near close to "write once run anywhere", especially for mobile phones. Motorola have tried to put forward a spec to get around this very recently, however there's no doubt whatsoever that merely because Motorola are the ones who have started the initiative, SonyEricsson and Nokia will inevitably slam it as being crap, just like ATI did to nVidia with MXM.
     
  19. Grit

    Grit Member

    Joined:
    Jun 11, 2003
    Messages:
    361
    Location:
    Bris Vegas
    akashra - Good point that most game developers don't do half the things they could to get the most performance out of a game, hence somewhat deflating the "But it's not native code" argument.

    That being said, until today, this thread had been dead for over a month, so if people are going to revive it, please make sure you've read all the previous posts first (just a general comment, not to anyone in particular).

    EDIT: In hindsight, I love the selection of "bf2 or aoe3" as the two example games - potentially two of the most underperforming (and probably worst written) games I've played in a long time. :lol:

    -Grit.
     
    Last edited: May 20, 2006
  20. MetalSkin

    MetalSkin Member

    Joined:
    Sep 24, 2002
    Messages:
    856
    Location:
    Brisbane, Australia

Share This Page

Advertisement: