Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
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: Programming in schools - opinions? on: 2017-02-24 10:21:51
I got into programming much early than most of my college pals here, almost 8 years earlier than when they started learning that they can also program computers, and they came to know about languages. The case of studies is different here in India, where you join school when you are 6 years old (play schools aren't a thing when I was young, but they came nowadays and are even admitting in 4 year olds). Then you study all the types of subjects until you get 16 and come out of school. We all had English, Telugu (our state language), Hindi (our national language), Science (biology, physics and chemistry), Social Studies (history, geography, civils and economics), and if the child wants to, they also teach Sanskrit (the oldest language from which all the Indian languages derived).

Okay, but that is a lot? You might feel so, but no. The syllabus they teach is very small, and they are present to let the child know the different available fields that they can get into. Till here, computers are only a basic education, children will learn to use computers, play games, create art works using paint, create presentations, taking printouts, sending and receiving emails, etc., Nothing more. And I can bet 90% of my friends haven't seen a computer until they are 12 or 14. Even schools lacked faculty who can teach computers, so even though the government sponsored the hardware, they had to take rest here.

I and a friend of mine, taught computers to ourselves, by experimenting with them. We used to see what makes what, that we actually opened up hardware and refitted them, and by reading their manuals, we came to know about operating systems, software, and all. We made games (using Game Maker 5.1) when we are 12, and we showed most of my friends what a computer is, by using games.

Then after school, we had two ways, the diploma (work based courses) and the intermediate (maths, physics, chemistry, botany, zoology, history, geography, economics, and civil). I went the intermediate way and chose Maths, Physics and Chemistry as my preferred subjects. Additionally, here, English, Telugu and Sanskrit are a must. No programming or computers here again.

Then there are two major streams, Engineering and the Medicine, but there are also Arts, law, etc.,

Coming to Engineering, the guys who chose to intermediate will be taken into the first year, while the diploma guys join directly in the second year. There are five major branches, which are as follows:

  • Computer Science
  • Electronics & Communications
  • Electronics & Electrical
  • Mechanical
  • Civil Constructions

It is in engineering that most students here take their first glance at computers. However, the first year of engineering is the same for all the streams. We have to study Applied Mathematics, Applied Chemistry, Applied Physics, Computer Basics, Programming in C, Engineering Mechanics, Mechanical Drawing. English comes additionally here as one of the language subjects. There are no needs to keep Telugu, Hindi and Sanskrit, we will be well versed in them because they are our native languages.

When I got into engineering at the age of 18 in 2013, I already know of C, C++, Java, C#, VB.Net, Haxe, JS, PHP, and some basic Ruby. I already knew the languages, how to debug programs, (I had written my first game engine back in 2009 in Java) so I assumed that it will be very very easy, but alas, it isn't.

Why?? Faculty are interested in completing the subjects (as increasing the students marks, not knowledge), and didn't care about the thought process. I mean, they didn't teach the students how to understand a problem and find the cause for it. And next, the colleges here are affiliated to universities, and had to teach the never updated syllabus that is designed by some very experienced faculty (experienced in teaching and academics, not in the emerging technologies).

There is also a drawback in my own self. I always thought that computer science was nothing but programming, commanding computers to do what we want, but then it actually is all about learning lessons from others inventions, and finding the logical solutions to the real world problems. With the subjects we had, and with that decade old syllabus, we are only going to learn the real basics which are just enough to survive in the everyday's programming job.

We are taught design patterns, and it is our part to learn about when to use a specific pattern. We are taught about data structures, and again, we have to learn to find the correct datastructure to use on our own. The same goes to computer organisation, operating systems, linux programming, and a lot of subjects.

With all these things said, I came to know that a teachers part is very limited, and in fact, it is the part of the students that has more weight in the complete learning process. Teaching to kids is, yes, fine, but it will only be effective when the child is also interested in the outcomes. At such a young age, I don't think children in schools need high programming, because they don't know how the problems will be, and all. Instead, tell them how to think.

Games are a wonderful tools for that, and most of the young people today are well capable of playing games. Teach them to programming by teaching them to make games. Giving some presentations with some code snippets will only make them yawn in class and makes them sleep.
2  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 14:58:02
Cell grids are good, I agree, but @Riven, I don't know which type of game the OP is making, so I recommended one that works for all sorts of games. Even with adding a number to make the indices positive, it won't work well when we have open world games. However, AABB trees are easy to understand, and yet the same time, give good performance.
3  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 13:19:47
Grids are extremely fast and trivial, but you need to spend some time tweaking them when you have objects with negative positions. Since you'll typically implement them as 2D arrays, negative indices will be a problem.

I really really prefer using boundary volume hierarchies, like aabb trees or circle trees. You can read up more here:
4  Discussions / Miscellaneous Topics / Re: What I drew today on: 2017-02-14 13:20:52
Been a bit artistic in today's English class in college:

5  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-12 05:23:44
I apologize for bringing c++ to this forum once again..

typedef std::_List_iterator<std::_List_val<std::_List_simple_types<std::function<void(int, int)>>>> ResizeListenerHandle;
So I wrote this as part of my c++ game. Believe it or not, it is actually useful.

... I sure am glad typedefs exist. persecutioncomplex

Combine that with macros!

#define DEF_ITER(type) typedef std::_List_iterator<std::_List_val<std::_List_simple_types<std::function<type>>>>

DEF_ITER(void(int,int)) ResizeListenerHandle;
DEF_ITER(void(int,int)) PositionListenerHandle;

// And so on...
6  Discussions / General Discussions / Re: Programmer jokes on: 2017-02-05 18:50:10
... snip ...

You must watch this:

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
7  Discussions / Miscellaneous Topics / Re: Saving, loading—oh no! Semi-tutorial discussion holy piñata thing on: 2017-02-04 19:08:21
In my opinion, serialization is a dangerous thing to use for saving games.

Consider the case that you released your game that is using serialization of the game stats object. You have fields such as this.

public class Stats
    public static int levelReached;

    public static int numVehiclesDestroyed;
    public static int numCarsImmobilized;
    public static int numCarsImpounded;

You are saving this as your game save. Good, but then in a next version, you decided to refactor numCarsImpounded into numCarsCaptured or something for instance. When you release this version, you'll also introduce a bug, a major issue. All the existing player's game saves will be lost as serialization will fail.

You might also have save game on exit, and that even destroys all the progress the guy has made. I even faced this issue in a college project, and this was my good lesson.

For this purpose, I'd never consider serialization for save games. Instead, my choice would be to go with JSON or XML. Have predefined JSON structure, and you can also upgrade existing save games to newer JSON structure. If you fear that player may alter the stats, go implement a custom file format, maybe even binary.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-03 13:40:18
Turned 60. Shocked

Wait, is that in decimal system or some other like hexadecimal?

60 (oct) == 48 (dec)
60 (hex) == 30 (dec)

Which one should we follow?
9  Game Development / Newbie & Debugging Questions / Re: Looking for some library for triangulating polyine / path on: 2017-02-02 17:51:27
For any non-intersecting polygon, you can make it into triangles by considering the first vertex to be the common vertex of all triangles. Then iterate on the remaining vertices (from 1 to n - 2) and get (s, i, i + 1) into a new triangle. This is the simplest algorithm and should always work.

Btw why you need a library when this is just one simple function?
10  Game Development / Newbie & Debugging Questions / Re: Load a GMMOD File on: 2017-02-02 15:55:59
I did some searching, and found a solution for this. The GMMOD file is a text based file, and contains model in the GAME MAKER 3D MODEL format. The format seems to have changed, and modern GM versions now use OBJ instead of this file format.

However, there is some editor to create models in this file format:

I've tried to create a simple triangle with it (it's not at all easy to use, Blender is the right tool for this job) and exported it into a GMMOD file, and it created the following contents.

5 GMMC 5.0 1.0000 1 1.0000 0.0000 1 1 0  0 0
0 4.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
9 0.0000 4.0000 23.0000 0.0000 -1.0000 0.0000 0.0000 0.0000 16777215.0000 1.0000
9 -21.0000 4.0000 0.0000 0.0000 -1.0000 0.0000 0.0000 0.0000 16777215.0000 1.0000
9 19.0000 4.0000 0.0000 0.0000 -1.0000 0.0000 0.0000 0.0000 16777215.0000 1.0000
1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000

From my limited understanding (and guesses), the first part seems to be the instruction type and the rest are arguments. My assumption is as follows:

  • 100 seems to be file format version, or some magic number.
  • 9 seems to be vertex definition, followed by 3 floats for position, 3 floats for normal and 4 floats for color.
  • I didn't understand what 0 and 1 commands stand for.

It is extremely difficult to progress, since there exist no documentation for this file format. And then, I found a cool function in this program. It can export GMMOD files into OBJ models. Use the settings icon in View 2 to export as OBJ.

And this one works fine, I can load the OBJ model in Blender and it rendered exactly as it is in the GMMC editor. Definitely recommend to go use the OBJ export feature and update all your models to this format. BTW out of curiosity, from where did you get GMMOD models?
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-28 19:44:41
Just got an idea to generate a polygon from an image, and started to code it out. There are a few imperfections, but it is looking out nice!

Polygon polygon = new Polygon();

List<Vector2> vertices = new ArrayList<>();
Color pixelOut = Color.REUSABLE_STACK.pop();

// Start scanning the image from left to right, and then from top to bottom
for (int y = 0; y < image.getHeight(); y++)
    boolean found = false;

    for (int x = 0; x < image.getWidth(); x++)
        image.getPixel(x, y, pixelOut);

        // Add the first non-transparent pixel
        if (!found && pixelOut.a != 0)
            vertices.add(new Vector2(x, y));
            found = true;
        // Add the last non-transparent pixel
        else if (found && pixelOut.a == 0)
            vertices.add(new Vector2(x - 1, y));
            found = false;

// We got the vertices that surround the image, but they are in scanned order.
// Sort them into clock-wise order
Vector2 imgCenter = Vector2.REUSABLE_STACK.pop().set(image.getWidth() / 2f, image.getHeight() / 2f);
Collections.sort(vertices, (v1, v2) -> (int) (v1.angle(imgCenter)) - (int) (v2.angle(imgCenter)));

And it looks like this in action!

Looking cool! This is very inefficient however, generated 880 vertices for this simple tree image. I'm now going to try creating a convex hull over this concave polygon.
12  Discussions / Miscellaneous Topics / Re: What's in your gamedev software rig ? on: 2017-01-24 18:09:02

You might have said that unintentionally, but VIDYA in Telugu means EDUCATION.
13  Game Development / Newbie & Debugging Questions / Re: Attack action on: 2017-01-24 17:01:45
@SHC that's also what I do in my game.  I have a rectangle that is larger than the enemy, and if the player intersects with that rectangle, enemy is triggered to attack.

You seem to have associating one extra rectangle per each enemy aren't you? I'd instead associate one large rectangle with the player, and if the enemy intersect the large rect, then only that player will rush and attack.

Though both works, it is just an optimization to remove extra shape instances. Even though you went with either way, no penalty will be observed if you have a broadphase that prunes away unnecessary checks.
14  Game Development / Newbie & Debugging Questions / Re: Attack action on: 2017-01-24 16:52:40
I think for simple 2D platformer games, using raycasting is a bit overkill, instead you can get around with a circle with a defined radius of visibility around the area of the player.

(Excuse my poor drawing skills). Any enemy once got a event with circle of visibility, can attack the player and charge towards him. This is more simple in my opinion.
15  Discussions / Miscellaneous Topics / Re: What's in your gamedev software rig ? on: 2017-01-24 15:30:35

Intel i7 4790k
RedGear Wireless Pro Gamepad (XBOX Style)
Speedlink Wired USB Gamepad (PS3 Style)
LiveTech Wired USB Gamepad (PS3 Style, cheap one)
Microsoft XBOX 360 Wireless Controller (Original, including wireless receiver for PC)
Logitech WebCam, keyboard and mouse
Built-in Sound Card
An old 1600x900 monitor (Saving now to replace it with a new one)


Windows 10 Home
Java 8 (64 bit)
.Net 4.6
Python 3
Ruby 2
SilenceEngine, Unity3D
IntelliJ IDEA Ultimate
Eclipse (college forces me to use Eclipse, although I have IDEA)
Atom (my favourite for Web dev and Gradle script editing)
Synfig Studio (2D skeletal animation tool)
Blender 3D
16  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.

Look at the language-selector in the top right!
17  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.
18  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.

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.

activity.runOnUiThread(() ->

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:
19  Discussions / General Discussions / Re: GLFW Controller Database on: 2017-01-10 14:34:46

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.

20  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.

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:

#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?
21  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.
22  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
23  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.

<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

<set-property name="joml.debug" value="true">
24  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 as
. 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:

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/'
      [ERROR] Line 59: Only string constants may be used as property name in System.getProperty()
:examples:compileGwt FAILED

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

Better solution will be to replace
calls with a regex to


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.
25  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=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

Is that billboarding or something else?
26  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.
27  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).

Starting to implement mouse picking!
28  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.

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:

The desktop version uses TinyFileDialogs that come with LWJGL 3, while in HTML5 and Android, I use the native dialog implementations.
29  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.
30  Game Development / Newbie & Debugging Questions / Re: Type checking an init method on: 2016-12-27 16:39:50

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.

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.
Pages: [1] 2 3 ... 61
numerical (178 views)
2017-02-21 07:32:16

numerical (177 views)
2017-02-21 07:31:46

theagentd (285 views)
2017-02-18 13:42:33

theagentd (286 views)
2017-02-18 13:35:16

h.pernpeintner (1453 views)
2017-01-24 22:39:11

h.pernpeintner (1438 views)
2017-01-24 22:38:32

Galdo (2003 views)
2017-01-12 13:44:09

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

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

0AndrewShepherd0 (2332 views)
2016-12-15 21:50:57
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 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‑
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!