Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (208)
games submitted by our members
Games in WIP (781)
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 ... 61
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-19 18:51:35
I decided to add multi lingual support for my website powered by Jekyll, and it is extremely easy with the front matter. From now on, I'm going to post in Telugu and Hindi along with English.

https://goharsha.com/blog/multi-lingual-support/

Look at the language-selector in the top right!
2  Discussions / General Discussions / Re: GLFW Controller Database on: 2017-01-17 14:13:11
I just purchased Redgear Pro Wireless Game Pad with XBOX 360 layout, and this one is so cool! It's just ₹1600/- ($23.54) and is the best one for the price. Got the following mappings in Windows.



This one identifies as Xbox 360 Controller on XInput mode, and as Redgear on DirectInput mode, and both works out of the box without any custom drivers.

The commit 5685a23 adds the support.
3  Java Game APIs & Engines / Android / Re: OpenGL ES 2.0 - Interaction between the game loop and the rendering thread on: 2017-01-12 23:21:59
From my experience, Android is a lot different from traditional desktop systems. Unlike the desktop, you have two threads, the android UI thread and the GLThread created for you by the GLSurfaceView. I see that you are trying to separate rendering and logic, but I'd say it's not worth the effort on Android.

I agree that parallelization gives a performance boost, but only if done correctly. And most of the time, there will be other reasons of you experience the performance issues. I'd not go for it unless there are no other areas of optimization left.

Coming to the question, I guess you want to run some tasks on the UI thread, like operations that switch the device orientation etc., and some other you want to handle in the GLThread, like in the case of inputs.

1  
surfaceView.queueEvent(() -> postTouchEvent(finger, false, 0, 0));

That will make your code run on the GLThread. Now for operations like changing the device orientation, you can use the activity methods like this.

1  
2  
activity.runOnUiThread(() ->
        activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE));

This is very similar to swing's SwingUtilities.invokeLater method. Now let us get to the game loop. In the renderer of the GLSurfaceView, there is no separation of logic and render. When you set the render mode to continuous, it repeatedly calls the onDrawFrame method, so keep both the update and render calls directly in it.

For reference, you can checkout the code in my android backend: https://github.com/sriharshachilakapati/SilenceEngine/tree/master/backend-android/src/main/java/com/shc/silenceengine/backend/android
4  Discussions / General Discussions / Re: GLFW Controller Database on: 2017-01-10 14:34:46
@chrisevergreengamesorg

If the game pad is identified as USB Joystick on Windows, that means that windows is using the generic driver for Joysticks. Don't you have a driver that came along with it?

And by Single Axis, DPad Only, do you mean there is only one analog stick, or there are no analog sticks, and DPAD is reported as axes also? And is this your gamepad? I had a hard time searching for this one, it seems there is very less information on this.

5  Game Development / Newbie & Debugging Questions / Re: Should I still use a 4x4 matrix for a 2D game with OpenGL? on: 2017-01-08 13:36:45
Even if it is 2D, you'd need the projection matrix, to project from the world space to the NDC. In case you need a moving camera, then you better go with a matrix, but you can optimize it to use a single vector offset.

Now considering the model matrix (better call it as sprite matrix I think) if all you need is positioning objects, there is no need to use the matrix in the first place, you can just go with a 2D vector.

1  
2  
3  
4  
uniform mat4 projView;  // AKA the combined camera matrix
uniform vec2 offset;      // The entity position

layout (location = 0) in vec2 position; // The vertex position

Then you simply multiply it with the projView matrix and get your output in NDC. In case you have rotation (2D rotations are just rotations on the z-axis) so you can get away with a 2D matrix for rotations:



You can simply multiply this matrix with your position to make it rotated. So the final shader might look like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
#version 410

uniform mat4 projView;
uniform vec2 offset;
uniform float rotation;

layout (location = 0) in vec2 position;

void main()
{
    float sinR = sin(rotation);
    float cosR = cos(rotation);

    mat2 rot = mat2(cosR, sinR, -sinR, cosR);

    vec2 vPos = offset + (rot * position);
    gl_Position = viewProj * vec4(vPos, 0.0, 1.0);
}

I however, recommend against this, because it is not that necessary to super optimize the program. The second thing is, I believe that premature optimization is the root of all evil. If your hardware supports a lot of power, why not utilize it?
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.9.0 on: 2017-01-07 04:14:52
GWT does optimizations only when not in Super Development Mode. Once you start with gradlew superDev, it just starts with the super dev server, and still runs the WAR it created for production. If you enable the DevMode with the bookmarks (go to localhost:9876 to get the bookmarklets) then a recompile will happen disabling the optimizations so you can debug your program using source maps, right in the browser.
7  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.9.0 on: 2017-01-06 17:44:21
Done! I have updated the examples to use JOML-GWT successfully! Thanks for the work @KaiHH.



New examples can be found here
8  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.9.0 on: 2017-01-06 17:27:09
You have to define the properties that you use in the module description file, and also set the accepted values.

1  
<define-property name="joml.debug" values="true,false">

Then whenever we want to set the property in the user project, they would add the set property command to their module file like

1  
<set-property name="joml.debug" value="true">
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML for GWT on: 2017-01-06 16:13:54
First working version of JOML for GWT has been published to oss.sonatype.org as
org.joml:joml-gwt:1.9.2-SNAPSHOT
. Interoperability with WebGL through SHC's excellent WebGL4J via float[] and GWT's Float32Array emulation.

That's great, and I started to port the examples to use JOML. Unfortunately I'm greeted with an error message:

1  
2  
3  
4  
5  
6  
7  
:examples:compileGwt                 
Jan 06, 2017 8:55:28 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Compiling module com.shc.webgl4j.examples.client
   [ERROR] Errors in 'org/joml/Options.java'
      [ERROR] Line 59: Only string constants may be used as property name in System.getProperty()
:examples:compileGwt FAILED

The reason is that
System.getProperty
calls are inlined by the compiler so they must have constant args. Think of it like a
GWT.create
call with a String.

Better solution will be to replace
hasOption
calls with a regex to
System.getProperty()
.

1  
2  
hasOption\((.+)\)
Boolean.parseBoolean(System.getProperty($1));

That is sufficient in my opinion. By the way, the use of pre-processor is a nice idea, does that work with IDE support? I don't think it works in IDE, but am curious.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-04 15:19:56
Here's a short video showing the fog in motion and a quick walk around the forest.

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

Is that billboarding or something else?
11  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JOML 1.9.2-SNAPSHOT on: 2017-01-02 00:42:40
The use-case are people with really ancient (or self-built) JREs, who simply want to use the math classes of JOML and not the NIO interoperability with a Java/OpenGL binding library (NIO classes only exist since 1.4).

That's impressive, why not maybe publish a GWT version too? I can write the GWT module for you, it's just including an XML file along with Java class files and the sources.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-31 18:46:40
Made my first commit of this new year 2017 at 12:04 AM IST (Indian Standard Time, +5:30 GMT).

https://github.com/sriharshachilakapati/SilenceEngine/commit/ed154982e706df397ded210c5b5d47ae6a5981a9

Starting to implement mouse picking!
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-29 19:02:35
Added a modal dialog API to SilenceEngine, that pauses the game while the dialog is showing.

1  
2  
3  
4  
5  
6  
7  
8  
if (SilenceEngine.display.confirm("Do you want to run dialogs test?"))
{
    String value = SilenceEngine.display.prompt("Enter something!");
    SilenceEngine.display.alert("You've entered " + value);

    value = SilenceEngine.display.prompt("Enter something again!!", "why not?");
    SilenceEngine.display.alert("You've entered " + value);
}

It produces the dialogs like this:







More in this link: http://imgur.com/a/QNOt0

The desktop version uses TinyFileDialogs that come with LWJGL 3, while in HTML5 and Android, I use the native dialog implementations.
14  Discussions / General Discussions / Re: New Year Resolutions -- 2017 on: 2016-12-27 17:38:33
Hope everything goes fine this new year. Year 2016 was pretty bad, most of prominent people here passed away, I got sinus, etc.,

  • I started exercising this year, and wanted to continue it the next year too without breaks.
  • Learn a new language. I'm focusing on Malayalam (since I've got friends who speak it natively).
  • Participate in many hackathons. I've been part of two hackathons till now (one state wide and one national wide) and that is awesome.
  • Plan out sleep, I spent last four months with barely 4 hours of sleep every day, and it broke me down after the last hackathon where I spent 3 days with absolutely no sleep.
  • Try not to keep this same list for the next year.
15  Game Development / Newbie & Debugging Questions / Re: Type checking an init method on: 2016-12-27 16:39:50
@Abuse

Generics aren't necessarily the evil, it is just better to use them internally and not expose them. For example, I have this declaration in my DynamicTree broadphase.

1  
class DynamicTree<AABBType extends DynamicTree.AABB, CollisionType>

That is because I have the same implementation for both 2D and 3D scenes! I just require the AABB type to follow an interface, and CollisionType is simply the component type, CollisionComponent2D and CollisionComponent3D are the actual types that get there.

However, it is bad if you expose this class to the user, as that will make the user to use generics in all the type declarations, so I have wrapper classes DynamicTree2D and DynamicTree3D that I expose, they just use the DynamicTree class internally.
16  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-24 19:42:40
Just published a blog post explaining AABB Trees for collision detection!

https://goharsha.com/blog/aabb-trees-for-collision-detection/

Special thanks for Box2D author Erin Catto and Bullet author Nathanael Presson for opensourcing their implementations.
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-23 15:12:28
We started a new project in college, we formed as teams of 4 members, and we started teaching on Fridays to freshers in college under the name ALLIANCE. Our aim is to teach programming and modern technologies that college doesn't teach as part of curriculum, and I'm taking charge of Java.

My goal is to start with the basics (I'm going to teach freshers, who have absolutely no idea of programming) and slowly take them to GUI. However, I plan not to touch AWT/Swing, but instead focus on JavaFX. I also don't want to touch applets. This goes on for three months, and then I'll show them design patterns and take them as assistants in my final year projects.

The main goal is that (since we lost hope that the university will update the syllabus, it last updated 5 years ago and is having Java 5 in the syllabus) we introduce modern Java (Java 8, we also want to teach functional programming basics) and inculcate it in the fresh minds before they are polluted by the time they start old Java as part of syllabus. We are teaching to students one year early, and faculty also agreed to not focus more on Applets and J2ME which are the two main roadblocks as part of the syllabus here. I think they should only be taught to the point that they can write the exam for score.

By the way, I'm going to replace the Graphics2D part with Processing.
18  Game Development / Newbie & Debugging Questions / Re: LWJGL2 using LWJGL3's image loading on: 2016-12-22 07:38:41
I haven't been following lwjgl3 lately. Last time I tried it, I couldn't change from fullscreen to windowed dynamically, and that made me upset.

You can do that now in the latest release. Just do call glfwSetWindowMonitor function.
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-21 15:08:58
Worked a bit on CSS for my SilenceEngine website, made the progress bar show different colors based on the percentage filled in the bar:



The percentage will be fetched from the GitHub API automatically! Also did a few tweaks to my own GRID layout (flex grid) that displays the features.

Also released version 1.1.3
20  Game Development / Newbie & Debugging Questions / Re: Delay Line of Code for X Amount of Seconds on: 2016-12-19 09:12:50
I'd actually be (mildly) against this abstraction layer. The more complex your game gets, the more trickery is involved adjusting the internal state of the timers. In the end you are going to expose all fields with getters and setters and your abstraction layer is getting in the way.

Can you please explain more? I think I already expose everything except the elapsed and the active flag. What is the trickery involved in it?
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: How to upgrade lwjgl within IntelliJ + LibGDX on: 2016-12-18 14:30:39
@orangepascal

You are semi-right, LibGDX do come with LWJGL in it, but technically it is possible to update the LWJGL 3 version.

1  
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion:@jar"

All you have to do is to add
@jar
at the end of the definition. Then you can add LWJGL3 dependencies like you do on any other LWJGL application.

The only thing is that this is not at all recommended and may introduce you to bugs since LibGDX might not be written for your version of LWJGL3.
22  Game Development / Newbie & Debugging Questions / Re: Delay Line of Code for X Amount of Seconds on: 2016-12-18 13:55:48
I guess that you didn't completely understand what Riven said, you seem to not understand the logic. He just gave you the core logic. While it works in the raw form, you can make your life easier by introducing a
GameTimer
class.

1  
2  
3  
4  
5  
6  
public GameTimer(long millis, boolean loop, Runnable action)
{
    this.millis = millis;
    this.loop = loop;
    this.action = action;
}

We take the number of milliseconds to wait, whether to keep running or stop after the first run, and an action, which is a Runnable which can be invoked later when the time expires. Now, we just need start and stop methods so we can control the timer whenever we want.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public void start()
{
    this.elapsed = 0;
    this.active = true;
}

public void stop()
{
    this.active = false;
}

This is simple enough, we have the basic encapsulation of the timer. All we need now is the core logic of the timer. We'll do it in the update method of the timer.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
public void update(long elapsedMillis)
{
    if (!active) return;

    elapsed += elapsedMillis;

    if (elapsed >= millis)
    {
        action.run(); // Run the action
        stop();

        // If in loop, start the timer again
        if (loop)
            start();
    }
}

That is all there is to it. Just update the timer object every time you update the game along with your objects and you are done.
23  Games Center / Showcase / LDSnake - LD37 JAM Entry on: 2016-12-12 19:43:53




LDSnake


A simple snake game clone done in 8 hours. Use WASD or the arrow keys to play. You will be out if either you have hit the edges of the screen or you have hit your own tail. Also the game speed increases gradually. I also thought of making an android version, but that isn't so stable, hence only desktop and web versions for now.

Note that the desktop version needs Java 8 with OpenGL 3.3 or later. If you are on Mac OS X, you have to launch it with -XstartOnFirstThread VM argument.

Links


24  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-06 04:03:18
Kinda What I did yesterday in normal sense, but technically what I did today since I did it after the date change in the midnight:

I've got SSL on my website!!! It's now https://goharsha.com/
Thank you CloudFlare for offering free SSL.
25  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LWJGL 3 - Assimp bindings on: 2016-11-29 08:20:39
This is awesome!

But you kinda made elect's work on jAssimp obsolete...?

Thanks, and no, jAssimp is still the goto for Android.
26  Discussions / Miscellaneous Topics / Re: What I drew today on: 2016-11-14 13:48:09
I think this thread should have a fan made JGO logo, made using GIMP all with mouse and brush.



I don't know if this is a violation of rules, if it violates, I'm sorry. I'm not using the logo for any purposes and won't ever be. Just made it for this thread.
27  Game Development / Newbie & Debugging Questions / Re: Layering Particles under Sprites (LibGDX) on: 2016-11-09 18:50:39
You can start a line with two @ symbols and it will be highlighted in the code for you. Bold tags will not work.

1  
2  
3  
this is a normal line
but this is highlighted
and this is another normal line.
28  Discussions / Suggestions / Re: Art section on: 2016-11-09 18:48:52
Nice, but wait, do you mean you want an asset store or something? Your tone seems like you want to make art and see it in others games, but I'm not sure.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-11-09 17:02:51
Drew the character for my November's GitHub GameOff game JAM.



First time making a better character. Don't ask why he is not having eyes, I'm not gonna tell you that.
30  Games Center / Contests / Re: Github's Month-Long Game Jam: GameOff on: 2016-11-08 08:25:34
Ive started mine! It's a bit late into the month but I can cram together a little demo, it's called Silicon Tycoon. A tycoon game about computer software!


Thank you for posting here and reminding me, I almost forgot. But shitty life, had exams till 15th this month, and projects in college.. Will do somehow.
Pages: [1] 2 3 ... 61
 
Galdo (401 views)
2017-01-12 13:44:09

Archive (556 views)
2017-01-02 05:31:41

0AndrewShepherd0 (1023 views)
2016-12-16 03:58:39

0AndrewShepherd0 (953 views)
2016-12-15 21:50:57

Lunch (1085 views)
2016-12-06 16:01:40

ral0r2 (1318 views)
2016-11-23 16:08:26

ClaasJG (1414 views)
2016-11-10 17:36:32

CoffeeChemist (1406 views)
2016-11-05 00:46:53

jay4842 (1490 views)
2016-11-01 19:04:52

theagentd (1250 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!