Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (755)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 3 ... 5
1  Game Development / Newbie & Debugging Questions / Re: Classic transparency problem with PNG on: 2015-01-18 13:44:47
So I guess the issue is really with the image source and the premultiplied alpha. I have some trouble really understanding all of this because it doesn't behave as I expect it to, but I know a way to deal with it, which is just to leave the clearColor as black.   Clueless
2  Game Development / Newbie & Debugging Questions / Re: Classic transparency problem with PNG on: 2015-01-18 12:50:22
i guess, the png images come with premultiplied alpha.

what happens if you change it ?
So I don't really get this in it's full glory, but I changed the blendFunc to see what happens.
It was:
batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

Now it is:
batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA);

It looks like this with the latter code (don't mind the different color tint):

So it looks like you could be right. I will test some more things now. Thank you very much for your great help so far, basil_. Smiley
Still, if someone has more information, please let me know. I will let you know if the problem is solved and how.
3  Game Development / Newbie & Debugging Questions / Classic transparency problem with PNG on: 2015-01-18 12:03:19

Have been off this board for quite some time. So I am glad to finally having a reason to come back. Smiley Of course it is that I am having a problem I am not able to fix myself.

I am currently developing with LibGDX. It is a 2D-side-scroller. I used black as the clearColor so far but changed it to white for testing purposes. I use background, foreground and decoration layers to draw tiles. Some tiles have transparency via alpha-channel in PNG-format. Now with the black clearColor it worked fine. But when I changed it to white it suddenly looked like this:

So my questions are: As the vertical structures on the sides of the door belong to the deco layer, shouldn't the background layer, which is drawn before deco layer, give the source color for the blending? Is the clearColor somehow a problem? What could solve the problem?
I have following line in my code:
      batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

This is fixed function, does this still affect rendering when using shaders? I found sources which said so.

To make it clear, my rendering routine for the map works this way:
   public void draw(SpriteBatch batch, float x, float y){
      drawBG(batch, x, y);
      drawFG(batch, x, y);
      drawDeco(batch, x, y);

And drawDeco is where the transparent PNG is in.

Does someone have a clue? Is some information missing to see the problem? I will be glad if you can help me.
4  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-30 12:56:55

Just wanted to say that I am stopping my activity on this project. I have learned so many new things through it, but I am also getting a bit tired of it. After all it is just a clone of minecraft. Smiley

I am now working on another project which I plan to finish. Honestly, I will do this!  Cool
But it will be only 2D.

I will not make a topic for the new project for now. This will be done, when there is enough material and a demo to test it.
All that I can say now: currently I am working on my own particle generator for the game. This is what it looks like:

(don't mind the skyrim screenshot in the back. Just trying not to let it look too empty, simulating some ingame stuff...)
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Thank you for your support on this project and see you soon on the next one. Smiley
5  Games Center / Archived Projects / Re: My little project on: 2013-04-26 18:50:08
Hey, nice! It's living! Cheesy

So this is a good step forward. I haven't been able to get .OBJ loaded. But I haven't really been working on it. This is something I will do sometime in the not so very near future.

Keep the thread up to date if you do something new. Smiley
6  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-21 18:27:14
BTW - what do you do when a collision occurs, do you check for collision before allowing movement?
I am not sure, if my approach is really that good, but I do it like that:
Since my movement is based on velocity and friction, when I move the player, a constant value times delta (in ms) is added to the velocity vector. So, when I am checking for collision, I am testing it with my velocity vector. After collision check I cap the vector by multiplying it with the time value of the collision check ( a value in [0,1] ).
- If the value for multiplying is 1, then the whole vector will be applied.
- If it is lower, the vector will be used with the lower values and then resetted to 0. I am still working on my strafing algorithm, so I am not talking about that now.
7  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-21 14:55:15
I've added random items / blocks to mine but would like to make my trees actually look like trees, there must be some simple algorithms out there for this?!
For my own project, I think I would just think of a strategy to do this myself. After all, this can't be so hard, can it? Will see.

missed the to tell you if its fixed bit, and yes it is fixed. Smiley
Thank you, I am very happy to hear that. Cheesy
8  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-20 15:39:37
Ok, I found something about those gaps here:

Now it seems to happen on certain nVidia Hardware. And as says:
glEnable(GL_POLYGON_SMOOTH): This is not a recommended method for anti-aliasing. Use Multisampling instead.
I used gl_polygon_smooth and there you have it...

Ok, I updated it and fixed another bug that was mostly invisible and is therefore swept under the rug.
The old download is updated!

Please, Phased, if you read this, tell me if the strange gaps have vanished...  Cheesy
9  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-20 14:53:10
benCraftAlpha3_17_E.jar is what i downloaded (in case you put up a wrong file)

Oh my .... THIS looks terrible!  Shocked It is a fine screenshot, a masterpiece, but the gaps! Gotta do something about it!

But honestly, I don't know what could be causing this. As I am not able to reproduce this I will hardly ever know if I have fixed it by doing anything. Hmmm, maybe I should think about what could be causing this first. Or maybe someone already knows it...
If you would like to help me further, you could tell me what hardware you have, especially graphics card of course. Maybe I will eventually get an idea, what is the reason for these gaps.

Anyway, thank you for your screenshot, this is worth a... uhm... chunk of gold!! With chocolate on the inside. Smiley No, really, thanks for that.

In Australia we have usage caps, and I capped mine, but it should be reset on the 23rd.
Good to know, so I will be warned before wandering off to Australia. Smiley
(don't get me wrong, I am not planning to go to Australia... maybe Austria. *g*)
10  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-20 13:28:40
There seems to be a 1 pixel gap between each triangle, your able to see the lines of where they connect, you should add that to your to fix list.
This is odd, I had this problem before, but I thought I fixed it because I can't see those lines anymore. Can you give me a screenshot of it?
Thank you for your information. Smiley
11  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-20 12:57:53
Another update!

I haven't achieved as much as I would have liked to in the last week, but after all it is still going forward.

Most of the time was spent on analyzing the usage of memory and refactorings based on that.
Did some corrections on the rendering algorithm and the usage of the VBOs. I added two textures (dirt and grass) and created a few chunks to play and experiment. Nothing special though.
I also added a little hud to select the used cube type with the mouse wheel.

Everything is still very dirty and hacked together. I will do some polishing, when there is nothing more urgent in the way.

You can see the features in the video:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

There is also a downloadable version
This version is compiled with jdk 1.7.0_07.
You may be experiencing a collision bug when jumping at edges of cubes. This will be fixed in a later version. Please tell me, if you have problems or get other errors.

Next up:
adding fog and frustum culling and fixing the damn collision testing bug. Smiley
12  Games Center / Cube World Projects / Re: Voxel - a start on: 2013-04-19 20:38:16
Are you using VBOs or DisplayLists or ImmediateMode?
If you are using VBOs, maybe there is a problem with memory. I had some problems at first, then I changed a bit of my code to use VBOs properly and it was better since then.
13  Games Center / Cube World Projects / Re: Voxel - a start on: 2013-04-19 15:41:38
I see, you are making progress there. Smiley The trees look ok, just some of them may be a bit too small.

Do you plan adding ray casting for voxel picking soon?
14  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-15 17:29:51
Thank you for the video, this helps. It doesn't really look like the problem is just that it won't stop rotating.

So there still is this line, that seems wrong:
      a -= n / 180 * Math.PI;

What are you doing there and why? Is the value n supposed to be in degrees? Is it actually in degrees?
15  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-14 16:20:17
Because of not having any proper information about what "doesn't stop rotating" really means, we can't really tell what you want to hear apart from where the problems in the code may lie.

There is no screenshot, no captured video, no sketch, no precise information about it. Anything of this could help. All that I see in your code for now is, that you seem to be messing with angles in degrees and radians. But maybe I got this wrong. In the end, you should know best and tell us, if this could actually be the problem or not. So, when you look at the comments I made on your code, is this correct?
16  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-14 10:55:41
I will try to comment your code to see where the problems may be.
public void rotate(double x, double y, double cx, double cy, double n) {
      double dx = x - cx; // calculate current angle of drawn line (the bow?)
      double dy = y - cy;
      double r = Math.sqrt(dx*dx + dy*dy);
      double a = Math.atan2(dy, dx); // angle is known now in rad

      a -= n / 180 * Math.PI; // rotation in rad is converted to rad... uhm, yeah. And then subtracted from the computed angle of the line... am I getting this wrong?
      this.x = cx + r * Math.cos(a);
      this.y = cy + r * Math.sin(a);
   public void render(Graphics g) {
      //image.draw((float)x, (float)y);
      g.drawLine((float)x, (float)y, (float)x2, (float)y2);

   public void update(GameContainer container) {
      Input input = container.getInput();
      rotation = Math.atan2( input.getMouseY() - 600/2, input.getMouseX() - 800/2 ); // mouse coordinates relative to center of the screen used for getting the angle between normal position without rotation and rotation to current mouse position
      rotate(x, y, x2, y2, rotation); // method for rotation. Uses line start and end point and rotation angle as inputs...
17  Discussions / General Discussions / Re: anyone tried an oculus rift? on: 2013-04-14 09:50:58
YEAH, my all time favourite topic!!! I would love to have one of those VR Headsets! I can't wait for them to be available as consumer product. Every now and then I watch a video on youtube showing people who try it out. And I always ask myself when I will be able to experience this myself... >_<
I will pay whatever I can for this! Smiley

So to answer your question correctly: no, I haven't tried one. Sad
18  Game Development / Newbie & Debugging Questions / Re: Rotate player in relation to mouse position on: 2013-04-14 09:44:59
Is this in 3D or 2D? I guess it is 2D. Then I think you have a top down view and the player can rotate by the imaginary z axis coming out of the screen.

In this case it must be fairly simple. Just compute the distance between the player position and the mouse position and store it for example as a Vector2. You can then normalize it and calculate the dot product on the norm vector representing rotation of 0 degrees. You then just have to see if you are above or under the y position of the player to get the angle right.

If my assumptions are right, tell me if you need more explanation. Or maybe there is an even easier way.
19  Games Center / WIP games, tools & toy projects / Re: My First Java Game (Heavy WIP) on: 2013-04-14 09:00:42
I do think so as well. Generating levels out of images is nice. What I like even more are nice editors. Smiley But I think that you can do lots of things with images, especially when you mix it with other techniques, like the mentioned text file. Maybe I will do something with this myself sometime.  Roll Eyes
20  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-11 18:35:30
Thanks to both of you. Smiley

But I think it is nothing special. I heard that Blinn-Phong is part of the fixed-function toolbox in OpenGL. So I feel like I haven't really achieved much for now. But if it looks ok in the game, than I will be glad. Cheesy

That looks really cool. Do you plan to use lots of real time lighting, or is it for just a few special effects?
I would like to add a few special effects. So this is not for extensive use. But it is great for learning how to do this and that and lighting in 3D was something I wanted to do for a long time now.  Cool

EDIT: Ah, almost forgot: your project is super-mega-great, Vermeer. Wink I am actually trying to get my project half as beautiful as yours.
21  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-11 13:51:26
It has been more than a week with no update now. This is, because I am not really working on it. Instead, I am learning about lighting to be able to implement it in this project. I want to do this on my own with shaders. For now, I have read a lot about the theory and I have implemented blinn-phong in a test-project. I also have a short video of it:
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
Nothing too great about it. But this is just a start.

Now I will continue learning. Smiley
22  Games Center / Cube World Projects / Re: 3D Turnbased Rougelike (LWJGL) on: 2013-04-08 16:26:14
Looks veeery interesting! I like the idea of random generated dungeons. Looking forward to seeing your progress on this.

Nice lighting! Smiley
23  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-04-03 17:55:19
As this goes to everyone building those engines I feel like answering:
It sounds like an accusation. Even if it just was for copying the idea as fast as possible and getting it running, I don't see any problem in that as long as it is for fun.

As you can see in my thread, I am taking my time to optimize things. And I think others do aswell. For me it is a good thing to learn it by just copying the concept of minecraft, because these are my first steps in 3D programming and I am happy with my project. I love Minecraft and I would like to see if I can be able to get something similar working. Then, after that, I will go on making my own stuff with the things I have learned. This is my plan.
24  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-04-03 16:09:27
Really nice work! I am looking forward to implementing lighting im my project too. This can create amtospheric highlights. Smiley
But for now, I am still struggling with my collision detection, trying to make it better and more efficient.

Keep up the good work, this will be an awesome competitor! Wink
25  Games Center / WIP games, tools & toy projects / Re: Pseudo Voxel Expriements on: 2013-04-02 12:28:46
I just came here to say, that it looks great and inspiring. Smiley Good work!
26  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-01 22:24:04
I have put my posts together:
Old post:
I am using AABBs and dynamic seperating axis test. And the tests are pretty slow because I am doing them on all cubes currently... this is what I am going to change when fixing performance issues. Did this on raycasting for picking already.
When I am done with that, there will be some work with the chunks to do, because one single chunk is getting boring.

New Post:
I take it you define a bounding box for the player/camera, and use this to detect if 'bound' with one of the blocks?
Yes, of course. If you are really getting the book I told you about, then you will find excellent explanations on this in the Appendix A. Wink
27  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-01 22:05:24
Did you build with Java 1.7?
Yes, I do.

Here is my video which is just showing a minute of so called "gameplay"...
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
28  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-01 21:48:45
You aint dumb @Sparky83!
Maybe not completely, but I have potential! Wink Thanks for defending me against myself anyway. Smiley

Anyway, tried to run your jar and I got this on my terminal:

Exception in thread "main" java.lang.UnsupportedClassVersionError: engine/EngineMain : Unsupported major.minor version 51.0

Running on a Macbook Pro.
Try downloading it again, it shouldn't do this now. I used an older compliance level. Do you have an old version of Java on your machine?
29  Games Center / Cube World Projects / Re: Sparky's little Cube World Project on: 2013-04-01 21:14:16
So here is my promised version with collision detection. I had some problems with it because I am unexperienced and a bit dumb, but now I have it neeeeeaaaarly working! Smiley

You can test it here: Alpha2

I still have severe problems with performance. Because of this there are still 8*8*8 cubes per chunk. This is what I am going to fix next. I can't wait. Smiley

I will post a video of it, when it is ready!
30  Games Center / Cube World Projects / Re: Only one block in chunk being drawn when using textures on: 2013-03-31 20:15:50
If you really study math with this one, you will be up to the task of 3D game programming.

I am not advertising, I just love this book as it helped me so much btw. Smiley
But you can of course also do it without it.
Pages: [1] 2 3 ... 5
DesertCoockie (52 views)
2018-05-13 18:23:11

nelsongames (83 views)
2018-04-24 18:15:36

nelsongames (74 views)
2018-04-24 18:14:32

ivj94 (758 views)
2018-03-24 14:47:39

ivj94 (87 views)
2018-03-24 14:46:31

ivj94 (643 views)
2018-03-24 14:43:53

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!