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 (590)
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 ... 7
1  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-08-19 18:48:32
Have been busy lately with other things - I'm not sure at this point if I will work on this again, maybe - may be not.
Working on a small app atm..

Anyhow...I have uploaded the source code to my site:
http://borderterrierart.weebly.com/programming.html

Please feel free to use any of it. Its not perfect, or even good, but you might be able to use some of it if your learning LWJGL - especially to make a
block game.

I'll still be around on forum so ask questions if you need to...
2  Games Center / Cube World Projects / Re: Terminal - A space voxel game on: 2013-08-19 13:14:01
Hi,

It look very interesting what you are doing. Keep trying on it. I will post the source code for the picking when I get home. There are lots of people who will be able to help too.
3  Games Center / WIP games, tools & toy projects / Re: Stickman Revolution (official name) [UPDATE, June 10,2013] on: 2013-08-08 13:04:34
Such fantastic progress since I last looked at this! Smiley Looks so cool
4  Games Center / Cube World Projects / Re: 3D Turnbased Roguelike (LWJGL) on: 2013-08-08 13:02:00
good job.
That game looks awesome. Good graphics.

Hi, thank you for that. Sorry for late reply been away. Hope to get back to programming again shortly.
5  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-07-21 19:38:55
Where can we play it? Is there any chance you show how goes your code so we all can learn from this good work too? Thank you keep the good work!

I will compile a runnable version, and also update the source code for download. I've cleaned the code up a bit and annotated some of it. Thank you for taking an interests, I'm doing this project to learn various things.

The project is coming along nicely, but that inventory popup/screen seems really clumsy to me, like it's always blocking your view of the block hand. Obviously I saw the "x" button, but I think it would be a lot better to put the inventory somewhere less-intrusive.

Yes, I see what you mean. I plan for the windows to be moveable, drag with mouse. I've got a a map window to put in, I might put the Inventory under that. Thank you for your suggestion, I'll change that for the next update.
6  Games Center / WIP games, tools & toy projects / Re: 2D platformer (Boxman) on: 2013-07-18 09:43:50
That just looks so good! It really changes it with the lighting..
7  Games Center / WIP games, tools & toy projects / Re: Procedural 2d Pixel Vessels / Space Ships on: 2013-07-18 09:42:23
I like this Idea, looks great, the pictures are so suggestive of things!
Creatures, spaceships, building plans... excellent.
8  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-07-18 09:39:47
Update

Added a 3d cloud. Modelled and textured in blender, and exported as .OBJ. 
I have a also made a new animated water texture, and pass co-ordinates to the shader.

<a href="http://www.youtube.com/v/fFeFzTAbHgo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/fFeFzTAbHgo?version=3&amp;hl=en_US&amp;start=</a>
9  Discussions / General Discussions / Re: New feature: post quality ensurererer on: 2013-07-09 19:15:47
If nobody replies after 5 (!) real, informative updates, it's telling.

May I just add something to the mix... What if nobody replied - but people gave you appreciation medals instead - would that be a validation of the content?
10  Games Center / WIP games, tools & toy projects / Re: KDoom - Game Engine/Doom Clone I'm working on on: 2013-07-09 19:07:48
That's looking really good. Would like to give that a try when it's ready Smiley
11  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-07-03 19:43:50
Face Picking part 2 - Java Code

This is my cumbersome implementation. Its not optimised, or well coded, but it should be clear how it works.

The update loop gets the camera vector....using the horizontal rotation (rot) and vertical rotation (lookupdown) angles in degrees
1  
2  
3  
4  
5  
6  
7  
public void getNormalisedCamVector(){
         camVector.y =  (float) Math.sin(lookupdown * piover180) * 1f;
         float v = (float) Math.cos(lookupdown * piover180) * 1f;
         camVector.x = (float) Math.sin(yrot * piover180) * v;
         camVector.z= (float) Math.cos(yrot * piover180) * v;
         
      }



Next a test is done in X, if facing right x>0.... so
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  
      //do right X sweep
         if(camVector.x>0){
           
            for(int distance=1;distance<10;distance++){
            //solve for t
            t =   (((int)xpos -( distance+0.5f) )-xpos) / camVector.x;
            Xh = (int)xpos -(distance + 1);
           
            //solve for Yh
            Yh = -camHieght + t*camVector.y;
            Zh = zpos + t  * camVector.z;
            Xd = xpos - Xh;
            Yd = Math.abs(-camHieght - Yh);
            Zd =Math.abs(zpos - Zh);
           
           
            Yh = (int) (Yh+0.5f);
            Zh = (int)( Zh+0.5f);
            helperX=Xh;
            helperY=Yh;
            helperZ=Zh;
            //System.out.println("Xh="+Xh+ "   Yh="+ Yh +  "  Zh=" + Zh);
            if(isHelperOnSoildBlock()){
               helperFace = 5;
               
               XDist = (float)Math.sqrt(Xd*Xd + Yd* Yd + Zd*Zd);
               xx = Xh; xy = Yh; xz = Zh;
               //System.out.println("XDist =" + XDist );
               break;
            }
            }
           
         }


some floats are used to hold temp values. The isHelperOnSoildBlock method uses the helperBlock position and returns true if the block is soild (not water or air).
The distance is saved.

Y and Z axis tests are just the same. (as well as facing left x<=0)

After all the tests:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
if (XDist < ZDist && XDist < YDist){
         
            if(camVector.x>0){
            helperFace = 5;  
            }else{
            helperFace = 4;  
            }
           
           
            Xh = xx; Yh = xy; Zh=xz;
         }


In this example if the X distance was the shortest, the faces and block position are saved. The blocks render method will only render the
face with that helperFace ID.

one thing to note:
when a block is removed , its the block at Xh, Yh, Zh

but if a block is added
then if HelperFace =4, then Xh-=1 just before the block is placed.
So we use the helperface ID to determine how the selected face alters where we place a block - but not where a block is removed.
12  Games Center / Cube World Projects / Re: Deathsiege on: 2013-07-01 07:49:04
This is looking / sounding really good. Will definatly give this a try on the 15th! Smiley
13  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-30 15:15:40

Picking faces in 3d - Part 1 - Maths Theory

I'm not sure if this is a standard approach, this is just how I figured it out.

A  ray is traced from the camera position along its direction Vector.

In a voxel world a test can be made at unit intervals on X,Y,Z axis to see if a collision with a
face has occurred. The distance of 3 possible collisions is compared. The closes is the hit face.
(this method can be adapted to work with non-axis aligned boxes too)



This example shows how to use parametric equations to make these tests. These are the equations we will use




This example will be shown in 2d for clarity, but unlike equations of line, this method will work exactly the same in 3d.



 
The camera is located at (1,2.5) has a Vector of (1,-0.25)
That means for each moment of 1 in X, there will be -0.25 movement in Y

We will use the parameter t, which could be visualised as time. After a given time, we will be further along the line. We know where we want to be in x. We are checking all the x planes moving away from the camera in + direction(in this case).

For this example we will be checking x= 6.   So x(t) = 6.
Now we have x(t) we can solve for t.




Now we can calculate the y value y(t) where the line will be on x=6. If the value is >box min and <box max position then the face has been hit.





In 3d the Z and Y values have to be checked, both must be within the in and max bounds of the box for there to be a hit.

We then calculate the distance to that point - in 3d   Distance = Math.sqrt ( X^2, Y^2,Z^2)

Now test all the Z planes, then all the Y planes. The one with the shortest Distance is the one you hit.

Part 2 coming soon - Java code



14  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-29 19:48:27
Update

I have been working on the picking, rather than tracing a in ray increments along the ray and testing block intersection, I have finally decided to ditch this
and do 3 separate axis tests at 1 block intervals, using parametric equations. This is not only 100% accurate, it eliminates problems with corners, and assuming you can pick a block 10
units away on each axis, that is 30 calculations for worst case. Rather than the 100 or so I was doing before for  0.1 unit accuracy.

Now, I'm testing for collision with a face, not a cube! Smiley

I can give details of how this is done if anyone should require a mathematical explanation with code.

<a href="http://www.youtube.com/v/HtjWJiodjhs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/HtjWJiodjhs?version=3&amp;hl=en_US&amp;start=</a>

15  Games Center / Cube World Projects / Re: LWJGL - Voxel Engine on: 2013-06-28 17:39:27
If you render the water first at any point, the depth test will prevent terrain being drawn behind it.  Draw all solid terrain first. Then transparent things in s second pass. That may solve it
16  Games Center / WIP games, tools & toy projects / Re: LodeScape RPG on: 2013-06-21 19:17:53
The lights add so much mood to the game! It transforms it. Could you add a reddish light for the fireplace etc? Or make the how hole map a very dark blue, like its lit by the moon, then add the warm glow of the street lamps?

It look great and is really coming on. Smiley
17  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-21 19:02:38
I think you should use a shader to make the whole world look like the Furnace GUI does right now Smiley


That's a good idea, I would like it to look different. How I would do that I'm not sure, ill take a look at cell shaders, then maybe some vertex noise?

TBH, I've never seen a non-random-gen voxel engine. I think it would be a really cool direction to take, as you could do a lot with it. And in my opinion, built worlds always look much nicer than otherwise.

The landscape is random, I use a diamond start algorithm. But your suggestion is one I'd not considered, and it would Lend itself to small missions?

And in my opinion, built worlds always look much nicer than otherwise.

Random generation can sometimes be just as nice as custom-built. Take a look at Delver for example*.

(*If you look around, you may be able to find the old free version. If not, just watch the videos and look at the screenshots.)

Delver is very interesting, and has a lot in common with my other game. The old free one uses prefabs joined together I believe. Like say-animal crossings!

Making a whole landscape by hand would be a challenge! I'd need to either make a tool to do that, or add tools from within the game, or utilise some minecraft world editing tools and read the format and convert it.

All very interesting. I currently changing the picking to pick faces rather than cubes.
Has anyone ever used the openGL name stack? (Though I thing I will solve the problem geometrically)
18  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-20 11:24:00
Update

Added inventory, with mouse wheel selection, Workbench, Furnace + mockup GUI.
Added axe movement (not show in video)
Refactoring of code with comments.

<a href="http://www.youtube.com/v/emMQi-YiaAo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/emMQi-YiaAo?version=3&amp;hl=en_US&amp;start=</a>
19  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-14 18:16:48
Yea, opacity can be a pain. Hopefully is sorted!

Shaders.....http://pastebin.java-gaming.org/aacfa371065

In your java program - to communicate with the shaders you use the uniform variables:-

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
glUseProgram(shaderProgram); 

   int loc = GL20.glGetUniformLocation(shaderProgram, "u_texture");
   GL20.glUniform1i(loc, 0);
         
   int loc1 = GL20.glGetUniformLocation(shaderProgram, "iGlobalTime");  
   GL20.glUniform1f(loc1, f);     //f is a float that is based on a counter or delta time
       
    //set scroll mode to 1 (scroll)
   int loc2 = GL20.glGetUniformLocation(shaderProgram, "scroll");          
   GL20.glUniform1i(loc2, 1);

//Do rendering stuff


glUseProgram(0); //stop using the shader program


           



This example instructs the shader to enable the scrolling for the water. You need 2 textures in the texture atlas adjacent to each other horizontaly.
20  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-13 10:03:26
Update

Using shaders now. Added Scrolling water effect, and discarding fragments.
Added glass with translucency, and Leafs with transparency.
Water now scrolls slowly.

I can post the shaders if anyone would like them- but they are only basic.

<a href="http://www.youtube.com/v/hKn1Q-mU8EE?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/hKn1Q-mU8EE?version=3&amp;hl=en_US&amp;start=</a>

21  Games Center / WIP games, tools & toy projects / Re: SF Citybuilder- Buildings/Concept Art on: 2013-06-10 20:05:39
Facial art work is looking very good. Lots of combinations! Love the shading one the geodesic dome. Gives a real sensation of illumination.

Did you see this face builder tool?
http://www.0x10cblog.org/0x10c-news/0x10c-facebuilder-tool-demo-released-video/

The way the face art selection is integrated into the game environment.
22  Games Center / WIP games, tools & toy projects / Re: Stick Battle (WIP name) [UPDATE, June 10,2013] on: 2013-06-10 19:33:41
This looks very interesting.

Yea, pic only goes so far, but pigs go all way!


Looks such good fun. Runs at 245 fps Smiley
23  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-10 19:22:41
Update

I finally made some textures! 2 colours of fog, sky box, movement tweaks.
Sounds still wont record Sad

<a href="http://www.youtube.com/v/8LZJfpM7MKM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/8LZJfpM7MKM?version=3&amp;hl=en_US&amp;start=</a>
24  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-10 14:35:04
@Vermeer You probably have answered this question, but did you use JBullet for the bouncing blocks that flew into the air when you destroyed a block?

No, I just used a few vector calculations..
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  
//first I give the blocks random horizontal velocity at a random angle
//when its constructed

this.yVel = 2;
yRot = (float) Rand.nextInt(360);
hVelocity = (float) 1/50f;

//then I do the transformations on each entity like this in the update loop
for(Entity Ent : entities){
      //find the ground level for the entity  
      ground = getGroundLevel(Ent.getX(), Ent.getY(), Ent.getZ());
           
         
      //apply vertical calculation ie, its vertical velocity  
      Ent.setY((float) (Ent.getY()+Ent.getyVel()*TIME_STEP*2));
      Ent.setYVel( Ent.getyVel() +((float) (GRAVITY*TIME_STEP)));
         
      if(Ent.getY()<=ground+0.7f)   {
            Ent.setYVel(-(Ent.getyVel()/4));
               
            Ent.setY(ground+0.7f);
            Ent.sethVelocity(Ent.gethVelocity()/1.8f);
               
            }  
           
//move the enity horizontally
      Ent.setX(Ent.getX() + ((float) Math.sin(Ent.getyRot() * piover180) * Ent.gethVelocity()));
      Ent.setZ(Ent.getZ() + ((float) Math.cos(Ent.getyRot() * piover180) * Ent.gethVelocity()));
           
         
           
      Ent.tick();

//I also check if it needs removing, or if player is near it.


Thanks for your positive comments Smiley
25  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-09 21:15:24
@oskuro

Thanks for your comments. I will take this in a new direction eventually, like I'm planning water shaders etc. I will try to make the graphics different!  But I do take what you mean. Actually part of the idea is replication, it's like having a specific goal, sure the problems of playability and what makes a good game is solved, but my quest is to try learn how to implement things. And being original, without the underpinning skills is a bit much for me.
In short, it's a way to focus and solve specific problems.

A Minecraft clone is actually a pretty good way to learn OpenGL and 3D concepts. Smiley Who cares what the product looks like -- this is a programming forum, after all.

Thanks Davedes, also thank you for the amazing tutorials on shaders. This is what I'm reading!
https://github.com/mattdesl/lwjgl-basics/wiki
Your normal maps in lesson 6 is awesome. Smiley


26  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-06-09 19:11:39
Update
I am doing some more work on this to learn some things I will need for my other game.

The biggest change is from VBO's to Display lists. That may sound odd, but FPS is much increased. My management of static VBO was probably not ideal. I can go into specific details if required.

I have also temporarily removed infinite terrain to improve the feel of everything and restructure the code to be more game orientated, in preparation for adding multiplayer support.

I am currently adding trees and shaders - in preparation for using my own textures. I also plan to use the UI from my other game, as its designed to work in any project.

I have added large scale water (that does not flow yet) but it feels like water, effect movement and vision, and I have added sounds too( but they didn't record, that will be sorted for next update). I'm thinking of joining GitHub soon and will put the project up there.

Do you unload chunks when they are not in view and then load new ones?


Yes, I had a fixed number of chunks, and moved data into them to overwrite un-needed chunks. (will put this back in soon)

@Vemeer:
Pro-tip:
Use another simplex noise layer to generate the grass colors Wink

Thanks for that, I will do that when I get around to biomes!

here is latest update:-

<a href="http://www.youtube.com/v/bVLixGQIwP4?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/bVLixGQIwP4?version=3&amp;hl=en_US&amp;start=</a>


27  Games Center / Cube World Projects / Re: 3D Turnbased Roguelike (LWJGL) on: 2013-06-09 08:53:17
You said, in that thread, that you would be willing to share your knowledge. Do you think you would be able to point me towards some interesting multiplayer resources? I'd love to do some reading. Smiley

I will continue to share all block world code. Multiplayer is not done yet but look here...
http://www.gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking

Also here is a good resource:
http://www.java-gaming.org/index.php?board=19.0


I learnt how to start multiplayer from van zeben a video tutorials:
http://www.youtube.com/user/DesignsbyZephyr
Such as opening sockets, making packets of data, parsing them, game flow, and concurrency.


Will come back to this armed with a bit more knowledge. Smiley hopefully!
Looking forward to it.

Thank you, will be coming back to this.
28  Games Center / WIP games, tools & toy projects / Re: Limited Force on: 2013-06-08 21:13:30
Your game looks very cool. Excellent presentation, and smooth motion and graphics.Looks very interesting. Reminds me of playing Homeworld! Wil be interesting to see how this develops.

All it be rpg, shooter, or strategy? Or all?
29  Games Center / Cube World Projects / Re: 3D Turnbased Roguelike (LWJGL) on: 2013-06-08 17:40:03
Thank you for the positive comments. I am putting it on hold for a short while to inversigate some other programming techniques.

I've been developing the blockworld game, and will be updating that soon. I'm looking at using shaders, multiplayer, and I've added sound.

Will come back to this armed with a bit more knowledge. Smiley hopefully!
30  Games Center / WIP games, tools & toy projects / Re: LodeScape RPG on: 2013-06-08 12:43:52
Game is looking really good  Smiley

That also sounds a good idea with GitHub- need to look at that.
Pages: [1] 2 3 ... 7
 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

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

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

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

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!