Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
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: http://www.gamasutra.com/view/authors/322755/Sean_O%27Neil.php
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 https://github.com/mattdesl/lwjgl-basics. 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 (http://www.lwjgl.org/wiki/) as well as "Learning Modern 3D Graphics Programing", an excellent - and free - introduction to OpenGL (http://www.arcsynthesis.org/gltut/). 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
1  
(a.compareTo(b) == 0) == (a.equals(b))

(see http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html).

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
1  
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
Moin,
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: http://www.gog.com/en/gamecard/tyrian_2000
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:
http://java.about.com/od/javasyntax/a/nameconventions.htm
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:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
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;
      scene.update(fdelta);
      scene.render(fdelta);
      millisPassed = System.currentTimeMillis();
      calculateFps();
      yield();
   }
}


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>:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
public class Scene implements IScene {

   protected ArrayList<Entity>   entities;

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

[...]

     @Override
   public void update(final float fdelta) {
      for (Entity entity : entities) // <--- isEmpty
         entity.update(fdelta);
   }

   @Override
   public void render(final float fdelta) {
      for (Entity entity : entities)
         entity.render(fdelta);
   }
}


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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
   public void render(final float fdelta) {
      for (IRenderCallback c : renderers)
         c.render(fdelta);
   }

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


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]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 03:59:02

Norakomi (26 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (50 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (75 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!