Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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 810 times)
0 Members and 1 Guest are viewing this topic.
Offline gridur

Senior Newbie




Groovy


« Posted 2005-07-27 22: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.

PEJava.java - main class http://www.home.no/kutulunadir/Java/PEJava.java
Meny.java - menu class http://www.home.no/kutulunadir/Java/Meny.java
Editor.java - the Editor class where the performace drops http://www.home.no/kutulunadir/Java/Editor.java

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

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2005-07-27 22: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).

Kev

Offline gridur

Senior Newbie




Groovy


« Reply #2 - Posted 2005-07-27 23: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 meny.java from its listeners before i enter editor.java 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 meny.java 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: http://www.home.no/kutulunadir/Java/Project Europa.zip

// Gridur<br />--------------------------------------<br />Spell of Play Studios<br />http://www.spellofplay.com<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




Groovy


« Reply #3 - Posted 2005-07-28 01: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 />http://www.spellofplay.com<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.

 

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 (17 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (50 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!