Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (290)
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 4
1  Games Center / Featured Games / Re: Overbind on: 2013-05-18 19:41:04
Don't drop this game!

Add things like Buttons/Pressure Plates/Timers/Doors/Forcefields, and then make cool new levels with them.
Ala: Take some stuff from games like Portal and make new puzzlez with it.

Edit:
Or invent some new puzzle elements that are tied to the magnetic propulsion/repulsion ability of the player!
Like: A box that the player can push/pull by clicking it.

- Longor1996
2  Game Development / Newbie & Debugging Questions / Re: How do i generate triangles from points on a plane? (in 3D) on: 2013-05-14 17:50:05
We're already having a communication problem:  You say that all the point are on a plane.  If that is the case there's no projection needed.

search: "mesh from point cloud".

Okay, I found something called "Delaunay triangulation", wich seems like the best solution to my problem.
Actually, not all point's are on the plane, but these non-plane point's are getting sorted out by a very simple point-on-plane test before they are put into the trinalge generator.

Thank's for the advice.

- Longor1996
3  Game Development / Newbie & Debugging Questions / Re: How do i generate triangles from points on a plane? (in 3D) on: 2013-05-14 17:31:15
You're teacher's correct, since all the points are on a plane it's a 2D problem.  But to get an answer to your question you'll have to provide more details.  Like what are you attempting to do.

Okay, how does one project points onto a plane and then connect them to make triangle's?
Maybe I have luck searching for "project points onto plane and connect hem to triangle's".
And I already said what I wan't to do, if you wan't to know for what exactly:
It's for a CSG-Raytracer based on triangle-meshe's. I already know how to do everything, the only missing part is the triangle generation.
And don't tell me that I can raytrace CSG-body's directly, i already know that.
It's just that I would like to use the triangle-generator for some other thing's later too.

- Longor1996
4  Game Development / Newbie & Debugging Questions / How do i generate triangles from points on a plane? (in 3D) on: 2013-05-14 16:31:42
Hello everyone!

I have a question, for that i can't seem to find a good answer for on Google.

The question is this:
I have a plane in 3-dimensional space, that is stored as a object containing a plane-equation,position and a surface-Normal.
And I have a set of n 3D-points, that all are lying on the plane.

1  
2  
3  
4  
5  
6  
7  
// Probably important: Im using Vector's as Point's and vice-versa.
class Vector
{
 float x,y,z;
 
 -snippedTheRestOfTheClass-
}


1  
2  
3  
4  
5  
6  
7  
8  
class Plane
{
 float d;
 Vector position;
 Vector normal;
 
 -snippedTheRestOfTheClass-
}


Now i wan't to generate Triangle's from these points-on-the-plane.
Im somewhat unable to successfully implement a algorythm that does that for me.
My math-teacher told me I should try to '2D-project' the point's onto the plane and connect them then using 2D logic.
Too bad I don't know how to do this right.

Please help!

- Longor1996

PS: Im (still) sick, so please write in a way that i don't have problems to understand the things you write.
PPS: Also, i wan't to generate as few triangle's as possible, if that is possible.
PPPS: The generation of these triangle's is for 'offline'-use, so it doesn't have to be fast.
5  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-05-11 18:07:29
Thank you all for your help. I used steg90's method, and it worked. I was expecting something more compilicated with usage of trigonometry to tell you the truth.

-

My current problem is that from some angles, players cannot see the rest of the blocks through a transparent block. At some points it seems like there are no other blocks behind the transparent ones like water. I don't know if my explanation is good enough to understand. I am not sure what causes that.

Paul.

To fix this problem (almost):
1  
2  
3  
         GL11.glEnable(GL11.GL_BLEND);
         GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
         GL11.glAlphaFunc(GL11.GL_GREATER, (float) 0.1);


And then you will also have to do depth-sort your chunks.
Then render opaque things front-to-back, and then render back-to-front transparent things.

Example:
1  
2  
3  
4  
5  
6  
7  
List<?> visibleChunks = ???;
Collections.sort(visibleChunks,frontBackDistanceSort);

for(int n = 0; n < visibleChunks.size(); n++)
    visibleChunks.get(n).renderCall(OPAQUE);
for(int n = visibleChunks.size()-1; n >= 0; n--)
    visibleChunks.get(n).renderCall(TRANSPARENT);


- Longor1996
6  Games Center / WIP games, tools & toy projects / Re: A Java scripting language -- Leola on: 2013-05-09 16:45:08
And what is this then?

- Longor1996
7  Games Center / Cube World Projects / Re: Voxel - a start on: 2013-05-09 16:43:55
I think it's a good idea to use the programmable pipeline.
Just don't forget to make some sort of fallback for the systems that don't support shaders.

Have a nice day!

- Longor1996
8  Games Center / WIP games, tools & toy projects / Re: A Java scripting language -- Leola on: 2013-05-09 15:27:30
Hey, newera32,

before the view-counter/guest-counter in this thread shoot's up rapidly out of no-reason,
I think I should tell you that I posted a link to this thread in the english minecraft forum in a very well visited thread.

Little question here:
Is it possible to save the bytecode that the leola-vm uses to the harddrive?
And is it also possible to execute bytecode from the harddrive?

- Longor1996
9  Discussions / General Discussions / Re: Your favorite platform games of the last five (5) years? on: 2013-05-03 15:25:33
Super Meat Boy and Mario Portal.

I wasted 9 hours of my live playing Mario-Portal.

- Longor1996
10  Games Center / Cube World Projects / Re: Voxel - a start on: 2013-04-28 19:12:06
Thanks Longor,

I'm changing mine now to be coded in C++ and using Shaders...

Will take on board what you have said and try the 1d array, I've heard that does speed things up a lot on other forums.

Not so sure about using a singleton pattern for blocks though...as there are many of these.

Here's another tip:
Don't switch the programming language to C++.

Why?
Writing a Voxel Engine in C++ is incredible hard because of memory-management.
Also, you won't get any big speed improvements in C++, because Java is as fast as C++ with JIT, Runtime-Optimization etc.etc (i heard so).
The biggest problem in C++ are the memory leaks. Java has them too (i heard so), but they aren't very big (i heard so too).
Oh, and you can use Shaders in Java too.

If you rewrite your Engine in C++, good luck!

- Longor1996
11  Games Center / Cube World Projects / Re: Voxel - a start on: 2013-04-27 15:54:34
Hello everyone.

It seems like (to me) that all of you have problems with Memory usage and Render distances.
Is it that hard to make 16³ big chunks and have ~8192 of them rendered with a render distance of nearly 0.5 Km and a RAM usage of 240 Mb?
(240 Mb because of Server/Client world chaching, the client alone only has a RAM usage of ~100 MB)

Here is a tip on how to speed up your voxel engine like heck-no-what:
Use 1 Dimensional Arrays and Integer ID's + MetaData for your blocks.
This way here, is slow and memory comsuming:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
class Block {
 boolean isVisible;
}
class BlockGrass extends Block{
 int GrassType;
}

class Chunk{
 Block[][][] contents;
}


Do this instead:
1  
2  
3  
class Chunk{
 int[] blockData;
}

And use singleton classes to code the behavior of the blocks.
Like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
class Block{
 abstract void onRightClick(World world,int x,int y,int z);
 abstract void onNeighborBlockChange(World world,int x,int y,int z);
}

class Button{
 void onRightClick(World world,int x,int y,int z){
  world.setBlockID(x,y,z,BID_BUTTON_ON);
 }
 void onNeighborBlockChange(World world,int x,int y,int z){
  if(checkIfButtonCanStayHere(world,x,y,z)){
    dropBlockAsItem(world,x,y,z);
  }
 }
}


If you didn't understand something just ask as many questions as you wan't.

- Longor1996
12  Games Center / Cube World Projects / Re: [Experimental] Mass Voxel Render on: 2013-04-24 23:40:26
How to search for LAN-Games:
Send a UDP Packet with some client informations to all units in a network.
This happens by sending the UDP packet to the address '255.255.255.255'.
When a Server receives one of these messages, it just has to sent a info packet back to the client.

- Longor1996
13  Game Development / Newbie & Debugging Questions / Re: Saving/load system on: 2013-04-24 23:35:49
I use an seriziable Named-Binary-Node-Tree.
Very useful and no problems with changing classes.

Reasons the system is useful.
  • Small and Compact
  • Data is saved in Binary form, very small
  • Little-to-No overhead while saving/loading
  • Binary Tree is structured like an XML document
  • No problems when classes undego major changes

- Longor1996
14  Games Center / Cube World Projects / Re: [Experimental] Mass Voxel Render on: 2013-04-24 23:31:23
In the Networking or the Voxel handling?

Here is a more detailed explanation of the Server/Client model.
'C' is the Client, 'S' is the Server. '>>' means that 'X goes from A to B'.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
C: Create Socket and try to connect to Server
S: Accepts Connection
C >> S: Sends Login Request Packet
S: Checks if the login is valid (Player isn ot already there/Server is not full, etc.etc.)
Not-Accepted: Send ConnectionKill Packet to Client and Stop.
Accepted{
 S >> C: Send Asset-Count and Assets //NYI
C: Receive Assets and use them //NYI
C >> S: Send the Asset Packet back
 C: Create local World Instance
 C: Go into infinite Packet reading loop
 S: Start a new Thread and go into an infinite Packet reading loop
 S >> C: Send Spawn-Area Chunks
 
 // LOOP START
C: Read every Packet and execute it using the assigned Handler
 S: Read every Packet and execute it using the assigned Handler
}


Btw:
The NetPac system is a modular multipurpose tcp-packet networking system i made for my applications.
How Packet's are handled still has to be specified for every Server/Client instance.
But that isn't really hard to do.

- Longor1996
15  Games Center / Cube World Projects / Re: [Experimental] Mass Voxel Render on: 2013-04-24 22:57:01
The networking is based on raw Java NIO/TCP and my own network protocol called NetPac.
It's pretty fast. It takes just 8-20ms to send 8 chunks from one PC to another PC in a local network.

- Longor1996
16  Games Center / Cube World Projects / [Experimental] Mass Voxel Render on: 2013-04-24 22:39:21
Hello everyone!

I made a small experimental mass voxel-renderer.
"A picture can say a thousand words..."

"Two pictures even more!"


More pictures!





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

The world consists of an infinite amount of chunks, but to spare memory and performance, the amount of chunks is limited to ~8000.
Each chunks consists of 16³ blocks, from wich every single block has an Identitifer,SkyLight and BlockLight value.
The world is loaded/unloaded while moving around, making the world virtually infinite in every direction.

Blocks are saved as 24-Bit Integers, wich are split like this:
1  
2  
3  
4  
5  
6  
i = Block Identifier
l = SkyLight
b = BlockLight

Binary: iiiiiiiiiiiiiiiibbbbllll
Hexadecimal: iiiibl

Every block can have an binary-data-tree storage assigned to it, wich allows it to store an virtually infinite amount of extra data.

The whole thing uses an Server/Client+Model/View/Controller system, wich makes it extremely dynamic.
If you wan't to make a Minecraft clone with it, no problem.
If you wan't to make a Cellular Automata Simulator, no problem.
If you wan't to make a 3D Picture program, no problem.

And because of learning purposes on my side, the whole system uses a server/client model.
The biggest fact is: This engine is much more memory efficient than the Minecraft engine.
Also, it renders blocks much faster. There is no problem in redrawing 1-3 chunks every single frame.

What do you guys think of this?

- Longor1996
17  Games Center / WIP games, tools & toy projects / Re: State of Fortune on: 2013-04-22 21:37:36
That looks cool!
Is it already uploaded or part of the next big update?

- Longor1996
18  Games Center / Cube World Projects / Re: Voxel Engine Zombies Game - Problem on: 2013-04-22 21:07:55
Hi there!

Can someone help me on this one problem I seem to keep having;

I can render my players weapon but when I rotate the weapon dosn't rotate and keep at the same position as what I intended it to be at.

1  
2  
3  
glTranslatef(x+.3f, y-0.3f, z-0.3f);
glRotatef(rX, 1.0f, 0.0f, 0.0f);
glRotatef(rY-90f, 0.0f, 1.0f, 0.0f);


This is my code for the model rotation for the weapon can someone help me please and thanks if you do Smiley

How about:

1  
2  
3  
glRotatef(rY-90f, 0.0f, 1.0f, 0.0f);
glTranslatef(x+.3f, y-0.3f, z-0.3f);
glRotatef(rX, 1.0f, 0.0f, 0.0f);


That should work.

- Longor1996
19  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-04-22 14:53:14
Hi Pauler.

Thank you. It work but the problem is that the face culling doesn't draw the bot face anymore. It has something to do if it is clockwise or not.

It's incredible easy! Just flip the edge vertices.

Clockwise:
Triangle A is: A B C
Triangle B is: A C D

Counter-Clockwise:
Triangle A is: C B A
Triangle B is: D C A

- Longor1996
20  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-04-22 14:06:55
Hello there.

It's very easy to split a Quad into two triangles.

1  
2  
3  
4  
5  
// Label your 4 Vertices from A-D
A GL11.glTexCoord2f(spriteX, spriteY + small);           GL11.glVertex3f(x1, y1 + height, z1);
B GL11.glTexCoord2f(spriteX, spriteY);                     GL11.glVertex3f(x1, y1 + height, z1 + length);
C GL11.glTexCoord2f(spriteX + small, spriteY);           GL11.glVertex3f(x1 + width, y1 + height, z1 + length);
D GL11.glTexCoord2f(spriteX + small, spriteY + small); GL11.glVertex3f(x1 + width, y1 + height, z1);


Clockwise:
Triangle A is: A B C
Triangle B is: A C D

Result:
1  
2  
3  
4  
5  
6  
7  
8  
9  
// Triangle A
A GL11.glTexCoord2f(spriteX, spriteY + small);           GL11.glVertex3f(x1, y1 + height, z1);
B GL11.glTexCoord2f(spriteX, spriteY);                     GL11.glVertex3f(x1, y1 + height, z1 + length);
C GL11.glTexCoord2f(spriteX + small, spriteY);           GL11.glVertex3f(x1 + width, y1 + height, z1 + length);

// Triangle B
A GL11.glTexCoord2f(spriteX, spriteY + small);           GL11.glVertex3f(x1, y1 + height, z1);
C GL11.glTexCoord2f(spriteX + small, spriteY);           GL11.glVertex3f(x1 + width, y1 + height, z1 + length);
D GL11.glTexCoord2f(spriteX + small, spriteY + small); GL11.glVertex3f(x1 + width, y1 + height, z1);


I hope this helps.

- Longor1996
21  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-04-15 20:02:47
16384 chunks, 67108864 blocks @60 fps. (vsync enabled)

Yay! Your Engine is as fast as mine.
The difference in the FPS comes from my PC.
My PC is a big piece of crap, but im happy with it.

Oh, and i think you forgot something: Memory Footprint.
That's what im interested in the most.

- Longor1996
22  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-04-15 19:29:46
256 chunks, 1048576 blocks.

And the next Question:
How big is the memory footprint with 256,1024,2048,4096 and 8192 chunks?
My experimental engine can handle ~16000 16³ Chunks without crashing and a stable framerate of 50 fps.
Im just wondering what your engine is capable of.

- Longor1996

PS: Your CHunk counter in the video seems to go a little bit, wrong?
23  Games Center / Cube World Projects / Re: Voxel Engine Problems on: 2013-04-15 18:58:39
Hi there.

That looks pretty good so far.
How many cubes & chunks in total are in memory (RAM) right now?

- Longor1996
24  Game Development / Newbie & Debugging Questions / Re: Is this code evil? on: 2013-04-13 21:37:55
Hi there.

How about Valve Key/Value Files?
They are easy to read/write/handle.

- Longor1996
25  Game Development / Newbie & Debugging Questions / Re: Generating three random booleans on: 2013-04-12 17:24:52
How about this?
1  
boolean bool = (System.nanoTime() & 0b1) == 0;

That should be pretty random, i think...

- Longor1996
26  Discussions / General Discussions / Re: Storing level data on: 2013-04-05 20:33:38
1 Million Integers?

1 Integer = 4 Bytes
1 Million Integers = 4 Million Bytes

4 Million divided by 1024 = 3906,25 Kilobyte
3906,25 Kilobyte divided by 1024 = 3,814697265625 Megabyte

Correct me if im wrong.

- Longor1996
27  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Public Domain] UN project, General purpose library, 2D, 3D and anything else on: 2013-04-04 01:51:19
The BOLA License seems like the way to go.
All i wan't is actually this one line:
1  
1. Not take credit for it, and give proper recognition to the authors.


Wich (i think) means:
Don't say you made this code. Give credit to the original Author.

Am i right with that?

- longor1996
28  Java Game APIs & Engines / Engines, Libraries and Tools / Re: [Public Domain] UN project, General purpose library, 2D, 3D and anything else on: 2013-04-03 22:49:50
Hi there.

Interesting Project here.

Maybe you can add my BinaryDataTree System?
It's published under the BSD-License, if that matters.

Link

- Longor1996
29  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-04-03 21:52:23
Hi.

Does anyone here plan anything?

I may not always think much of the level of software engineering in much of the code that's slung around these parts, but that said: what's wrong with hacking just for fun?


There is nothing wrong with it!
I was just wondering, because it seemed like no one makes any plans at all for their voxel-engines.
A voxel-engine without any planning is going to be refactored a lot.
By having a good plan you won't have to refactor that much.

Im saying that only because no one should go trough the pain called "code refactoring".
But without any plan one will have to go trugh that many many times.

- Longor1996

PS: If this post seems somehow unfriendly/non-constructive, please mind that i have an ill, and im not in the best mood because of that.
30  Games Center / Cube World Projects / Re: LWJGL BlockWorld on: 2013-04-03 19:46:29
Just a random Question again:
Does anyone that makes a Voxel Engine make any plans?
It seems like everyone just want's to clone Minecraft as fast as possible,
ignoring all good programming principles while doing so.

Does anyone here plan anything?

- Longor1996
Pages: [1] 2 3 4
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (61 views)
2013-05-17 21:29:12

alaslipknot (70 views)
2013-05-16 21:24:48

gouessej (100 views)
2013-05-16 00:53:38

gouessej (98 views)
2013-05-16 00:17:58

theagentd (107 views)
2013-05-15 15:01:13

theagentd (98 views)
2013-05-15 15:00:54

StreetDoggy (144 views)
2013-05-14 15:56:26

kutucuk (167 views)
2013-05-12 17:10:36

kutucuk (166 views)
2013-05-12 15:36:09

UnluckyDevil (175 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.286 seconds with 20 queries.