Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 ... 37
1  Game Development / Newbie & Debugging Questions / Re: Would it be better to make a thread for terrain generation> on: 2014-10-06 12:55:22
If you're going to stream in/out terrain then I would split it up into another thread if I were you. On the other hand, if you aren't used to threading then you can start with doing it in the same thread (just limit the number of chunks per tick) to get the game up and running.
2  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > KICKSTARTER at 40% Go Go! < on: 2014-10-06 06:08:03
I just supported my first ever kickstarter! Smiley

It looks great so far, keep up the good work!

Mike
3  Game Development / Newbie & Debugging Questions / Re: NullPointerException or if statement on: 2014-09-30 11:28:33
The if statements all the way. If the first two elements aren't null and the third one is you will have wasted the time it takes to call the two render methods and you may get render artifacts in the result.

Also, entering try clauses is quick, catching exceptions is slow Smiley

Mike
4  Game Development / Newbie & Debugging Questions / Re: Interleaved VBO troubles on: 2014-09-25 20:32:22
Another chance to post this awesome guide by our overlord! Smiley

http://www.java-gaming.org/topics/introduction-to-vertex-arrays-and-vertex-buffer-objects-opengl/24272/view.html

Mike
5  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
6  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
7  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
8  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
9  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
10  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
11  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
12  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
13  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
14  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
15  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
16  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%
17  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
18  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.
19  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
20  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
21  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
22  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
23  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;
    }

}
24  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
25  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?
26  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
27  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
28  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
29  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
30  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?
Pages: [1] 2 3 ... 37
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (37 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (27 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (77 views)
2014-10-11 22:30:10
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!