Garbage Collection (programming java C Style)

I didn’t take your post as an attack, I simply didn’t understand it as I see that there is quite a lot of knowledge readily available and AFAIC this thread mostly proved a commonly known best practice regarding GC. I just didn’t understand why you see this as a sign of immaturity.
There are a number of good books for games (I only read Andrew Davison’s book but though it was quite good, but I hear there are more good ones), there is Jeff’s Performance Tuning book (a bit outdated, but still very useful), there is this site, and there’s probably a lot more available too.

But, like I said, compared to C++, of course java is not as mature for gaming. As I see it, this is to be expected, and there’s more to it than just C++ vs. java: The fact that VM technology is so rapidly evolving, some ‘best practices’ are bound to change a lot. For example, object pooling used to be a common good practice to avoid GC stutter. Not so anymore. On the old MS VM, inlining code manually or otherwise uglyfying your code (like using fixed point calculations instead of the now quite fast floats) was needed to squeeze performance out of it. On recent VM’s this can even make performance worse. And let’s not even start about J2ME, where things are very different.
Maybe this confusion is where your feeling of immaturity comes from. If so, you do have a point. This community is probably where you will learn the most because, as Cas said, many experienced people come here and even the Sun folks come here to keep us updated and clear up confusion.

And you’ll be happy to learn that flame wars don’t happen here often. :slight_smile:

There’s very very little available in printed form right now but for three good reasons:

  1. It only became feasible to write high performance graphics bindings with the advent of Java 1.4 (not 1.3)

  2. Only very recently did LWJGL and JOGL arrive on the scene (LWJGL not long after Java 1.4 was released, JOGL about a year later) and both APIs are still more or less in alpha, meaning that they change in ways that tend to break existing code from time to time. Not a good point to start writing a book from!

  3. Nobody’s really cared that much until very, very recently, now that Java is both fast and capable.

Hanging around in here you are probably going to be at the cutting edge of Java games development and after a while as qualified to write that book yourself as any other. My best advice is to write a game in Java and find out about it all for yourself :slight_smile:

Cas :slight_smile:

[quote=“erikd,post:21,topic:24510”]
I think we should set up a special topic and put Jeff, Blah^3 and Mithrandir in there along with twelve spurious “facts” about this and that and see how big the fireball gets. I’ll moderate it by fanning the flames ;D

Cas :slight_smile:

He confesses his guilt…

Yes. I got paid money to write for game programming gems books. Surprisingly enough, they couldnt care less about java, although I got htem to put the JDK on the GPG CD :).

Untli the demand for java games dev books is proven, most publishers refuse to pbulish for it. Killer java game programming only got off the ground after being free on a website for many months, IIRC.

If you’d like to start one, you can create one as part of JGF (link below). Iv’e been long wondering how best to present info on such things - FAQ format, article format, what?

Unfortunately I already have to much in my plate, time management is a skill that i still do not master, i work 18h a day (like most people in the industry, sometimes more) there has to be a smarter way to work (like Dilbert strips use to say: work smarter not harder) i for one have not found that path.

In terms of format i like to have article format with some simple examples and if possible benchmarks, something in the lines of Dr. Dobbs articles (theory first (including historical background if possible), then some code listings and sometimes benchmarks showing the difference between implementations).

No.

I can over simplify for you how the GC works, but if you really want to understand it, you need to read at least one master’s thesis.
(Thats what I did, awhiel ago. It was the thesis of our primary GC guy at Sun. I understood about half of it.)

Fast GC is really a rocket-science subject.

Is there any publication (or website) dedicated to java game programming (tricks/gems)?

As others have said, this forum is probably the best colelctio nof that you will find.

Part of the problem is that various tricks that made sense in the past, have becoem nonsensical or even destructive as VM technology has improved. Even the best book you can fidn is loikely to have somewhat old advice. That beign said, the book by the guys at Full Sail isnt bad as far as it goes. Ther may be a few others around thata re both recent and authoratative enough to be useful.

But the best game programmers seldom have the time to write bnooks or white papers. Its the nature of the business. They are already incredibly over-loaded just writing their games.

If you havent read Josh Bloch’s Effective Java yet, do.

Thanks for the tips Jeff,

Like I wrote in a previous post, other areas of java programming are already covered by best practice like Effective java book :slight_smile: in a couple of years maybe we will se a java game gems series :wink:

I just skimmed the Effective java book have to read it again and see what I can extract that applies to the game programming field.

As others have pointed out, the Java game space is still fairly rpaidly evovling.

The other thing to remember is that game programming is not the same as enterprise programming.

In enterprise programming, the problems are all well known and by and alrge old, aand new techniques emerge slowly if at all.

The whole point of game development is to “go where no-one has gone before” and ahdrware and software is constntly evolving.

For this reason I wouldn’t use the term “best-practices” for the Game Gems series. “Particulalrly useful approaches to point problems people have used in the past that may or may not apply directly today” would be a much better description.