Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 4 5 [6]
  ignore  |  Print  
  why are people trying to use Java2D to make games?  (Read 21124 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #150 - Posted 2013-04-06 22:25:42 »

Oh you're right, I misread, sorry, carry on. Down with Java2D!! Cheesy

Offline Agro
« Reply #151 - Posted 2013-04-06 22:31:44 »

Java2D is cool and all, its just that it hogs too much resources o.O

Offline tyeeeee1
« Reply #152 - Posted 2013-04-06 23:26:12 »

Java2D is cool and all, its just that it hogs too much resources o.O

It doesn't hog that much as far as I've seen. Almost everything I've ever programmed runs on 10mb of RAM or less and the one thing, a game, that I've programmed that runs on more only uses up to 30mb of RAM.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #153 - Posted 2013-04-07 00:05:05 »

Java2D is cool and all, its just that it hogs too much resources o.O

It doesn't hog that much as far as I've seen. Almost everything I've ever programmed runs on 10mb of RAM or less and the one thing, a game, that I've programmed that runs on more only uses up to 30mb of RAM.

I think Agro means CPU time, not RAM.

Offline Agro
« Reply #154 - Posted 2013-04-07 00:08:41 »

Java2D is cool and all, its just that it hogs too much resources o.O

It doesn't hog that much as far as I've seen. Almost everything I've ever programmed runs on 10mb of RAM or less and the one thing, a game, that I've programmed that runs on more only uses up to 30mb of RAM.

And yeah, CPU time / RAM, interchangable.

For some [simple] Java games, I think 10 MB is a lot. On that scale, compared to other Java games, its a large difference.

Offline novasharp

Junior Member


Medals: 1
Projects: 1


Gamemaker


« Reply #155 - Posted 2013-04-07 00:18:11 »

I know that I am personally using Java2D because I want to make a game that does not need any extra libraries. Sure its not too bad to add extra jars, but having natives gets a bit annoying. I tried using LWJGL and kept getting UnsatisfiedLinkErrors claiming wrong ELF type. No such thing with Java2D.
Something like LibGDX streamlines the process for you. They have a GUI tool where you select the folder to save your Eclipse project, and then when you open it in Eclipse it "Just Works."

Anyways... It's your funeral. Smiley At the end of the day, almost everybody who is serious about game development and has given both Java2D and LibGDX a try will not prefer to use Java2D. Not only is it less performant and more verbose, but it ports to less platforms and includes zero utilities that almost all games will need (game loops, GUI, input polling, bitmap fonts, asset management, texture atlases, animated sprites, particles, physics, tiled maps, or whatever).

For that, I was talking about LWJGL. Also, I wasn't talking about coding. When I use Eclipse, it always just worked because I could specify the native location. I was talking about when I exported my game and tried to run it elsewhere. I have not made a game yet in LibGDX, so I don't know how well one export transfers from one platform to another, but with LWJGL, I exported my game under Windows and when I tried to run it under Linux, it spat out that error.

novasharp
Online princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #156 - Posted 2013-04-07 02:03:51 »

This is shit you need to know about. You need to know how to do this. If stuff like this gets in your way and you just give up on it despite fairly plain evidence that it's solvable in the form of all those other games out there that have got it working then you're possibly not going to be of the right mindset to be a developer in the first place. Maybe I'm reading too much into this.

Cas Smiley

Offline StumpyStrust
« Reply #157 - Posted 2013-04-07 02:53:23 »

....dang princec all swarin and sheet but yeah it is kinda basic and not very hard to deal with. I will be honest, I have never setup libgdx without the gui setup program doing everything for me. Does that make me a huge noob? Probably.

Java2D is slow but not 10 images being rotated slow. You have to be doing something horribly wrong. Instead, just drop j2d and move on to the future, libgdx.

Offline Agro
« Reply #158 - Posted 2013-04-07 02:58:40 »

OR Java2D gets more support from the devs Cheesy

Offline novasharp

Junior Member


Medals: 1
Projects: 1


Gamemaker


« Reply #159 - Posted 2013-04-07 03:39:01 »

This is shit you need to know about. You need to know how to do this. If stuff like this gets in your way and you just give up on it despite fairly plain evidence that it's solvable in the form of all those other games out there that have got it working then you're possibly not going to be of the right mindset to be a developer in the first place. Maybe I'm reading too much into this.

Cas Smiley

I mean, it's not like I just gave up. I finished the game. I just decided that since I am doing mostly 2D development, I would give Java2D a try for my new game.

....dang princec all swarin and sheet but yeah it is kinda basic and not very hard to deal with. I will be honest, I have never setup libgdx without the gui setup program doing everything for me. Does that make me a huge noob? Probably.

Java2D is slow but not 10 images being rotated slow. You have to be doing something horribly wrong. Instead, just drop j2d and move on to the future, libgdx.

To be fair, my definition of slow is fairly strict. My game was getting ~50fps as opposed to the intended ~60fps. With a bit of optimization, I could have gotten over it. Also, the problem was not low fps, it was stuttering due to a game loop that did not react well to a fps decrease. I would simulate constant updates by sometimes updating/ticking multiple times before rendering. If I just separated out game logic from rendering, my problems would go away (for now).

novasharp
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Roquen
« Reply #160 - Posted 2013-04-07 07:57:05 »

I love classes like java.awt.geom.AffineTransform.  They're awesome because they make me laugh and reassure me that I'll never have trouble getting work.
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #161 - Posted 2013-04-07 07:58:42 »

I love classes like java.awt.geom.AffineTransform.  They're awesome because they make me laugh and reassure me that I'll never have trouble getting work.
That class confused the shit out of me when I was starting out...I mean, what the heck is an AffineTransform object? They say everything is an object, I can't really imagine it as a manager, component etc Roll Eyes
Online princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #162 - Posted 2013-04-07 12:12:07 »

One day the monkeys saw a giant black monolith in the middle of the canyon. Upon it was carved a single word, "Maths".

They stood around, scratching their heads for a few minutes, and then started screeching and jumping in rage. Soon they had bashed the monolith into irregularly sized chunks, none of which would fit next to any other chunks ever again properly, and were sort of happy that they'd managed to object-orient the monolith.

Cas Smiley

Offline deepthought
« Reply #163 - Posted 2013-04-07 17:11:49 »

That sounds like it could be a Douglas Adams quote.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline ReBirth
« Reply #164 - Posted 2013-04-08 03:38:25 »

... none of which would fit next to any other chunks ever again properly, ...
But but it is not vanished, the smallest chunk should be still there persecutioncomplex

Offline kaffiene
« Reply #165 - Posted 2013-04-09 06:40:43 »

AffineTransform works fine.  I got some pretty speedy animations running that used it.  What's the problem?

I like OpenGL Java2D is cool too.  I don't get all the angst - choose whichever you like.
Online Roquen
« Reply #166 - Posted 2013-04-09 07:14:59 »

It's basically a 3x2 matrix class: look at the source of say "concatenate".
Offline jobiho

Senior Newbie





« Reply #167 - Posted 2013-04-11 22:54:15 »

I just started to port a game from Flash to Java and when I started to port the code I already knew that the rendering part should be separated as much as possible (which it should be anyway) so I could decide later wheter to use Java2D, opengl, a printer or whatever.

So in my opinion the question about wheter to use Java2D to make games or not should be wheter or not to use Java2D for the rendering.
Java2D is not about game programming, it is about image processing (which it seems to do very well).

It is perfectly valid to use Java2D for your rendering.
And if you have separated the rendering from the rest of the game it should be no problem to switch from the Java2D API to some OGL API.
Same applies for the inputs btw.
Offline StumpyStrust
« Reply #168 - Posted 2013-04-12 00:56:56 »

Java2D is so very very very limited. I can do image processing...slowly.

One of the big issues is not that it is super slow (which it is) but that the performance is inconsistent across systems. That is to say, on my desktop I easily get 5k sprites (64x64) but on my laptop due to crapy DX drivers, get fill rate limited after about 200 sprites at the same size. I could switch to the opengl pipeline which will fix the fill rate limit but gives all sorts of other issues. It is not consistent.

Using opengl, my laptop gets fillrate limited again but easily hits 10-20k sprites using glBegin glEnd. Adding basic sprite batching and bam! 50k. You also cannot do any cool effects such as lighting, additive blending, or the all powerful shaders without bashing your skull into the ground and sacrificing valuable processing time to try and hack java2d to get it to do what you want. Java2D was NEVER meant for games. It is not as simply as just rendering. Rendering eats into frame rate which logic needs.

If you want to make a game, then use a library/rendering method for games. *whisper* libgdx
If you insist on writing your own engine/lib/everything then break out some assembly or use opengl bindings.
If you STILL like java2d well then before you start asking all sorts of questions on performance and best method for rendering images, please read this.

http://www.java-gaming.org/topics/java2d-clearing-up-the-air/27506/msg/246444/view.html

Once you are done reading that, shoot yourself in the foot because that is what you are doing by using java2d for rendering

Offline relminator
« Reply #169 - Posted 2013-04-18 07:30:53 »

There is no point arguing this.

People do what they want.  Pointing Best answer so far.


This. 

I come from an OpenGL background yet I made it a point to make my first Java engine in Java2D (would have taken me less time and effort if I jumped straight to LWJGL).

My sole reason for using Java2D (aside from the fact that I was helping my nephew with his Java Graphing Assignment) is because it was fun learning it. ;*)

Offline gouessej
« Reply #170 - Posted 2013-04-18 10:20:22 »

Java2D is so very very very limited. I can do image processing...slowly.

One of the big issues is not that it is super slow (which it is) but that the performance is inconsistent across systems. That is to say, on my desktop I easily get 5k sprites (64x64) but on my laptop due to crapy DX drivers, get fill rate limited after about 200 sprites at the same size. I could switch to the opengl pipeline which will fix the fill rate limit but gives all sorts of other issues. It is not consistent.
The older versions (before 1.6.0) of Java3D have the same kind of problems and Oracle is going to do the same mistakes with the 3D API of JavaFX.

Offline Oskuro

JGO Knight


Medals: 39
Exp: 6 years


Coding in Style


« Reply #171 - Posted 2013-04-18 10:57:15 »

I blame Notch.

I was all happy about choosing a good extension for game development, when, looking into Notch (because Minecraft) I stumbled upon his Left4kDead game, and from that went on to check the Java4k page, which lead me to think:

"All these cool games are being done in plain Java?"

"And they run fine?"

"And they take 4k?"

"..."

"..."

"I must learn to do this!"  Angry



More seriously, I spent many years jumping from one framework/API/Tool to the next (bare OpenGL, Panda3d, Ogre3d, ACS, Unity...) and finally realized that I had no experience with the basics. So made the decision to buckle down, and strive to actually finish a project using no extras.

That doesn't mean I don't see the limitations, I've been tinkering with normal mapped lighting and blending modes recently and right now could punch the JVM in the face, but I still think it is a worthwhile exercise.

One one hand: Learn to crawl before you walk
On the other: The more you can do without extra tools, the better

Offline gouessej
« Reply #172 - Posted 2013-04-18 20:05:48 »

One one hand: Learn to crawl before you walk
I agree with you.

On the other: The more you can do without extra tools, the better
Personally, I would rather advise people to learn the basics before using high level APIs that hide most of the complexity. Extra tools can be useful to avoid reinventing the wheel as I explained here.

Offline Oskuro

JGO Knight


Medals: 39
Exp: 6 years


Coding in Style


« Reply #173 - Posted 2013-04-19 11:14:00 »

Personally, I would rather advise people to learn the basics before using high level APIs that hide most of the complexity. Extra tools can be useful to avoid reinventing the wheel.

Yeah, I should have explained that better. I meant more or less that same thing. Understanding the basics makes using advanced tools even better.

Using the tired car metaphor, you don't need to understand how the engine works, or the basic physical properties of the vehicle, but having an understanding of those, even a cursory one, will help when you come across unexpected issues.

I know plenty of people (and been one of them too) who jump on advanced tools from the get go, and then are stumped when they run out of tutorials for specifically what they want to do.

Offline davidc

Senior Member


Medals: 5
Projects: 2



« Reply #174 - Posted 2013-04-19 12:11:04 »

I'm going with the "doesn't require signed applets" excuse. It seemed like a nice idea being able to deploy an applet without extra fluff that requires the user to sign off on scary security warnings.

Oh, and I'm ridiculously lazy.
Online princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #175 - Posted 2013-04-19 12:22:19 »

Please, stop using applets Sad

Cas Smiley

Offline gouessej
« Reply #176 - Posted 2013-04-19 12:33:29 »

Please, stop using applets Sad
Yes please let us applets die.

Offline davidc

Senior Member


Medals: 5
Projects: 2



« Reply #177 - Posted 2013-04-19 12:42:19 »

The tribe has spoken. Applets, bring me your torch it's time to go.
Offline ReBirth
« Reply #178 - Posted 2013-04-20 13:44:11 »

At first I prefered applet over webstart, until I can't get libgdx/lwjgl applet work.

ALL HAIL PRINCEC!

Pages: 1 ... 4 5 [6]
  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.

pw (37 views)
2014-07-24 01:59:36

Riven (38 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (50 views)
2014-07-17 23:47:54

danieldean (42 views)
2014-07-17 23:41:23

MustardPeter (44 views)
2014-07-16 23:30:00

Cero (60 views)
2014-07-16 00:42:17

Riven (57 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!