Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (739)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (820)
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  
  Great Performance drop troubles  (Read 1569 times)
0 Members and 1 Guest are viewing this topic.
Offline gridur

Senior Newbie


« Posted 2005-07-27 20:28:18 »

Hey ppl!

I have posted pretty much lately regarding my game Project Europa, and now i have to burden you all with yet a new problem regarding graphics this time =)

The thing is, i have just started using BufferedImage with ImageIO as a loader, instead of Image with Toolkit.
I have also restructured the game some so that the Editor runs in a induvidual class and menu in one and game in one.

I've just got it all to work, but i reallised that the performance really did a total dive to the worst, the editor is just down straight useless in the state that it is in at the moment.
I dont know if it's the change to BufferedImage from Image or if it roots in the structual changes that i've done so it would be a real nice super thing if some guru would like to check my code, a fast check and see if there are some apperant stuffs there that can cause the perf. drop.

One thing that im thinking of is the Transperant images, can these be the cause, and do they really make the performance drop that much? its just down silly how slow things go right now.
I'm using PNG as the image format, and at the moment every image have a color depth of 8bit.

Very well here's some classes that are involved in the game editor. - main class - menu class - the Editor class where the performace drops

// Gridur<br />--------------------------------------<br />Spell of Play Studios<br /><br /><br />Download and test the open Beta of Time Breaker (3D Arkanoid) and comment on our forum!<br />---------------------------------
Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2005-07-27 20:41:51 »

Are you using Java 1.4 or 1.5?

In 1.4 images loaded by ImageIO are not accelerated by default, so you need to load them with ImageIO and then copy then into accelerated image create with the Toolkit (createCompatibleImage).


Offline gridur

Senior Newbie


« Reply #2 - Posted 2005-07-27 21:10:00 »

Im using 1.5 so that might not be the problem, as i can see with some deeper inspectation i think that it is the Event listeners that is fooling around again, the rendering is being pretty fast but the listeners got a grave speed problem, should i put the events in a nested class or is there any other way to speed this up?

I have released the from its listeners before i enter now (I realised that the meny listeners still were in process whilst being in the editor class) but can it be that the events are called through the class in some way and thus making the process real slow cause the loop in that class is disabled? (= no sleep procedures).

hehe maybe you want the complete project soon kev? ;P

Well i've posted it on my ftp so that you can test it out, maybe you can feel it a bit more when you try it out? Fetch it here:

Project Europa Source:

// Gridur<br />--------------------------------------<br />Spell of Play Studios<br /><br /><br />Download and test the open Beta of Time Breaker (3D Arkanoid) and comment on our forum!<br />---------------------------------
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gridur

Senior Newbie


« Reply #3 - Posted 2005-07-27 23:45:40 »

Finally i cracked the problem!!!

The troubles lied in the tile, enemy and item renderers.
Before when i used Toolkit, the renderers called these methods by giving the class a id number that specified the graphical object.
when i converted from Toolkit to BufferedImage this crashed the whole system of the renderers, so now i have reconfigured the classes so that all the gfx elements are read and buffered when a renderer is created.

The id call method have been altered some to, instead of calling to load a ImageIO, the "image" variable just copies the active gfx object and renders this.

Very well, i have some more coding to do before the system is fully functionable, i'll probably will come with a new silly question soon hehe, tnx for all the helt anyway!

// Gridur<br />--------------------------------------<br />Spell of Play Studios<br /><br /><br />Download and test the open Beta of Time Breaker (3D Arkanoid) and comment on our forum!<br />---------------------------------
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Ecumene (48 views)
2017-09-30 02:57:34

theagentd (71 views)
2017-09-26 18:23:31

cybrmynd (181 views)
2017-08-02 12:28:51

cybrmynd (180 views)
2017-08-02 12:19:43

cybrmynd (187 views)
2017-08-02 12:18:09

Sralse (192 views)
2017-07-25 17:13:48

Archive (744 views)
2017-04-27 17:45:51

buddyBro (876 views)
2017-04-05 03:38:00

CopyableCougar4 (1421 views)
2017-03-24 15:39:42

theagentd (1315 views)
2017-03-24 15:32:08
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

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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!