Greets, all.
I promise to you all that in the next few months I will be very much more active… no secret I’m writing a game, but I prefer to wait before getting into the innards.
So I want to ask a question, and I am seriously hoping I don’t start a flame session here… there are reasons for asking the way I am.
I’m forced, unfortunately, to support JDK 1.3.1 at the moment. Mac support is critical to what I am working on, and believe me, it is the FIRST THING I am getting rid of once Apple releases the final on 1.4.1. So I’m screwed as far as animation is concerned… I have to put up with whatever I can get in 1.3.1.
This means that I have largely depended on the expertise of you fine folk. Your insights have been VERY critical to designing fast, clean code. However, I think I have a rather nasty problem lurking.
Everything works currently, but it’s being tested this week with multiple sprites… and I am extremely nervous. We currently use 8 frames of image… and want to display said 8 frames in one second… now the quirky thing is that the timing is WAAAAY off when you compare the Mac versus the PC… I attribute this to a difference in the timers, even allowing for the “timer hack” so graciously provided by TheLorax (thanks for posting it again, Jeff).
So here’s where I am not following: in 1.3.1, I realize I do not gain any acceleration benefits, I don’t get VolatileImage, and what I DO get is BufferedImage, unaccelerated. I’ve preloaded my images, and I redraw my backgrounds once per second, and use a single g.drawImage for every frame I render from one of two flip buffers till we’ve loaded the alternate one. Put another way, we draw background once, and the moment you start moving, we draw into the second background buffer while we keep sliding in a direction from the first one. Flip once we’re at a tile boundary. Unfortunately you can’t do this for sprites, so you are forced to draw sprites EVERY render.
The big question is, how many frames can I expect UNACCELERATED JAVA to be able to produce in a second? I keep hearing of the 400 fps demo in 1.4, I’ve personally seen games running 120-180 fps, and yet I don’t think I can display any more than 8. EIGHT. That’s a BIG disparity.
And with that kind of a disparity, I’m forced to ask: do the changes from 1.3 to 1.4 REALLY make that much of a difference as to give you a 10 to 1 speed increase?
What am I missing here in my bid to take over the gaming world? (just kidding, btw).
Your help is greatly appreciated.