Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 / jMonkeyEngine / Re: Starfield in jMonkey? on: 2007-03-01 19:43:35
Hmm . . .

I mean star dust is okay.  I'm sure I'll want it when I get around to actually making this thing.

My problem is more the sky box itself.  I mean, I haven't put a TON of effort into it, but I really expected it to look a WEE bit better than what you might see if you hung a ship on a string inside a cardboard box that a donkey vomited into.     Roll Eyes

In any case, the quest continues.  I'm not sure what's wrong . . . too low-res images, I should be using something other than a skybox . . . something like that . . . who knows.
I'll get it figured out, I'm sure, I was just hoping for a bit of help to make it easier.

Thanks for the stardust though.
2  Java Game APIs & Engines / jMonkeyEngine / Starfield in jMonkey? on: 2007-02-22 23:58:37
Just had a quick question about the best way to do a starfield in jMonkey.  Obviously, I'm planning on making a space combat / "space trader" type of game, and this is going to be an integral part of making the world look good.  I have a pretty good handle on moving the ships around, and dealing with very large, very far off objects, (planets, stars, etc.)  but the background . . . not quite so sure.

I've gone through the very basic tutorials on the site, but haven't really found a good way of doing it yet.  I tried playing with a SkyBox with quite unsatisfactory results, but I may not be using it correctly. 

Basically, I'm thinking that using a texture that's high enough resolution to look good is going to be hideously big, and I'm not really sure quite how to play nice with something like that.  I have SOME ideas, and could probably make it work, and I'm sure there's a "right way" to do this.  I just don't know what it is.

I've been impressed with jMonkey so far, and have a pretty good idea of how to tackle this project.  But this one thing . . . Grr . . . very frustrating.

Can anybody help, or even point me in the right direction?  I'd be greatly appreciative of any advice anybody could offer.

Thanks in advance,

Nate Nelson
3  Java Game APIs & Engines / Java 2D / Re: Dynamic images & servlet config. on: 2005-12-08 16:10:18
Well, two problems with that . . .

1) I've set the java.awt.headless flag in my tomcat startup, and it has no effect at all.  It dies every time I try to create a BufferedImage (or any other type of image, for that matter) regardless of what flags I set.  Nobody's tips on how to get tomcat to run headless have ever worked for me with this app.  I suspect some of the calls I'm making can't be done headless.  Maybe that's not right, but SOMETHING'S keeping me from being able to run headless.

2) I've already got X installed.  Might as well take advantage of it, right?

Besides, I've tracked it down to an xauth issue.  Not sure if anybody here is well versed in that or not.  Kinda doubt it, since the standard answer around here seems to be "Just run headless".  Which would make sense if I could.

Anyway, if anybody knows xauth and wants to help me troubleshoot this, post a reply, and I"ll give you the specifics of what I've done so far, but otherwise, I'll keep my Xserver stuff out of the Java forums.  :-)

Thanks anyway, though.  I appreciate the efforts.
4  Java Game APIs & Engines / Java 2D / Re: Dynamic images & servlet config. on: 2005-12-07 18:04:06
Unfortunately, I know X is working okay, but I think it's configured such that my JVM can't connect to it.  I suspect the answer is in the output of the ps command.

root 6873 5967 0 03:53 ? 00:00:11 /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-bI32tt

I think that "-nolisten tcp" flag is messing me up.  So I'm sure it's a config issue, but I don't know enough about how X works & how java connects to it to be sure.

Any further ideas?  Like I said . . . KDE works just fine on this box.
5  Java Game APIs & Engines / Java 2D / Dynamic images & servlet config. on: 2005-12-06 17:44:07
I apologize for the cross-posting.  I already put this up on the main sun forums, but there's a few slightly sharper graphics people here on the JGO forums.  Any help would be appreciated.

Okay, so I'm creating a web-based game, and I'm doing just a wee bit of dynamic image creation.  Up to this point everything has been working fine on tomcat 4.something, Java 1.4.2 running on Gentoo. I'm upgrading to Suse Professional 9.3, java 5 and Tomcat 5.0.30.

Everything seems to be working well, but my dynamic image generation keeps throwing one of the two following stack traces, seemingly at random:

java.lang.NoClassDefFoundError
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:164)
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
**edited - myclass**.performAction(**edited - myclass**.java:66)
**edited - mysuperclass***.execute(**edited - mysuperclass**.java:86)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


OR

java.lang.InternalError: Can't connect to X11 window server using '127.0.0.1:0' as the value of the DISPLAY variable.
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)
sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142)
java.security.AccessController.doPrivileged(Native Method)
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:164)
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
**edited - myclass**.performAction(**edited - myclass**.java:66)
**edited - mysuperclass**.execute(**edited - mysuperclass**.java:86)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


Which error gets thrown depends on whether or not I've JUST bounced tomcat. At least . . . that's the only factor I can figure out. (When I restart tomcat, I get the second stack trace, otherwise, the first.) It SEEMS as though I don't have X installed, but it's not only installed, it's running. Here's the output of ps -ef just to prove it:

root 6873 5967 0 03:53 ? 00:00:11 /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-bI32tt

While I'm doing most of this configuration remotely on the command line via SSH, KDE is up and working, and was used for the initial install of all the software. Oh, and on that second stack trace, I've tried every value I can think of for the DISPLAY environment variable. localhost:0, :0 . . . nothing at all, I'm stumped on that count.

Frankly, I'm baffled. I've tried just running headless, but as I'm actually using BufferedImages, it seems that I cannot simply run a headless environment, or at least, I get exactly the same errors. Any suggestions?
 
6  Java Game APIs & Engines / Java 2D / Re: Web-Game dynamic image creation problem. on: 2004-07-23 13:31:46
Well, thx for the help & all, but no dice running it 'headless'.  I went ahead and just threw XFree86 on there and all seems to be good now.  Took a bit of configuring, but it works now.

Gotta love dynamically generated .pngs.  I even got them to display right cross-browser, even in IE for PC. Shocked

If anybody has any luck with this kind o' thing in a headless envrionment, go ahead and post it here, 'cause it would be good to know.

-PhilBob
7  Java Game APIs & Engines / Java 2D / Web-Game dynamic image creation problem. on: 2004-07-22 13:43:38
Okay . . .

I've not done a lot of serious game development yet, but I've played with the Java 2D API and am somewhat familiar with it.  It's been predictable stuff . . . trying to build a little tetris game using AWT, Swing . . . whatever.

But I'm making a web-game this time, and while trying to display mapping info for my in-game world, I've come across a situation where I simply MUST generate images on the fly.

"No problem," I think, "I'll just whip up a BufferedImage, draw a few quick lines to it, use ImageIO to write it straight to my output stream and voila!"

Great theory.

It doesn't work.

Here's the code:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
             List roadList=(List)request.getSession(true).getAttribute("roadList");
             BufferedImage image=new BufferedImage(400,400,BufferedImage.TYPE_INT_ARGB);
             Graphics2D g2=(Graphics2D)image.getGraphics();  //I know . . . use createGraphics . . . this is temporary
             g2.setBackground(new Color(0,0,0,0));
             g2.setPaint(Color.RED);
             for(int loop=0; loop<roadList.size()-1; loop++)
             {
                   RoadSegmentMapping start=(RoadSegmentMapping)roadList.get(loop);
                   RoadSegmentMapping end=(RoadSegmentMapping)roadList.get(loop+1);
                   g2.drawLine(start.getXloc().intValue(),start.getYloc().intValue(),
                                     end.getXloc().intValue(),end.getYloc().intValue());
             }
             response.setContentType("image/png");
             try
             {
                   ImageOutputStream out=ImageIO.createImageOutputStream(response.getOutputStream());
                   ImageIO.write(image,"png",out);
                   response.getOutputStream().flush();
                   response.getOutputStream().close();
             }


The stack trace I get is . . .

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
java.lang.NoClassDefFoundError
      java.lang.Class.forName0(Native Method)
      java.lang.Class.forName(Class.java:141)
      java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
      java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041)
      java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1031)
      com.alliance.action.DynamicImageTestAction.execute(DynamicImageTestAction.java:32)
      org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
      org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      com.alliance.servlet.SessionFilter.doFilter(SessionFilter.java:39)


I'm guessing because I'm not in a windowing environment, there's no GraphicsEvironment set up.  I'm running this on a linux server that is not running XWindows or anything like . . . strictly text-based.  Running on Tomcat currently.  If details are important, I'll get them, but I just need to know where to start looking.

Thanks in advance.

   -PhilBob
8  Java Game APIs & Engines / Java 2D / Re: Text in a 2D app. on: 2003-07-14 13:10:34
I sat down this weekend and started actually figuring out what I needed to be able to draw on my screen at any given point in time, and how fast it needed to be able to run.  This solution should work perfectly, and the good part is that it makes substituting in graphical tiles a breeze later.  If I use swpalmer's suggestion (which I had actually concluded on myown, but it's good to have experienced ppl agreeing with me) I should be able to absolutely blast the graphics up onto the screen.  :-)  (WAY beyond even 30 fps . . . ridiculously fast.)

So . . . with that I passed my final technical hurdle.  JavAngband is officially in development.  Smiley  If I ever release it, I'll be sure to let y'all know.   Roll Eyes  In the meantime, thx for all the help.
9  Java Game APIs & Engines / Java 2D / Re: Text in a 2D app. on: 2003-07-11 19:00:42
Hee Hee!

That works quite well . . . thank you much.

I'm just going to have to create my own fonts.  Not a great loss, it'll just take some time.  It goes rather quickly now.  Not quite as fast as I'd like, but with a bunch of optimizations, I don't think that will be a problem.  I can redraw the entire grid of 1600+ characters at a good enough FPS to be worth doing.  Given that on average, only 10-50 of those change per refresh, there's a TON of optimizations I can make.  Even if I wanted to make my screen scroll, that's not that big a deal.  It might take a slightly different implementation, but still . . . I think we're okay here.

So basically what I've done, is created a font . . . a transparent GIF where the letters are transparent and everything else is black.  I'm cutting it apart, dumping each letter into a teeny-weeny BufferedImage, and writing each one of those to it's appropriate place on the screen as display circumstances warrant.  (via Graphics2D.drawImage(img,x,y,Color,null); )  I'm getting about 10-15 fps.  Now, that works, and it'll only get faster, so I won't complain . . . but . . .

Is there a different method I should use to do this?  It seems like I ought to be able to do it a lot faster.  Upwards of 30 fps if I wanted.  There's no real REASON to do it that fast, but . . . y'know . . . it's the principle of the thing.

Anyway . . . thanx for the help, both previous and future.

-Nate
10  Java Game APIs & Engines / Java 2D / Text in a 2D app. on: 2003-07-03 15:30:31
I don't know if any of you have ever seen the slick little ASCII graphics game called Angband.  (A derivative of UMoria if anybody knows that one instead)  It's a fun little game and I figured it was a good candidate for conversion into Java.  I'm having just one little problem.

I can't print text with any kind of speed.  I need to be able to print out a roughly 100x50 grid of characters with each character possibly being a different color than the one next to it.  I have explored the following options.

1 - Graphics.drawString for each character.  Very slow.  About 3 fps.
2 - Graphics.drawString for each line, which would be an AttributedString.  That works too, but setting attributes for each character is ALSO freakin' slow.  I may be able to optimize that, but if there's not much to optimize, I might be screwed.
3 - Haven't tried this yet, but using a bunch of offscreen "layers".  Draw the dungeon on a Buffered image, then just cut & paste appropriate parts each frame.  I'm sure that will be at least decent speed, but that means if my users want to scale their window size up, I could be having to paste images in excess of 1280x1024.  That's not an appealing thought for a simple text game.

I figure there HAS to be an easy solution I'm just not coming up with.  Again, there's a lot of optimizations I could make.  for example, on average, out of that whole 100x50 grid, only 2 or three characters will ever change.  That's easy enough to just change those, but I should be able to COMPLETELY redraw the screen at a rate faster than 3 FPS.

Am I approaching this wrong?  Does anybody have any suggestions?  I have a few niftly little tricks I could try if I were doing this in C++ and had pointers to play with.  Is there anything even SLIGHTLY comparable here?

Suggestions?

-Nate
11  Java Game APIs & Engines / OpenGL Development / Re: Stuck - newbies & textures on: 2003-06-08 22:10:31
Quote
You're sure you're enabling and disabling texturing in the correct places?


Well, now that's an interesting question.  Where are the appropriate places?  I'm enabling texturing in my glInit() method, but not really anywhere else that I know of.  Is there something other than this line that needs to be done?

1  
gl.enable(GL.TEXTURE_2D);


I'll go ahead and test out to see what color polygon I'm getting.  I'm not sure I ever do actually set the clearcolor, so I'll play around with that and post the results.  Thanks tho.

-Nate
12  Java Game APIs & Engines / OpenGL Development / Re: Stuck - newbies & textures on: 2003-06-07 19:13:16
Quote
_always_ remember to use the native byte ordering


Okay . . . good to know.  What exactly does that do again?  Suddenly my texture name is 1 every time . . . that's prolly a good thing.  I'm assuming I can't always count on OpenGL giving me texture name in numerical order, right?

Unfortunately, that still doesn't solve my problem . . . wait . . . nope . . . still getting black and . . . still getting white.

Any other thoughts?

-Nate
13  Java Game APIs & Engines / OpenGL Development / Re: Stuck - newbies & textures on: 2003-06-07 18:11:05
texName is the openGL texture name of the texture I'm assigning.  It's an int . . . I'm assuming that's just a pointer to where openGL has decided to store my texture.   At least, that's my best guess given that I don't really understand the architecture yet.

Basically, if you take a look in the loadGLTextures() method there's a series of commands:

1  
2  
3  
4  
5  
    IntBuffer tempBuf=ByteBuffer.allocateDirect(4*(newImages.length)).asIntBuffer();

    gl.genTextures(texList.length,Sys.getDirectBufferAddress(tempBuf));

    addToTexIndex(tempBuf); //my own method defined elsewhere.  It works okay.


That just takes the set of texture names I've just generated and dumped them into a specific IntBuffer where I can get at them later in a more organized fashion.  That's the addToTexIndex(tempBuf) command.

I've looked at the logs and in the rendering code when I'm using the variable texName, texName==tempBuf.get(0)  It's the same value.  If you actually want the integer representaion of that, I could prolly dig it out of the logs.  I'd be surprised if it's the same value every time, tho.

Any other questions?

-Nate
14  Java Game APIs & Engines / OpenGL Development / Stuck - newbies & textures on: 2003-06-07 12:48:49
Okay . . . I've done as much research as I can, looked at a bunch of tutorials and am baffled why I can't texture a simple polygon.  I created a 64x64 texture in .png format and took some demo code I'd already used and adapted it to map a texture onto my polygon.  There's two variations where I get 2 different results.

Variation 1 - I insert two lines of code when I'm loading the texture
1  
2  
gl.texParameterf(GL.TEXTURE_2D,GL.TEXTURE_MIN_FILTER,GL.LINEAR);
gl.texParameterf(GL.TEXTURE_2D,GL.TEXTURE_MAG_FILTER,GL.LINEAR);

In this variation, I can tell from the logs that the program runs just fine, but I get a black screen.  I would assume it's displaying a beautiful black polygon at me.

Variation 2 - In this variation, I remove those two lines and VOILA, I get a nifty white polygon bouncing around my screen

I'm positive my texture is loading from the file okay, because in the logs I see the right sizes for the height and width.  I've tried 64x64, 128x128 and 256x256, and when I change the image, it shows up in the logs.

I'm hoping wiser heads than mine might make something of this.

If anybody wants to see it, here's the relevant code below.  If there's any important bits missing that may be important, let me know and I'll post that too.

(sorry my code's displaying all nasty . . . can't get the indentations to work right.)

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  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
  private void glInit()
  {
    if(log.isDebugEnabled()) log.debug("glInit()");
 
    gl.determineAvailableExtensions();
    gl.enable(GL.TEXTURE_2D);
    gl.shadeModel(GL.SMOOTH);
    gl.matrixMode(GL.PROJECTION);
    gl.loadIdentity();
    glu.ortho2D(0,mode.width,0,mode.height);
    gl.matrixMode(GL.MODELVIEW);
    gl.loadIdentity();
    gl.viewport(0,0,mode.width,mode.height);
    gl.clearColor(0.0f,0.0f,0.0f,0.0f);
    if(GL.WGL_EXT_swap_control)
    {
      if(log.isDebugEnabled()) log.debug("swapcontrol");
      GL.wglSwapIntervalEXT(1);
    }
  }

  private Texture loadTexture(String filename)
  {
    BufferedImage newImage=null;
    File newFile=new File(filename);
    try
    {
      newImage=ImageIO.read(newFile);
    }
    catch(IOException e)
    {
      log.error("Could not load image in file: "+filename);
    }
    if(newImage==null && log.isDebugEnabled())log.debug("Texture didn't load correctly");
    Texture newTex=new Texture(newImage);
    return newTex;
  }

  protected void makeGLTextures(String[] newImages)
  {
    IntBuffer tempBuf=ByteBuffer.allocateDirect(4*(newImages.length)).asIntBuffer();
    Texture[] texList=new Texture[newImages.length];
    for(int loop=0; loop<newImages.length; loop++)
    {
      texList[loop]=loadTexture(newImages[loop]);
    }
    gl.genTextures(texList.length,Sys.getDirectBufferAddress(tempBuf));
    for(int loop=0; loop<texList.length; loop++)
    {
       if(log.isDebugEnabled()) log.debug("binding texture to name="+tempBuf.get(loop));
       if(log.isDebugEnabled()) log.debug("w="+texList[loop].getWidth());
       if(log.isDebugEnabled()) log.debug("h="+texList[loop].getHeight());
       if(log.isDebugEnabled()) log.debug("p="+texList[loop].getPtr());
       gl.bindTexture(GL.TEXTURE_2D,tempBuf.get(loop));
       gl.texParameterf(GL.TEXTURE_2D,GL.TEXTURE_MIN_FILTER,GL.LINEAR);
       gl.texParameterf(GL.TEXTURE_2D,GL.TEXTURE_MAG_FILTER,GL.LINEAR);
       gl.texImage2D(GL.TEXTURE_2D,0,GL.RGB,
                    texList[loop].getWidth(),texList[loop].getHeight(),0,GL.RGB,
                    GL.UNSIGNED_BYTE,texList[loop].getPtr());
if(log.isDebugEnabled()) log.debug("texture "+tempBuf.get(loop)+" successfully bound.");
    }
    addToTexIndex(tempBuf); //my own method defined elsewhere.  It works okay.
  }

Finally, my display code:
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  
    halfx=size.x/2;
    halfy=size.y/2;
    gl.pushMatrix();
      gl.translatef(position.x,position.y,0);
      gl.rotatef(angle,0.0f,0.0f,1.0f);
      if(textured)
      {
        gl.bindTexture(GL.TEXTURE_2D,texName);
        if(log.isDebugEnabled()) log.debug("Binding Texture "+texName);
      }
      gl.begin(GL.QUADS);
        if(textured)
        {
          if(log.isDebugEnabled()) log.debug("textured");
          gl.texCoord2f(0.0f,0.0f);
          gl.vertex2f(-halfx,-halfy);
          gl.texCoord2f(1.0f,0.0f);
          gl.vertex2f(halfx,-halfy);
          gl.texCoord2f(1.0f,1.0f);
          gl.vertex2f(halfx,halfy);
          gl.texCoord2f(0.0f,1.0f);
          gl.vertex2f(-halfx,halfy);
        } else {
          if(log.isDebugEnabled()) log.debug("untextured");
          gl.vertex2f(-halfx,-halfy);
          gl.vertex2f(halfx,-halfy);
          gl.vertex2f(halfx,halfy);
          gl.vertex2f(-halfx,halfy);
        }
        gl.end();
      gl.popMatrix();
15  Java Game APIs & Engines / OpenGL Development / Re: compile problem - prolly just a stupid mistake on: 2003-05-22 17:31:08
Quote
yeah - how the hell did you compile in the first round


I'm using JDeveloper and currently I have 3 different JRE's on my box.  Last one I just dropped my class into an already built project and did it that way, but this time it's got its own project . . . which defaulted to 1.3.1.

Wasn't actually aware you could force compile to a particular JRE version.  That's kind o' kewl.

Anyway . . . is fixed for now . . . no more questions for a while.

-Nate
16  Java Game APIs & Engines / OpenGL Development / Re: compile problem - prolly just a stupid mistake on: 2003-05-22 15:29:54
Well, figured it out myself.

Was using the 1.3.1 JRE.  Switched to 1.4.2 beta and it works just fine now.

Guess you guys built this with 1.4.x

Sorry to bother.

-Nate
17  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-22 13:13:37
Quote
We mustn't lose our focus which is for a high performance Java games platform.


Ah, to have such attitudes here where I work.  Every day is a new adventure in atrocious planning, mangled code and major rewrites.  God forbid the whole PURPOSE of each project might actually stay the same from day to day.  It's always "MORE FUNCTIONALITY!  WOOHOO!"

I truly admire such a focused effort as y'all are putting into this.  So . . . I guess hardware only, it is!   Cry

-Nate
18  Java Game APIs & Engines / OpenGL Development / compile problem - prolly just a stupid mistake on: 2003-05-22 13:06:08
Okay . . . just wrote a quick little Base OpenGL class to derive all my other classes from.  I go to compile and the only error is . . .
1  
2  
3  
4  
5  
6  
7  
8  
 
   [javac] C:\NateDev\Artillery\src\com\rn\GLUser.java:12: cannot access org.lwjgl.DisplayMode
    [javac] bad class file: C:\NateDev\Artillery\lib\lwjgl.jar(org/lwjgl/DisplayMode.class)
    [javac] class file has wrong version 48.0, should be 47.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac]   protected static DisplayMode mode;
    [javac]                    ^
    [javac] 1 error

The only time I've ever gotten this error before was when I the package name in one of my class files didn't match the directory I'd put it in.  Took forever to figure it out.  This . . . well, it's in the .jar, so that's not the problem and the .jar is definitely in the classpath, etc.

I managed to compile a class similar to this yesterday, so I'm positive this is just a ID-10-T error, but I'm wondering if anybody out there's willing to smack me upside the head and tell me what's wrong.

-Nate
19  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-22 11:30:10
Quote
It was a deliberate filter on Win32 to barf on modes that it claimed were allowed but which would give you 3fps.


Well, that makes sense, but would it make sense to simply set flags that indicate feature X is not available in hardware, then leave it up to the programmer to actually pay attention?  That way, dudes like me, who are just using OpenGL for 2D stuff have more portability options.  Personally, I don't like Java2D.  Using LWJGL would be really nice, but if by default I can only run my simple non-processor-intensive games on hardware accellerated boxes, suddenly I'm having to look at other alternatives.

Yes, that's what programming's all about, I realize that, but adding that feature seems to keep with the 'lightweight' spirit of what you all are doing while adding a potentially useful feature . . . software only rendering.

It's just a thought, though.
20  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 14:55:19
Quote
LWJGL is a hardware acceleration API only!


Truly?!  Why . . . how could I have missed that?  Sad

Okay . . . that sux.  Are there PLANS to extend to software rendering?  Maybe . . . pleeeeease.

*sigh*  Mebbe I'll just switch to GL4Java or something . . . at least if they support software rendering I might.  Or maybe I'll use GL4J for software and LWJGL for hardware.

Cry
21  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 13:47:23
Quote
in the mean time, do you have any other somewhat similar workstations, you could test?


Unfortunately no.  I've been pushing hard for better equipment . . . at LEAST a dual monitor setup . . . but to no avail (I'm the ONLY developer w/o one  Angry ).  Fortunately, we FINALLY get to requisition new stuff in June, but then there's a mandatory 90 day delay.  Damn the state budgets.   Angry

As for hijacking someone else's computer for a bit . . . mebbe, but doubtful.  IS Dept would freak already if they saw half the stuff I have installed on THIS one.  One of the perks of being a developer . . . they rarely check. Smiley

Lemme know if there's any other info you need.

-Nate
22  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 13:29:21
Okay . . . I'm saved from feeling like a COMPLETE idiot . . .

Tested OpenGL . . . saw the nifty spinning cube and everything.  I KNEW I'd used OpenGL stuff before.

But that was for OpenGL1.1 interfaces.  When it got to 1.2 interfaces it freaked out.

In the report section it says: "No Hardware Support"

Is that mandatory for LWJGL to run?

Here's all the stuff my system DOESN'T support.

-No hardware support
-No compiled vertex array.
-No 8bit palette texture support.
-No multitexturing extension.
-No secondary color support.
-No S3TC compression support.
-No Texture Edge Clamp extension.
-No vertex program extension found
-No Fragment program extension found.
-No ICD Registry Entry.
-Few texture units found.

Like I said . . . crappy, but I'm positive I've at least done BASIC openGL stuff before . . . I think.  I'm gonna feel like a twit if this is really the problem.  (Mebbe it was D3D . . . hmm)

(edited to add --)
Hmm . . . looks like it might be defaulting to some standard Microsoft software OpenGL renderer . . . which would explain why that spinning cube was rendering at a whopping 3 fps.  Roll Eyes

Who needs fast . . . and if it doesn't work at all . . . well . . . so be it.  I'll wait 'til Sept. when we get new workstations.
23  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 13:14:03
Here's output from WindowCreationTest.class
1  
2  
3  
4  
5  
6  
7  
8  
Removed 0 duplicate displaymodes
Found 49 display modes
java.lang.Exception: Mode not supported by hardware
      at org.lwjgl.opengl.BaseGL.nCreate(Native Method)
      at org.lwjgl.opengl.BaseGL.doCreate(Unknown Source)
      at org.lwjgl.opengl.GL.doCreate(Unknown Source)
      at org.lwjgl.Window.create(Unknown Source)
      at org.lwjgl.test.WindowCreationTest.main(Unknown Source)Display created

Then it hangs.   :-/  I have to kill it manually.

(edited to add ---)
FullScreenWindowedTest.class has similar output I can post that if you need it.
24  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 13:10:21
Quote
Do you have net meeting running?


Not that I know of.  I don't even know what that is.  This is a work computer, so they could have anything on it.  *rolls eyes*  Just kind of playing around with this stuff on lunch hours to prep for the REAL development at home.

Yeah . . . that's what I'm doing.  Wink

Seriously, though.  Went through the list of services and the 'NetMeeting Remote' service wasn't running.

Also forgot platform.  I'm running Win2k on a box with . . . 600+MB RAM, and even though the case is stamped with a Pentium III logo, I think it's a P2 . . . couldn't tell you what speed, and a piece of crap graphics card that streteches the definition of "accelleration"
25  Java Game APIs & Engines / OpenGL Development / Re: gl.create() problems - mode not supported on: 2003-05-21 12:50:57
Well, here's raw output for you: with the -ea switch:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
Removed 0 duplicate displaymodes
800,600,16,60  //That's my System.out.println you were asking about
java.lang.Exception: Mode not supported by hardware
      at org.lwjgl.opengl.BaseGL.nCreate(Native Method)
      at org.lwjgl.opengl.BaseGL.doCreate(Unknown Source)
      at org.lwjgl.opengl.GL.doCreate(Unknown Source)
      at org.lwjgl.Window.create(Unknown Source)
      at com.rn.artillery.Tutorial.initialize(Tutorial.java:37)
      at com.rn.artillery.Tutorial.execute(Tutorial.java:23)
      at com.rn.artillery.Tutorial.main(Tutorial.java:245)
Selecting NT display mode check
Querying Real 3D Starfighter device
Querying NetMeeting driver device
Found 49 displaymodes
Window registered
Created window
Pixel format is 4
Destroying directinput
Releasing DC
Destroy window
Destroyed window
Debugger disconnected from local process.
Process exited with exit code 0.


Helpful?

-Nate
26  Java Game APIs & Engines / Java 2D / Re: LWJGL Tutorials on: 2003-05-21 12:03:37
Quote
You've seen GAGE?


I have indeed.  Some cool stuff and I'm actually currently using the timer for framerate limiting right now.  I actually don't like Java2D . . . kind of a pain in the booty to use at the moment.  There just seems to be too many annoyances.  Then again . . . I'm trying to use OpenGL, so I might just be shooting myself in the foot.  *shrug*

Found some good tuts I'm trying to use though, and a friend who I didn't realize had worked with OpenGL before.  Go figure.

Thanks for the suggestions tho.

-Nate
27  Java Game APIs & Engines / OpenGL Development / gl.create() problems - mode not supported on: 2003-05-21 11:41:12
I've copied code nearly exactly from several of the tutorials I've seen on this site.  The only problem is anytime I try to do a gl.create() I get the following exception:

1  
2  
3  
4  
5  
6  
7  
8  
java.lang.Exception: Mode not supported by hardware
      at org.lwjgl.opengl.BaseGL.nCreate(Native Method)
      at org.lwjgl.opengl.BaseGL.doCreate(Unknown Source)
      at org.lwjgl.opengl.GL.doCreate(Unknown Source)
      at org.lwjgl.Window.create(Unknown Source)
      at com.rn.artillery.Tutorial.initialize(Tutorial.java:37)
      at com.rn.artillery.Tutorial.execute(Tutorial.java:23)
      at com.rn.artillery.Tutorial.main(Tutorial.java:245)

Here's the relevant code:
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  
  private void initialize()
  {
    try
    {
      mode=findDisplayMode(800,600,16);

      System.out.println(mode.width+","+mode.height+","+mode.bpp+","+mode.freq);
     
      gl=new GL("Test", 50,50,mode.width,mode.height,mode.bpp,0,0,0);
      gl.create();
      glu=new GLU(gl);

      glInit();

      Keyboard.create();
      quadPosition = new Vector2f(100f,100f);
      quadVelocity = new Vector2f(1.0f,1.0f);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }

  private DisplayMode findDisplayMode(int width, int height, int bpp)
  {
    DisplayMode[] modes = Display.getAvailableDisplayModes();
    for(int loop=0; loop<modes.length; loop++)
    {
      if(modes[loop].width==width
        && modes[loop].height==height
        && modes[loop].bpp>=bpp
        && modes[loop].freq==60)
          return modes[loop];
    }
    return null;
  }


Any help anybody?  I KNOW the particular mode *IS* supported, so I don't think that's it.  Sorry for a newless clewbie type question, but this has got me stumped.
28  Java Game APIs & Engines / Java 2D / LWJGL Tutorials on: 2003-05-20 14:31:24
I'm looking for some sort of tutorial which will kind of show me the basics of using OpenGL to program 2D games.  I'm wanting to do a strategy game (not RTS yet . . . don't start gagging) and I don't want to do it 3D.  Think along the lines of Civ 3 or something . . . that caliber graphicswise.

Unfortunately, all the tutorials I can find out there have to do with OpenGL 3D programming.  I'd do it with Java2D except . . . well . . . it's slow.  I've looked at GL4java and LWJGL and I have to say I like the looks of LWJGL better, though if anybody has any other good suggestions, I'll look at those too.

I've looked at most of the 3D tutorials out there, and they're somewhat helpful, but not quite what I'm looking for.  I dunno . . . does what I'm looking for exist?

If not, maybe just somewhere that would step me through the concepts would be better than nothing.

-Nate
29  Java Game APIs & Engines / Java 2D / Re: VolatileImage vs. Automatic Images or somethin on: 2003-05-01 16:12:53
JVM version is . . . 1.4.2beta

Memory on card is . . . I think 16MB, but it's a POS card.  Right now I'm using a 640x430 VolatileImage, a 640x50 VolatileImage and three 30X30 VolatileImages.

That's it.  Really, it should be able to handle that much, I would think.  I dunno . . . another thing I noticed.  There's only one chunk when I run it in fullscreen mode then it's smooth at 30 fps after that.

*sigh* I'm stumped.
30  Java Game APIs & Engines / Java 2D / VolatileImage vs. Automatic Images or something. on: 2003-04-30 13:52:39
I've seen a lot about 'Automatic Images' . . . I think that's the term, but all these discussions seem to be long-running ones so I'm not sure I follow it.

Basically from what I understand this . . .

1  
BufferedImage autoImage=gc.createCompatibleImage(width,height);


. . . creates an image which is hardware accelerated, provided I don't modify it in any way.  If I paste anything onto it with . . .

1  
2  
Graphics2D g2 = autoImage.createGraphics();
g2.drawImage(someImage,x,y,null);


. . . makes it so it's not hardware accellerated.  Is that right, or am I off somewhere?

I'm not doing it this way ATM.  I'm using BufferedImages to hold raw images so that I can composite them and still preserve any transparency.  So I take and composite them all onto a VolatileImage.  If the contents change, or I lose the contents of the VolatileImage, I rebuild the background, but as it happens so infrequently, each refresh I'm just pasting the VolatileImage Background . . . for sure accellerated . . . and slapping foreground stuff on top of it.  (don't need transparency for that stuff yet.)

The reason I ask is that I'm hitting a slow framerate and I think it's 'cause I'm doing something wrong.  I'm trying to figure out if using these 'automatic images' might be faster, or if I might be hitting a bottleneck somewhere I don't know about.  

So . . . here's a rough outline of the code 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  
public class ContentWindow extends Component
{
  VolatileImage myBG;
 
  private void buildBG()
  {
    Graphics2D g2=myBG.createGraphics();
    //Bunch of draw operations
    g2.dispose();
  }

  public void render(Graphics2D g2)
  {
    if(myBG.contentsLost())
    {
           buildBG();
    }
    g2.drawImage(myBG,getX(),getY(),null);
    g2.setColor(Color.yellow);
    g2.fillRect(mouseX-5,mouseY-5,mouseX+5,mouseY+5);
  }
}


Right now, this component is 640x430 . . . running in windowed mode, and it's the ONLY component being redrawn.  I've limited the framerate to 20 refreshes per second and STILL it chunks every half-second or so.  Is there something I'm doing wrong here?  Some way to optimize this?

I'm running on some sort of P3 (not sure what) a TON of memory, but a piece of crap graphics card.  Still . . . not doing anything OVERLY taxing.  Anybody with advice, I'd be more than happy to hear it.
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 (46 views)
2014-10-17 03:59:02

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

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

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

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

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

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

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

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

BurntPizza (82 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!