Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 ... 9
1  Game Development / Newbie & Debugging Questions / Re: trying to implement a daemon to write to web in my game ... failing on: 2015-10-05 17:22:40
The idea is just to have a thread that loops once a second and either does nothing (most of the time) or reads the current high scores or writes the players high score.

How about showing/downloading the highscores only at the end of a game / in a special screen. There is really no need to download them every second.

Also, please don't use static if you don't know what it does. After you have made sure what it does, and you actually want something to be static, code it. If you make existing methods static, there is something wrong with the design for your code. If you haven't made any design (looks that way to me) I really recommend making one in UML. It is not only handy to gain insight in bigger projects, but it also makes clear what your code is doing. For starters, if you take those designs seriously, this means that you will write much better code that actually does something in a straight-forward manner. Well that's what I would recommend beginners anyway, professionals use this already...
2  Game Development / Newbie & Debugging Questions / Re: libGDX - What about that? on: 2015-09-26 20:42:47
Hello J0,

Yes, Swing is awesome, but it is not meant for games:
Images that should be drawn stuck together get separated on certain frames.
Some frames have trouble loading.

There are a lot of tricks to counter this, like drawing your game on one image and replacing your screen with that image when you are done with it, but that's not what you came to ask for right:
I was actually wondering what libGDX was.

A wrapper to create games for: iOS/Android/Mac/Linux/Windows/Web all at once. This wrapper uses OpenGL for all platforms, in short.

- Would it be possible to have an application working part libGDX / part swing? Can you make a libGDX component show up in a JFrame?
- Would libGDX be faster and/or more efficient than swing?
- Would I need to rewrite my procedural part for collision detection, positions, or can all that be kept?
- How difficult is libGDX to understand to someone who never dealt with anything else than swing?

Sorry for skipping a few questions, but I think you should find out for yourself. Here the main part though:

- Yes, but your application won't be cross-platform anymore. So it would make more sense to use plain OpenGL in this matter, in other words: LWJGL (OpenGL itself is written in C++ so LWJGL ports it to Java)
From now on I will translate 'libGDX' as 'OpenGL', since that is applicable to OpenGL itself.
- OpenGL is indeed much faster than Swing since it doesn't use software rendering like Swing but hardware rendering. It also does a lot for you, you don't have to write your own gameloop anymore and all those nice things.
- You can keep almost all of your code, almost the only thing you must change is the way you draw onto the screen, but I would do it as soon as possible if I where you, I might be forgetting some things.
- Hard to say, but for 2D games it's not too hard. LibGDX makes things easier as well, although I really recommend using LWJGL (and thus plain OpenGL) if you want to learn the depths of game programming.

Hopefully my answers helped, even if it is only a little.
3  Games Center / WIP games, tools & toy projects / Re: Vangard on: 2015-09-26 14:14:12
Is this any better?

I like it certainly more now!

Thanks for taking my feedback seriously, therefore I have made an example image for you as well, it's done quite quick and low resolution, but I hope it points out a little better what I stated in the above post.
Your vegetables are lined up, what is best for farms? I guess that's a matter of experimenting, this example does at least fine for wild bushes though.
You could also distinguish farms by surrounding them with a little fence or something.

Some strawberries and single colored sorry for being boring forest fruits

As you see my bushes have two layers just like your trees (but smaller), what tunes them the most are I think the fruits I added. This is still quite vulnerable to experimenting though Cheesy
Just throwing out some ideas, hope it can help!
4  Games Center / WIP games, tools & toy projects / Re: Vangard on: 2015-09-23 22:30:55
Here is my veggie plot model loaded into the game:

No offense, but I expected a totally different (consistent) drawing style.

Your trees were simple but truly awesome, I don't think the vegetables fit your game.
To be honest, your houses would lose in an instant too if they were to battle with your trees in a beauty contest. Smiley

To make your game look more cohesive:
I would suggest to make one vegetable look like a small tree (if you want to create a yard, you could concentrate them in a small area (will look nice since they have some transparency).
The same for bushes etc. with some colored berries in there (the bush/fruits have the same design as the trees, but on another scale).

Also, if that isn't the case already: I would make the trees (thus your vegetables and stuff as well) 'wobbly' (slowly transforming), like a slime, pudding or this bird:

Click to Play

Sorry for the bad example Tongue Make your game become alive!
5  Games Center / WIP games, tools & toy projects / Re: Vangard on: 2015-09-04 17:19:19
Let's say the player can chop down trees, or enchant them. I guess you could open a context menu when they first click on a tree, either after launching the game, or acquiring a new ability. Say the player chooses to chop down that first tree. Well then, the player would chop down any right-clicked tree. But then, maybe you could either change the behavior in some kind of menu, or by left-clicking on a tree to open up the context menu. Wink

Some nice thinking. It has a (few) disadvantages though: You would have to click multiple times to make the player do what you want.

My idea:
That when you press the right-mouse button a context menu opens, with all the behaviors to choose from in a radial menu. If the right-mouse button releases the context menu disappears, and the selected behavior will be executed. In the middle I would put the default behavior (which could be the last selected behavior), so that you can CLICK and not have to HOLD/DRAG the right-mouse button if the default behavior should be executed.

The advantage is that you can right-press the tree, the player goes to the tree already, and while he does you can drag your cursor to the behavior you wish (if you don't wish it to be the default). All in one clean click, while being able to keep checking on the game, since a radial menu does not cover half of your precious screen. + they are evident (if really needed you could show a description on hover)

An example radial menu:

With this you can just show it in the middle of battle, since it is very fast and does not cover half of your screen. I think the problem is less unique than you think Smiley
6  Discussions / General Discussions / Re: MySQL insert became fast after adding an index on: 2015-08-19 20:17:36
Actually, now that you say it Riven, I remember that I still have a check in the importer so the same records don't get saved twice. I put it in mainly because I did implement the deleting of files later:
$field = FieldValue::find()->where(['updated_at' => $dateOfFile])->one(); //slightly modified

Which is code in PHP Framework Yii2 for the following:
SELECT * FROM field_value WHERE updated_at = :date LIMIT 1

So this topic was actually a big lie.. probably.. I am sorry guys persecutioncomplex

EDIT: Well now I think about it, could this little query really cost 2 minutes?? That's impossible because then my charts would have never loaded in the first place

And no there were almost no other SELECT queries on the server, the client had access to it, but I am surprised if they have even logged in once a day.
7  Discussions / General Discussions / Re: MySQL insert became fast after adding an index on: 2015-08-19 17:15:56
In most cases, ALTER TABLE makes a temporary copy of the original table. MySQL waits for other operations that are modifying the table, then proceeds. It incorporates the alteration into the copy, deletes the original table, and renames the new one.

Maybe a fragmented table got rebuilt into a new one.

Also: InnoDB? MyISAM? Using transactions? Which isolation level? Doing bulk inserts or prepared statements?

How does a table become fragmented? I have only read/inserted records in it.
The table uses InnoDB, I don't use prepared statements nor do I use transactions or bulk inserts, my bad.
It was meant to just insert 3 records every ten minutes, but since I am a little slow the files were stacked up since May Kiss And I have got to admit, didn't even think of using the prepared statement.

Possibly because of contraints (unique'ness of primary key) the database has to check on each insert.
It can do these checks much faster with an index.

I didn't use any constraints in the table though, except this auto_incremented Primary Key:
| Field       | Type         | Null | Key | Default             | Extra                       |
| id          | int(11)      | NO   | PRI | NULL                | auto_increment              |

Thanks for all of your fast replies. Smiley
8  Discussions / General Discussions / MySQL insert became fast after adding an index on: 2015-08-19 16:23:07
It actually happened at work, where I had a table which contained almost 2 million records.
I had created an importer which read csv's from Google Drive and saved the values from these files to records in the table. Which are displayed in a chart on the website.
The importer runs every two hours for an hour (via a cronjob) and had 33k files on Google Drive to go 1 month ago (and every 10 minutes, 3 new files are added), while I had 1 month of vacation to go Smiley so I went to check up on the website yesterday.

What I saw: the charts were incredibly slow (if the page did not throw an exception because it was allocating too much bytes) and the importer had still 27k files to go.
When running the importer manually, I found out that it took 2 minutes Clueless to save 1 file in the database.
So two problems came to my path: slow charts (front end, reading/SELECT) and slow importing (back end, writing/INSERT).
I had prioritized the charts, since that's what our client sees. So yesterday I made an sqldump from the database on the server for my laptop and I updated a lot of queries for the charts (the client requested some quite complex formules), and added an index for one column. The charts have a much more acceptable loading time now.

So today I was going to do some refactoring since I updated all those queries (Before updating those queries I did a lot of hacking in PHP, long story), and since I am on my PC instead of my laptop today, I went to make an SQL dump again. Shockingly, I saw two files on the server:
  • dump_18-8.sql 134 MB
  • dump_19-8.sql 219 MB
I immediately executed the importer manually and yes, not even 15K of files were left (the importer removes them after they have been read) and it now takes ~2 sec to save one file to the database... Shocked

How is it possible that an insert-statement takes considerably less time (2 min. to 2 sec) after adding an index to the table? It seems the contrary is not the only truth?
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-14 22:25:07
my vector graphics drawing package

Sounds interesting, what should I think about when you are talking about your Vector-program, something like a particle editor? Well you said in your Vangard topic that your game was vector based and didn't use any textures, but I always thought Vector images were textures persecutioncomplex

Did something myself as well, actually it was written in C# with .NET (first time).
Not really Java-unrelated since it's created to parse Json to JAVA-class files.

Click to Play

What's up next is converting the class to an enum from the actual data in the Json or create instances from it in runtime, not 100% sure yet.
10  Games Center / Showcase / Re: SpaceBlocks demo on: 2015-08-12 16:45:54
I wouldn't say that "there's not much so far", since it actually already has two different multiplayer game modes and an enjoyable singleplayer gamemode.

I have a few tips which should only cost a little effort, but would make the game much more enjoyable I think:
  • The ships are way too fast IMO, I would nerf the thrusters (or make a mountain out of a molehill Tongue)
  • Ear candy/sounds instead of beeps
  • I wanted to give up/return to main and pressed ESC, but the application closed Sad
  • A dynamic enjoyable background (see f.e. the project mentioned below) with planets (instead of those circles)

This project made me think about the following project, check it out for inspiration: wonder when the owner of that project is going to push the update with galaxies...

Thanks for the fun and I hope you won't give up this project Smiley
11  Game Development / Newbie & Debugging Questions / Re: Path to JAR - any problems with this approach? on: 2015-08-10 16:30:10
Instead of:
path = path.substring(0, path.indexOf("/MyApp.jar!"));

I would use the more flexible:
path = path.substring(0, path.lastIndexOf(File.separator));

Still, instead of playing with Strings, you could also just get it's parents absolute path:
File file = new File(Main.class.getResource("Main.class").getFile());

But.. hardcoding "Main.class" is unnecessary as well, you could try making a temp file instead, which results in:
File temp = File.createTempFile("temp", ".tmp" );
12  Game Development / Newbie & Debugging Questions / Re: Finding out if car is sideways on: 2015-07-20 10:14:17
This is some simple code I used (where body is the car).

    * Kill the literal velocity

   void updateFriction(Body body)
      Vector2 impulse = getLiteralVelocity(body).scl(-0.1f*body.getMass()/maxSpeed*getSpeed());
      body.applyLinearImpulse(impulse, body.getWorldCenter(), true);
   Vector2 getLiteralVelocity(Body body)
      Vector2 currentRightNormal = body.getWorldVector(new Vector2(0, 1));
      return currentRightNormal.scl(;

getWorldVector returns the vector from the car's perspective, so you want to kill vertical velocity (car's perspective) although it would be quite handy for parallel parking Smiley

I followed this tutorial (implemented in Box2D) but can be applied everywhere since it's about car physics:

EDIT: It also explains an easy way to get your car drifting.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-05 10:49:15
When I finally fell asleep, I had some extremely psychedelic dreams concerning a purple glowing clone of me created by selling my soul to some weird entity [...] Eventually the police came and I tried to escape.
I think you should definitely make an RTS game about your dream Grin

Some mentally-focussed RTS that doesn't make you king of slaves but of real people (not king of mars, but president of america).

One where you can build soul-exploitation facilities to turn villagers into purple super warriors (ghosts), and cancer research facilities to turn villagers into intelligence? (F.E. 1 villager is 1 intelligence and 1000 intelligence could be the required knowledge for a soul-exploitation facility?)
You forgot to quote the most important part, the pizza. So you can build a pizzahut, which makes villagers actually go to the above facilities out of free movement (in a dreamy state, zombielike, cuz that's what all games are about)

While we are at it, we also make a national newspaper production centre. Which provides (false) sided propaganda for us, which makes villagers fight for our mistaken cause in politics.
14  Discussions / Miscellaneous Topics / Re: What's your favorite OS and why? on: 2015-06-06 09:41:14
Arch Linux here as well.

Just the package manager is enough reason for me to love Linux. Think about the pain to install jdk on Windows, or about compiling silly programs. (You can only compile Rust programs in the Rust shell instead of cmd, there is probably a workaround for that etc.. etc.., another reason why Windows should be avoided)

Why Arch? Totally customizable, the disadvantage of 'totally customizable' is that it could need some time before it's ready to use though (depends on what you want, but I personally like the i3 tiling window-manager where you have to install every function yourself). In the beginning it's quite annoying that when you are working, think of making a screenshot, and find out that you haven't installed any software to make that screenshot. But in the end, you have something that's totally yours (although I still and probably forever make adjustments/changes). For example, I programmed my own status bar in C to replace default status bar from i3 (i3-status). In the upcoming vacation I am also planning on writing my own Display (Login) Manager.

I still use Windows a lot though, it's essential. A lot of things are Windows-dependent: games, but think about Microsoft Office or Paint.NET as well.
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-05-29 21:16:04
Played around with Perlin Noise for the first time to generate 'sky'. (Yes the landscape is a bunch of Math.randoms)
The following images may look better when you click on them.

Two types of space:

No doubts, this one looks craz... very abstract

Yes this one has sharp contrast with the landscape


16  Discussions / General Discussions / Re: Rayvolution's JGO Appreciation Thread (AKA: Free copies of Retro-Pixel Castles!) on: 2015-05-27 17:37:49
Sure, I would appreciate a copy, it would be rude to ignore this present, no?

I don't know if it matters but I already have an account: profile

Thanks in advance.
17  Games Center / WIP games, tools & toy projects / Re: Dominance (work title) - spaceship war game on: 2015-05-26 20:40:09
Thanks for your concern, I still am active on the forum indeed but in peace and silence!

And admirable to be able to make such a game without even one drawing, creativity does not rest within paint skills but in solvability and innovativity I suppose.
Well, about the crash... I was actually searching for a file, I didn't launch it from the terminal since I'm on Windows. I had to do some work...
18  Games Center / WIP games, tools & toy projects / Re: Dominance (work title) - spaceship war game on: 2015-05-26 19:40:02
That was a lot of fun Grin

Is all of the art generated with standard drawing functions? It all looks really good (especially the radar and spawn portal)!

I encountered one little problem though, which needed a Ctrl+Alt+Del since I played fullscreen:
The game crashed when a red enemy ship got swallowed by my portal. (It was really small when the game crashed at least)
Your program probably doesn't generate output error messages since I couldn't find a log from your game, so I am sorry for not being able to provide you more information than this.
19  Discussions / Miscellaneous Topics / Re: I'm baaaaack... on: 2015-05-23 00:48:33
Alternatively I have participated in the programming competitions at I especially like the King-of-the-hill competitions.

You made me remember them again... So I decided to do something with the somewhere on this forum mentioned Rust language (thanks for that, Rust is quite fun so far, although I'm still a newbie ofcourse).

Don't spend years of your life on something that will give you almost nothing in return.

And this is most important question in our life for all of us =)

What you can do more important in free time then programming?
In most cases: drink, make fun, play games, watch videos, sleep and another stuff “that will give you almost nothing in return” in next days even not talking about next months or years.

Let flame this question, really I want know you’re opinion – what alternative you have? =)

Agreed upon. The best would be thinking/studying about the afterlife, if it exists life on earth is literally a wink, philosophy is quite fun too + makes people more interesting IMO.
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-30 21:08:30
Started this week working on my own project since school started -.-

I started to built random level generation which I'm going to use for my project.
The last time I posted something about it was a (very much alpha) video on page 10 in this thread.

More fun than school! Wink
21  Games Center / WIP games, tools & toy projects / Re: Bit Siege - 2D Competitive Multiplayer PvP Game. (Patch v1.3.1 out now!) on: 2015-01-20 18:45:03
Your website looks nice and clean. Your game LOOKS a lot of fun too. Sadly enough there aren't any games up, atm.
I also would suggest a server setup page where you can choose max players, etc.. and most important choose the port the server should use .

A little bit of curiosity: what future plans do you have for this game and are you working on this project all alone (that's how it sounds)?

I hope I can play it soon. Wink
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-15 21:01:23
How do you know the names/addresses and the layout of the data in the executable?

It's crazy what people can do with memory searchers like CheatEngine...
I have messed for a little while in that business but I don't think I have it in me.
23  Game Development / Newbie & Debugging Questions / Re: Java code migration to Android on: 2014-11-26 09:53:23
This is one reason why people use libraries... If you want to do coding for multiple platforms at once (android, computer, ios etc.)
use LibGDX for example (it even supports WebGL). Otherwise, you have to do some "simple copying" yourself.
24  Game Development / Newbie & Debugging Questions / Re: Adding a ActionListener to JOptionPane.showOptionDialog? on: 2014-11-03 21:33:57
Had to change it to:

That while-loop is out of the question...
The custom dialog is a better option.

But I would say to just 'do nothing' when the user leaves it empty.
Error messages are really annoying sometimes, certainly when you accidentally activate something and it doesn't leave after a blow on ENTER.
25  Discussions / General Discussions / Re: Icebucket challenge ??? on: 2014-08-29 19:15:00
This Ice Bucket Challenge is like 'race against cancer'.

People want to do 'weird' things (race, nominate), and what do they do? Connect it with something 'good': "Hey I'm Chris and I'm squeezing boobs for charity" (this quote is real, three guys gave 20 dollars to charity per pair of squeezed boobs, it's not really the same, but comparable).
26  Game Development / Game Play & Game Design / Re: Need Opinions - yes really - Game Control on: 2014-08-23 18:07:49
It's kinda make to be a successor to Legends of Yore, so I'm thinking mobile is where I like to play best.

It's really where the question came from, I love the free movement but on mobiles past experience makes me think it's not as nice as infrequent tapping.

There is a certain difference between turn-based games and infrequent tapping...
It's not like free movement can't have that infrequent tapping, moving tile by tile, the difference is kind of that other objects in the world keep moving whether you do something or not.
27  Game Development / Game Play & Game Design / Re: Need Opinions - yes really - Game Control on: 2014-08-23 17:16:33
For desktop I would use: keyboard
For mobile I would use: touchscreen
For ouya I wou...

Oh wait, that's not the question, next time I will read the main post, promise. Kiss

Certainly free movement. I would have played LOY so much more if that game wasn't turn-based...

And about 2: Players want to do things (move/attack) themselves, if everything happens for them, (no choice, for as far as 'free will' exists Roll Eyes) and they can't decide to exchange some loot for some health, it's the end of the fun.

Sorry for this subjective post, but you asked for our personal opinions, so here it is. Smiley
28  Games Center / Contests / Re: Ludum Dare 30 (Connected Worlds) on: 2014-08-23 13:15:17
Oh, my suspicions about notch participating were true:

Edit: his internet connection probably can't keep up very well (2.6k+ viewers, if that matters) Tongue
29  Discussions / Miscellaneous Topics / Re: Life is like a strategy game sort off on: 2014-08-06 21:15:16
The fact that " you" can't influence the brain's electrons is a red herring - you are the brain's electrons!

That's funny, since electrons can't do anything on themselves... Smiley:
basically an electron is moved by the forces they exert on each other
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-08-02 10:02:24
How will it become scrap?

It was a joke/sarcasm. Some people think that way... So don't take me too serious Wink

Your memory seems quite slow compared to the other high-end PC's, didn't you pay attention to the CAS Latency?
You have the best processor out there, so I don't understand why that score is so 'low' either, you were probably gaming, watching movies, video-editing, installing windows and recording while doing that test. Wink Or maybe it is because your memory 'under-performs' compared to other desktops (or even your laptop with 18.26) which also has effect on your CPU, your PC is ready for his first upgrade Grin (joking joking joking).
It's (very probably) because the other CPU's are overclocked, so don't worry Wink
Very very good video card though, it should be able to handle Minecraft Wink (You know my bad-joke-habits by now, right? Smiley)
Pages: [1] 2 3 ... 9
BurntPizza (9 views)
2015-10-07 02:11:23

KaiHH (12 views)
2015-10-06 20:22:20

KaiHH (11 views)
2015-10-06 19:41:59

BurntPizza (23 views)
2015-10-06 19:04:48

basil_ (44 views)
2015-09-30 17:04:40

shadowstryker (22 views)
2015-09-29 15:55:06

TheSpaceHedgehog (28 views)
2015-09-29 01:58:48

GamerC4 (54 views)
2015-09-24 21:10:38

GamerC4 (71 views)
2015-09-24 21:09:48

htuy (28 views)
2015-09-24 04:57:24
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!