Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-11-22 20:41:05
Hi Abuse,

Sorry it's been a while since I checked the thread. I tried buffer strategy but it did not fix the issue. It basically just created a volatile image behind the scenes anyways which I had already tried. 

I actually did have delays after switching to FSEM - it was necessary for me to wait until FSEM was fully instantiated before the canvas.getWidth() and Height returned valid properties. Unfortunately that didn't fix the performance issue.

Regarding repaint - you are confusing BurntPizza's test code with mine. My code doesn't spin on repaint().
2  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 21:28:28
Unfortunately, no luck. Just as slow in FSEM. In the pseudo-fullscreen mode it is slightly slower that way (likely due to the buffer copy).

Weirdly, my BICUBIC interpolation now crashes with an NPE in J2D.

java.lang.NullPointerException
   at sun.java2d.pipe.DrawImage.renderImageXform(DrawImage.java:515)
   at sun.java2d.d3d.D3DDrawImage.renderImageXform(D3DDrawImage.java:77)
   at sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:268)
   at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:128)
   at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:1047)
   at sun.java2d.pipe.ValidatePipe.scaleImage(ValidatePipe.java:207)
   at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3047)
   at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2996)
3  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 17:33:07
Could be just vSync or something that's dropping you down to 30fps (though that still performs better than mine).

Yeah basically my solution is to do a 'simulated fullscreen' by creating an undecorated window that fills the entirety of the screen. Seems to work okay, I guess I'll go ahead with this unless someone has some magic to get fullscreen exclusive mode to work.
4  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-24 17:08:05
Are you able to reproduce the problem in fullscreen mode BurntPizza? Scouring this forum it sounds like there is a fair amount of knowledge on here about hardware accelerated images, and this feels like a pretty common situation when making a 2D game run fullscreen... surely someone has run into this before!
5  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 20:50:27
Turns out fullscreen mode is important - if I go into windowed mode, it takes about 2ms just like nearest neighbour. Still pluggin away.
6  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 17:53:38
I haven't, but ultimately it needs to run on my machine (and presumably any other machines with the same issue). I'm still a bit skeptical about your example - maybe it needs something drawn to the buffer for it to slow down?

Does buffer.getCapabilities(gc).isAccelerated() return false or true for you? I get "false".
7  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 15:51:41
Hmm nope. JPanel ~25ms even just for nearest neighbour, 60ms for Bilinear. Took a look at imgScalr and this "library" just calls g.drawImage()!!

Running out of ideas here Sad
8  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 15:27:41
I noticed that you are painting onto a JPanel whereas I am actually painting on a Canvas. like 8 years ago I recall testing the two and discovering that Canvas ran faster than JPanel but maybe for some reason using Canvas in this case eliminates the HW acceleration? Will see if I can try out JPanel.
9  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 02:44:32
Hmm. Welp. Thank you! This is very useful information but simultaneously pretty depressing that it seems like some sort of hardware thing. I will probably look at this more heavily tomorrow and see if I can write a software implementation that's not too bad.

Really want to avoid converting this whole renderer over to GL!
10  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 02:34:51
And what is getWidth() and getHeight() in your example? What are you scaling up to? (I am scaling up to 1920x1200 with setfullscreen enabled)
11  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 02:22:32
Haha what in the world. Is that right? How is this so fast for you... Like if you nanoTime() around that call what do you get (in ms?) Does it change depending on RenderingHints.BICUBIC?
12  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 02:07:10
ATI HD5770. Not the fanciest video card, but I do similar scaling in GL multiple times per frame and it is very very fast so I feel like this is clearly running in software and not HW.

Does this code run fast for you? In a blank canvas scaling an image 1280x800 up to 1920x1200?
13  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 02:01:39
BufferedImage@632f19fe: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 1280 height = 800 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0

So I think that's TYPE_INT_RGB. I seem to recall reading that the quickest type of rendering is whatever the canvas returns out of createImage so that the format matches.
14  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 01:57:06
Yes, exactly that. Here is the line. It's an Image.

1  
2  
3  
4  
5  
6  
7  
// elsewhere in the Canvas
buffer_ = createImage(bufW, bufH);

// In the render loop
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g.drawImage(buffer_, 0, 0, getWidth(), getHeight(), null);


I should point out that generally speaking all the rendering code runs very very fast (hundreds of images in <10ms), it's just this scaling that seems slow and it clearly seems to not be running on the hardware
15  Java Game APIs & Engines / Java 2D / Re: Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 01:50:01
Yeah BurntPizza, that is what I tried, but it is very, very slow. ~2ms for nearest neighbour, ~40ms for bilinear, ~145ms for bicubic. ddscale=true seems to have no effect.
16  Java Game APIs & Engines / Java 2D / Fast 2D hardware scaling of images (without GL?) on: 2014-10-23 01:17:33
Looking for a fast way to scale up a pretty big (1280x720) backbuffer with decent quality (not nearest-neighbour) to fit different resolution monitors for fullscreen mode. This would have to be something fast enough to execute at runtime, presumably using hardware accelerated scaling.

I can do this with GL fairly easily, wondering if there is a way in Java2D land.  I've mucked around with various different approaches to achieve this, including toggling ddscale=true (which seemed to have no effect for me).

Anyone have a solid tried-and-true method of achieving fast runtime scaling in Java2D to support multiple resolutions?

Thanks
17  Game Development / Newbie & Debugging Questions / Re: Random JVM crashes. (no JNI) on: 2013-06-20 12:47:37
Joen is right, there's lots of free memory. Funny but accurate explanation here: http://www.linuxatemyram.com/

Also, I do output the memory in a private log, it didn't exceed more than 10mb at one point. Plus, you'd think it would throw OutOfMemoryException not just crash the JVM.
18  Game Development / Newbie & Debugging Questions / Re: Random JVM crashes. (no JNI) on: 2013-06-19 13:18:59
- I am changing out the hardware so hopefully that will rule out that problem.
- Detailed info on the server and JVM is in http://pastebin.java-gaming.org/cfa70551363 but I tried both 6.0_27-b07 and 7.0_06-b24.
- The Linux box is: Linux 2.6.32-220.13.1.el6.x86_64 OS:CentOS release 6.4

I will ask why they installed 7.0_06 and try upgrading to the latest and see if that helps.
19  Game Development / Newbie & Debugging Questions / Random JVM crashes. (no JNI) on: 2013-06-18 20:08:45
Hello,

I have a J2SE application that is running the server for my game.  It runs on a Linux box that is getting a number of various JVM crashes. The program has no JNI and does not use any libraries, it's all just Java. The call stacks are always different, and I don't see any consistency in what is happening in the application when the JVM crashes. It does however always seem to be a SIGSEGV. Sometimes they happen after 2 minutes of uptime, sometimes after days.

I tried upgrading the JVM from 6.0_27-b07 to 7.0_06-b24 but it has made no difference. I uploaded all the hs_err logs here: http://www.tacticstudios.com/downloads/logs.rar if you would like to take a look.

Due to the inconsistent call stacks my only assumption is that memory is getting corrupted in some way, and the crash is occurring later on.  Maybe it is a hardware problem? I'm not certain what would cause this.

Any assistance you can provide in how to debug this, or any ideas would be extremely appreciated. Here is the most recent log: http://pastebin.java-gaming.org/cfa70551363

Jesse
20  Game Development / Performance Tuning / Random JVM crashes (no JNI) --- wrong subforum... remove on: 2013-06-18 20:04:09
Hello,

I have a J2SE application that is running the server for my game.  It runs on a Linux box that is getting a number of various JVM crashes. The program has no JNI and does not use any libraries, it's all just Java. The call stacks are always different, and I don't see any consistency in what is happening in the application when the JVM crashes. It does however always seem to be a SIGSEGV. Sometimes they happen after 2 minutes of uptime, sometimes after days.

I tried upgrading the JVM from 6.0_27-b07 to 7.0_06-b24 but it has made no difference. I uploaded all the hs_err logs here: http://www.tacticstudios.com/downloads/logs.rar if you would like to take a look.

Due to the inconsistent call stacks my only assumption is that memory is getting corrupted in some way, and the crash is occurring later on.  Maybe it is a hardware problem? I'm not certain what would cause this.

Any assistance you can provide in how to debug this, or any ideas would be extremely appreciated. Here is the most recent log: http://pastebin.java-gaming.org/cfa70551363

Jesse

EDIT: This was put in the wrong forum... I guess I had multiple windows open. Meant to be under "Newbie" questions... Posting over there. Please delete!
21  Game Development / Newbie & Debugging Questions / Re: Avoiding "The application's digital signature cannot be verified" on: 2012-03-05 01:19:08
Right, of course! Brilliant! Thank you.
22  Game Development / Newbie & Debugging Questions / Re: Avoiding "The application's digital signature cannot be verified" on: 2012-03-04 23:50:18
Is Verisign the one to use if I have to pay?

I actually tried completely removing the clipboard and robot and it is still showing... is there some way to show what in my project is causing this thing to appear?
23  Game Development / Newbie & Debugging Questions / Avoiding "The application's digital signature cannot be verified" on: 2012-02-28 17:24:41
I self-sign my applets and of course the user is presented with a screen that prompts them to confirm the digital signature every time they visit the page (unless they confirm they don't want to see the message again).

It's appearing because I request access to the user's clipboard (so they can cut & paste text), and to lock their mouse to the applet (so they can scroll around in the game easier)

Is there seriously no way of avoiding this message? Like getting the applet signed or approved by Verisign or somebody that can confirm it's just a game and not out to steal your private information.
24  Game Development / Newbie & Debugging Questions / Re: Weird rendering glitch on: 2010-03-20 16:49:40
I store the Graphics object of the backbuffer as a member variable of the main frame. It's just an image I use for double buffering to prevent flickering.  I don't store the Graphics object of the paint() method that's passed as a parameter. 
25  Game Development / Newbie & Debugging Questions / Re: Weird rendering glitch on: 2010-03-20 02:05:54
Yeah the browsers are IE, Mozilla, and Chrome.  All 3 it's doing this on his machine.  I've tried all three locally and they all work fine for me.

The applet calls repaint() on the Canvas every frame.  ie. there is a main thread that runs the game and calls the repaint method every X milliseconds.  I add the main Canvas to the JApplet's ContentPane on applet initialization. I can try calling repaint() on the Applet itself... will let you know how that goes.

For the load screen (which I'm less concerned about if the game ends up working fine) the HTML is as follows:
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  
<html>
<title>Immortal Empire</title>
<link rel="stylesheet" href="iempire.css" type="text/css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<body>
<TABLE WIDTH=100% border=0 cellpadding=0 cellspacing=0>
<TR ALIGN=CENTER HEIGHT=80%>
<TD ALIGN=CENTER VALIGN=CENTER>
<BR><BR>
<applet code=Main.IsoGame.class width="800" height="600">
<param name="boxbgcolor" value="#000000">
<param name="boxfgcolor" value="#000000">
<param name="progresscolor" value="#9B5000">
<param name="boxborder" value="false">
<param name="image" value="ie_loadscreen.gif">
<param name="cache_archive" value="IsoGame.jar,IsoImages_interface.jar,IsoImages_game.jar,IsoSounds_interface.jar,IsoSounds_game.jar,IsoMusic_bossbattle.jar,IsoMusic_cinematic_standard.jar,IsoMusic_cinematic_vuldreth.jar,IsoMusic_desert.jar,IsoMusic_dialog_dazo.jar,IsoMusic_dialog_elder.jar,IsoMusic_dialog_maielle.jar,IsoMusic_grasslands.jar,IsoMusic_menu_0.jar,IsoMusic_menu_1.jar,IsoMusic_volcanic.jar,IsoLib_jogg.jar,IsoLib_jorbis.jar,IsoLib_tritonius.jar,IsoLib_vorbis.jar">
<param name="cache_option" value="Plugin">
<param name="cache_version" value="0.0.3.4,0.0.1.D,0.0.1.C,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8">
You cannot play this game because you do not have Java installed.  Java is a free download, please acquire it from <A HREF="http://www.java.com" target="_blank">http://www.java.com</A>.
</applet>
</TD>
</TR>
</TABLE>
</body>
</html>


It took me a while to settle on this type of deployment since it handles JAR caching and JAR indexing correctly in all browsers without needing javascript. I don't use JNLP - but maybe I should?
26  Game Development / Newbie & Debugging Questions / Weird rendering glitch on: 2010-03-19 14:48:17
Hello,

One of my customers is experiencing a very strange problem when trying to access my game.  It's a Java Applet.  Just to be clear - this is the applet loading screen.  It does it when displaying the game too.  He says it's happening in all 3 browsers (ie, firefox, chrome).  Given that it's happening on the applet load screen I feel like the HTML must be the culprit, but to be honest I'm completely stumped here.

Here's a screenshot:


Here's how it's supposed to look:


Here's another example of the login screen (this is in-game code)



and how it's supposed to look:



Ignore the debug info - was just some stuff I printed to help debug the problem.

Anyone seen this before or have any idea what's going on here?  Most of my customers have no problem.  Website is www.immortal-empire.com
27  Games Center / Archived Projects / Multiplayer Strategy RPG - Immortal Empire on: 2010-01-30 00:42:59
Hey guys,

I've posted here a few times and this community has always been very helpful to our cause.  Our game just launched, Immortal Empire: http://www.tacticstudios.com/empire

It's a Multiplayer Strategy RPG.  Play co-op, or PvP, has a free trial.  $10 and you get a permanent account, could not be cheaper.

Here is the trailer: http://www.youtube.com/watch?v=j-cyLJmBe_U

Screens below:




Javagaming.org makes the credits for your help Smiley

Thanks,

Jesse Attard
28  Game Development / Newbie & Debugging Questions / Re: Jar Indexing progress bar on: 2009-11-27 16:38:03
Yes that's what I'm currently debating. It seems like that will work fine.  But it makes me cry on the inside
29  Game Development / Newbie & Debugging Questions / Re: Jar Indexing progress bar on: 2009-11-27 14:53:27
There's no particular reason I'm using the class loader - other than that it works and caches in the way I want it to.  Just has this problem with the progress bar. 

I have not used the URLConnection before, but I will definitely give that a shot.  I am concerned however that the caching it would use sounds like it is not as persistent as the JAR caching.  (for example, it mentions circumventing the cache if the user hits refresh on their browser)  With Jar Caching, the file is cached until the user manually deletes it or it is updated server-side.

Jesse
30  Game Development / Newbie & Debugging Questions / Re: Jar Indexing progress bar on: 2009-11-26 19:03:22
Okay, I follow what you are saying. I can do this no problem - however in my calling code, I am not actually "reading" the data into memory. I am simply "touching" it so Jar Indexing decides to download the JAR.

My code looks like:

1  
GetClass().getResourceAsStream(filename);


This is the function that blocks until the JAR is finished downloading.  Now I could wrap this in a subclass like you suggest, such as

1  
new WrappedInputStream(getClass().getResourceAsStream(filename));


but this will just block in the same way as before. My overloaded read methods would never be executed.

Jesse
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TheDudeFromCI (9 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (91 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (102 views)
2014-11-29 21:32:03

toopeicgaming1999 (161 views)
2014-11-26 15:22:04
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
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!