Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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  
  And, as a newcomer, this is why i'm confused  (Read 3103 times)
0 Members and 1 Guest are viewing this topic.
Offline harpon

Junior Newbie





« Posted 2012-10-16 14:04:11 »

Hey guys, first let me introduce myself I'm just your average 19yo boy I'm here because I have great game design ideas and I'm trying to make a MMORPG like minecraft but instead of cubes I will use DINOSAURS!
That was the mandatory "i want to make new minecraft/mmropg joke" but seriously I came here because our teacher said we will make a little game in java at the end of semester and since then I'm lurking about java and games.
As a filthy webdesigner I really like java, it's really "clean" compared to stuff I usually do (I can't code in php anymore) and I love the fact that you can create objects and use them, but on the other hand recommendation for beginners in gamedev are just plain confusing let me show you :



What I'm supposed to do? Is java2d really awful? I don't want to make fancy stuff I just want to experiment and at the same time don't want all this knowledge to be wasted (if java2d isn't viable anymore everything I learned will be null?). I looked some java2d tutorials and I noticed they all use the same "boilerplate" code (basically notch code, on youtube atleast) so yeah..
Slick2d seems to be nice if your focus is "make 2d games" since you can work more easily on content but that's not my case I'm more interested in experimentation than releasing content.
So what should I do?
Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2012-10-16 15:05:38 »

Java2D is really cranky; it's hard to get it to perform reliably across operating systems, JRE versions and sometimes even across drivers. Few people know all its tricks and ins and outs, and almost nobody uses it for games.

If you fancy getting low level, use LWJGL and write straight to OpenGL and OpenAL. There's a bit of a learning curve but it's only a little bit steeper than Java2D. It's relatively simple, has more or less guaranteed performance, and has tutorials everywhere on how to do mostly anything. Mostly everybody uses LWJGL for games written in Java.

If you want some of the work done for you, use libgdx and pick and mix from the extras it provides on top. On the desktop, libgdx just uses LWJGL. libgdx biggest attraction is that it abstracts the underlying APIs so that your game will be runnable on the desktop, Android, HTML5, and even eventually iOS as well, at the expense of a little extra space in your brain. The API abstraction is really just the tip of a very complex iceberg though so don't go imagining it to being a magic bullet.

Slick2D was designed for people who already knew and liked Java2D and wanted to migrate to a faster solution, however whether it's actually faster these days is moot as much of Java2D was accelerated adequately anyway.

Cas Smiley

Offline Varkas
« Reply #2 - Posted 2012-10-16 15:51:55 »

Java 2D was improved from Java version to version, though. It used to perform fairly well on Windows, but often had problems on Linux, at least that is my experience in my projects. I have no experience on other platforms.

I use it, because it is available in each Java installation, and does not require any additional libraries. This usally means less sources of deployment troubles, and easier distribution.

It also depends on the game you are going to make. An action-shooter aimed at twitch reactions of players will most likely not work well with Java 2D. If you make a strategy game, port a card game on a board game to a computer game, it should be good enough for sure.

Even in 1998 when I made a boulder dash clone as an applet to see if Java can be used for games, it was "good enough" for that. Since then it became a lot better, and surely still is good enough for many games.

Java 2D is a very powerful API IMO, and even if it doesn't have top-notch performance it has a lot of inbuilt goodies which can be very useful. I assume this is exactly the reason why it doesn#t perform so well - it can do a lot, and this causes some overhead even for simple operations.

Few people know all its tricks and ins and outs

I want to second this. I work with it so long now, and there are still a lot of features which I never used, and/or which I didn't master. But I think I'll stick with Java 2D until I make something fast paced, or something that needs 3D anyways.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2012-10-16 15:58:23 »

JavaFX is the new hotness when it comes to "standard" Java doing realtime graphics I think.

Cas Smiley

Offline Varkas
« Reply #4 - Posted 2012-10-16 16:03:41 »

I'm a late adopter by nature, so I have no idea  Grin

But I heard that is shall become part of the standard edition, so maybe I should look into it at some time.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Online kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #5 - Posted 2012-10-16 16:16:59 »

Slick2D was designed for people who already knew and liked Java2D and wanted to migrate to a faster solution, however whether it's actually faster these days is moot as much of Java2D was accelerated adequately anyway.
Last I tested, Java2D with its various accelerated pipelines was still a few magnitudes slower than Slick2D (keeping in mind that Slick2D doesn't use any of the newer and faster OpenGL techniques). Java2D and its AWT/Swing parts just weren't designed for games.
Offline Varkas
« Reply #6 - Posted 2012-10-16 16:23:37 »

Java2D with its various accelerated pipelines was still a few magnitudes slower than Slick2D

A magnitude usually means ten times difference, a few magnitudes implies something like 1000 (4 magnitudes) difference. On windows where Java 2D can use hardware acceleration, I have troubles to imagine that. Is the difference really that big?

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Offline matheus23

JGO Wizard


Medals: 97
Projects: 3


You think about my Avatar right now!


« Reply #7 - Posted 2012-10-16 16:28:47 »

Java2D with its various accelerated pipelines was still a few magnitudes slower than Slick2D

A magnitude usually means ten times difference, a few magnitudes implies something like 1000 (4 magnitudes) difference. On windows where Java 2D can use hardware acceleration, I have troubles to imagine that. Is the difference really that big?

I think (and speaking with my own experience) he is talking about java2d being ~2-5 times slower.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Varkas
« Reply #8 - Posted 2012-10-16 16:30:31 »

Yes, those numbers look more familiar Smiley

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Online kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #9 - Posted 2012-10-16 16:52:27 »

I think (and speaking with my own experience) he is talking about java2d being ~2-5 times slower.
Yup.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #10 - Posted 2012-10-16 16:59:07 »

Well, in this case, you may not want to use anything other than what your teacher expects. And when a teacher says "we will make a little game in java", he either supplies a little framework or will just use Java2D.

So I would really ask before you dive into something because OpenGL and Java2D are entirely different.

For the pros: In Java2D you might learn how to get an image to be "managed", useless knowledge for later opengl coding.
And in OpenGL you may learn that its ideal, most of the time to use power of 2 textures and that binding textures takes a deal of performance, so spritesheets make sense.

My journey was Java2D -> Slick -> Libgdx
On that journey I have ported a game from Java2D all the way to now Libgdx.

Apart from the libraries, which have to be included and stuff, which might be confusing, Slick2D is probably the easiest, then Java2D, then Libgdx

Problem with Java2D is you have to write your own gameloop, throttle frames, get to know what and how you can draw on some elements like canvas, double buffering - a lot of stuff you dont have to deal with, when using other options.

So my advice is ask your teacher =P
Its no use when your teacher tries to explain bufferedimages, canvas, affinetransform and you are using something other than java2d...

Offline Oskuro

JGO Coder


Medals: 32
Exp: 6 years


Coding in Style


« Reply #11 - Posted 2012-10-17 14:15:13 »

Problem with Java2D is you have to write your own gameloop, throttle frames, get to know what and how you can draw on some elements like canvas, double buffering - a lot of stuff you dont have to deal with, when using other options.

I know I keep parroting these lines.... But for a newcomer who is learning, actually having to manually do all the low level stuff is a good learning experience.

Think of it as a car. You don't need to know about the inner workings of a car to drive it, but it sure helps when you inevitably need to do some maintenance.

And if the game is really simple (let's think PONG simple), the infrastructure requirements are low enough that doing it all "by hand" is feasible.

(And if you're starting with game development, you should be aiming at PONG simplicity... Ok, you can make the paddles out of Dinosaurs.)

Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #12 - Posted 2012-10-17 15:15:19 »

Cero, those problems generally exist in any low-level API (incl. LWJGL and JOGL).

Oskuro, I prefer to adjust your analogy: think of game development as a making a car as opposed to playing games which is driving a car. Suddenly cars are a lot more complicated than anyone thought. Who knew?

Cas Smiley

Offline Cero
« Reply #13 - Posted 2012-10-17 15:32:09 »

Cero, those problems generally exist in any low-level API (incl. LWJGL and JOGL).
Sure. I was referring to proven high level APIs.


Problem with Java2D is you have to write your own gameloop, throttle frames, get to know what and how you can draw on some elements like canvas, double buffering - a lot of stuff you dont have to deal with, when using other options.

I know I keep parroting these lines.... But for a newcomer who is learning, actually having to manually do all the low level stuff is a good learning experience.

Think of it as a car. You don't need to know about the inner workings of a car to drive it, but it sure helps when you inevitably need to do some maintenance.

I dont fully disagree, of course it can be interesting and helpful, but it comes at a cost: time.
You may waste time worrying over low level problem that already have been solved.
If you are really a high level game developer / designer, you want to get things done. A technician might be interested in the inner workings.

My point is: Unless you start at assembly language, you will always have a level of ignorance between you and what is happening under the hood. If you want to make a product, these libraries are tools to make it possible.
I may be able to open a can of food without a tool... during that process I may learn things to build my own tool, and then if my bought can opener break, I might understand why and may be able to fix it.
But normally, when you are product focused, get tools, learn how to use them and choose the high level route.

My fridge keeps stuff cold. I need my food to be cold. I dont care how it does it - its a black box.

Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #14 - Posted 2012-10-17 15:34:37 »

My fridge is a white box Smiley

Cas Smiley

Offline davedes
« Reply #15 - Posted 2012-10-17 19:37:57 »

As LibGDX improves, there is becoming less and less reason to use LWJGL. At the lowest level, LibGDX is just a thin OpenGL ES wrapper that ports to Android, WebGL, and iOS in future.

Slick is nice as it abstracts concepts like frame buffers, matrices, "orthographic" projections, blend functions, etc. However; it's buggy, not suitable for larger projects, relies on old techniques, doesn't port to OpenGL ES, and is now pretty much dead.

So, basically, just use LibGDX... Smiley

Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #16 - Posted 2012-10-17 20:59:26 »

At the lowest level, LibGDX is just a thin OpenGL ES wrapper that ports to Android, WebGL, and iOS in future in the now.
FTFY Smiley

Online pjt33
« Reply #17 - Posted 2012-10-17 21:34:11 »

If you fancy getting low level, use LWJGL and write straight to OpenGL and OpenAL.
That's not low level. Low level is writing directly to the pixel buffer of a BufferedImage and then rendering it with one Java2D call per time round the loop.

Tongue
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 114
Projects: 4
Exp: 3 years



« Reply #18 - Posted 2012-10-19 04:49:47 »

Hey guys, first let me introduce myself I'm just your average 19yo boy I'm here because I have great game design ideas and I'm trying to make a MMORPG like minecraft but instead of cubes I will use DINOSAURS!
That was the mandatory "i want to make new minecraft/mmropg joke" but seriously I came here because our teacher said we will make a little game in java at the end of semester and since then I'm lurking about java and games.
Obligatory, default, dull, response.
Do not start with a multiplayer game. Takes forever to debug plus you have to deal with servers etc etc etc.
Try to develop by your own. Chances are the class will move too slowly, and your professor/teacher might not know that much about game programming, it's not exactly all the same as "normal" java (excuse my terminology).

Also,

LibGDX is THE ANSWER. Although it's fine to start with Java2D. Just use a game loop.
Offline Oskuro

JGO Coder


Medals: 32
Exp: 6 years


Coding in Style


« Reply #19 - Posted 2012-10-22 15:25:08 »

Oskuro, I prefer to adjust your analogy: think of game development as a making a car as opposed to playing games which is driving a car. Suddenly cars are a lot more complicated than anyone thought. Who knew?

Actually, the car in my analogy is the system upon which you're building the game (Say, the JVM and its related classes, etc...)

But let's not get into an analogy fight..... I mean, that'd be like two parrots arguing over which one is polly and wants a cracker. Wink

Offline Cero
« Reply #20 - Posted 2012-10-22 19:35:47 »

Oskuro, I prefer to adjust your analogy: think of game development as a making a car as opposed to playing games which is driving a car. Suddenly cars are a lot more complicated than anyone thought. Who knew?

Actually, the car in my analogy is the system upon which you're building the game (Say, the JVM and its related classes, etc...)

But let's not get into an analogy fight..... I mean, that'd be like two parrots arguing over which one is polly and wants a cracker. Wink

Well you do know that this analogy is wrong, bringing the JVM into it. Because Game dev and Software dev in general is done using other languages and there is no JVM equivalent with C++. Unless you say its the OS then, but that would be ridiculous =D

Offline Oskuro

JGO Coder


Medals: 32
Exp: 6 years


Coding in Style


« Reply #21 - Posted 2012-10-22 22:13:55 »

Gee, the way I phrased it is almost as if the JVM and java classes are an example of underlying system. For C++ it'd be the compiler and target OS, yes, or the OpenGL libs if you're using them...

Offline masteryoom

JGO Coder


Medals: 5
Projects: 3


If you look closely, you might see it turning...


« Reply #22 - Posted 2012-10-30 10:59:46 »

Quote from: Cero link=topic=27547.msg247087#msg247087 date=1350480729
My fridge keeps stuff cold. I need my food to be cold. I dont care how it does it - its a black box.
[/quote
Mine is white. Why is yours black. Is it really old?  Shocked

Smiley
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #23 - Posted 2012-10-31 00:26:01 »

My fridge keeps stuff cold. I need my food to be cold. I dont care how it does it - its a black box.
Mine is white. Why is yours black. Is it really old?  Shocked
Errr....black box definition #2.

Offline gene9

Senior Member


Medals: 8



« Reply #24 - Posted 2012-10-31 06:17:12 »

JavaFX is the new hotness when it comes to "standard" Java doing realtime graphics I think.

Cas Smiley

JavaFX is a much improved successor to Swing for doing traditional component GUIs with edit fields, checkboxes, grid controls, and some multimedia and animation functionality.

JavaFX is not appropriate for games at all in the same way that Swing wasn't. Actually people would often use the very basics of Swing just to setup a drawing context. JavaFX isn't applicable on that level.

You should know this, oh Java games master.

Offline princec

JGO Kernel


Medals: 282
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #25 - Posted 2012-10-31 10:10:50 »

I would know it if I actually took a look at JavaFX but as my realtime graphics needs are handily catered for with LWJGL.

Cas Smiley

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.

xsi3rr4x (50 views)
2014-04-15 18:08:23

BurntPizza (46 views)
2014-04-15 03:46:01

UprightPath (62 views)
2014-04-14 17:39:50

UprightPath (44 views)
2014-04-14 17:35:47

Porlus (61 views)
2014-04-14 15:48:38

tom_mai78101 (84 views)
2014-04-10 04:04:31

BurntPizza (142 views)
2014-04-08 23:06:04

tom_mai78101 (242 views)
2014-04-05 13:34:39

trollwarrior1 (201 views)
2014-04-04 12:06:45

CJLetsGame (208 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!