Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (748)
Games in Android Showcase (226)
games submitted by our members
Games in WIP (834)
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 ... 63
1  Game Development / Newbie & Debugging Questions / Re: Stream.filter(...).count() didn't work on: 2018-01-30 15:18:34
instead. It will become

3, col))

By the way, why convert the list to array in the
method in the first place?
Use a list directly there, and use collector to collect the stream contents.

public List<CellPanel> getNeighborsAt(int row, int col) {
    return ->
            (cell.getRow() == row - 1 && (cell.getCol() >= col - 1 && cell.getCol() <= col + 1) ||
            cell.getRow() == row + 1 && (cell.getCol() >= col - 1 && cell.getCol() <= col + 1) ||
            cell.getCol() == col - 1 && (cell.getRow() >= row - 1 && cell.getRow() <= row + 1) ||
            cell.getCol() == col + 1 && (cell.getRow() >= row - 1 && cell.getRow() <= row + 1))

Should be better.
2  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-12-16 10:24:12
Nope it isn't. I'm still working on it Roi. Only that I'm having a tough time looking to port the post contents.
3  Discussions / Miscellaneous Topics / Re: Career advice on: 2017-12-08 17:24:21
Am in Bangalore, India. You thought I moved to a different country for a second right?  Wink
4  Discussions / Miscellaneous Topics / Re: Career advice on: 2017-12-08 03:20:33
Thank you all for the responses. I have opted to the startup as well, and it is extremely fun way (though we are working with PureScript, a functional programming language). I just finished moving to the new city.
5  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-25 11:15:37
Thanks for that Riven, but I think that I'm going to do that only once I believe it got to a point to show others. I still have to write code to migrate posts.

However I'm taking some time, as I now have to move to a city that is ~700 km away because of job. I might not be available for two weeks because of house hunting, packing and moving things etc.

I'll be getting back to this from 11 or 12 December. The progress is smooth enough.

Regarding the UI of Flarum, I beleive that it is community centric, as is Discourse. To me they both appear to be same. However, I don't think you can get a sidebar into it. You can, by fiddling with adding a component to Mithril, but I don't think you can integrate it without spoiling the look. That's my opinion though.

See ya soon once I settle down there.
6  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-22 17:19:09
How are things going SHC? Is there somewhere you are hosting it that we can have a play with?

I'm having a little bit of trouble with posts breaking because of tables. Flarum's BBCode plugin has limited tags, so I'm now in the process of writing an extension for it. Also, the icode tag breaks as well.

However the markdown support is good, so in the end, I might be just using the text formatter library and translate from BBCode to markdown. Just now I'm reading up the internal representation of posts. It appears that SMF stores the posts as raw BBCode. Flarum however stores it in a internal XML format that is easier to render.

By the way, I'm not going to host this anywhere without the permission of @Riven. In the meanwhile you can set up a local Flarum instance and run the migrator yourself.
7  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-16 09:22:42
Keep it simple... just require everyone to change their password on first login, move on.

It could stress out JGO servers as requiring to change the password means that the server has to send a lot of mails with links.
8  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-16 04:13:41
A quick change is that I added error reporting and also a progress notifier in the tool. This migration script is CLI based, as you can see it:

This should be more better as I will get to know if the script was hanged or not. I had to admit it is stressing out the MySQL server, as I can see the disk access at 99% rate. I have also added recognition of user groups, and currently this script translates everyone as Members, Mods and Admins.

By the way, did I mention that I'm committing this to GitHub? It's at

Great progress dudes!

Thanks! That will keep me excited to do, it was boring a bit to stare at the screen doing nothing while the migration is done. Currently for 11513 users, it is taking me ~12 minutes to do the port, that is with the reduced data which excludes people who have never logged in after activating their accounts and also non-activated accounts.

Ofcourse this is one of the first snags of a data-migration: how do we get application X to understand the password-encryption (salted-hash) from application Y. Typically this involves a bit of custom code in the new application. I could PM you your own SMF credentials (as hash+salt) and you could test your new implementation with that.

Yep I agree. I had looked into the sources of Flarum and found that it uses the same hashing used by Laravel framework, which I guess is bcrypt. I'd like to experiment with that, please do send me my own credentials in the PM.

Having to reset your password seems like a pretty reasonable thing when switching to a new site.

True that, it would be fine with most of the users as they log-in with social media anyways, but wouldn't hurt more for experimenting right?
9  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-15 16:55:34
Porting of users is done, but however they are created with no password, and hence they cannot log in. They are required to click on forget password link and create new password for the accounts. Members visible in the admin panel:

And here is a ported user:

Profile pictures are a bit off, but I don't think I can fix that. Still had to search where Flarum stores them. And of course, mods and groups aren't ported yet.
10  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-15 16:35:01
This is really awesome. Congratulations. What do you see as the next steps?

First step is to port the users. Once that is done, I could look into porting the meta data, like the profile picture etc., Right now however profile pictures cannot be ported because it appears to me that Flarum caches them in other locations, and I cannot access the server of JGO to download the images.

After this is done, I can continue to port the posts. The good thing about Flarum is that it supports posts in both BBCode and also Markdown. However, I think I have to modify them a bit.
11  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-15 16:29:40
Hey @Riven, I started migrating the users and found that there are a ton of users who have activated the accounts but haven't logged in even once. The lastLogin field for some is set to 0. Should I migrate them too? Or can I optimize the script to remove them?
12  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-15 02:42:21
That was my thinking when I started inspecting the data, to load as many tables as possible into MySQL and go from there. The tools I have for inspection are not so hot: e.g., Notepad/Wordpad! Advice on a better way to inspect the dump would be appreciated.

For this large data, phpMyAdmin and other web based tools will trigger a post error, you need to work from the command line. After you create the database, do this from cmd:

$ mysql -uuname -p
Enter password: *****
mysql> use dbname
mysql> source path/to/dumpFile.sql

That will do the trick of importing. It took me 30 seconds for that to complete.
13  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-14 16:04:10
After spending two hours to understand the tables and relations, wrote a script to migrate the categories and boards. The current output is like this:

The script also maintains the order of the categories and the boards inside them.
14  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-14 09:03:01
I got the dump imported into MySQL. Am now trying to get it into Flarum.

15  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-06 08:05:33
Where? I'm hosting the backups that you are providing everyday with cron jobs at but aren't they encrypted?
16  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-06 06:49:00
I definitely want to try it out @Riven, that would be something I'm really willing to do. However I can't say an expected date or so, this is experimentation and I'm going to start in a month after my exams. Will you please PM me with a link to the database dump you said earlier?

The idea of the freezing up of the current forum as an archive is pretty simple that it is the first one that came to my mind, and especially as I've witnessed it on the community, it went completely smooth and I like it. However from some previous messages, I understand @Riven is not interested in this, he wants a completely migrated community and also be happy with the links.

In this way, my guess is that we have to first start tinkering with a modern PHP system (I'm looking at Flarum) and then spend some time analyzing how it stores the posts in the database. I had worked with PHP and MySQL in the past (but not a forum software though, nor I had written any mods for SMF) and I think a bit of looking into should get us something. My guess is that this approach works, but in the longer end.

  • Start with analyzing the database table structures.
  • Write scripts to automate the process.
  • At each iteration, test and improvise the script.

If you permit, I'd like to take the dump you're going to provide, and create a repo on GitHub and commit this dump into it. Our tool should be able to take a basic site of Flarum and modify the database after reading all the posts and the users. What do you think?

And we could always take the help of experienced and willing to contribute members like @philfrei.

By the way, I opened a support ticket in the Flarum forums:
17  Discussions / General Discussions / Re: Gosh, it's quiet in here on: 2017-11-05 12:55:55
I see three main problems for this forum being so quite. The first thing, is that the forum software is old. So old that I remember once reading that Riven said it is not possible to even theme it as it is already running on a lot of mods. One solution is migrating the forum to a new software, like Discourse? If the need for Ruby was the problem, why not Flarum? I know it's really in the beta, but it looks stunningly good.

Second problem as above all mentioned, there are more people who read than people who contribute and post here. Number one reason again is the forum software, it is preventing newbies from registering or changing email address. Second thing, professors seem not to encourage gaming or game development, some here strongly believe that traditional reading and writing answers is the real way of learning. I even experienced situations with professors trying to steer me away from games in general for my own good, and I feel like WTH?

Regarding with frameworks etc., that is not the cause of steering away. Today's people want to show something, they want immediate results. That is favoured by large and already matured engines like Unity and people prefer them. They do have a point as they are already mature engines used by tonnes of successful games. As I see in my surroundings, in college, I always see people want to get something up and running, nobody really wanted to explore what it is under the hood.

The third main problem is the language getting old, and Oracle is having focus on features that not everyone would use or such. It's not a wrong thing, but even being a fan of Java language for its simplicity, I really don't see the need of having modules other than in case of enterprise developers. In my case, most of that is already being done by Gradle and other build systems. I really want to see C# like features, specially the events, delegates, properties, async functions, etc., I'm looking for the introduction of value classes to Java. Kotlin in that end seems promising.

Apart from all this, everyone will have their own personal reasons for not contributing much, as I had my excuse of career building. I'm now in the final year of college, having lots of assignments, exams, and at the same time I had to work on projects, internship, etc., I really used to have a lot of time 6 months ago that I now lack. Since I'm missing a lot of classes now, I had to self study and it also adds to it. Anyways, I'll look into getting more time for the community now.

By the way Riven, is it possible to migrate to a new forum software now? I really hate surfing it on mobile. If you need any help I can do regarding this, let me know. I'll be having more time after a month.
18  Discussions / Miscellaneous Topics / Career advice on: 2017-10-10 14:29:21
Hi friends, I'm posting in JGO after a long while today. I'm in my final year of my college and had spent the last two months attending interviews. I'm posting this today because I'm in a dilemma and I need a career advice from someone experienced.

My first interview was in an MNC, which had 60 years of industry experience. I was asked questions on Assembly programming there and I cracked it. However, two things I'm concerned are the pay package and the available projects; they are offering me 3.36 as the package, which is half of my father's current pay (he earns 7 per annum).

My second one was a startup, which was founded in 2012, and they held the interview on purely technical rounds. I cracked it too, and apart from a job, they asked me to join early for a mandatory student internship in the next semester. The package is much higher here, they initially offered me a package of 8 per annum, and said that depending on my performance in the internship they might increase it to 12.

I'm not thinking only in terms of salary, but also in terms of the projects that I'll be working on; the big MNC is a service based one, and mostly works with low level technologies and databases. The new startup is a national payment gateway in India, and it's major client is the reserve bank. The Technology they are using is PureScript which is a functional language.

Regarding company size, the MNC has got 3,86,000 employees while the startup had got less than a hundred employees.

Now I'm in a dilemma. What factors should I be considering as a fresher?
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-09-30 19:33:38
I experimented with creating a UWP app with Java, and it seems with GWT it is possible, although I had to use a hack.

More details coming soon. I'm very sleepy now.
20  Game Development / Newbie & Debugging Questions / Re: No OpenGL context found with new game sessions. on: 2017-09-06 09:51:40
It seems to me that you are creating the texture on the networking thread, where OpenGL context is not current. I think you should be creating the thread in the main thread. Maybe make request handler queue the requests and you process that request queue in your game's update operation.
21  Game Development / Newbie & Debugging Questions / Re: graphics2d.scale to make full screen on: 2017-09-03 05:02:59
I'd not deal with the scales of Java2D. When I used to do it, I used to do it with triple buffering. One is the on screen image, and two BufferedImage instances for off screen. I kept the screen image (window) completely resizable. Off screen buffers are in game resolution.

When presenting, I used to calculate the aspect, and find the scales. Then draw the image on the screen with the drawImage method.

// new_(width|height) is the dimension of the scaled image
// bound_(width|height) is the dimension of the window
// original_(width|height) is the dimension of the game resolution

// first check if we need to scale width
if (original_width > bound_width)
    //scale width to fit
    new_width = bound_width;
    //scale height to maintain aspect ratio
    new_height = (new_width * original_height) / original_width;

// then check if we need to scale even with the new height
if (new_height > bound_height)
    //scale height to fit instead
    new_height = bound_height;
    //scale width to maintain aspect ratio
    new_width = (new_height * original_width) / original_height;

// Now clear the screen
g2d.fillRect(0, 0, bound_width, bound_height);

// Calculate the offset x and offset y
int offsetX = Math.abs((new_width - bound_width) / 2);
int offsetY = Math.abs((new_height - bound_height) / 2);

// Draw the image onto the screen
g2d.drawImage(offScreenImage, offsetX, offsetY, new_width, new_height, this /* window */);

This is what I used to do, and it worked for me perfectly.
22  Game Development / Newbie & Debugging Questions / Re: JavaFX updating a Label on: 2017-08-26 14:13:47
Use Platform.runLater(Runnable) to delegate to the UI thread.
23  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2017-08-26 01:22:48
WebGL4J version 0.2.9 is now released into maven central. It fixes two bugs with the bindings, and also got partially documented.




compile group: 'com.goharsha', name: 'webgl4j', version: '0.2.9'

// or shorthand notation
compile 'com.goharsha:webgl4j:0.2.9'

Also released on GitHub for those who are not using Gradle or Maven.
24  Game Development / Newbie & Debugging Questions / Re: Text rendering problems on: 2017-08-16 16:45:24
What does that mean? Did it work or not?
25  Game Development / Newbie & Debugging Questions / Re: Text rendering problems on: 2017-08-15 17:39:17
No, disabling the depth testing forces the renderer to replace the pixels, and the blend function tells it to blend with existing pixels instead of overwriting completely. In case your font texture has a black background, then yes, and in that case you have two options:

Modify the font shader to discard on a black pixel.

if (texel.rgb == vec3(0, 0, 0))

Or you can set the texel's alpha to zero so it won't be overwritten.

if (texel.rgb == vec3(0, 0, 0))
    texel.a = 0;

That should do what you are aiming for. An even simpler solution is to edit your font textures and save them as PNG images with transparent background. In that case, you can simply multiply the texel with a color vec4 to change the text color too.
26  Game Development / Newbie & Debugging Questions / Re: Text rendering problems on: 2017-08-15 17:28:56
Disable depth testing before rendering text, that works for me. Also set your blend function to the following.


That should solve this issue. Also make sure to render text after all the drawing in the scene is done. Don't forget to enable the depth testing back once the text rendering is done.
27  Discussions / General Discussions / Re: Setting resolution for your game? on: 2017-08-14 08:01:52
I had to use this line too when I was using Java2D in 2012 on Mac.


Otherwise, I got the menubar still visible in the past. By the way, I too prefer OpenGL, that makes graphics really easy and gives good performance too.
28  Game Development / Shared Code / Re: Mp3 Player with Jlayer on: 2017-08-08 17:43:10
I gave a read on the licensing of MP3, and I got some quotes from the following links:

This announcement only means that the licensing of MP3 software ends, and they aren't required to pay to the Fraunhofer institute to use MP3 in their products. One important part is this:

This licensing program has now ended. Manufacturers which have already been mp3 licensees can still use the licensed software without any problems moving forward.

The licensing program has of course been ended, but still there is a small catch. From this quote:

Should other vendors be interested in using Fraunhofer’s mp3 software, they can now get in touch with Fraunhofer directly with their query.

They aren't saying that the MP3 software is now license free, you still have to get in touch with the company directly with your queries. It's only that from now on, they won't collect any fee, but there might be restrictions on the use of the software.

However, the end of the mp3 licensing program does not automatically mean that all mp3 technology is available license-free now. Apart from the core mp3 patents included in the licensing program, there might still be some implementation–specific patents (or patents for other functional enhancements) that have not expired.

MP3 has got some patents, and as I'm aware, they're in the European union and in the US. The patents in Europe were already expired in 2012, while since the US had patents for much longer time, they expired in the US in 2017. This means only that the software is patent free, and patents are much different from licenses and copyrights.

But having all this very sensitive stuff, and also that there are even better formats available, I think switching to either AAC or OGG Vorbis (there is also a term Theora I didn't know about) is a much better option.
29  Game Development / Shared Code / Re: Mp3 Player with Jlayer on: 2017-08-08 14:46:51
I heard there are licensing issues with using MP3s in Java applications, and hence I always use OGG. I don't know what they are though, could someone explain me about them?
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-08-07 14:50:32
I thought I need a better way to keep track of what resources are in memory, and decided that Scene should be able to define dependencies on resources. To make this easier, I thought I might define a DSL. So here is it:

public static class LevelResourceTable extends ResourceTable<Resource>
    texture(Resource.PLAYER, FilePath.getResourceFile("player.png"));
    texture(Resource.ENEMY, FilePath.getResourceFile("enemy.png"));
    texture(Resource.SKY, FilePath.getResourceFile("sky.png"));

Where Resource is a simple enum.  I can then simply let the scene declare the dependencies. I'd be having different tables like these, and scenes will be declaring them as:

public class Scene1 extends Scene
    public List<ResourceTable> getDependencies()
        return Arrays.asList(
            new LevelResourceTable(),
            new GlobalResourceTable()

I'm still thinking of an even easy method of having returning the dependent resource tables from a scene. Seems Java can have the beauty of these DSLs right?
Pages: [1] 2 3 ... 63
xxMrPHDxx (337 views)
2017-12-31 17:17:51

xxMrPHDxx (111 views)
2017-12-31 17:15:51

xxMrPHDxx (160 views)
2017-12-28 18:11:33

Ecumene (354 views)
2017-09-30 02:57:34

theagentd (505 views)
2017-09-26 18:23:31

cybrmynd (557 views)
2017-08-02 12:28:51

cybrmynd (488 views)
2017-08-02 12:19:43

cybrmynd (462 views)
2017-08-02 12:18:09

Sralse (424 views)
2017-07-25 17:13:48

Archive (1347 views)
2017-04-27 17:45:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!