First Post

Hey guys,

I’m very new to game programming (as in, I just decided a few weeks ago I would like to try my hand at it). My java background is mainly logic and string parsing, so I don’t know that much about animation except for some of the basic swing objects. I have searched on the web for some of the simple stuff, but it seems most of the good information is in more expensive books (which I was hoping to avoid, if possible).

I don’t really have any ideas, I just thought I would try my hand at style similar to the old Final Fantasy games. I don’t know how hard those games are to program, compared to side-scrollers or whatever, but they seem more interesting than a side scroller to me.

The first step (I suppose) is to get acquainted with basic animation as I know the least about that (well, I don’t know much about sound either, but I think animation should come first). I have looked on the web and searched through the forums, but I am still unclear which method is the fastest: bufferedimage, volitaleimage, image, memorysourceimage, bufferstrategy, etc… Is bufferstrategy the only one that supports page flipping and blitting? How important is hardware acceleration?

I also have a general question about animation: is it more efficient to copy a series of stored pictures for animation (by that I mean store the pictures externally from the program) or have the computer draw each image, pixel by pixel, with the drawing information embedded in the program itself.

I am sure my questions have been answered before, but I seem to have trouble finding the answers. Also, If I am posting in the wrong place, I apologize. One of the admins can move my thread.

Thanks guys :stuck_out_tongue:
Stephen

For your first game programming experience, try something a lot smaller than a final fantasy style game. And yes, bufferstrategy does support flipping and blitting. You can store images as bufferedImages mostly. I believe bufferedImages are hardware accelerated (am I right?). Also, search for active rendering (used with buffer strategies). Better to start with and get used to that than have to learn it later, like I did. Also, for the efficiency of copying images, that’s what the buffered images are. They are stored after being loaded, and it is easier to draw them.

Go buy Killer Game Programming. It’s only 40-50 (less for me, cus I had a discount), and it proved invaluable for my programming skills. It teaches you everything you want to know about everything you just asked, including sound stuff.

And, after trying out a few things, and getting the hang of it, look up Slick, a Java gaming library. To put it simply:
Progress on my game before Slick: 0.01%
Progress on my game after Slick: 2-3%

In one day I made a gigantic leap in progress.

Man, I was hoping to avoid that 50 bucks. Oh well.

Thanks for the input. I’ll see if I can find a used copy and save a few.

http://www.abebooks.com/servlet/SearchResults?sts=t&tn=Killer+game+Programming&x=0&y=0

There you go, that’s even less than I paid with a discount.

Developing Games in Java is another good book to buy. You get either one for about $20 on Amazon.com, though I see that you can do the same on the link posted.

20 bucks is alot better, so thanks.

Also, Question: I know that having a separate animation thread is important so the animation will be clean (or whatever word one uses to describe it), but does having more than one thread for animation provide any extra benefit?

I would assume that multiple animation threads would benefit a multi-core processor, that could run more than one instruction set simultaneously, but I’m thinking that possible synchronization issues would make a single core processor even slower. What do you think?

[quote=“dyingstar90,post:7,topic:31465”]
Unless you’re animating a whole lot of stuff and have a whole lot of processor cores, it probably won’t do any good to have more than one thread for the animation.

What might be useful is creating separate threads to do different things. For instance, I have a main update thread (including animation), the AWT Event Thread, music in one thread, and sound effects in one thread each (so they can play at the same time). Additionally, I do some initialization in separate threads and load a particular large background image that changes for different levels in a separate thread.

[quote=“dyingstar90,post:7,topic:31465”]
In general, using Ncpu + 1 threads, where Ncpu is the number of processor cores you have, is supposed to be optimal. I don’t know where the “+ 1” comes from, but it seems obvious that having alot more threads than processor cores isn’t going to do any good.

And, yes, synchronization slows things down. One way to reduce the problem is to use final or volatile variables where possible. That’s a relatively complicated topic, which I just bought an ebook called Java Concurrency in Practice for. (It’s available on Mobipocket for $30+.)