Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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-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
2  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.
3  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!
4  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)
5  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?
6  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?
7  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.
8  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
9  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.
10  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
11  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.
12  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.
13  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
14  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!
15  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.
16  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?
17  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.
18  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. 
19  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?
20  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
21  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
22  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
23  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
24  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
25  Game Development / Newbie & Debugging Questions / Re: Jar Indexing progress bar on: 2009-11-26 14:41:46
How do you wrap the stream? Would you mind sharing your code?

Jesse
26  Game Development / Newbie & Debugging Questions / Jar Indexing progress bar on: 2009-11-26 04:37:54
Hello,

I am using Jar Indexing to load certain parts of the game at opportune times for the end user.

For example, most of the source (1mb worth or so) is in one JAR, whereas sfx and music are in another (27mb or so).

So they are able to download the basic 1mb app and show an in-game load screen.  The problem is, there doesn't seem to be any callback for when elements inside a jar are loaded from indexing.

Does anyone know a way around this? I'm referencing the audio in a separate thread, but that thread just blocks until the whole 27mb is downloaded. Best I can do right now is a spinner, but some indication of progress would be great.

Thanks for any help,

Jesse
27  Java Game APIs & Engines / Java Sound & OpenAL / Re: Fast way to play sounds in Java Applet on: 2009-06-11 03:26:38
Been a while before I was able to try this out, but wanted to post thanks because this totally worked and solved the problem.  Plays mega fast now
28  Java Game APIs & Engines / Java Sound & OpenAL / Fast way to play sounds in Java Applet on: 2009-04-12 14:25:02
Saw a post slightly below this asking same question but didn't find an answer so I'll repost his question since I am having the same problem.

I am playing small 22khz 16 bit WAV sound clips in a Java Applet using the following code:

1  
2  
3  
4  
5  
6  
7  
InputStream is = loadFile(filename);
AudioInputStream ain = AudioSystem.getAudioInputStream(is);
DataLine.Info info = new DataLine.Info(Clip.class, ain.getFormat());      
Clip clip = (Clip)AudioSystem.getLine(info);
clip.open(ain);
clip.start();
// I close the clip object with a linelistener once it's done playing


Works great, but takes about 6ms to execute, even on sounds that have already been loaded. I need to be able to play this sound more than once, and allow overlapping of that same sound.

Would like something more responsive - anyone have a faster method to play sound?

Some things I have tried:
- Holding a reference to the clip instance rather than reinstantiating seems to drop from 6ms to 2ms, but then repeating the same sound interrupts itself... I could get around this by keeping say, 4 references to the same clip but I'm also having issues with sounds entirely cutting out (never playing again) using this method.
- The basic play(getCodeBase(), filename) stuff is slow and doesn't allow overlapping whatsoever
- OGG code streaming in a separate thread, this seems decent for music but for sound clips not responsive enough

Thanks,

Jesse
29  Game Development / Newbie & Debugging Questions / Re: Loading resources from multiple JARs on: 2008-10-07 01:25:13
Umm so I named it resources.Jar with a capital J.  Wow I'm bad.  Umm... yeah. embarassed
30  Game Development / Newbie & Debugging Questions / Re: Loading resources from multiple JARs on: 2008-10-07 01:06:15
Sorry it took so long to reply. I just tried with no space in the ARCHIVE tag, and it made no difference.

No one has deployed a game through an applet like this? =(
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.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (36 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
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

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