Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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: Isometric Engine on: 2003-05-19 20:16:58
I'm not really a graphics guru but here's a suggestion to prevent refreshing all visible tiles for occlusion.  If you attribute each tile with a height value (could be as simple as 1 or 0) then you check the surrounding tiles of the player (i.e. the ones lower then them on screen) and if they have the height set then you redraw otherwise you know the player isn't occluded.

I don't know if this would be useful or not but it seems like you trade redrawing everything for about 3 ifs (and of course some memory accesses Smiley)
2  Java Game APIs & Engines / Java 2D / Perfomance Problems related to GC?  Look here on: 2003-05-15 20:18:20
The following is the Garbage Collector Portal from Sun.  It mines the GC logs to give you GC info.  It may prove useful and confirm if that pause is because you caused GC or ineffecient rendering code.  Hope this helps Smiley

http://developer.java.sun.com/developer/technicalArticles/Programming/GCPortal/
3  Java Game APIs & Engines / Java 2D / Re: Fire-Power clone, how to start? on: 2003-05-15 19:33:32
Cheesy

I think you misinterpreted.

(Although I'd expect no less from the author) should read "Although I'd expect the author to pimp his own stuff".  Grin

4  Java Game APIs & Engines / Java 2D / Re: GAGE Licensing on: 2003-05-15 19:28:22
Good lord I've created a monster!  And yeah, wow, going from a licensing question to printing source code on toilet paper is about as far of the mark as I can conceive.

jbanes, I'm doing (get ready to roll your eyes) Yet Another MMORPG.  I have the 2D and Sound already written so I just need the timer.  I'll drop you a line if I ever get my lazy butt in to gear and finish what I've started.

P.S.  Use two-ply.

P.P.S.  What in the heck do you use caffienated soap for?  I mean aside for washing.  Do you eat it?  I mean, egad man, What's the point!
5  Java Game APIs & Engines / Java 2D / GAGE Licensing on: 2003-05-14 17:28:31
Just out of curiousity what type of license do you have for GAGE?  I'm writing something and I'd like to use the GAGE Timer and I'm willing to give credit and all.
6  Java Game APIs & Engines / Java 2D / Re: Fire-Power clone, how to start? on: 2003-05-14 17:21:21
jbanes, the digital GAGE pimp  Grin.  It is a really good API so if you want a quick start I suggest it.

(Although I'd expect no less from the author)
7  Java Game APIs & Engines / Java 2D / Re: java race game on: 2003-05-14 17:19:07
P.S.  I'd cheat on the map vs. avatar collision if I were you.  First, I'd have the course be on infinite pavement and the track be simple bounding lines drawn on the pavement.  That way you can just have the car "correct" it's course if it gets to the track edge.  Cheating yes, but since this doesn't sound like this needs to be super advanced I'm go that way.  You can always add features later.
8  Java Game APIs & Engines / Java 2D / Re: java race game on: 2003-05-14 17:16:50
For the XML stuff I can whole heartedly recommend JDOM.  It's worked like a charm for me.

I'm with Abuse on this one.  With real life you have stuff like friction, wind resistance (a.k.a. wind friction), center's of gravity, the track altering the physics as we all know grass behaves differently than dirt which is different than pavement, etc.  The list goes on and on.

Although unless you handed in a design doc specifically stating you'll be implementing all that, I'd just assume fixed car weight, fixed road friction, make all terrain pavement, have no weather and a bunch of other simplifications.  At that point you can make your racing game almost like that space game.  Only problem is that it'll feel floaty and very unrealistic.  But hey, it's your interpretation, right?  Who says it's got to be Gran Turismo on the first go?
9  Java Game APIs & Engines / Java 2D / Re: Semi-transparent Image painting? on: 2003-05-12 12:51:01
A quick side note is that by grabbing the pixel data for the BufferedImage it can no longer be accelerated.
10  Java Game APIs & Engines / Java Sound & OpenAL / Re: Java Sound Sucks on: 2003-05-12 12:47:33
Assuming you can get JOrbis to work right.  I still have that problem with the OGG -> WAV never returning.  I hope OpenAL is better.
11  Java Game APIs & Engines / Java 3D / Re: Leaves: coloured shapes or textures? on: 2003-05-08 13:18:20
I'm no 3D graphics wizard but I'd think the textured route would be faster.  The only reason I say this is lighting and movement.

Say you want wind, then having a bunch of shapes could actually be moved dynamically whereas a texture could not (without looking funny).  Anyhow, just one reason why one would want shapes.

But for lighting, wouldn't that cause a serious drain on realtime shading if you have individual leaves?  I realize you're having them a flat color, but that way they'd look funny as no leaves would cast shadows on each other.  A single texture would be shaded as the object you've applied it to.  I hope I'm not sticking my foot in my mouth though.
12  Java Game APIs & Engines / Java 3D / Re: Finished my tutorial - please check it on: 2003-05-01 19:41:59
I can respect your bold decision to ignore the most noble of all punctuation, the period.  Many do not know the fascinating and intrepid history of the Period, and I am one of those people.  So, yeah, nice work.

But I warn you, one day your going to get pulled over for blowing through all those stop signs. Smiley
13  Java Game APIs & Engines / Java 3D / Re: Finished my tutorial - please check it on: 2003-05-01 13:40:48
Pretty good, has some formatting issues though (as you know).  I kind of agree with MisterX, the introduction paragraph had way too many I's.

The only other piece of advice is this:  The period is your friend.
14  Java Game APIs & Engines / Java 2D / Re: Basic questions on Buffer Strategy, please hel on: 2003-04-29 20:37:50
Ummm...well, I didn't say I implemented it properly Smiley

I actually just used a timer and made sure to only render after the vsync refresh.  The entire code was in place and all I needed was a timer with 1 ms resolution.  So I say I implemented it, but really it wasn't fully since I didn't have an appropriate timer.

BTW, I know about the GAGETimer.  I just haven't gotten around to doing animation yet so I haven't bothered with it.
15  Java Game APIs & Engines / Java 2D / Re: Advice for a newb? on: 2003-04-29 20:32:35
Let's not forget Star Control 2 although one may argue that's not Strategy.  Though the original Star Control was.

To make my post a little more substantial I'll add some comments on Java and Space Strategy game design.

My biggest problem with Space Strategies is that they're epic.  Too epic.  I find that most of them have a threshold after which the entire rest of the game becomes cleanup.  And that's very, very dull.  So if anything you should try to address the issue of end-game slowdown.

I myself am a professional Java developer (well, I get paid for it, I don't know how professional I am  Grin) and started my own game, simply for the sake of learning and my love of games.  From what I've learned, one very important thing is your API choice.  It can make your life easy or miserable.  Unless you're crazy to make your own, do your research carefully and make sure the API you choose suits your needs, be it graphics (LWGL, Java3D, etc.) or sound (JavaSound, Tritinous, OpenAL, etc.).
16  Java Game APIs & Engines / Java 2D / Re: Basic questions on Buffer Strategy, please hel on: 2003-04-28 16:03:41
So BufferStrategy is VSync locked automatically?  I looked through the entire JavaDoc and couldn't find anything about VSync, so I implemented my own.   :-/
17  Java Game APIs & Engines / Java 2D / Re: BufferStrategy and Alt-Tab on: 2003-04-22 13:39:22
I get the same problem as well actually with a Geforce 4 Ti 4400 and I think not the latest but the previous release of the Detonator drivers.  Are you using Detonators as well?
18  Java Game APIs & Engines / Java 2D / Re: "Snap-to-grid" functionality on: 2003-04-17 13:08:03
Ah, didn't think of that.  Although if it were me and I needed to use the keyboard for example, I'd simple capture the keypress and move the component in my grid increments rather than worrying about relative alignment and stuff.
19  Java Game APIs & Engines / Java Sound & OpenAL / Re: OGG Help on: 2003-04-16 13:48:27
Ah, unfortunately this thread doesn't have what I posted in a different thread.  Too bad it can't automagically update all related posts Smiley

Anyhow, the problem lies in the fact that once converted to PCM, the AudioInputStream always returns -1 for getFrameLength() and available() always returns 0.  This is due to something deep deep in the Tritonus API where the AudioInputStream is actually reading from an internal TCircularBuffer.  This buffer blocks on the read with a
1  
 while (buffer.available() == 0) { Object.wait(); } 


Since available() is always 0 at the end it always blocks.  There's also a condition where if frameLength == -1 then it skips the EOF check based on frameLength.  When I found this out I was overjoyed and thought maybe I could fix it.  Then I tried a smaller file, about 1MB.  And lo and behold it worked perfectly fine.  In fact it only starts this problem once the input file size gets to around 3MB.  So I was back to square one.  I emailed the VorbisSPI who are responsible for the OGG to PCM conversion code but they haven't responded.  And it looks like Tritonus is all but dead considering they haven't updated in like 2 years.

P.S.  That's all the code necessary but you need to have the proper jars.  VorbisSPI 0.6 should have all of them and I can't get VorbisSPI 0.7 to recognize an OGG file and they haven't been any help on that bug either.

Of course they were really helpful for a different problem I have, so what can I expect for free Smiley  And it does work really well except for the bugs I'm battling now.
20  Java Game APIs & Engines / Java 2D / Re: "Snap-to-grid" functionality on: 2003-04-16 01:40:26
Wouldn't you want the object position to then become the aligned position?  I would think it would be confusing if you align something to a grid but the data is not aligned.

Dunno if that's what you want.  I had to implement this for my job, I created a form builder, but since the form was printable I had to make sure that the object was where it was on the screen as well as on the paper.
21  Java Game APIs & Engines / Java Sound & OpenAL / Re: OGG Help on: 2003-04-16 01:37:51
I'm not quite sure I understand.  Isn't that just the same thing I have just syntactically shortened?  I appreciate your help but I'm not sure I catch your drift.  Could you further explain?
22  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 23:50:13
The bug is not there in 1.4.1_02 because I just tried loading a 1 pixel image and it worked fine.  I discovered that no matter what I did, the initial delay was always around 1.2s for the first image.  Turns out it doesn't matter if it's a 1360x768 or 16x16 image, ImageIO takes 1.2s to warm up.  So, I had this idea, I'll try to warm up ImageIO before I do anything else.  Sure enough by loading a single pixel image (I'm sure size doesn't matter though) before I do anything else (even starting my rendering loop) I cut down the initial delay to 100ms.  Then it only takes 300ms for my background instead of 1.2s.

Hope this helps anyone else who might have this issue.
23  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:36:30
Abuse, you are...well...<sniff sniff>....my hero...the wind beneath my wings...

But seriously Thank you very very much.  That was definitely it.  Using ImageIO took a 12s startup down to 2s.  And that'll definitely teach me to be lazy.

Thank you to everyone who helped.
24  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:31:52
Oops forgot to mention that I think MediaTracker is somehow behind this, although I'm sure you all figured that out anyhow Smiley
25  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:30:26
Ah, I gotcha.  Yeah since I created those images I can definitely say they have transparent pixels.

BTW, I think I've finally narrowed it down.  I tried on a whim to load a completely different image first.  Turns out no matter what image I load, I get an initial 7s delay from ImageIcon.  This surprised me when a 100 byte GIF took 7s to load.  And after testing I get this no matter which image I use.  Now, granted that I get about 1s extra from the 1360x768 image.  But that's acceptable.  The 6~7s pause it what's unacceptable.
26  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:21:47
Interesting.  The strange thing is that I have other transparent images and they work fine with transparency as it is.  Dunno how I got that for free.

However after tracing the code I found that the moving the images to the BufferedImage doesn't actually affect speed at all.  It takes roughly 0ms (according to System.currentMillisecs()) and once drawn are quite fast.  (Maybe cuz I have a Athlon 1800+, dunno).

The real culprit is
1  
new ImageIcon(fileName)


It takes about 120ms to load a 140byte GIF.  Since I have about 40 GIFs at that size, it quickly adds up to a big delay.  And the 1360x768 GIF takes about 7~9s depending on the JVMs mood.
27  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:14:42
Thanks for your help anyhow. Smiley
Hope I didn't offend you but I was going for gameshow humor.
28  Java Game APIs & Engines / Java 2D / Re: Image Loading Speed on: 2003-04-08 00:01:05
Nice try but try again.  The JPG at maximum quality is 150kb while the GIF is 500k.
29  Java Game APIs & Engines / Java 2D / Image Loading Speed on: 2003-04-07 23:48:10
I'm using the following code to load images to display.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
ImageIcon ii = new ImageIcon(imageLocation);
                  Image loadedImage = ii.getImage();
                 
                  int imageWidth = loadedImage.getWidth(null);
                  int imageHeight = loadedImage.getHeight(null);
                 
                  if (getGraphicsConfiguration() != null)
                  {
                        Image acceleratedImage = getGraphicsConfiguration().createCompatibleImage(
                                    imageWidth, imageHeight, Transparency.TRANSLUCENT);
                        acceleratedImage.getGraphics().drawImage(loadedImage, 0, 0, null);
                        loadedImage = acceleratedImage;                              
                  }


The funny thing is this, I'm loading a 1360x768 image to display as a background and after doing several time trials I found something weird.

As a GIF - ~9s
As a PNG - ~18s
As a JPG - ~19s

Astonshing!  And after I went through my images and made them all GIFs, my program loads 10s faster then before.  Any ideas why GIFs are loading that much faster?  And am I the only one who's had this happen?
30  Java Game APIs & Engines / Java Sound & OpenAL / OGG Help on: 2003-04-05 17:08:11
Well, technically this is not really OGG related I don't think.  But I'm not sure where else to post this.  But I have the craziest thing, I have an AudioInputStream that eventually just blocks on a read and never comes back.  The crazy thing is the same class running on a different machine doesn't block!  And I'm using the same version of the JVM.  I'm going nuts trying to figure this one out.  I used the same OGG file to create the stream, have the same class, same jvm just different machines and on one machine the read blocks and the other the read returns an EOF properly.  Please, any help would seriously be appreciated as I'm going crazy on this one.  Here's the class I'm using:

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  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
import javax.sound.sampled.*;
import java.io.*;

public class OggTest
{
      public static void main(String[] args)
      {
            try
            {
                  File songFile = new File(args[0]);
                  AudioInputStream ais = AudioSystem.getAudioInputStream(songFile);
                  AudioFormat afVorbis = AudioSystem.getAudioFileFormat(songFile).getFormat();
                  AudioFormat afPCM = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
                        afVorbis.getSampleRate(), 16, afVorbis.getChannels(),
                        afVorbis.getChannels() * 2, afVorbis.getSampleRate(), false);
                  ais = AudioSystem.getAudioInputStream(afPCM, ais);

                  DataLine.Info dli = new DataLine.Info(SourceDataLine.class, ais.getFormat());
                  SourceDataLine sdl = (SourceDataLine) AudioSystem.getLine(dli);
                  sdl.open(ais.getFormat());

                  sdl.start();
                  int bytesRead = 0;
                  byte[] byteBuffer = new byte[128000];
                  while (bytesRead != -1)
                  {
// The problem is this read blocks on the very last read and never returns
                        bytesRead = ais.read(byteBuffer, 0, byteBuffer.length);
                        if (bytesRead != -1)
                        {
                              sdl.write(byteBuffer, 0, bytesRead);
                        }
                  }

                  sdl.drain();
                  sdl.stop();
                  sdl.close();
            }
            catch (Exception e)
            {
                  e.printStackTrace();
            }
           
            System.exit(0);
      }
}
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.

trollwarrior1 (24 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
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!