Is java falling behind in game development?

In my case the issue wasn’t there until switching to Java 5. We tested 1.5.0_01, _03, and _04 and the problem appears to be in all of those. The nature of the issue made it slow to find.

Id be curious if its reproducible in 1.6 (mustang)

Sounds like you’re a little sensitive to this issue and personally I don’t care if you are or not, but I am not trying to be insulting or offensive about this so I apologize if you feel that way. But looking at the new games that are coming out with PS3 and XB360 and how game developers are going to take advantage of the multi-core processors by adding more multi-threading, gpgpu processing, etc. I still wonder if Java is up to speed. Maybe you’re right. I’m not saying you’re not. Like I said. This is just frank communication. I support the use of Java for gaming just like you. I just want to know that I have a fighting chance.

[quote]Edit: I take it back. There is one, and only one, way you could chnage the situation.
Write a killer AAA blockbuster hit title in Java.
One so good that Sony and Microsoft are both desperate to have it on their platform.
You do that and all the problems go away
[/quote]
This is a bit like the “who came first: the chicken or the egg” kind of situation, don’t you think?
Will some company (or group of indies) invest in writing a killer AAA title, hoping Sony, Microsoft and Nintendo are going to make java available on their platform?
Will Sony, Microsoft and Nintendo make java available on their platform, just in case someone would write a killer AAA title in java which they are dying to get on their platform?
I’m guessing the answer to both questions is “no”, leaving java in the current status quo.

The answer lies in looking at how the other guys bootstrapped it. Basically the owner of the technology pumped a ton of money into making sure they got their technology where they wanted it and that people used it. They also executed on their plans pretty quickly and even more importantly they got the hype machine running at full steam beforehand.

Without the bootstrapping from Sun you can more or less conclude it isn’t going to happen.

Cas :slight_smile:

This is a bit like the “who came first: the chicken or the egg” kind of situation, don’t you think?
[/quote]
(The egg came first. Whatever layed the egg was not a chicken, the egg contained the genetic mutation that separated the chicken from whatever it’s parents were.)

I think Chris is saying that the Killer Game(s) must be written for PC/Mac/Linux and be so popular that the console makers want it ported to their systems, thus giving them incentive to have a Java Runtime on their console.

I think the PC game market is still there. It seems to be able to evolve faster than the console market, since PCs capbilities change more frequently than console capabilities. So the end result is that the most “cutting edge” games should show up on a PC first anyway. E.g. Doom 3.

The GC activity is significantly different using the same options with Mustang b43.

check this out, I’ve been trying to put together a test case…
Here it is running on 1.5.0_03

C:\DevJava\BugReports>"c:\Program Files\Java\jre1.5.0_03\bin\java" -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps  -cp . JVMCrash
0.000: [GC 0.000: [ParNew: 3967K->0K(4032K), 0.0200582 secs] 3967K->1066K(16320K), 0.0205862 secs]
10.541: [GC 10.541: [ParNew: 3968K->0K(4032K), 0.0104868 secs] 5034K->1395K(16320K), 0.0109198 secs]
32.334: [GC 32.335: [ParNew: 3968K->0K(4032K), 0.0151047 secs] 5363K->1522K(16320K), 0.0155206 secs]
54.148: [GC 54.149: [ParNew: 3968K->0K(4032K), 0.0140430 secs] 5490K->1663K(16320K), 0.0145384 secs]
75.734: [GC 75.735: [ParNew: 3968K->0K(4032K), 0.0071965 secs] 5631K->1823K(16320K), 0.0077193 secs]
97.746: [GC 97.747: [ParNew: 3968K->0K(4032K), 0.0114971 secs] 5791K->1940K(16320K), 0.0119415 secs]
119.838: [GC 119.839: [ParNew: 3968K->0K(4032K), 0.0141531 secs] 5908K->2056K(16320K), 0.0146701 secs]
141.901: [GC 141.901: [ParNew: 3968K->0K(4032K), 0.0155667 secs] 6024K->2171K(16320K), 0.0161009 secs]
163.354: [GC 163.355: [ParNew: 3968K->0K(4032K), 0.0158057 secs] 6139K->2378K(16320K), 0.0163267 secs]

Here is the exact same code running on Mustang b43:

C:\DevJava\BugReports>java  -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps  -cp . JVMCrash
0.000: [GC 0.000: [ParNew: 3968K->0K(4032K), 0.0174371 secs] 3968K->953K(16320K), 0.0181594 secs]
28.058: [GC 28.058: [ParNew: 3968K->0K(4032K), 0.0151061 secs] 4921K->1110K(16320K), 0.0154193 secs]
69.326: [GC 69.327: [ParNew: 3968K->0K(4032K), 0.0135772 secs] 5078K->1113K(16320K), 0.0139347 secs]
110.623: [GC 110.624: [ParNew: 3968K->0K(4032K), 0.0148840 secs] 5081K->1114K(16320K), 0.0152321 secs]
151.814: [GC 151.814: [ParNew: 3968K->0K(4032K), 0.0131889 secs] 5082K->1115K(16320K), 0.0135931 secs]
193.205: [GC 193.206: [ParNew: 3968K->0K(4032K), 0.0138703 secs] 5083K->1117K(16320K), 0.0142879 secs]
234.612: [GC 234.613: [ParNew: 3968K->0K(4032K), 0.0150744 secs] 5085K->1118K(16320K), 0.0155725 secs]
273.818: [GC 273.819: [ParNew: 3968K->0K(4032K), 0.0131767 secs] 5086K->1120K(16320K), 0.0137323 secs]
312.053: [GC 312.054: [ParNew: 3968K->0K(4032K), 0.0141546 secs] 5088K->1122K(16320K), 0.0146340 secs]
350.398: [GC 350.398: [ParNew: 3968K->0K(4032K), 0.0151758 secs] 5090K->1123K(16320K), 0.0156526 secs]

Notice the frequency of the collections, and the rate at which the second set of numbers around the “->” grows.
This test generates no objects that should live longer than about one second. At least not in the test code itself. I think in the JRE code some long-lived objects are accumulatng… maybe some weak map or something?


(The egg came first. Whatever layed the egg was not a chicken, the egg contained the genetic mutation that separated the chicken from whatever it’s parents were.)

I think Chris is saying that the Killer Game(s) must be written for PC/Mac/Linux and be so popular that the console makers want it ported to their systems, thus giving them incentive to have a Java Runtime on their console.
[/quote]
Well it was me, not Chris, but spot on.

+1

Two questions and pardon my ignorance at reading this output but ilamost nevre loo katt he raw GC dump like this…

(1) What happens if you DONT specify concurrent GC but just use the dafault (which is what I always run with.)

(2) Are those last numbers the pause? And th first the time it staretd at? If so, I see a hit of les then 2/100ths of a second every 20 to 40 seconds. Why is this a problem? Am I misreading something?

[quote]I think the PC game market is still there. It seems to be able to evolve faster than the console market, since PCs capbilities change more frequently than console capabilities. So the end result is that the most “cutting edge” games should show up on a PC first anyway.
[/quote]
Good point, and sure the PC market is still there. But maybe one good reason those ‘Cutting Edge’ games were written in a language like C/C++ is because then they have a chance to be portable to consoles later? When I look at the shelves, I think AAA titles are a minority on PC’s compared to consoles even though PC’s are generally more capable.
Being both cutting edge and daring (e.g. dev. in java) is maybe a bit much to ask? As far as I can see, ‘daring’ is still a word investors don’t like very much.

[quote] E.g. Doom 3.
[/quote]
I see your point, but Doom3 is a bad example. It was going to sell in huge numbers anyway even though it would be PC only at first, having the ID/John Carmack names on their side. So there was virtually no risk involved.
Using java will always be an added risk of losing market potential as long as there’s no java on consoles.

Good point, and sure the PC market is still there. But maybe one good reason those ‘Cutting Edge’ games were written in a language like C/C++ is because then they have a chance to be portable to consoles later?
[/quote]
I really don’t think so. Generally porting something cutting edge to a console requries pretty ,ajor rewriting since up til now the graphics hadrware has been so unique on the consoles.

Rather, I think they are coded in C/C++ because almost everything is still. And for the same reasons-- its a known quanitity. It takes a brave person to try new tools on a game project, especially one that is also trying to cut new technical ground in other areas.

Hmm. i dont see that at all. I see something else-- the accessability of the PC ADDS a flood of lower grade titles to the shelves. Take those away so they dont distract yo uand I thik the total number of AAA titles on any one paltform, PC or Console, is about the same.

Take awy from Consoles the numebr of AAA title that are ports of older PC AAA titles and I thin kthe PC proibably pulls out ahead by a tiny bit (but not a lot today. This was more true in the past.)

HOWEVER to get to the nub of SWP’s point, look at where the new ground is being cut, and youll generally see it on the PC first.

And here I agree. It IS a lot to ask. But thats what being on the cutting edge is about. The risk adverse dont do it.

I see your point, but Doom3 is a bad example. It was going to sell in huge numbers anyway even though it would be PC only at first, having the ID/John Carmack names on their side. So there was virtually no risk involved.
Using java will always be an added risk of losing market potential as long as there’s no java on consoles.
[/quote]
No, your missing the other side of the equation.
If its a big enough hit on the PC it will force there to be Java on consoles.

To use your own example, if DOOM3 was in Java, do you think we’d have Java on
all the consoles today? I sure as hell do.

The question is, are you willing to bet on being that big a hit?

[quote]I really don’t think so. Generally porting something cutting edge to a console requries pretty ,ajor rewriting since up til now the graphics hadrware has been so unique on the consoles.
[/quote]
Sure, but at least it can be done.

[quote]Rather, I think they are coded in C/C++ because almost everything is still. And for the same reasons-- its a known quanitity. It takes a brave person to try new tools on a game project, especially one that is also trying to cut new technical ground in other areas.
[/quote]
Yes I agree it’s probably the most important reason. But don’t you think portability is still a consideration to stick with C++ and not go for java?

(Move GC thread comments back to that other thread!)

Cas :slight_smile:

No, I’m not missing the point, I’m just adding to the discussion. Maybe just to get my own views clear :slight_smile:

I agree 100% with you here, but I think it was a bad example because there was no point for Doom3 to be written in java. There was no risk in Doom3 because they are no new players and they had a huge codebase at their disposal, Doom3 being just an incremental step in the ID FPS range (not denying it is rather cutting edge).
I’d rather take Farcry as an example. Or Half-Life 2 (Because afaik, they created a completely new engine anyway, so java could have made sense there).

Well it really depends on how muich of that cdoe was brand new v. just an incremental improvement.

I agree that having a workable existing codebase lessens your advantage in changing any technologies
at all because there is a cost in codebase loss. At some point though you hit an inflection point anyway
wher you DO have to throw out a large portion of your codebase. Thsoe are good times to evaluate
new technologies.

Makes sense to me, and the same logic still applies. IF Half-Life2 had been a Java program then there is no doubt Sony would do everything in their power to make sure there was a Java VM available to run it.

I think it depends on the project.

If I were doing a game today where I had idnetified one of my primary targets as a console then yes, the irionic
thing today is that in that case Java loses in the portability area.

If I were doing a game whre my primary target was the desktop then I dont think I’d worry about this. If my game is a big enough hit to warrant the costs of targeting a console as an after-thought then I’d assume I’ll have the leverage to demand Java.

The big thing to remember here is that, unelss I design up front for the limits and peculiaritites of both console and PC, IMO the work of doing such a port wil be enormous no matter what. Its going to likely mean major redesign of both the graphics system and the user interface so its not going to happen unless Im a mega-hit.

Frankly, if all else failed, a port could be a completely new graphics engine in C for the platofrm, and a PD Java interpreter for the game logic. I dont think doing such an after-thought port of a C program will be any less work.

This is my experience in the industry, YMMV.

I just wanted to throw in an article from next genration, citing Valve boss Gabe Newell on porting code to the next generation of consolses (xbox360, ps3) with a multicore processor architecture:

[quote]Technologically, I think every game developer should be terrified of the next generation of processors. Your existing code, you can just throw it away. It’s not going to be helpful in creating next generation game titles
[/quote]
IMHO this is another good reason for relying on sophisticated VMs / Runtimes, which let game developers focus new algorithms and game concepts instead of bugging with each different hardware architecture.

Yeah, the next generation your gonna have 3 choices…

(1) Use a VM built by rocket scientists

(2) Use a game engine built by rocket scientists

(3) Go back to school for an intensive course in rocket science.

That being said, ofcourse Valve has a vested interest in people going to engines. Nonetheless I dont think hes being
totally phony.

Its an opportunity for the right tehnology, theres no doubt about that. The question that stands is when will one of those parties with a vested interest in making the VM technology happen, make it happen.

And you don’t know how badly I wish I had an answer for all of you to that question.