Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  No flicker, but traces and greying, someone help!  (Read 4327 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-07-20 17:28:01 »

I'm writing a relatively simple game, asteroids style sort of. Anyway, its scrolling and shooting and stuff but I'm getting some tracing of sprites and a little greying of the background stars..

Could someone have a look and see if they can explain the effects? I'm actually using buffer strategies so I'd expected to prevent this sort of thing..

http://www.cokeandcode.com/astroprime

Its a webstart and very basic at the moment. If you just start a local a server then enter the death match you'll be able to see the problems (and fly around).

Thanks for any help

Kev

PS. I've also got a few questions on how to make things look like they're glowing (shields/explosions etc..), but I'll save them til later Smiley

Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #1 - Posted 2003-07-20 19:22:56 »

Works fine 4 me (apart from the 1st time, when I had kazaa running in the background - it crashed the PC Angry Kiss)

Can u post a screenshot of the visual problems u are seeing?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2003-07-20 19:31:18 »

I'm thinking maybe its my laptop screen leaving blur behind it since when I take a screen shot things look fine.. thanks for checking tho..

Ok, I'll start another post for the visual effects I'm trying to achieve now Smiley

Kev

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

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2003-07-21 03:58:01 »

I can't start a game on Mac OS X.  The connect, settings, exit, local server buttons all don't respond to clicks.  I can type server addresses and passwords (hit enter to move between those two fields) and press Esc to exit.. that's it.

Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2003-07-21 04:32:02 »

I don't know if Macs do this or not, but check to make sure that the annoying "Would you like to create a shortcut?" dialog is gone before you enter full screen mode. It has an annoying way of grabbing the input.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2003-07-21 04:57:41 »

Damn it, damn it, damn it..

Really starting to wish I had access to a Mac, this is the second time something doesn't work.

Is there a document somewhere that describes differences between Mac and Windows VMs and hopefully the common gotchas..

This I would suppose would be something to do with which mouse events actually get fired.

OOI, when you attempt to click on the connect button, does the white box around it go grey?

Thanks for the feedback,

Kev

Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #6 - Posted 2003-07-21 08:48:04 »

yeah, I had that dialog stealing focus from the full screen window. (the only thing that gave it away, was the mouse cursor, which reverted to the system cursor instead of that little ship) The solution is ez enough, just press escape once.

The new veresion with the 'do you want to play fullscreen' dialog fixes the problem though Smiley

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #7 - Posted 2003-07-21 15:40:10 »

Quote
Damn it, damn it, damn it..

Really starting to wish I had access to a Mac, this is the second time something doesn't work.

Is there a document somewhere that describes differences between Mac and Windows VMs and hopefully the common gotchas..

This I would suppose would be something to do with which mouse events actually get fired.

OOI, when you attempt to click on the connect button, does the white box around it go grey?


Since I can type in the password and server fields it seem that stolen focus should not be the issue... even if it was.. clicking should change the focus..

The box around the button does not change in any way when it is clicked.

You might find helpful docs here http://developer.apple.com/java/

I can look a bit deeper this evening.  I'm happy to test on the Mac for people. In the end it means more games for us Mac users.

If you sign up as a developer on Apple's web site (there is a level of free membership) you can access their java-dev email list and ask questions there.  It might be a good place to ask for volunteer testers as well.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #8 - Posted 2003-07-21 15:42:16 »

I was really wondering whether mousePressed gets called at all on OSX?

Maybe just mouseClicked gets called or something?

Can you click on the text fields to change which one has focus?

Cheers,

Kev

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #9 - Posted 2003-07-21 15:49:10 »

No I can't - focus only changes when I press enter.

There are no messages in the webstart log.  It seems as if no mouse presses are being registered at all.

If you add some debug output I can try again and send you the results.

As far as I know mousePressed is fully supported... but there could be Bugs with Apple's fullscreen implementation maybe??  I will reset and try window mode.

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

JGO Coder




Where's the Kaboom?


« Reply #10 - Posted 2003-07-21 15:53:34 »

Ok, how do I get it to ask me about fullscreen mode again?

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2003-07-21 16:17:05 »

Fraid you need to click the settings button to get to that option after the first check..

However, if you locate the directory ".astroprime" someone (depends on webstart) on your harddrive and delete the files inside (or edit them, its pretty obvious properties files), should get check again..

Thanks for the support,

Kev

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #12 - Posted 2003-07-21 18:33:46 »

Could you give me a better hint?Smiley  What APIs are you using to make the .astroprime folder?  I can't find it anywhere.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2003-07-21 18:37:28 »

doh! it only does that on windows. Its a nasty hack round webstarts user directory.

You're looking for a file called client.props

Sorry about the mistake,

Kev

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #14 - Posted 2003-07-21 20:24:42 »

Found it.. BUT... don't do that.  It has put clients.prop in the directory with the Web Start application and/or the root of the HD.  Something that I feel Web Start apps shouldn't be messing with.  (It is possible even that on some systems the file permissions would make this impossible.)

What is wrong with the user's home directory?

Ok.. Test Results:

It works in windowed mode! Interesting... if we can isolate the full-screen problem I will file a bug report with Apple.
The text in the middle of the screen when you start a game is illegible.  (I think it says press space to start or something like that.)
Your ship appears on top of a green square that rotates with the ship.
During the game the cursor is changed to a small black rectangle.

Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #15 - Posted 2003-07-21 20:52:55 »

Quote
Found it.. BUT... don't do that.  It has put clients.prop in the directory with the Web Start application and/or the root of the HD.  Something that I feel Web Start apps shouldn't be messing with.  (It is possible even that on some systems the file permissions would make this impossible.)

What is wrong with the user's home directory?

Ok.. Test Results:

It works in windowed mode! Interesting... if we can isolate the full-screen problem I will file a bug report with Apple.
The text in the middle of the screen when you start a game is illegible.  (I think it says press space to start or something like that.)
Your ship appears on top of a green square that rotates with the ship.
During the game the cursor is changed to a small black rectangle.



hahahaha,
looks like you've got your work cut out for ya kev Smiley

write once, debug everywhere bwhahahah Wink

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #16 - Posted 2003-07-22 06:18:57 »

Quote

Found it.. BUT... don't do that.  It has put clients.prop in the directory with the Web Start application and/or the root of the HD.  Something that I feel Web Start apps shouldn't be messing with.  (It is possible even that on some systems the file permissions would make this impossible.)

What is wrong with the user's home directory?

Ok.. Test Results:

It works in windowed mode! Interesting... if we can isolate the full-screen problem I will file a bug report with Apple.
The text in the middle of the screen when you start a game is illegible.  (I think it says press space to start or something like that.)
Your ship appears on top of a green square that rotates with the ship.
During the game the cursor is changed to a small black rectangle.


First, let me say, YOU ARE A STAR. Thanks, really needed some OSX testing.

* The directory it tries to write to is ".". Which, I had assumed that web start created a directory to run each app in, and hence using "." would keep all the files with the application. I've already put a hack in for windows. I'll rectify this. Does the "user.home" still work as system property on all platforms?

* Yeah, I've been kind of aware of the text problem. It will get updated at a later time. At this moment, its not really at alpha test yet. Just needed to sort this visual style out.

* See, the green square is interesting. The Ship is a gif with a transparent background. The color of the background is a vibrant green (to help with screening it out). So, OSX isn't supporting transparent gifs? Or, more likely, I'm doing something wrong?

* The cursor, again, its a black sqaure, but all the alpha is set to 0, meaning it should be a transparent black square. This is how I turn the mouse off. Doesn't seem to be any other way. So again, OSX isn't supporting transparency, or do I need to turn something on? Again, I'll look into it and post back.

Just to reiterate, MUCH MUCH MUCH appreciated.

Kev 'off to find the Java 2D bug parade'


Abuse: Damn right, Java2D really does need work to be compatible across platforms. The above problem would be hassle for even applications, let alone games. But I suppose its a step better (in my view) than worrying about platform,vendor and driver dependance in something OpenGL Smiley.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #17 - Posted 2003-07-22 07:30:13 »

I've just been convinced that the sensible thing to do is "go and have a look at JOGL/LWJGL" and use it for 2D games.

So, I'm off to have a look. Damn it, I hate using native libraries.

Kev

Offline krypto

Junior Member




while(true) { self.caffeinate (); }


« Reply #18 - Posted 2003-07-22 10:04:04 »

IS it possible os x's pallette doesn't support the particular mask color you are using.?

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline krypto

Junior Member




while(true) { self.caffeinate (); }


« Reply #19 - Posted 2003-07-22 10:05:17 »

Quote
I've just been convinced that the sensible thing to do is "go and have a look at JOGL/LWJGL" and use it for 2D games.

So, I'm off to have a look. Damn it, I hate using native libraries.

Kev



That would be a shame, I know you have been an inspiration and valuable learning source to people like me. People who don't want to use native stuff, just straight java. Embarrassed

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #20 - Posted 2003-07-22 10:14:36 »

I'm just going to test the waters. What with my new experience of web start I wondering whether the distribution of native libraries is really something the user has to end up worrying about anyway.

That said, at the moment, I'm still of the opinion pure Java is still the ideal solution.

Kev

Offline krypto

Junior Member




while(true) { self.caffeinate (); }


« Reply #21 - Posted 2003-07-22 10:16:51 »

Quote
I'm just going to test the waters. What with my new experience of web start I wondering whether the distribution of native libraries is really something the user has to end up worrying about anyway.

That said, at the moment, I'm still of the opinion pure Java is still the ideal solution.

Kev
 In my case its not the end user I'm worried about. I develop on a laptop, old rage mobility card. None of the opengl/gl4java/jogl demos have ever run well or consistanly for me.

JRPG Users -  General Users Site
JRPG Developers -  The JRPG Project's Home
Archimedes
Guest
« Reply #22 - Posted 2003-07-22 10:23:21 »

Quote
That said, at the moment, I'm still of the opinion pure Java is still the ideal solution.Kev

This is more than an opinion, it's the reason that Java exists. :-)  Otherwise there's no need for a JVM - an "emulator".

Now to the but...
I'm just using Jogl because my current Java application is to draw (hopefully fast) 3d graphics.
Furthermore I hope that Jogl will enter the standard Java edition one day; so this day using Jogl will mean to use pure Java. :-)
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #23 - Posted 2003-07-22 13:11:38 »

Quote
First, let me say, YOU ARE A STAR.

Err.  "God" actually Smiley
<----

Quote
Does the "user.home" still work as system property on all platforms?

It works on OS X, Windows and Linux.

Quote
* See, the green square is interesting. The Ship is a gif with a transparent background. The color of the background is a vibrant green (to help with screening it out). So, OSX isn't supporting transparent gifs?

I'm using both GIFs and PNGs with transparency in my Swing app and they are working fine.  How do you load the GIF?  Do you transfer it to another image before using it? Maybe there is a step where the alpha is getting lost?  This is interesting and something that we should figure out as it is likely to catch other developers as well.

Re:Write Once, Debug everywhere... You have to expect some of that. what are the chances that every JRE implementation is going to have (only) the exact same bugs?  It's no different than having bugs in different implementations of libc or such.  Just look at the hell that configure scripts go through to test platform inconsistencies for C/C++ projects on unix.

If you go with JOGL I will be unable to test further until the next version of OS X is released Sad  I don't have access to the developer preview required to run JOGL on the Mac. ($$)

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #24 - Posted 2003-07-22 13:44:55 »

Coo, I was under the impression the JOGL mac version was out, about and already in use... hmm...

The GIF is loaded using ImageIO I think, but it is then transferred into an accelerated image (which I believe has transparency currently set to BITMASK).

I'm only going for a sojourn (spelling?) in JOGL country. If its great, I might stay, if not, I'll be hiking back over this way.

Kev

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #25 - Posted 2003-07-22 14:26:08 »

JOGL is available and working on the Mac... IF you have the developer preview of OS X 10.3.  For that you need to pay.. and since my company doesn't develop for the Mac in particular they aren't going to pay for the level of developer support that would get me access to that preview.

I think that transfer of the image from the one returned by ImageIO to the other is likely where the alpha is somehow lost.  If you can send me a small example of how you do that I can submit it in a bug report to Apple, or we might uncover a flaw in your logic (perhaps the behavior is not clearly defined?).

You could compare with using the AWT image loading which will produce a managed (accelerated) image from the start.

Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #26 - Posted 2003-07-22 14:39:56 »

This is the top of one of my classes. I'm at work right now, so this is from the CVS repository at java.net. I will be passing an image loaded from ImageIO into this method:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
/**
 * A set of utility methods to load images
 *
 * @author Kevin Glass
 */

public class ImageLoader {
    public static int TRANSPARENCY = Transparency.BITMASK;
   
    public static Image createMaskedImage(Image src) {
        Image image;

        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        image = gc.createCompatibleImage(src.getWidth(null), src.getHeight(null),
                                         TRANSPARENCY);

        image.getGraphics().drawImage(src,0,0,null);
       
        return image;
    }


And using the returned image.

Kev

Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #27 - Posted 2003-07-22 15:31:52 »

Quote
This is the top of one of my classes. I'm at work right now, so this is from the CVS repository at java.net. I will be passing an image loaded from ImageIO into this method:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
/**
 * A set of utility methods to load images
 *
 * @author Kevin Glass
 */

public class ImageLoader {
    public static int TRANSPARENCY = Transparency.BITMASK;
    
    public static Image createMaskedImage(Image src) {
        Image image;

        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        image = gc.createCompatibleImage(src.getWidth(null), src.getHeight(null),
                                         TRANSPARENCY);

        image.getGraphics().drawImage(src,0,0,null);
        
        return image;
    }


And using the returned image.

Kev


Thats where your bug is! Smiley

You are assuming the image returned from createCompatibleImage() starts off totally transparent.

It does in the Windows JRE, but it is not guaranteed to.
(and looks like Apple decided to go with something different Roll Eyes)
(incidentally, I ran into this same bug in J2ME :p
The Sun MIDP reference implementation initialises images to White, where as the Nokia implementation initialises to Black Roll Eyes)

You should change your load code to look something like this (so you are guaranteed to maintain the Alpha in the source image) :-

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
import java.awt.*;
import java.awt.image.*;
public class ImageLoader
{
   final GraphicsConfiguration gc;
   public ImageLoader(GraphicsConfiguration gc)
   {
      if(gc==null)
      {
         gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
      }
      this.gc = gc;
   }

   public BufferedImage loadImage(String resource)
   {
      try
      {
         BufferedImage src = javax.imageio.ImageIO.read(getClass().getResource(resource));
         //Images returned from ImageIO are NOT managedImages
        //Therefor, we copy it into a ManagedImage
        BufferedImage dst = gc.createCompatibleImage(src.getWidth(),src.getHeight(),src.getColorModel().getTransparency());
         Graphics2D g2d = dst.createGraphics();
         g2d.setComposite(AlphaComposite.Src);
         g2d.drawImage(src,0,0,null);
         g2d.dispose();
         return dst;
      }
      catch(java.io.IOException e)
      {
         return null;
      }
   }
}

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline kevglass

JGO Kernel


Medals: 85
Projects: 25


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #28 - Posted 2003-07-22 15:54:25 »

Updated, new version on webstart.

Now I'm going to try the JOGL stuff...

Kev

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #29 - Posted 2003-07-22 17:19:41 »

I still get the green background... I'm looking into it...

Pages: [1] 2
  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 (12 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (182 views)
2014-04-01 02:16:10
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

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