Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  First Post  (Read 1613 times)
0 Members and 1 Guest are viewing this topic.
Offline dyingstar90

Junior Newbie





« Posted 2008-03-03 21:03:21 »

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 Tongue
Stephen
Offline Kakashi266

Junior Devvie





« Reply #1 - Posted 2008-03-04 22:33:55 »

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.

Offline dyingstar90

Junior Newbie





« Reply #2 - Posted 2008-03-05 19:30:39 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kaosnkorruption

Senior Newbie





« Reply #3 - Posted 2008-03-06 00:23:22 »

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

Junior Devvie





« Reply #4 - Posted 2008-03-06 18:21:32 »


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

Offline fletchergames

Senior Devvie





« Reply #5 - Posted 2008-03-06 18:50:08 »

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.
Offline dyingstar90

Junior Newbie





« Reply #6 - Posted 2008-03-07 01:47:13 »

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?
Offline fletchergames

Senior Devvie





« Reply #7 - Posted 2008-03-07 05:57:59 »

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?
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.

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?
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+.)
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (27 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!