Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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]
1  Game Development / Performance Tuning / Re: Engine Test For Optimization Please! on: 2010-01-21 20:43:19
OS: Windows 7 64-bit
Video Card: Nvidia 7900 GTO
CPU: AMD Athlon X2 4200+

Framerate:~150 fps
2  Game Development / Performance Tuning / Re: Sprites! on: 2010-01-13 21:04:56
I also got a huuuge performance boost when switching to VBOs.

Riven mentioned the Buffers put() operation: For me single put()s are pretty slow, I try to put() everything in the Buffer with a single put(). To do that I keep arrays for all the data (vertex, color, etc. ) and collect the game's data in there every frame and then put it in the buffer with one call. I even don't create the arrays every render call to keep the garbage low. Instead a simple int shows how big the array is. Works like a charm for me.

[EDIT] Ahh, that's exactly what Riven suggests in his latest post. Didn't see that.
3  Game Development / Shared Code / Re: ColorGradient Component on: 2010-01-05 18:42:52
Here's the link. Keep in mind this is years old and my first attempt in writing my own component.

Have fun.
4  Game Development / Shared Code / Re: ColorGradient Component on: 2010-01-05 09:27:04
Yes, that was a long time ago.. I try to find the code when I am coming home from work. Maybe it's still somewhere on my harddisc.
5  Discussions / General Discussions / Re: Windows 7 on: 2009-10-22 18:01:54
I heard that it's a giant pain to upgrade from XP to Windows 7 (I think you have to backup everything, erase everything, then install Windows 7 and restore data from backup), but I've heard pretty good things about its stability (finally for Windows!).

I switched over from XP to Win7 a couple of days ago. Actually the pain was not that big: I had a free partition I could install Win7 on and it automatically created a bootmanager so I'd be able to switch back to my old XP installation. But up to now I didn't feel like it because Win7 just works like a charm. It is totally worth the price in my opinion. Of course I had to install all the programms again, but since my XP was pretty old I actually liked the fresh new start and got rid of a couple of things
6  Game Development / Newbie & Debugging Questions / Re: Keytool / inofficial cert on: 2009-10-17 23:07:27
Last time I worked with keystores I had a strange issue because of blanks in the directory name.. don't know if this is a problem here or a strange thing that only appeared on my machine.. but it's easy to test...
7  Game Development / Game Play & Game Design / Re: Game Object Component System on: 2009-06-07 11:23:30
There are also two very insightful discussions over at gamedev.net:
8  Game Development / Newbie & Debugging Questions / Re: rogue-like rendering on: 2007-10-29 10:32:53
It's 4000 triangles for the background and 4000 triangles for the foreground!

I tried the netbeans profiler and found out that I spent almost 40 % of the time in the rendering method in "self time". I guessed that this high number reflects the large amount of array operations I did for filling up the vertex arrays. So I implemented a update method that only changes the parts of the vertex array that actually need an update. That doubled the framerate instantly, but at the moment there is only one tile that needs an update so the framerate will drop again the more tiles change on the map(for a visibility algorithm for example).

Thx cylab you were right!
Do you got more tips on performance?
9  Game Development / Newbie & Debugging Questions / rogue-like rendering on: 2007-10-29 08:02:17
Hello,

I want to write a rogue-like game and decided not to use any of the curses libraries and use ogl instead. Right now I want to represent a standart sized console window with 80x25 characters. This is how I draw the tiles at the moment:

1. I use vertex arrays with 2 triangles for every tile I want to draw as background.
2. Then I draw the same geometry again with textures and alphablending on and other colors(foreground color)

With that I can draw every letter with any background/foreground color combination. The letters are stored in the texture. This method is not very fast so I wanted to ask you what kind of improvement you would suggest. Vertex sharing was my first idea, but that would mean that every vertex has only one colorattribute and therefore the colors would mix over tile boundaries, which is bad..

Thanks
thala
10  Games Center / Archived Projects / Re: Wires: rotate the tiles so they are all connected on: 2007-08-18 18:36:47
I really like that game! With time you get better and better.. I just did a 10x16 in 350 seconds..
11  Game Development / Newbie & Debugging Questions / Re: quadtrees and moving objects on: 2007-05-12 15:22:06
Thanks for your comments.
I will try to implement the method Riven suggested.

Recently I thought about another tree to implement a scenegraph: R Tree The wiki entry is not so good, so if you want to know more read this paper.
This tree is made to handle spatial data in multiple dimensions.. in this case it's only 2 dimensional and would hold rectangles. The nodes itself can overlap and their boundaries can grow, if you add new items to a node. The tree supports searching in areas for example questions like: which nodes are inside this arbitrary rectangle. If a nodes covered area gets to big, it's splitted up in smaller nodes similiar to quadtrees.
Advantages: moving objects just cause a node to grow, the don't leave the node -> this means you have to check the size from time to time, if it's to big -> split nodes
Disadvantages: I guess collision detection doesn't work so well, or is harder to implement

I didn't test this kind of tree yet, I just had spend a couple of moments to think about it.. what do you guys think?
12  Game Development / Newbie & Debugging Questions / quadtrees and moving objects on: 2007-05-10 14:27:09
Hi,

I need a pointer on the whole quadtree thing.. Imagine there is a 2d space shooter game consisting of a lot of asteroids, ships, baseships and so on. The whole "world" is at least, say 100 x 100 Screens big, the user can fly around as he likes. My first thought was to divide the space with a quadtree to optimize the amount of draw calls. In every node would be a couple of game objects. Due to the nature of space shooter the objects move. If one object leaves a node I just have to delete it from the old and move it to a new one and so on. Thats not the problem. But what happens if I got a big baseship or something similiar that moves from one node to another ( see attachment)

There is a point in time, when I have to move the object from one node to another. At first glance I would say that is when the center of the object is now in the new node. But if I move the ship in that moment, it is clipped from screen but it should be seen a bit longer.

So my question is: How do you handle this, and is a quadtree the right tool for moving objects?
13  Game Development / Shared Code / Re: ColorGradient Component on: 2007-05-03 15:53:49
@irreversible_kev: thanks for your comment, I changed that behaviour. Source and Webstart should be updated
14  Game Development / Shared Code / Re: ColorGradient Component on: 2007-05-02 19:08:18
Thanks for the link Kev, that is the piece of code I had been looking for some weeks ago. Well, nevermind, I learned quite a lot, while writing my own version of a ColorGradient / GradientEditor.
15  Game Development / Shared Code / Re: ColorGradient Component on: 2007-05-02 18:08:16
@kev: it was the particle editor pedigree. I postet a question related to that on lwjgl.org forums, perhaps you saw the thread.
16  Game Development / Shared Code / ColorGradient Component on: 2007-05-02 15:26:51
Hi,

A couple of weeks ago I saw a nice component in a Java program that I wanted to use in my own programs. Unfortunately I couldn't find the sourcecode anywhere and I still don't know if it is available somewhere. So I rewrote the Component, this is what it looks like:


I made a Web Start so you can give it a try. The sourcecode is also available here. It would be great if you could make some comments on it and its usefulness because this is the first time I am implementing my own components.
17  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-31 19:39:58
Well I think it works finally, I had a ByteBuffer with ByteOrder.LITTLE_ENDIAN which I copied into one with ByteOrder.nativeOrder(). Damn it that hurts Smiley

But why my above example doesn't work I still don't know, but it doesn't matter, my tga-loader works.

The Code from Java Cool Dude is an interesting piece of Code for a newb like me Smiley

Thanks to you all
Thala
18  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-31 16:37:48
Yes, that is right, I tried it uncommented but it still doesn't work and for that parameters are used the standardvalues so it should work anyway, shouldn't it?

I thought something like that:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
byte [] b = new byte[12];
        b[0] = 23; b[1]=5; b[2]=50;
        b[3] = 0; b[4]=0; b[5]=50;
        b[6] = 50; b[7]=0; b[8]=0;
        b[9] = 23; b[10]=5; b[11]=50;
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, TexBuf.get(3));
        ByteBuffer b1 = BufferUtils.createByteBuffer(12);
        b1.put(b);
        b1.rewind();
        GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 2, 2, 0, GL11.GL_RGB, GL11.GL_BYTE, b1);
        System.out.println("" + TexBuf.get(3)+" "+ GL11.glIsTexture(TexBuf.get(3)));


should work in any case.

thala
19  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-31 11:42:30
Hmm, can't nobody help me? I've gone through the hole forum searching for similiar problems, but I haven't found something that could help me.
Or isn't it possible to fill a ByteBuffer with a few Bytes and then pass this Buffer to glTexImage2D?
-Buffer is in native order
-Buffer is rewinded
-Buffer is direct
-Texturing is enabled
-glIsTexture returns true
-glBind is used

I can't figure it out.
20  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-28 09:54:40
I've uploaded the source, perhaps that helps:
GLTest.java
tga.java
test2.tga
21  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-28 09:29:45
Yepp I did enable it
22  Java Game APIs & Engines / OpenGL Development / Re: problems creating textures on: 2004-08-28 08:53:40
Hello again,

yes, that was really the problem. I forgot to rewind() the buffer. I am very new to these nio-Buffers and I start to think that they hate me :)

The next problem is already there: I can only see a white rectangle with no texture, but there should be one. First I thougth that my tga loader may be spilling out corrupt data, but the values look okay in debugger mode. Also glIsTexture returns true. So I googled a bit and they say that this happens if I call the texture functions before getting a GL-Context, but I am definetly calling the texture-functions after the whole lwjgl-window creation an d so. Another google result said, that this could happen, if the texture data is corrupt or the texture couldn't be created.
To make sure that the error is not the tga loader I created a 2x2 texture by hand:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
//another texture
       GL11.glBindTexture(GL11.GL_TEXTURE_2D, TexBuf.get(1));
        ByteBuffer pix = BufferUtils.createByteBuffer(12);
        pix.put((byte)5); pix.put((byte)5); pix.put((byte)5);
        pix.put((byte)30); pix.put((byte)100); pix.put((byte)100);
        pix.put((byte)40); pix.put((byte)40); pix.put((byte)40);
        pix.put((byte)0); pix.put((byte)0); pix.put((byte)50);
        pix.rewind();
        GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, 2, 2,
                    0, GL11.GL_RGB, GL11.GL_BYTE, pix);
       
        System.out.println("" + TexBuf.get(1)+" "+ GL11.glIsTexture(TexBuf.get(1)));

output is: 2 true
The drawing code is still the same, except I use TexBuf.get(1) now and there is another GL11.glBindTexture(GL11.GL_TEXTURE_2D, TexBuf.get(1)); in it. Whats wrong this time?

Greetings
thalador

23  Java Game APIs & Engines / OpenGL Development / problems creating textures on: 2004-08-27 18:21:20
Hello,

I have got problems creating a texture with lwjgl.
Here's the code:

loading data:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
tga x = new tga();
        x.load(new File("./test2.tga"));
       
        ByteBuffer f = x.getPixelData();
       
        TexBuf = BufferUtils.createIntBuffer(5);
        GL11.glGenTextures(TexBuf);
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, TexBuf.get(0));
        GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, x.getWidth(), x.getHeight(),
                    0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, x.getPixelData()); *
       


rendering code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glLoadIdentity();
         
            GL11.glPushMatrix();
            GL11.glTranslatef(0.0f, 0.0f, -12.0f );
           
            GL11.glBegin(GL11.GL_QUADS);
                  GL11.glTexCoord2f(0.0f,0.0f);
                  GL11.glVertex3f(-1.0f, -1.0f, 0.0f);
                 
                  GL11.glTexCoord2f(1.0f,0.0f);
                  GL11.glVertex3f(1.0f, -1.0f, 0.0f);
                 
                  GL11.glTexCoord2f(1.0f,1.0f);
                  GL11.glVertex3f(1.0f, 1.0f, 0.0f);
                 
                  GL11.glTexCoord2f(0.0f,1.0f);
                  GL11.glVertex3f(-1.0f, 1.0f, 0.0f);      
            GL11.glEnd();
            GL11.glPopMatrix();
         
           

The tga getPixelData Method returns a ByteBuffer with the Pixeldata. I use only 24Bit TGAs with no alphabits.
I get a java.nio.BufferOverflowException in the line marked with the *

What am I doing wrong? I can't really figure out at the moment. If you want I can post the tga-loading code, but it is really hacked together.

Greetings
thalador
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (21 views)
2014-09-19 03:14:18

Dwinin (35 views)
2014-09-12 09:08:26

Norakomi (62 views)
2014-09-10 13:57:51

TehJavaDev (87 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!