Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 3418 times)
0 Members and 1 Guest are viewing this topic.
Offline CPeX

Senior Newbie

Java games rock!

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

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 Spiffy Duke »

Medals: 1030
Projects: 3
Exp: 20 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 Devvie

« 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: 57
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.

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

JGO Ninja

Medals: 16
Projects: 4
Exp: 14 years


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

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 Spiffy Duke »

Medals: 1030
Projects: 3
Exp: 20 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  

DesertCoockie (52 views)
2018-05-13 18:23:11

nelsongames (83 views)
2018-04-24 18:15:36

nelsongames (74 views)
2018-04-24 18:14:32

ivj94 (759 views)
2018-03-24 14:47:39

ivj94 (87 views)
2018-03-24 14:46:31

ivj94 (643 views)
2018-03-24 14:43:53

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!