Results 1 to 18 of 18
- 06-29-2011, 06:31 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 1
- Rep Power
- 0
- 06-29-2011, 07:45 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-29-2011, 08:09 PM #3
The uneducated public's opinion about it. "Oh you're using Java to program a game, isn't that slower than flash?"
Or the lack of any official general enthusiasm for game programming with Java, which goes hand in hand with public opinion. People think Java is for boring GUIs, and Oracle doesn't do much to correct that stigma.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-29-2011, 08:15 PM #4
What he said... The overall lack of support for Game Developers from Orcale is definitely my least favorite thing. As well as the assumption that Java is bad for game programming. AND the stuttering that I think is caused by drawing with Java2D (anyone else have this problem?)
- 06-29-2011, 08:27 PM #5
What stuttering? Sounds like you're doing something wrong, to be honest.
Java is a great platform for game development, but the public doesn't realize it because there are only a few people who know how to do it right and then 99% of other people doing it wrong, giving Java a bad rep. "I always thought that Java GUIs were slow and unresponsive." No, that just means whoever wrote the program you're thinking of didn't know enough to do the work off the EDT. "I thought that Java graphics flickered." No, that just means whoever wrote that program didn't know how to paint correctly.
There's a stigma attached to Java, and to applets, webstarts, and Jars, and the few people doing it right aren't enough to sway public opinion. That's frustrating, but that just makes it our responsibility to prove the public wrong.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-29-2011, 09:01 PM #6
There is just a slight stutter in the drawing. Maybe it has to do with the way I draw or my game loop.
I draw by extending a Canvas, calling setBufferStrategy(2) to double buffer, then getBufferStrategy() to get the strategy and then I call getDrawGraphics() on the strategy. I also have doWhile loops checking startegy.contentsRestored() and strategy.contentsLost() like this:
And my game loop is fairly simple:Java Code:do { do { Graphics2D g = (Graphics2D) strategy.getDrawGraphics(); // Draw here g.dispose(); }while(strategy.contentsRestored()); strategy.show(); }while(strategy.contentsLost());
EDIT: I am a noob game and java dev if that explains any of my programming flaws >_>Java Code:long start = System.nanoTime(), curr; while(running) { if(!paused) { updateGame(); paintGame(); } while((curr = System.nanoTime() - start) < period) try { Thread.sleep(1); }catch(Exception e) {} start = System.nanoTime(); } System.exit(0);
- 06-29-2011, 09:13 PM #7
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Truthfully? This question, and others like it.
Originally Posted by conopoly
- 06-29-2011, 09:14 PM #8
I hate the fact that I have to write it, I mean any real language would be able to produce itself via communicating with my thoughts.
Other than that, I guess I'll agree its the misconception of the language. Though I can't argue that C++ may have the advantage over modern gaming.- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
- 06-29-2011, 09:16 PM #9
What's the most frustrating thing about Java?
Other people's code and their lack of documentation. I tell you, bIsR() doesn't really do a helluva lot for me.
- 06-29-2011, 09:57 PM #10
Member
- Join Date
- May 2011
- Location
- Belgium
- Posts
- 4
- Rep Power
- 0
- 06-30-2011, 02:03 AM #11
Yeah, you're making it way more complicated than it should be. I would expect to see flickering if you're doing that, because you're fighting over what's being drawn- what you're drawing, and what the Component is drawing (which is probably nothing). Instead of any of that, simply override paintComponent (why are you using AWT instead of Swing?) and do all your drawing in there.
Recommended reading: Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)
It's these kinds of misconceptions that give Java a bad name.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-30-2011, 02:07 AM #12
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-30-2011, 05:03 AM #13
I just finished up two test programs. One using the painting method I detailed in an earlier post and one that extends a JComponent and overrides paintComponent(). Both programs stutter equally. Maybe your right in the long run and using the Canvas method is bad, but for simply moving a box across the screen they both stutter. Maybe it's my computers fault, but I ran the programs on my PC and my Mac and got the stuttering on both. So it's either my programming or java.
- 06-30-2011, 05:20 AM #14
- 06-30-2011, 08:01 AM #15
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Amen, brother!
Originally Posted by Junky
- 06-30-2011, 08:12 AM #16
It's your programming, believe me. I recommend you start a new thread in the AWT / Swing forum with a SSCCE that clearly demonstrates your problem.
db
- 06-30-2011, 02:52 PM #17
Darryl already covered this, but I'm going to second his statements- it's definitely your programming (right now I'm working on a program that does little more than move boxes across the screen, and it renders fine at 60 fps, and Java is capable of much more complicated animations). If you post an SSCCE in a new thread, I'd like to see what you're doing. Like I said, misconceptions like this are a pet peeve of mine.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 06-30-2011, 06:37 PM #18
Similar Threads
-
very frustrating.. recursive
By Yakg in forum New To JavaReplies: 5Last Post: 01-06-2011, 10:25 PM -
get index from an array (very frustrating)
By Yakg in forum New To JavaReplies: 4Last Post: 12-06-2010, 06:26 PM -
PLZZZZZ hlp me don't know any thing in java and need a favor
By ccoldfire in forum New To JavaReplies: 9Last Post: 10-04-2009, 05:45 PM -
Need help with a simple Java thing involving array of objects
By Jeremy8 in forum New To JavaReplies: 5Last Post: 02-25-2009, 07:14 PM


4Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks