why are people trying to use Java2D to make games?

Good programmers should be lazy. Laziness is virtue. It make you think more and write less. It will save you ton of work that have already be done. You have then more time for learning new stuff and writing interesting things instead of inventing wheels and writing boilerplate. But laziness does not mean that you should just use things that you don’t understand at all or copy pasting randomly. Lazy coder search reference even when inventing wheel again because all humans make mistakes and its not helpful make same mistakes that others have already pointed out.

Just using java is lazy. You should write your own compiler and build own virtual machine and write libraries against it and only after that starting to write games. Heck why not inventing computer first? So if you are lazy like every coder should have why not be just a tad lazier and use all the goodies that community have write before you.

There is a difference between laziness in learning, and laziness in programming.
One of them, you take shortcuts (such as x++; instead of x = x + 1; in the minor cases), or write utility code that you never have to touch again.
The other, you take someone else’s wheel.

WHOAH! There is a difference between buying an assembled computer, assembling a computer, and making all the components for the computer.
I don’t use C/C++/ASM because of the syntax (or rather how the syntax makes the source code look). ;D

Yes, but as programmers, we are the people “making the car”, not driving it (except when we test it). This statement can however be taken either way (as we could just be assembling the car), so does not contribute to the argument.

True.

Nope. Never tried it. And if it weren’t for the next part of your argument, I probably never would

Wait, WHAT??!! Does that mean I can use my code designed for LWJGL with LibGDX and still port to HTML5 & Android? (obviously changing the classes & method calls etc.) Why don’t they promote that as one of their advantages and I would have used it long ago!

I must see this for myself!

Yes that should be possible because it says that you can manipulate the pipe as u want, but I am just getting into libgdx so please don’t bother if there are some limitations.

@Topic
As I started gamedev. I googled “java tutorial gamedevelopment” -> Youtube + Everything else was about java2d. jogl, lwjgl, libdgx aren’t on the front-pages so as a beginner u want recognise them.
best regards

Please use a proper ‘you’ instead of ‘u’, it’s burning my eyes out right now. Take a look at TheCodingUniverse for some LWJGL tutorials.

Real men write all their code in assembly. Anything else is just laziness.

@HeroesGraveDev: Your idea of where the “being lazy” line is drawn is subjective. Some people think using pre-built game libraries is lazy, others don’t. Some like using full-blown game engines like Game Maker, other’s don’t. There is no right or wrong answer.

Since you talked about being subjective earlier, an appropriate end to your post would be that there is no objective answer.

Wait a sec didn’t we already have this laziness conversation?
http://www.java-gaming.org/topics/operator-overloading/26860/view.html starting from reply #18

Who cares about lazy or not, my first game is going to be completed while this thread goes on.

Library is made for lesser code after all.

laziness or not, it’s a fact that going through java2d is a bad idea. you place yourself at the mercy of the Event dispatch Thread, and you can’t really control when you refresh. Repaint() is just a suggestion the EDT gets around to when it’s good and ready.

You can control when you repaint. :point:

On Laziness:

It’s relative to the amount of time you have available. The more time you have, the more learning you should do while working.

Maybe you missed it because you were busy writing fundamental game utilities. Or, maybe you were just lazy. ::slight_smile: :slight_smile:

This! Java2D is the DEVIL! :slight_smile:

Learning is not same as writing from scratch. When you have more time you should make more games. This give really good feedback what is actually needed features at game development and then you can put all the time and effort for right things.

At my day job I code iPhone games. We have our own framework for ios. Still I have never written a single line of objective c. My main task is being graphics programmer. Still I don’t even know how gl contex is made with ios. I could use my time and learn objective c and rewrite the boiler plate but what would anything gain with that? That would only delay our games and cause new bugs.

Programming is team work. You need to learn to use others people code and spent your time more effectively if you want make games as job instead of just solo developer hobby.

Err, you don’t use repaint when you code in java2d… Or at least I don’t… There’s magic thing called setIgnoreRepaint() (Or something like that xD) which disables it, so that you can use your own active rendering, instead of passive rendering(repaint() and paint()).

i’m not going to shove my foot any further into my mouth.

Passive repaint works good enough for quite a lot of games. Not everything is a shooter or a jump-and-run.

I’m a bit puzzled about the hate for Java2D. It served me well since I first tried to make a game in Java 1998, a boulder dhas clone to see if Java is “good enough” for gaming. For me it was, and I’ve been using pure java for my games until a few weeks ago, and it still looks appropriate to me for most of my game projects.

[quote]why are people trying to use Java2D to make games?
[/quote]
People are not “trying to use”, but they are making games with Java2D. Why? Java2D is good enough for many sorts of games, it’s bundled with Java and does not need any extra install, setup or download. And it’s pretty straightforward to use, even if some messages in this thread claim otherwise.

The “you” is one of my new Year’s pledges. I already watched most of the youtubetutorials, I think they are quite good explained.
-> Back to Topic,
In my opinion awt offers a lot of great stuff for java2d, especially because you can write your own components, it’s highly customizable. Furthermore if you use the “double-buffered-layer-renderer” and active rendering it’s fast and accurate enough for desktop-applications. If you just want to add a scroll-pane in jogl/lwjgl/libgdx it’s not that easy as it would be in java2d.
best regards

Java UI stuff sucks if you want to do more then a few buttons. :cranky:

I love java2d and can get it to do all sorts of stuff. Most of the pics of particle effects I post are with a program that uses java2d so it can look great. Problem is, it is slow…and will not let you do anything past basic sprite games. No lighting without hacks and hair pulling, no additive blending so that cuts out more stuff, and it is very finicky with performance when changing from computer to computer. Not saying you can’t make good games but it is very limiting.

I can make it perform well enough on most computers but just using glBegin glEnd is faster. Libgdx’s silly simple sprite batch is even faster. Although it hurts to say this because I still like thunkin around with it, I agree that we should start pushing away from java2d. We should still answer questions when asked, but point to something much better…

Why people use it? Because when you google “java” and “game” you get java2d for the most part. And when you google anything about java and graphics stuff guess what, java2d. :clue:

I’m not sure if I want to believe in the “good game == high tech graphics engine” equation. There are enough types of games which do not need a high FPS. This forum has a lot of jump and run projects, but really, there are other games.

Puzzle games, card games, simulated board games, simulation games in general, point-and-click adventures, visual novel type projects and the like all do not need a high-tech graphics engine to become a good game.

I also see nothing bad in sprite or tile based engines. With good quality pre-rendered sprites and tiles you can make very good looking games, and Java2D is really good enough to draw tile based maps with sufficient FPS.

But I know that I have a different opinion on sufficient FPS from many forum inhabitants. Even for games that involve movement, I think that a stable 10 FPS are often good enough. But people post about engins that do like 800 FPS or 1200 FPS or more. I wonder what is this good for? It’s a technical achievement, and demonstration of coding ability, but it won’t make you a good game just by itself.

I dunno. I’m just worried that the “you need open gl to make good games” will teach new game designers wrong things. You don’t need open gl to make good games. First of all you need a good idea for a game, and skills to make this idea into a game … and if you are a good designer, you can bring a good idea alive even wiht very simple graphics. I believe more in the creativity of the designer to be important for games, than in the excellence of technical execuation. Particularly for indy and hobby projects - if you make a AAA game title, I would talk different, but 90% of the forum population don’t. Maybe 95%.

So I keep saying Java2D is good enough unless you are going to make a shooter, action RPG or jump-and-run. ANd even those you can make with Java 2D if your game can live without the most flashy effects - and these effects will not make a bad game any better. They just make it sell better if you advertise with the graphics.

I think you are underestimating the abilities of JGO. :slight_smile: Check out the Featured Games. Almost every game there would not be possible in Java2D alone. These are games made by forum members; indies and hobbyists.

Even the simplest puzzle games on JGO (Shijin Reversi, Atomic Harmony, Lost Geometry) require OpenGL because they are being distributed to Android.

Aside from all this, you are missing the whole point of the discussion. It’s not just about graphics or sound, but the platform itself was not designed for games and thus you end up needing a lot of boilerplate to get a simple game working. Tiled maps, game loops, texture atlases, input, themed GUI, etc.

Don’t even get me started on sound…

It seems like the only reason you are defending Java2D is because you are too stubborn to learn a new platform. ::slight_smile: Or maybe just ignorant of how much easier game development is with LibGDX.

EDIT:

[quote]So I keep saying Java2D is good enough unless you are going to make a shooter, action RPG or jump-and-run
[/quote]
If you’re trying to emulate Minesweeper, Solitaire, and other static games of the 90s, then sure, Java2D is suitable. But most of us aspire to make slightly more complex games. As soon as sound or a game loop is involved, Java2D/JavaSound is the wrong choice.

Amen, brother!