Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
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] 2 3 ... 36
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-21 19:47:37
Finished the new sun when playing with light scattering and started looking into some smaller vegetation:



Mike
2  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-21 19:39:29
I've been called Mike since I was born (well, the Swedish version anyway). I used to use a couple of internet names, but I don't mind everyone calling me by my real nickname Smiley

Mike
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-09-21 08:58:55
As for the above question, it was a bug in Kryo that Nate just fixed. Thanks!

Mike
4  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 13:30:19
1 billion euro (taxes) is a lot of money, let's hope that they do something fun with it (especially Markus with his 71%) and that Microsoft doesn't ruin Minecraft Smiley

Mike
5  Discussions / Miscellaneous Topics / Re: How to call police/ambulance from a different country on: 2014-09-12 13:08:50
How do you call an emergency number from a different country ?

You cannot. The best bet would be to
A) Call it in your country and see if they can forward it.
B) Google a local police station in the city and hope that the queue to get to an operator isn't too long.

Mike
6  Discussions / General Discussions / Re: Nvidia Sues Samsung and Qualcomm on: 2014-09-11 15:10:45
It has to do with 7 patents around GPU's:
http://www.pcworld.com/article/2603080/nvidia-sues-samsung-and-qualcomm-wants-galaxy-sales-blocked.html

In general the concepts around:
    The entire concept of the GPU, or a dedicated graphics processing chip
    Programmable shading
    Unified shading
    Multithreaded processing on a GPU
7  Games Center / Featured Games / Re: State of Fortune on: 2014-09-09 20:37:26
I ended up getting a nicer SSAO up and running anyway as well as using edge detected FXAA, I didn't want to let the normals defeat me Smiley

Here's a screenie of a remote lake that the new landscape formula generated, as well as a look of the new stone texture and a better look of the new water. There's still something missing that I can't really put my finger on (except for clouds as I scrapped them for now, I didn't like the look of the old ones), but sooner or later it'll be a great looking game Smiley


Mike
8  Games Center / Featured Games / Re: State of Fortune on: 2014-09-06 23:23:35
I gave up on the new ssao for now. I didn't get it to look like I wanted without a lot more work than I had thought. I was calculating the normals from the depth texture and I never got it perfectly stable when moving the camera around. Due to that the ssao got some very weird artifacts when moving the camera. The best way to solve it would be to create a normal texture and pass it to the ssao shader, but looking at the difference from the current shader it wasn't worth the work.

I settled on smoothing out the existing ssao instead. Here is a pic with the smoother ssao, the improved aa on distant objects and the new normal calculation Smiley


Mike
9  Games Center / Featured Games / Re: State of Fortune on: 2014-09-05 15:16:04
I'll see how they look if I shrink them a bit. Trees are huge though in real life! (At least in Sweden... Smiley)

I just finished changing the code for normal maps so they don't change anymore when you rotate the camera and I am currently busy with improving the SSAO as I never really liked it. The SSAO is starting to look really nice, I'll see if I can get it screenshottable in the weekend.

Mike
10  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-09-03 20:58:22
Java for evening fun
PHP for evening work project
Javascript (web and Rhino) for work
HTML for work
XSLT for work
VBA for work
SQL for work

I don't really prefer one language over another, they are all good for solving specific problems. I used to study/work with C++, Basic, VB6 and Lisp, but I don't use them anymore actively.

Mike
11  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-31 20:26:30
Nice! Getting over 300fps now sometimes.

When walking up/down you cannot click right/left to quickly sidestep, while you can click up/down to sidestep when you're moving right/left.

Mike
12  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-30 19:02:19
145-160 fps
Laptop
Core i7 3720, 4 cores @ 2.6Ghz w/ HT
Windows 7 64 bit
NVIDIA NVS 5200M

CPU didn't even take 10%
13  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-28 15:42:33
Sorry, should have said, what specs are the machines? Smiley Doh!

Kev

I thought so, but you were very specific about only needing FPS Smiley

31-32 fps
Laptop
Core i7 3720, 4 cores @ 2.6Ghz w/ HT
Windows 7 64 bit
NVIDIA NVS 5200M

Mike

EDIT: Maybe I had something running in the background, getting a stable 60-61fps now Smiley
14  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-28 12:37:58
I indeed needed the 512MB switch or it crashed right away.

A stable 31-32 fps.
15  Discussions / General Discussions / Re: Camera with Roll Pitch and Yaw on: 2014-08-28 06:15:31
Here's my code for the oculus rift with Z up using GL11:
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  
            float yaw = MyOculusRift.getOR().getYawDegrees_LH();
            float pitch = MyOculusRift.getOR().getPitchDegrees_LH();
            float roll = MyOculusRift.getOR().getRollDegrees_LH();
            GL11.glRotatef(roll, 0, 0, 1);
            float originalX = POSITION.getX();
            float originalY = POSITION.getY();
            double length =
                FastMath.hypot(BufferedMathFunctions.cos(-yaw) * BufferedMathFunctions.sin(90 - pitch),
                    BufferedMathFunctions.sin(-yaw) * BufferedMathFunctions.sin(90 - pitch));
            if (leftEye) {
                POSITION.setX((float)(originalX - BufferedMathFunctions.cos(-yaw)
                    * BufferedMathFunctions.sin(90 - pitch)
                    / length
                    * MyOculusRift.getOR().getHMDInfo().InterpupillaryDistance
                    / 2));
                POSITION.setY((float)(originalY - BufferedMathFunctions.sin(-yaw)
                    * BufferedMathFunctions.sin(90 - pitch)
                    / length
                    * MyOculusRift.getOR().getHMDInfo().InterpupillaryDistance
                    / 2));
            } else {
                POSITION.setX((float)(originalX + BufferedMathFunctions.cos(-yaw)
                    * BufferedMathFunctions.sin(90 - pitch)
                    / length
                    * MyOculusRift.getOR().getHMDInfo().InterpupillaryDistance
                    / 4));
                POSITION.setY((float)(originalY + BufferedMathFunctions.sin(-yaw)
                    * BufferedMathFunctions.sin(90 - pitch)
                    / length
                    * MyOculusRift.getOR().getHMDInfo().InterpupillaryDistance
                    / 4));
            }
            GLU.gluLookAt(POSITION.getX(), POSITION.getY(), POSITION.getZ(), POSITION.getX()
                + BufferedMathFunctions.sin(-yaw)
                * BufferedMathFunctions.sin(90 - pitch), POSITION.getY()
                - BufferedMathFunctions.cos(-yaw)
                * BufferedMathFunctions.sin(90 - pitch), POSITION.getZ() - BufferedMathFunctions.cos(90 - pitch), 0, 0, 1);


Hope it helps!

Mike
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-08-27 11:08:19
You can use DeflateSerializer to compress the data. Kryo doesn't do any compression by default.

If I change the register to (ContainerMessage is the message that contains all the short[], so I tried with and without that one just in case):
1  
2  
kryo.register(ContainerMessage.class, new DeflateSerializer(kryo.getDefaultSerializer(ContainerMessage.class)));
kryo.register(short[].class, new DeflateSerializer(kryo.getDefaultSerializer(short[].class)));


It doesn't differ a single byte on the resulting size.

Mike
17  Games Center / Featured Games / Re: State of Fortune on: 2014-08-26 19:06:18
Sounds promising. Looking forward for the update. Will you do a hard-reset or will we keep our accounts and gold? ^^

You'll keep your accounts, but I'll most likely reset the gold.

I gave up on digging for the foreseeable future as I need to limit the scope somewhat or I'd never be done with the update Smiley

Here's a screenshot of the "Very far" render distance (6km) with one of the new trees in the foreground, the new fog in the distance and the new water reflections (a screenshot doesn't do them justice though).


Mike
18  Game Development / Newbie & Debugging Questions / Re: How do I use Ashley entity framework alongside Kryonet? on: 2014-08-22 20:11:28
Awesome as always Riven, guess I was just lucky that it didn't break yet. I used to use a synchronize block but thought it wasn't needed as I wasn't looping through it. I'm now using a ArrayBlockingQueue instead.

Mike
19  Game Development / Newbie & Debugging Questions / Re: How do I use Ashley entity framework alongside Kryonet? on: 2014-08-22 12:26:56
Hi,

Sure, there is probably a much nicer way to do it though, but this works fine for me. As I'm not for-eaching the arraylist I didn't see any issues so far of not synchronizing it.

I'm sure there are a lot of people on the forum that knows a much neater way to do it though Smiley

Mike

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  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
public class HandleMessageThread extends Thread {

    private boolean threadRunning = true; //Check if the thread should keep running

    private final static ArrayList<Message> receivedMessages = new ArrayList<Message>();

    @Override
    public void run() {
        while (isAlive() && threadRunning) {
            try {
                while (receivedMessages.size() > 0) {
                    Message message = null;
                    try {
                        message = receivedMessages.get(0);
                        recievedMessage(message.getConnection(), message.getMessage());
                        receivedMessages.remove(0);
                    } catch (final Throwable t) {
                        if (message != null) {
                            Main.getKryoClient().submitError("Error processing message " + message.getMessage().toString(), t);
                        } else {
                            Main.getKryoClient().submitError("Error processing message", t);
                        }
                        receivedMessages.remove(0);
                    }
                }
            } catch (final Throwable e) {
                Main.getKryoClient().submitError("Executing message", e);
            }
            try {
                Thread.sleep(10);
            } catch (final InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    private void recievedMessage(Connection c, Object p) {
        if (p instanceof SessionReturnMessage) {
            SessionReturn.process((SessionReturnMessage)p);
        } else if (p instanceof PingMessage) {
            [...]
        } else {
            Main.getKryoClient().submitError("Cannot find method: " + p.toString());
        }
    }

    public void stopThread() {
        threadRunning = false;
    }

    public void received(Connection c, Object p) {
        receivedMessages.add(new Message(c, p));
    }
}

public class Message {

    private final Connection connection;

    private final Object message;

    public Message(Connection c, Object p) {
        connection = c;
        message = p;
    }

    public Connection getConnection() {
        return connection;
    }

    public Object getMessage() {
        return message;
    }

}
20  Game Development / Newbie & Debugging Questions / Re: How do I use Ashley entity framework alongside Kryonet? on: 2014-08-22 06:46:19
Hi,

I read a recommendation from Nate a couple of days ago that explained that due to the listener also does the (de)serializing of the objects he recommended to pass it off to another thread on busy network applications. I changed my code around to use another thread and it resolved a couple of queuing issues as well, so I'd say go for it! Smiley

Mike
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-08-22 05:58:59
Every number separately? That's... interesting Smiley

Nate, any nice idea?
22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-08-20 20:32:58
I'm still wondering about 3, anyone with any ideas?

As for 1 and 2: It became a whole lot better when I added a logic thread and didn't send all those messages from the same thread that handles the (de)serialization. Smiley

Mike
23  Java Game APIs & Engines / OpenGL Development / Re: Drawing big Objects far away on: 2014-08-20 20:24:38
After a lot of testing I'll answer my own question Smiley

The documents explain two ways to solve the issue, using the glDepthRangedNV function (which also works on new AMD drivers), OR using the shaders, there is no point in mixing the two.

As glDepthRangedNV was a lot easier to implement and the huge drawing distance is more for newer graphics cards anyway I went for that. The results are great, I'm getting 0.1mm resolution on a distance of 100.000 meters. No more flickering evah!

Note:
Set NVDepthBufferFloat.glDepthRangedNV(-1, 1) after the binding of the FBO, not after Display.create()
The internal depth buffer format of the FBO needs to be a 24 or 32 bit float or it won't work
You need to change two values of the projection matrix, something like this if you are handling the matrices old style:
GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection);
projection.put(10, nearPlane / (nearPlane - farPlane));
projection.put(14, farPlane * nearPlane / (nearPlane - farPlane));
GL11.glLoadMatrix(projection);

Mike
24  Java Game APIs & Engines / OpenGL Development / Re: Drawing big Objects far away on: 2014-08-19 07:47:24
I was testing some large drawing distances (perspective from 0.1 to 12.000) and while it looks awesome to see mountains kilometers away, the depth buffer started getting really inaccurate, causing some horrible artifacts.

Looking at "the Outerra way" I added the following, but it doesn't seem to make any difference at all. Did anyone successfully implement it or understand it good enough to give me a bump in the right direction?

I added in the initialization of OpenGL (right after Display.create):
NVDepthBufferFloat.glDepthRangedNV(-1, 1);

I changed the internal format for the depth buffer component of all FBOs to:
ARBDepthBufferFloat.GL_DEPTH_COMPONENT32F

I added the following at the end of all of my vertex shaders:
float Fcoef = 2.0 / log2(12000.0 + 1.0); //Fixed far plane of 12000 for testing
gl_Position.z = log2(max(1e-6, 1.0 + gl_Position.w)) * Fcoef - 1.0;

Any idea?

Kind regards,
Mike
25  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-08-18 09:27:56
Because I highly doubt that you have 4294967294 different kinds of tiles. As it is a value that will be stored/sent a lot you should keep it to the smallest primitive type that you can.

Mike
26  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Kryo/Kryonet compression and buffer on: 2014-08-18 09:14:36
I'm sending shorts to save space, one short per tile height (sending ints for types sounds horrible by the way Smiley).

Does anyone have any idea about the above queries?
27  Java Game APIs & Engines / Engines, Libraries and Tools / [SOLVED] Kryo/Kryonet compression and buffer on: 2014-08-15 14:10:33
Hi there,

I've changed around my whole network code to use Kryonet instead of gzipped strings. Unfortunately I ran into three connected issues, and I was wondering if there is a way to solve them.

1. Whenever a player connects to the server the area around him is sent from the server, at the moment I'm sending an area of 2000x2000 tiles to give the player a view distance of 1.000m. While this never was a problem before the Kryonet TCP send bytebuffer gets filled up very quickly and the whole server crashes, never recovering. I can catch the error and restart the server, but I was wondering if there was a better way to handle it.

2. The only way I managed to "solve" it was to start the server up with new Server(25 * 1024 * 1024, 1024 * 1024); Is allocating 25mb of buffer per connection really the way to solve such a problem? What about when people have created huge structures, do I have to go in and increase the number just in case the player loads that part of the map at startup?
I could lower the amount of data sent somewhat or throttle the sending of the land, but I'd prefer to have it work without having to rewrite a lot of code and decrease the experience of the players.

3. Back when I used gzipped CSV's an empty container (an array of 4356 shorts) took about 500-700 bytes, and now they take 8kb. Is there a way to compress the data or does it have to take as much as each individual value? I was looking at the Deflate serializer, but I didn't get it to work on a short[].

Kind regards,
Mike
28  Discussions / Java Gaming Wiki / Re: Pseudo random number generators on: 2014-07-30 19:29:04
Just in case data0 was changed by another thread? Tongue Sometimes people write funny code Smiley

Mike
29  Games Center / WIP games, tools & toy projects / Re: CMEngine - a from scratch, modern GL 3d engine on: 2014-07-29 20:02:15
Any kind of screenshot would help a whole lot with providing feedback, either of how it would look inside a game, or the tools available to create a game Smiley

Mike
30  Games Center / Featured Games / Re: State of Fortune on: 2014-07-29 19:18:01
(You edited your post, mean-o! Smiley) Dynamically selecting the LOD on distant chunks would work indeed, but it would be negative for the FPS. I wonder how much though.

That's what I do now already (each chunk being 66 by 66 tiles).

However, at the moment the landscape is rolling, so the LOD changes are quite smooth. Once people can start digging it'd not be rolling as there can also be a big peak on half of the chunk and a big hole on the other half of the chunk. My formula at the moment would then draw the land straight, but once you get to the higher LOD levels it'll change a whole lot. On top of that the texture of the dug out land might be different than the texture on the peak, making the jump in LOD even higher.

The more I think about it the more I realise that it's possible but extremely difficult to get right without ruining the FPS.

Mike
Pages: [1] 2 3 ... 36
 

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

The first screenshot will be displayed as a thumbnail.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (30 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

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

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

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

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

Tekkerue (50 views)
2014-09-09 02:24:56
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!