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   
Pages: 1 2 3 [4] 5
  ignore  |  Print  
  Guardian [FINISHED]  (Read 30386 times)
0 Members and 1 Guest are viewing this topic.
Offline masteryoom

JGO Coder


Medals: 5
Projects: 2


If you look closely, you might see it turning...


« Reply #90 - Posted 2012-12-17 05:31:15 »

Ok. You beat me there.  Wink

Smiley
Offline sproingie

JGO Kernel


Medals: 202



« Reply #91 - Posted 2012-12-17 05:33:12 »

I have used this function numerous times without problems, so this game must be using this function in a wrong way.

Even if the game is using the function incorrectly, I still wouldn't expect the native error, since LWJGL is supposed to check ranges.  glDrawArrays is a complicated function though, so it probably isn't possible to do every check.  Debugging it would probably be easier with source -- doable without, but probably not worth the trouble.
Offline davedes
« Reply #92 - Posted 2012-12-17 06:03:26 »

You can still use it though.

Yes, but it is no longer supported causing glitches like the above.
I wouldn't chalk it up to deprecated GL paths -- since these testers haven't run into issues with vertex arrays before, it seems more likely that you are doing something wrong. Which means that when you go to refactor to VBOs/shaders, you may end up with the same error. Maybe post some of your rendering code?

Vertex arrays are deprecated but they should still work fine if you are not requesting core profile.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline __iCode__

Senior Newbie





« Reply #93 - Posted 2012-12-17 15:17:00 »

You should make a website so we can keep track of the project there...
Do it!
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 138
Projects: 4
Exp: 3 years



« Reply #94 - Posted 2012-12-18 00:41:13 »

I would recommend going towards a blog...that way the posts are stacked and all the other blogspot features
Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #95 - Posted 2012-12-18 01:31:32 »

Good ideas.

Just give me a week or so to learn and switch rendering to OpenGL 3.

Then I may start a blog.

Offline matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #96 - Posted 2012-12-18 16:38:26 »

Just give me a week or so to learn and switch rendering to OpenGL 3.

I know learning OpenGL is a good idea...
But writing applications for OpenGL 3 is certainly not a good idea! Many people out there still have low-end or old hardware and are restricted to OpenGL 2.1 or even lower.

So to get most people playing your game I suggest targeting OpenGL 2.1 hardware, since it seems to be the best balance between being not deprecated and being usable for everyone.

I haven't got some of those links, but minecraft, steam and WolfireGames have made stats about the user's hardware. It showed that at the moment only about 50% of all the users have OpenGL 3+ cards (and drivers) and about 80-90% have OpenGL 2.1+ hardware. I myself got my OGL 4.2 hardware this summer. Before I had OpenGL 2.1 hardware.

davedes for example still has 2.1 hardware.  Pointing

I suggest learning the OpenGL 3 specification, but not really using it.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Best Username Ever

Junior Devvie





« Reply #97 - Posted 2012-12-18 17:57:42 »

Odd. I thought I saw a survey that showed 80-90% OpenGL 3.3+ support. I did not save the URL, though.
Offline sproingie

JGO Kernel


Medals: 202



« Reply #98 - Posted 2012-12-18 18:15:29 »

http://store.steampowered.com/hwsurvey

Doesn't break it down by OpenGL version, but you can expand the list of GPUs, and it overwhelmingly shows OpenGL 3+ capable cards.  Consider that Steam installations already tend to bias toward higher-spec machines (I don't have Steam on my crappy laptop) and that the survey doesn't include specifics on Apple hardware at all, and 50% doesn't sound implausible.

If your game's free, then frankly you probably shouldn't need to care.  Learn and use whatever helps you the most.

Offline matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #99 - Posted 2012-12-18 18:18:15 »

http://store.steampowered.com/hwsurvey

Doesn't break it down by OpenGL version, but you can expand the list of GPUs, and it overwhelmingly shows OpenGL 3+ capable cards.  Consider that Steam installations already tend to bias toward higher-spec machines (I don't have Steam on my crappy laptop) and that the survey doesn't include specifics on Apple hardware at all, and 50% doesn't sound implausible.

If your game's free, then frankly you probably shouldn't need to care.  Learn and use whatever helps you the most.

Just ninja'ed... Right a second before I found the link...
Didn't find the link about minecraft tho...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #100 - Posted 2012-12-18 21:09:27 »

Mojang stats were talked about here, but the actual page is down now:
http://www.java-gaming.org/index.php?topic=26377.0

Quote
  • About 91% of Minecraft users have computers that support OpenGL 2.0+, meaning we can write games fully with the programmable pipeline (GLSL shaders) and start to safely forget about supporting or having a fallback for the old fixed function pipeline.
  • 51% of the Minecraft user base have computers with graphics cards capable of OpenGL 3.0+.
  • 38.8% of the Minecraft user base have computers with graphics cards capable of OpenGL 3.2+.
  • 34.2% of the Minecraft user base have computers with graphics cards capable of OpenGL 3.3+.
  • 19.6% of the Minecraft user base have computers with graphics cards capable of OpenGL 4.0+.
  • 8% of the Minecraft user base have computers with graphics cards capable of running the latest OpenGL version 4.2.
  • Intel cards are crap (yes everybody already knew that) and account for the majority of the 9% that don't support OpenGL 2.0+.
  • Java 5 use has pretty much died with very few users still on that version of Java.
  • OS X 10.4 use is pretty much dead however OS X 10.5 still has significant market share.

And of course, OpenGL ES is pretty much just GL 2 with a few more features. This is why many of the "modern" GL 3+ tutorials are not great if you are looking to develop games for today's casual market, and why I started my lwjgl-basics API and tutorial series. i.e. Learning the programmable pipeline in a GL 2.0 compatible context.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #101 - Posted 2012-12-18 21:36:08 »

Okay, OpenGL 2.1 it is then.

I'm having a break after Ludum Dare so will start again in a couple of days.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #102 - Posted 2012-12-19 22:10:57 »

Okay, lots of the code in this project was for things I had never done before. Ever.
In my Ludum Dare entry, I rewrote the whole engine, and actually wrote BETTER code.
So, I am going to clean up the Ludum Dare entry, remove anything that was not part of the engine, and rebuild the game on top of that.
This will take a few days if things go smoothly.

Also: Switched rendering to VBOs only. Apparently, VBOs DO work well with constantly changing data. Hopefully that will fix the previously reported crashes when I release the next prototype.

Now I will go and seriously think about what this game is about...

Smiley

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #103 - Posted 2012-12-20 01:37:33 »

Guardian is now Finished (more or less)

Download is in the opening post.

There is not much. Basically you just defend the tower for as long as possible, collecting coins to help.
If you have 50 coins, you can heal fully by pressing H. If you have 150 coins, you can summon another Guardian by pressing the character select buttons while you are alive. (1 = Warrior, 2 = Archer, 3 = Assassin)
If the goblins get enuogh coins, they can summon orcs and trolls.
Remember that you can steal coins from the goblins.  Wink

I will tweak a few things if people want, but no new content will be coming, and if it does, it may be a while.

Don't worry. The art will continue!

At the start of this project, people loved the pixel art. I will not let them down.
I am not stopping work on the spritesheet (or the engine). I will continue making small similar games until the engine is polished enough to do a big project and the spritesheet is complete.

If anyone requests, I will make the spritesheet available for free and the engine Open Source so that you can make the same kind of games (or just peek at the source) and use the art for your own projects (as long as I get some credit, because I don't want the (rare, but still possible) situation where your game gets super-popular and I get fanboys screaming that I stole your art Grin).
Have fun people, and my next project will be shown soon.

CAN A MOD/ADMIN PLEASE MOVE THIS TO SHOWCASE

If you want a more complete-feeling game with similar gameplay (made with what is now the new engine) with similar art, go here to play my Ludum Dare entry.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #104 - Posted 2012-12-20 01:41:45 »

Oh, and can the people that had trouble running this before please try again, as I switched rendering over to VBOs. I hope it works now.

Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #105 - Posted 2012-12-20 03:19:33 »

Same thing. GTX 580

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x5c13b133, pid=4132, tid=3616
#
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) Client VM (23.5-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [nvoglv32.DLL+0x77b133]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Offline davedes
« Reply #106 - Posted 2012-12-20 03:22:09 »

Maybe time to show us some of your rendering code... Pointing

EDIT: Testing it here on my Mac Air, seems very laggy. Maybe something to do with your VBO usage.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #107 - Posted 2012-12-20 03:33:51 »

Entity rendering code:

There is no way that an entity would not have changed between frames, so there is no point keeping the buffer.

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  
      int buffer;
      buffer = glGenBuffers();
     
      FloatBuffer buf = BufferStorage.getBuffer(192);
     
      Vector2Float pos = this.pos.clone().subtract(new Vector2Float(0F, size.y-0.5F));
     
      float[][] vertices = new float[][]{{pos.x-0.5F, pos.y+0.5F}, {pos.x+0.5F, pos.y+0.5F}, {pos.x-0.5F, pos.y-0.5F}, {pos.x+0.5F, pos.y-0.5F}};
      float[][] texCoords = QuadTransform.translate(animator.getTexCoords(), tcOffset);
      float[] color = {1, 1, 1, 1};
     
      buf.put(vertices[0]);
      buf.put(vertices[1]);
      buf.put(vertices[2]);
      buf.put(vertices[3]);
      buf.put(vertices[2]);
      buf.put(vertices[1]);
     
      buf.put(texCoords[0]);
      buf.put(texCoords[1]);
      buf.put(texCoords[2]);
      buf.put(texCoords[3]);
      buf.put(texCoords[2]);
      buf.put(texCoords[1]);
     
      buf.put(color);
      buf.put(color);
      buf.put(color);
      buf.put(color);
      buf.put(color);
      buf.put(color);
     
      buf.flip();
     
      glBindBuffer(GL_ARRAY_BUFFER, buffer);
      glBufferData(GL_ARRAY_BUFFER, buf, GL_STATIC_DRAW);
     
      glVertexPointer(2, GL_FLOAT, 8, 0);
      glTexCoordPointer(2, GL_FLOAT, 8, 48);
      glColorPointer(4, GL_FLOAT, 16, 96);
     
      glDrawArrays(GL_TRIANGLES, 0, 6);
      glBindBuffer(GL_ARRAY_BUFFER, 0);
     
      BufferStorage.addBuffer(buf);
      glDeleteBuffers(buffer);


If anyone knows a way of rendering constantly moving data, let me know, as I think this is extremely inefficient.

BufferStorage
stores an arraylist of unused buffers.
getBuffer(int)
returns a buffer of the size requested, whether it finds one in the list, or creates one.
addBuffer(FloatBuffer)
adds an unused buffer to the arraylist.
QuadTransform
just does things like translating, rotating etc. to a float[][].

World rendering code is generally the same, but it saves the buffer as the data is mostly the same throughout the game.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #108 - Posted 2012-12-20 03:40:16 »

Same thing. GTX 580

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x5c13b133, pid=4132, tid=3616
#
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) Client VM (23.5-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [nvoglv32.DLL+0x77b133]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


Have you got the full dump?
                                                               

Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #109 - Posted 2012-12-20 03:59:20 »

I hope it's not too long

EDIT: Since you already looked at it, removed for better readability
Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #110 - Posted 2012-12-20 04:02:44 »

Same as the other one I got.

There is nothing special (as far as I know) about Sky.render(), it just happens that the sky is the first to be rendered.

EDIT: I start to get lag after a few minutes as well. Really need to optimise that, somehow.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #111 - Posted 2012-12-20 04:31:12 »

Okay, I uploaded a new version which render all entities in one pass.

Hopefully that fixes lag issues, not sure what to do about crashes though...

Offline davedes
« Reply #112 - Posted 2012-12-20 04:49:54 »

Yup, you need to pass all entity data in one go to the GPU -- aka create a "sprite batcher".

Other optimizations - use STREAM_DRAW, don't create new float arrays every frame, and ensure your transformation stuff is not slowing anything down. Also make sure to glEnableClientState and glDisableClientState for position, texcoord and colour since you are using fixed-function. And I'm not sure why you are deleting the VBO each frame.. Huh

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #113 - Posted 2012-12-20 04:51:30 »

I only delete the VBOs for entities, as they are constantly changing.
Chunk VBOs stay until a tile changes.

Does glEnableClientState (or disable) affect anything?

Offline davedes
« Reply #114 - Posted 2012-12-20 04:53:43 »

Unless I'm mistaken, glDeleteBuffers is like glDeleteTextures. It tells OpenGL to delete the object when it's no longer used. So in this case it's a useless call, since you are still using the buffer every frame. Still, it might screw things up depending on how the driver implements it.

Just create one buffer (glGenBuffers) at the start of your game, give it data every frame, and then once you are done (i.e. when your game is closing), delete the buffer with glDeleteBuffers.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #115 - Posted 2012-12-20 04:56:22 »

Oh, didn't think of that.

Fixed. Now it just resets the data every frame, like I wanted.

Offline HeroesGraveDev

JGO Kernel


Medals: 283
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #116 - Posted 2012-12-20 05:04:11 »

Okay, new release available.

People who had trouble before may want to try again, as I have been fixing things.

Also some performance optimisations.

Offline Gjallar

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #117 - Posted 2012-12-20 06:12:20 »

Okay, new release available.

People who had trouble before may want to try again, as I have been fixing things.

Also some performance optimisations.

Congrats, it works now  Cheesy
Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #118 - Posted 2012-12-20 12:23:57 »

A game is never truly finished... you have alpha, beta, then live... but unless it's put on a type of media and shipped to a customer that has no ability to update, the game is never truly finished 

Still, nice work Cheesy


Smiley



-Pickle

Offline Roquen
« Reply #119 - Posted 2012-12-20 13:20:51 »

A game is never truly finished...
That's wrong think.
Pages: 1 2 3 [4] 5
  ignore  |  Print  
 
 

 
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!