Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (582)
games submitted by our members
Games in WIP (503)
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  
  UIWindow/GUI Performance  (Read 1686 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2003-11-20 05:56:45 »

I've built a very small GUI to go over the top of martian madness, you can see it here...

http://www.newdawnsoftware.com/martian/screenshots/191103_1.gif

The GUI is currently static, which I assume mean textures are generated for the polys once at the start then its just a matter of drawing quads with those texture. My GUI is currently built out of 8 JPanels, each of which has a UIWindow. So I'd assumed (I assume alot) that this was going to be 16 triangles textured and placed in the right place...

However, I lost 100 FPS from the addition. I've made it possible to toggle the GUI on and off (with TAB for those who try out the demo) and using this you can see the significant drop.

1) Is this the expected sort of drop?
2) If not,
   a) Am I assuming something wrong and could design my GUI in a better way.
   b) Are there plans for improving the peformance of the GUI.

Any help/suggestions appreciated,

Kev

PS. That appearance bug is still hanging around Wink

Offline DavidYazel

Junior Member




Java games rock!


« Reply #1 - Posted 2003-11-21 00:46:07 »

Right now because we do not yet support sub-texture update we break the overlay into very small peices.  That way when the dirty region list is found we only have to update a couple of the textures.  This is not optimal because it means a lot of additional shapes. That being said, your frame rate drop does seem extreme.  Are you repainting your component on every frame?

When I do get sub-texture working then we can fall back to the way the overlay is supposed to work, which is to calculate an optimal set of power of 2 size textures to map the window into.

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2003-11-21 05:16:02 »

Ah ha, thats probably it since I have a bunch of sizable windows.

But no, I'm not actually repainting every frame. In fact at the moment the GUI is pretty static and should only get repainted at initialisation.

Kev

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

Junior Member




Java games rock!


« Reply #3 - Posted 2003-11-23 23:00:34 »

I have committed an update to the gui that should resolve your performance issues.

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2003-11-24 15:47:47 »

Coo! Performance is well up!

However, I'm getting some slight artifacts that I didn't have before. Almost like the image is being copied to the texture 1 pixel up from where it should be.

Kev

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2003-11-24 16:04:41 »

Again, I made a small change and things came back into line. Don't think its the correct fix but might help in finding the actual problem..

Change in UISubOverlayOptimized.java

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
protected void update(BufferedImage fullImage, Rectangle updateRect) {

        dirty = true;
        Rectangle r = updateRect.intersection(bounds);
        Graphics g = a.getGraphics();

        int destLX = r.x-bounds.x;
        int destLY = height-(r.y-bounds.y)-r.height;
//        int destLY = r.y-bounds.y;
       int destUX = destLX + r.width;
        int destUY = destLY + r.height;

        // updated to move the rectangle we're copying from
       // up one pixel
       r.y -= 1;
       
        int srcLX = r.x;
        int srcUY = r.y;
        int srcUX = r.x + r.width;
        int srcLY = r.y + r.height;


Thanks for the peforamance increase! I'm getting like 200 fps more than I was getting before. Superb!

Kev

Offline DavidYazel

Junior Member




Java games rock!


« Reply #6 - Posted 2003-11-24 16:09:45 »

Thanks for the fix!  Do you know that one routine took me 2 hours to write? Funny how some things just bring you to a standstill for no good reason.

David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #7 - Posted 2003-11-24 19:06:14 »

Hi
 Thanks for both fixes Mr Yazel and Kev, the UI performance is much much much nicer Smiley.

Endolf

Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #8 - Posted 2003-12-02 17:40:14 »

Hi
 I've just checked cvs, and it looks like kevs fix hasn't made it in, any chance of someone doing this for us?

Cheers

Endolf

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.

xsi3rr4x (72 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (79 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (80 views)
2014-04-14 15:48:38

tom_mai78101 (104 views)
2014-04-10 04:04:31

BurntPizza (164 views)
2014-04-08 23:06:04

tom_mai78101 (260 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!