Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  java 2D : how to make faster  (Read 2297 times)
0 Members and 1 Guest are viewing this topic.
Offline CPeX

Senior Newbie




Java games rock!


« Posted 2003-02-09 07:18:16 »

Hey
I'm making an ALife game and for the moment I have a terrible FPS
the methode to draw just a 50 circles on the buffer and flip the buffer takes 110 millis ! (with antialliasing)

1) Is this normal ?
2) to draw cicles is the ellips geom the one I have to use ?
3) any suggestions where I can make improvements
   (writing own circle draw methodes for ex.)

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2003-02-09 07:23:06 »

Stop drawing  Grin

No really - stop drawing circles and just blit a circle image.

However that said - 50 circles should render better than what you're saying - that is if the AA isn't taking its toll. Try disabling anti aliasing.

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2003-02-09 08:56:58 »

Or use OpenGL and forget Java2D. It's a waste of space..

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Themroc

Junior Duke





« Reply #3 - Posted 2003-02-09 09:25:08 »

Java2D isn't bad, but I lost faith when I saw that my code was running really fast on Windows but getting too slow on Linux (on comparable HW).

But then again I haven't tested OpenGL on any integrated-chipset-graphics (which is important, as they sell more than dedicated chips from nvidia or ati, especially the intel ones)

To the original question: AA is not hardware accelerated, drawing circles possibly not, too. (Simple) Line drawing seems to be accelerated on Windows.
Offline CPeX

Senior Newbie




Java games rock!


« Reply #4 - Posted 2003-02-09 11:22:25 »

I can't use images for my circles because the color and the radius is in function of the amount of food in an organisme

but all my circles are small. Maybe I have to draw polygones instead.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2003-02-09 11:54:35 »

If memory isnt too much of a concern, you could pre-create your organisms into a load of images, then select one suitable for the properties when drawing or if one isnt avalible, then create one as needed and store for further re-use. Theres also tricks with palletes you could try to get the variety of colours with a reduced set of images.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #6 - Posted 2003-02-09 16:11:54 »

Quote
But then again I haven't tested OpenGL on any integrated-chipset-graphics


Continuing to be off-topic:  Wink

At work I have a desktop with intel integrated chipset which performs I suspect well enough for 2d games (my 3d game still is playable on it). Especially when you want to do fancy stuff like rotation and blending you will have better performance using ogl on those chipsets.
And on wintel java2d might perform not too bad for simple stuff, it's still buggy and not reliable on that platform.

And remember that the playspeed will be a problem sooner or later when you want to make a game without some native help.

I said it before and I say it again:
Java2d for games: never again for me.

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #7 - Posted 2003-02-09 17:20:28 »

How fast is it without antialiasing?

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2003-02-09 20:41:35 »

Actually, using volatileimage on 1.4 and straightforward unscaled blits, it's about on a par with OpenGL. Nearly everything else it does it does very slowly though*

CpEx - what you should do is render your circles into a cache of images only when they change and draw them to your actual game display by using a blit. The circle-drawing bit with antialiasing on is slower by comparison than a blit. Not much slower mind - if you're doing antialiased blits it's still pretty dire in Java2D.

Cas Smiley

* It does have crackingly good quality output mind you. The font rendering is superb. (Shame they haven't got antialiased fonts in Swing by default isn't it?)

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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
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!