Java as a Professional Game Language

Ok… the more research i do and the more i code… the more i realize that some of the post are not only right but are missing the next point… let me explain.

Java may or may not be slower than c++ under different conditions. The point made in these forums is that the difference does not matter. More often than not is is GPU processing not CPU processing that bottlenecks the process… Ok … so we load our models into memmory prior to displaying them … i see no issues with that.

So hear the next point… what are we going to do … that will make java stand out as the next big thing… What features can we enhance, exploit or simply take advantage of that will say… ya that game was in java cause no other gamming language can do that…

It does not have to be something huge … just impactful. ie… lets say we wrap our game perfectly as a webstart… great go to the developer website… press a button play the latest game… its not a big thing… but it would be something…

i leave this thread for comments and further ideas.

While I haven’t done any formal market research on the subject, I believe that the Java brand has become associated with the following attributes (to a varying extent): cross platform, low performance, productivity, stability, and good for online applications.

Now, I’m not saying that all of them are true, but I do think they are out there in people’s minds and I know that people have a much easier time making judgements that confirm their own opinions than ones that force them to change. If people judged C++ applications in the same way as Java, then Star Wars Galaxies’s tightly network-coupled GUI would convince them that C++ is low performing, just as early Swing convinced many that Java is low performing. However, C++ is not associated with low performance in people’s minds so they don’t look to confirm that suspicion.

With that in mind, I think Sun should push the productivity aspect of Java. However, that requires that Java can deliver in that area, something that is far from certain for the game industry where Java developers currently have low-level OpenGL bindings while C++ developers have fully-featured engines like RenderWare with complete support for the content pipeline.

Anyway, I believe Xith3D is a good first step in a direction that will make Java really productive for games and that Sun should push that or other productivity solutions they have planned. If productivity pushes Java into the market, the performance stigma will eventually fade too (just as it did for C++).

Java has a LONG marketing road to travel before it becomes commonly accepted as a game language for all but a fringe group of software developers. Its really all about marketing. You cant sit back and say ‘I have the best BLAH’ and people will come to me for it. If noone knows that you have blah, or that its the best - you can’t be upset if they don’t beat a path to your door.

The last major (not J2ME) development to hit Java was the Game Developer Magazine articles on Dirty Java.

Apart from applets, webstart and potential instant portability, I don’t think there’s something you can do with java that you can’t with C++.
For me, the best thing about java is that you can write your games easier and faster, so cheaper than in C++, especially when you target multiple platforms. In addition, there are some great, free IDE’s available (I prefer Eclipse over Visual Studio any day for example) which helps in that respect.

Right now, I suppose the best thing that could happen to java is proper support on consoles (and getting the consoles to support OpenGL while being at it).
For games, this the lack of support on consoles is a pretty major issue and I don’t suspect this will be solved any time soon. If you target PCs and consoles which is very common when you write a game, java is simply not an option.

I think java would excel in a MMOG where you could have your server software and client software all in java. Java has already proven itself as server side technology, and the secure and highly portable properties of java make it possible to create clients for any kind of desktop, palmtop and cell phones relatively easy (compared to C/C++ anyway).

But this is all old news. Java’s strengths compared to C++ are pretty well defined and pretty well known, it’s just that C++ has gained a lot more momentum in it’s long period of existence and that you can use it on every platform.

(BTW. you started this thread in the wrong topic)

Erik

I concur with Erik here. Currently there is no clever bit of technology in Java which is compellingly better than doing your game in C++.

In development you’ve got these hurdles if you want to convince people:

[]State of the art garbage collection is possible in C++.
[
]Java code may look simpler to start out with but when you’ve had to deal with Buffers and don’t have static import or templates it soon starts looking worse than C++.
[*]Code development is only a small fraction of the budget of a big game. The smaller the game and team, the larger the fraction becomes – and the more likely you should have used BlitzBasic instead.

Even at the point of deployment you’re still facing these issues:

[]Performance. Yes, it’s still slower than C++ when push comes to shove. In some situations it’s not slower, but if you find yourself in a situation where it’s only 50% of the speed and this becomes the bottleneck… you start to run out of options, and developers don’t like running out of options.
[
]Webstart is ugly, closed and not customizable.
[]Dynamic mods have been working as .dlls in C for years.
[
]Cross-platform compilation isn’t as hard as everyone would like to think.
[]J2SE is still too big to deploy on Windows and Linux.
[
]Java code remains trivial to decompile and hack.
[]No console support. And likely when it arrives it’ll be slow as a slow thing and therefore useless. Java is, in fact, one of the most portable but least ported platforms around.
[
]Bytecode is surprisingly huge. In fact it seems to be as large as compiled C++ code for a given task.

So what’ve you got left that’s a killer feature that outweighs all this?

Cas :slight_smile:

[quote]state of the art garbage collection is possible in C++.
[/quote]
Can you point me to any C++ gc library which implements compacting collection ? Or at least one which is truly precise ? So far, I have seen only conservative, non-copying gcs for C++, which hardly fits ‘state-of-art’ for me.

I do not claim that java is better than C++ for games - I just want to get record on C++ gc straight (or learn about some uber-gc library out there).

Edit:
I have found some ‘mostly-copying’ gc for C++ (dated 93, I doubt if it will work with current compilers…). Unfortunately, mostly-copying means that you cannot copy all and you are still left with fragmented memory in some places.

Well observed Cas and very true!! Who was that guy who released a Java based action game recently?? :slight_smile:

I think Erik mentioned it:

[quote]Apart from applets, webstart and potential instant portability, I don’t think there’s something you can do with java that you can’t with C++.
[/quote]
So I’m not getting tired advocating Java gaming to focus on that kind of things! With Java, it’s by far more easy to deliver new code and content each day! That’s a REAL benefit over traditional solutions.

Take FlyingGuns as an example (or as a prototype for an example :slight_smile: ). We can develop while people are playing and thereby react on what they want.

This really is a special class of game you barely find in the mainstream market: low resource, living content, online-aware.
Add personalization, uploadable user content and such.

Try to exploit whats different in Java and don’t imitate the mainstream.

quoteFor me, the best thing about java is that you can write your games easier and faster, so cheaper than in C++, especially when you target multiple platforms.
[/quote]
Hi. I agree with most things you said. These are the reasons why I try to look into “Java games” now.

[quote]If you target PCs and consoles which is very common when you write a game, java is simply not an option.
[/quote]
In my experience many smaller game companies can’t go for the console market. The last two years I’ve been working for a small games company and we just finished our full price game. However the console market has never been an option for us. Unfortunately.
First it’s pretty expensive to buy a full development kit for, say, PS2. Second you need the resources (money and men) to port it over which we couldn’t - no free men, no free money for such a thing. Third they (Sony, M$, …) take a very close look at some finished levels of your game and if it doesn’t please them they don’t let you go. (Nota bene: this doesn’t mean automatically your game wasn’t good. For example on the Xbox M$ doesn’t allow serveral game genres to be published because they don’t want to compete with the PC in these sectors, etc).

The competition on the game market is pretty hard - especially for smaller companies who don’t have big money in the back. The big publishers (EA, M$, Infrogames/Ubi) do minimize their risk and say to you: come with a (nearly) finished game and maybe we’ll have a look at it. Now go to your bank and tell this to them.

We really have been very busy to “just” finish the PC version and even needed to swap publisher inmid of the game because the first one got bought off (and it’s been not a too small one).

Maybe there will be a Mac version one day, however I doubt it.

quote
[/quote]
I agree with you on several points. :slight_smile: Some I don’t. :slight_smile:

[quote][*]Java code may look simpler to start out with but when you’ve had to deal with Buffers and don’t have static import or templates it soon starts looking worse than C++.
[/quote]
Aren’t templates (or at least type safe collections) coming with Java 1.5 “real soon now” ? :slight_smile: This is one of the few points I really like at C++. :wink:

[quote][*]Code development is only a small fraction of the budget of a big game.
[/quote]
You mean compared to graphics, sound, and … management? From my experience a full price game does have a quite big code base and this doesn’t mean a small fraction of the budget. For smaller game companies there’s no “public relations management”, it mainly consists of developers and artists and one or two bosses. :wink:

[quote][*]Cross-platform compilation isn’t as hard as everyone would like to think.
[/quote]
In C++ it is. Of course it depends on your team. However try to get C++ devlopers today who aren’t M$ infested. Nearly impossible. We had a hard job to tell our developer colleagues NOT to use Win32-API stuff but to use standard ISO C++, the (cool) STL and our in-house (portable) base lib.
Unfortunately, due to massive time pressure you “forget” about such things occasionally and so, in the end, our code isn’t portable. :frowning:

[quote][*]J2SE is still too big to deploy on Windows and Linux.
[/quote]
When you talk about smaller games. For full price games this doesn’t matter at all because you’ll deploy them on CDs oder DVDs.

[quote][*]Bytecode is surprisingly huge. In fact it seems to be as large as compiled C++ code for a given task.
[/quote]
Who cares? Compared to the sound and graphics the Code size doesn’t matter - even for small games.

haha, try to make a game developer use MFC!

The C++ incompatibilities aren’t really a problem, bc. normal games coders tend to write straight code anyway. :slight_smile:

The main point is that the most important base libs like OpenGL are available on the all platforms.

I care. Half the deployment size of FlyingGuns goes to classes. And it isn’t really that much code.

Ok, not for the game’s GUI itself (which used our own lib) but for tools of all kind. On the other hand it’s possible to use the (dumb) MFC for in-game GUI.

[quote]The main point is that the most important base libs like OpenGL are available on the all platforms.
[/quote]
OpenGL and OpenAL. However 8 of 10 of our developers didn’t know anything about OpenGL/OpenAL but just M$ DirectX. So, if a 3d title is about to be produced guess what the bosses will hear which 3d API the company shall use?

[quote]I care. Half the deployment size of FlyingGuns goes to classes. And it isn’t really that much code.
[/quote]
Cas mentioned that Java Byte code is about the size of C++. So where’s the problem? The full Exe of my mentioned CD game is about 5 MBytes (unzipped. Zipped it’s 2 MB). 5 MB compared to 645 MB of data. This is a full price game. :slight_smile: If a game is middle range, the Exe goes smaller and so should the Java Byte Code go… :slight_smile:

But thats OK. Thats a concious decision to be on the MS platform. There’s nothing wrong about that. There is barely a market beside of that.

But at runtime? I haven’t used C/C++ in years so it’s a real question.

What I want to point out though is that dynamically loaded classes in Java are extremely powerful and are one of the features that make my “real” job possible.

It’s hard to come up with examples in games that don’t feel contrived but imagine adding an object to a distributed game (online) and that object while of course implementing a known interface adds completely new functionality. Without anyone installing anything at all - the classloading mechanism handles this all. We all know Java can do this, we just need to find a way to use it in games.

Most people are saying something like “use Java’s strengths” and I wholeheartedly agree.

Bill

I’ve always been an advocat (in the game team) to use standard C++, standard APIs etc, and not to bind ourselves to the MS C++ and MS APIs, because usually it’s not neccessary, no pro at all and most importantly it doesn’t make you free in your further decisions.

When Cas mentioned that C++ (in the games industry) is portable I said yes, theoretically. In practice this isn’t the case because 8 of 10 developers say: “MS rules the world, we want MS C++, MS DirectX, etc. Go away with your silly ISO C++, OpenGL/AL, Javadoc/Doxygen, CVS, etc. We use MS strings, MS help, Sourcesafe, blabla.”
This is becoming worse with every year people study at university and mostly learn how to use Visual C++ there instead of clean programming languages. There’s a nice interview on similar topics with Mr. Kernighan, one of the guys who invented C and AWK. http://www.cs.cmu.edu/~mihaib/kernighan-interview/

You said some posts before: [quote]The C++ incompatibilities aren’t really a problem, bc. normal games coders tend to write straight code anyway. :slight_smile:

The main point is that the most important base libs like OpenGL are available on the all platforms.
[/quote]
From my experience I’ve to disagree - unfortunatley. Because today “new developers” are bound to MS, don’t know OpenGL, let alone Iso C++ (or Java :-).
So: how “most important” are “base libs” if nobody uses them? Aside the - excellent - Quake engine I couldn’t even name a single PC game which uses OpenGL. :frowning:
In short: No portability with C++.

For professional games development, this can be a very valuable point of view!

For games, it might in many cases be favourable to just use DirectX bc. of its strengths. Why sacrifice the power of DX just for portability, if portability doesn’t add any value to the game?

OTOH, if portability is desired, it is very well possible to do it in C++. Still it would be possible to use DX - if properly abstracted! This is not too difficult. Even in C++.

[quote]In short: No portability with C++.
[/quote]
There’s a difference between ‘not being able to be portable’ and ‘don’t have the desire to be portable’!

I don’t want to advocate C++ here (wrong forum), just want to make clear that the enemy is really STRONG!

im really surprise i have not seen any reference to it… but the game Vampire the Masquerade was 90% java based. It did use some native calls… but it was essentially a java game… It rocked! and you had no clue that it was written in java. Best of all… a major producer distributed it… Activision.

[quote]im really surprise i have not seen any reference to it… but the game Vampire the Masquerade was 90% java based. It did use some native calls… but it was essentially a java game… It rocked! and you had no clue that it was written in java. Best of all… a major producer distributed it… Activision.
[/quote]
And the box actually carried the Java Powered logo, and STILL people did not realise that Java played an important role. :frowning:

-Chris

P.S. Here is a link to me holding up the Vampire box during a CES 2001 interview: http://java.sun.com/features/2001/01/ces.html

Common rule of marketing is that people have to hear something 20 times before they truly understand what you’re saying. The problem with that one case, is that its one case. Until people start hearing about 10,15,20 cases of commercial Java games - it will never gain the momentum it needs to get out of the fringe state.

However that GDM article on Dirty Java started a huge push for people wanting to use Java as a scripting language as the author of the article will attest. But then nothing new from the Java side, people started writing scripting engines in C++ and the buzz on Java went away. As an MBA student I have come to understand the need to generate and SUSTAIN buzz on a product - something that Sun and Java have just failed miserably at.