Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (603)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (651)
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]
1  Game Development / Newbie & Debugging Questions / Re: Homemade Java Libraries - Eclipse on: 2013-02-16 20:15:42
1) Create a new project for your library and start coding
2) Open the properties of the project you want to use the library with and go to the "Java Build Path" section (right click on project, then Build Path->Configure Build Path...). Click on the Projects tab and add your library project. If you want to deploy your library with the project check out the Export tab as well. Now you can access the library classes from within your other project.
2  Game Development / Game Mechanics / Re: 128 bit integer on: 2013-02-15 19:42:02
There's a very good series on implementing a real-time procedurally generated universe by Sean O'Neil on gamasutra:
Especially the third part might be an interesting read for you as it deals with problems and solutions of proper scaling.
3  Java Game APIs & Engines / OpenGL Development / Re: OpenGL learning W/O internet access on: 2013-02-10 22:07:42
I can't recommend a good book but I think you absolutely need one that doesn't only serve as an introduction to OpenGL, but also contains a reference part. Most books are targeted towards C(++) programmers, so having a c cheat sheet might be important too if you don't know the language (the OpenGL documentation uses C syntax and types as well).

Apart from that I think it's crucial to have a lot of source code ready to study and tinker with, like You'll certainly find a lot of open source games and other frameworks around the forum that you can download, too.

In your situation it is certainly morally justifiable to use a web crawler, so I recommend you get one for your OS and download the OpenGL documentation, the OpenGL wiki (you should set a reasonable delay between page requests that does not overburden the server), tutorials on the LWJGL wiki ( as well as "Learning Modern 3D Graphics Programing", an excellent - and free - introduction to OpenGL ( Last but not least make sure you have the source and javadoc for LWJGL (usually included in the download).

I hope that helps a bit.
Good luck and don't fall of the boat :~)
4  Game Development / Newbie & Debugging Questions / Re: Best way to handle depth? on: 2013-02-09 12:58:41
TreeMap and TreeSet are like the LinkedList of List implementations... just use PriorityQueue.
Didn't know that one, nice :~)
5  Game Development / Newbie & Debugging Questions / Re: Best way to handle depth? on: 2013-02-09 12:50:36
Avoid Autoboxing like the plague! Change that to an array Entity lists :-P
Why? It's not like you do complex calculations with them, you just use them as hash keys.
6  Game Development / Newbie & Debugging Questions / Re: Best way to handle depth? on: 2013-02-09 12:23:11
To avoid violating the contract make sure that
(a.compareTo(b) == 0) == (a.equals(b))


Populating and sorting a list every frame sounds needlessly expensive to me. You should consider updating such a list only when needed, which I guess would be far less often than every frame.
If you are using OpenGL and you don't need the list for game logic but only for rendering, I'd let the gpu handle that by using a 3d vector for vertex positions, which will automagically render everything in order. Otherwise you should organise your entities in layers as was mentioned earlier. Assuming you use integer depth values this can be as easy as having a
TreeMap<Integer, List<Entity>

where each List<Entity> is a layer. To render you just iterate over the map. Of course you should not have too many different depth values.
7  Games Center / Showcase / Re: Crusaders of Yore on: 2012-02-01 11:54:12
Cool stuff! I like the animations, very cute and smart. I think orientation would be easier if the "back stage" of your dungeon used a different tileset.
8  Discussions / General Discussions / Re: Programming language decisions on: 2012-01-20 15:14:25
Don't mean to interrupt the ongoing war but here are my two cents...

I used to program in C++ because I wanted to have the same toys the big boys play with... Then, in a moment of clarity and after many failures I decided that I could not be trusted with such power and switched to Java. I'm not a computer science graduate and although I known my share of design patterns and the ten commandments of OOP I think I'm just too stupid to write good software in C++. Java on the other hand is a very strict, monolithic language with fixed rules, which is why everything that isn't OOP (entity systems...) is doomed to fail. The rules are sometimes in the way, but for me, this is the reason why I use it: More often than not the true reason for Java being in the way is bad design. I'm a (probably not very skilled) hobby programmer, so of course this does not neccessarily apply to developers who know what they're doing.

Designing interacting, complex systems that know as little as possible about each other is tough. C++ gives you a hundred ways to shoot yourself in the foot and I think I abused most of them for some dumb reason I can't even remember. On the top of that, C++ is actually four languages in one, each one following different conventions and rules: There is C, "basic" C++, the STL and templates... And you HAVE to know all of them if you want to use third party code like SDL, Lua, etc.
9  Games Center / WIP games, tools & toy projects / Re: Flynn Gordon - Yet another Space-Shooter-Beginner-Project :) on: 2012-01-19 17:44:23
twas fun to play although the ship seems to be a bit too slow. Personally, I'd probably scale the sprites up quite a bit to tighten up gameplay and make space more valuable... especially space that is not currently occupied by deadly projectiles. Apart from that I feel the background is too dominant and shouldn't be as bright. The "boss-fight" was cool although more of a chore than a challange as it refused to die in reasonable time :~)

Still, five minutes of my life well spent. Thanks for sharing and good luck!

I tend to like this type of game. Is there a name for this genre?

AFAIK games like these are just called Shoot'em Ups... Maybe you should have a look at Tyrian if you don't know it already:
10  Game Development / Newbie & Debugging Questions / Re: Is this a memory leak or am I just paranoid? on: 2011-06-01 08:28:00
What is with the "I"? Smiley
Yes, that denotes an interface. I tried to use adjectives for interface names but to me it started to look silly pretty soon (for each Updateable do update...). So I ended up using substantives. My problem is that they tend to clash with class names and thats why prefixing interfaces with "I" works for me.

I thought this was pretty common:
11  Game Development / Newbie & Debugging Questions / Re: Is this a memory leak or am I just paranoid? on: 2011-05-31 17:18:49
The garbage collector will not run to clean up just a few KB,  it still has a lot of memory to spend before wanting to run.
Good to know, actually pretty obvious. Thanks for pointing that out.

You will have a program that comes with java called jvisualvm.exe it is extremely useful for figuring out whats going on.
I'll check it out, thanks.
12  Game Development / Newbie & Debugging Questions / Is this a memory leak or am I just paranoid? on: 2011-05-31 13:51:42
Hi everybody,

out of curiosity I monitored the memory usage of my game engine and noticed that it's memory usage rises at a rate of about 4k/second (task manager, Windows 7 x64). So far the program only consists of an entity/component system and a simple game class for testing. Essentially my game loop looks like this:

void gameLoop() {
   if (scene == null) throw new RuntimeException("Critical: Game.scene must not be null.");
   millisPassed = System.currentTimeMillis();
   while (!gameEnd) {
      fdelta = (System.currentTimeMillis() - millisPassed) / 1000f;
      millisPassed = System.currentTimeMillis();

I already found out that when commenting the scene.update and scene.render method calls out the memory usage is constant, but the only thing I do in those methods is iterating over an empty ArrayList<Entity>:

public class Scene implements IScene {

   protected ArrayList<Entity>   entities;

   public Scene() {
      entities = new ArrayList<Entity>();


   public void update(final float fdelta) {
      for (Entity entity : entities) // <--- isEmpty

   public void render(final float fdelta) {
      for (Entity entity : entities)

In their update and render method entities then call the update/render methods of their respective components which do the actual updating/rendering. As already mentioned the program currently iterates over an empty list of entities, so I don't understand why the memory usage increases constantly.
It's not a dramatic increase, from initially 6,000 KB it goes up to 15,000 in about half an hour, but it still concerns me as I assume that it'll be much harder to find the reason for this when my engine is actually doing something.

Here are the Entity's update and render methods:
   public void render(final float fdelta) {
      for (IRenderCallback c : renderers)

   public void update(final float fdelta) {
      for (IUpdateCallback c : updates)

I'm new to java and have no clue if this behaviour is normal or what causes it, so I hope you guys can explain it to me.
Thanks in advance!
Pages: [1]
SHC (11 views)
2015-08-01 03:58:20

Jesse (17 views)
2015-07-29 04:35:27

Riven (38 views)
2015-07-27 16:38:00

Riven (19 views)
2015-07-27 15:35:20

Riven (22 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (32 views)
2015-07-25 00:14:37

BurntPizza (43 views)
2015-07-24 22:06:39

BurntPizza (25 views)
2015-07-24 06:06:53

NoxInc (31 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41: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!