Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (207)
games submitted by our members
Games in WIP (781)
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 ... 41
1  Java Game APIs & Engines / OpenGL Development / Re: Double VBO no performance increase or decrease? on: 2014-01-18 02:49:38
There are other aspects to consider as well.  200,000 calls to Math.random() may be the bottleneck in which case you won't see performance changes from the GPU.  Similarly, you might be fill-rate limited so you won't see performance changes until you reduce screen resolution, overdraw or simplify your fragment shader.
2  Game Development / Newbie & Debugging Questions / Re: Groovy + Java = disaster? on: 2013-11-12 16:59:20
Try using IntelliJ? It's handling of Maven is far better, and I've had success with it handling projects with sub-modules and mixed Java/groovy source.
3  Game Development / Shared Code / Re: Entreri 1.7 Released (Entity-Component Framework) on: 2013-07-16 14:22:41
Although Artemis and Entreri originally started out having a similar API, Entreri has evolved in a significantly different direction.  The reason for this is that underlying component data is packed efficiently into primitive arrays that provides better guarantees for cache locality if used carefully.  Components are defined as interfaces, which IMO reduces the amount of boilerplate that you have to write and helps ensure the principles of data-only components are followed.

That being said, I haven't performed any official benchmarks yet because I am interested more in real application performance.  Often in micro-benchmarks, garbage collection doesn't kick which means lists of objects haven't been moved around in the heap and actually have quite good cache locality.  Anecdotally when doing tests between an old version of entreri (that was structured more like artemis) and the new entreri, data packing seemed responsible for a 2-4X performance improvement.  These performance advantages are less noticeable for small entity counts, but entreri scales very gracefully to tens of thousands while still giving very good performance (it won't be the bottleneck at that point).
4  Game Development / Shared Code / Re: Entreri 1.7 Released (Entity-Component Framework) on: 2013-05-22 04:06:04
Oh yeah, that's a typo, I was fussing back and forth about calling it Player or Location. Edited it to be correct.  Yes, the interfaces get implementations generated by annotation processing such that every bean method pair defines a "property" which is backed by a primitive array. The component implementations just get an index into that, so iterating over the component data of a particular type is very efficient and cache friendly.

And I should mention that the annotation processor would raise an error if my mistake was made in the actual code base.
5  Game Development / Shared Code / Re: Entreri 1.7 Released (Entity-Component Framework) on: 2013-05-20 13:26:11
Thanks for the comments; I know besides Ashley there is also another one called Ash. I think it's a general library thing though because you've also got things like Kryo and Slick. Artemis was my original inspiration and has since diverged pretty heavily but there is a fiction character named Artemis Entreri that I used to like, also it sounds kind of like Entity.

Gousseg,  this API still packs everything into primitive arrays, it just does it for you so it's less error prone and your code looks much cleaner.  In general, even entity libraries that don't do this still get you to think about your code in a novel way that can improve it.  I think this is like how learning a functional language can help your OO programming even when you don't program functionally directly.
6  Game Development / Shared Code / Entreri 1.7 Released (Entity-Component Framework) on: 2013-05-19 07:31:07
Hi guys!

It's been quite a while since I've posted but I've been lurking regularly as I finished up my first year of grad school. The big news now is that I've released a significant update to my entity-component framework: and I posted previously about an earlier version of Entreri:

You guys gave me some good feedback, mostly about scariness of strict component definition rules I had imposed.  After some significant revisions, I've updated it to allow you to define your component types as Java bean interfaces, and then an annotation processor to generate the implementation that uses a mapped-object model for performance.

As an example, I could define two components as follows:
public interface Location extends Component {
   public float getX();
   public Location setX(float v); // automatically returns this component

   public float getY();
   public Location setY(float v); // ""

public interface Health extends Component {
   public int getHealth();
   public Health setHealth(int v);

Then using these components would look along these lines:
EntitySystem system = EntitySystem.Factory.create();
Entity player = system.addEntity();

// .. later in your main loop ..
// this shows how to iterate over all entities with a single component type,
// and it uses a flyweight instance for faster iteration over the underlying data
ComponentIterator checkForDead = system.fastIterator();
Health flyweightInstance = checkForDead.addRequired(Health.class);

while( {
   if (flyweightInstance.getHealth() <= 0) {

Other new features include a parent-child hierarchy model that makes it easy to have one entity for the player, and another entity for its weapon and link them so that deleting the player entity will automatically delete the weapon. Another is a multi-threaded job/task API that tries to make simple parallelization easy to do without much thought, such as splitting the rendering and physics tasks onto separate threads with minimal synchronization.

I'd love to hear more feedback, and hopefully get people who have had experience with other libraries such as Artemis, or Ash, to give it a comparison.

7  Discussions / General Discussions / Re: I Switched to IDEA! on: 2013-03-09 21:04:52
Idea's maven and VCS integration is a lot nicer and native compared to the plugins that Eclipse makes you use.

I switched just recently, and the weirdest thing for me to get used to is not needing to save files.
8  Java Game APIs & Engines / OpenGL Development / Re: Altering an already bound texture on: 2013-01-04 17:24:50
** EDIT: This answer is more OpenGL than Slick oriented **

If it's a solid tint over the entire quad/triangle, you can do it with the texture environment and color of the vertices. Just set the environment to MODULATE and change the vertex color and you should see a tint without having to mutate the texture object (this also means you can tint different meshes separately without re-tinting the texture).

You can also use the BLEND and BLEND_COLOR environment options to specifically tint the texture regardless of what the vertex color has been configured as.
9  Java Game APIs & Engines / Java 2D / Re: Use drawLine to render a bullet(Slick2D). on: 2012-12-29 10:17:37
But but the angles, we need to use the radians stat or the cosines will get lonely!
10  Game Development / Shared Code / Re: OpenGL lightning fast (managed) VBO mapping on: 2012-12-21 18:35:37
I remember reading that you could effectively detach data from a VBO by calling glBufferData(target, null).  The GPU would continue using the previous block of data to complete rendering, but any data manipulation commands would use the new block assigned with the glBufferData call.

Have you tried this at all?
11  Discussions / General Discussions / Re: URL available (?) on: 2012-12-03 06:54:29
12  Discussions / General Discussions / Re: URL available (?) on: 2012-12-03 03:43:02
I am attempting to placate you, much like a cultist praying to Yogsethoth.
13  Discussions / General Discussions / Re: URL available (?) on: 2012-12-02 04:44:36
Well it is now redirecting for me now, too, so yesterday I was crazy.  In my defense, I've been using a hotel's internet service :/

It is nice to hear your opinion on the matter, Riven, and seems fair. Not that fair is an important detail for our glorious leader.
14  Discussions / General Discussions / URL available (?) on: 2012-12-01 04:12:46
When visiting instead of, it no longer redirects to the current domain name for JGO and shoes a for-sale page by go-daddy  Does this mean that:
A. I am, or my current DNS, is crazy
B. It's not really go-daddy and has been hacked
C. We could actually purchase because Oracle/Sun has given it up

15  Game Development / Game Play & Game Design / Re: Quadtree-like structure for dynamic / moving Game Objects on: 2012-11-21 01:26:23
I'm sure you could, but I haven't implemented that yet. Since it can support generic perspective frustums with arbitrary right/left, top/bottom values, I should assume it's possible.
16  Game Development / Game Play & Game Design / Re: Quadtree-like structure for dynamic / moving Game Objects on: 2012-11-20 22:47:40
It's a quadtree built on top of a grid.
Uh, it's a a quadtree without the quadtreey parts?

No, it uses a grid structure for inserts/removals from the spatial index, intersecting pair queries, and AABB queries. Then a quadtree is built on top of the grid and stored in a single int array; this is possible because it's a complete tree, where the leaves map to the grid cells.

The reason I brought this up was because I implemented it to be a structure that worked well with dynamic objects.  Both the grid and quadtree array can be cleared quite quickly, and building the quadtree up from the grid is more efficient than building the tree top-down.  In my game system, I then clear the tree each frame, possible updating what its extents are, and then re-insert every object.
17  Game Development / Game Play & Game Design / Re: Quadtree-like structure for dynamic / moving Game Objects on: 2012-11-20 22:17:39
Checkout my quadtree implementation:

It's a quadtree built on top of a grid.
18  Game Development / Performance Tuning / Re: Awesome SAT! 7-8 ms for 60k objects. on: 2012-11-19 02:18:53
1 million at 97ms
19  Java Game APIs & Engines / OpenGL Development / Re: Problems with OpenGL VBOs on: 2012-11-02 01:56:53
Your element size and strides don't make any sense in glColorPointer and glVertexPointer.  In both cases, your element size is 3 (red/green/blue and x/y/z).  Since each consecutive attribute immediately follows the previous, your stride should be 0 (not 4 << 2, which is 16 btw).
20  Discussions / General Discussions / Re: Java is pretty cool on: 2012-10-18 06:04:05
Reasons why I don't like Python, and why Java blows it out of the water:
1. Global interpreter lock, makes multithreading a huge pain. You could just fork, but their GC model breaks the copy-on-write policy used to make forking worth it.
2. Not statically typed. It is a huge pain to work in 50,000 lines of python with multiple people and not have static type checking.
3. I hate their dependency/library management system.

Reasons why Python is cool:
1. Duck-typing is pretty nifty
2. First class functions
3. List comprehensions
21  Discussions / General Discussions / Re: Tremble, mortals! I have enslaved your administrator on: 2012-10-02 05:58:13
Congrats, may your combined madnesses create beautiful things
22  Java Game APIs & Engines / OpenGL Development / Re: Lighting GLSL on: 2012-09-25 22:33:56
The light position is transformed by the current state of the model view matrix and those transformed values are what you see in the GLSL shader.

The effects that you might see depend on what matrix you've set before you call glLight().  If you have the identify matrix, and then call glLight(), and then perform your rendering, the light position you specified is already in "eye" space and it will move along with the camera.

If you set the matrix to the view's inverse transform, and then call glLight(), the light's position you specified is in "world" space and should be fixed.

If you set the matrix to the view inverse multiplied with the model matrix of an object, and then call glLight(), the light's position will be in "model" space and will move along with the object.

It sounds like you're having the first problem where you set the light position too soon, which is odd since you claim to be setting it after you translate the model view matrix.  I'd double check the flow of your operations to make sure you are doing it in the right order.  It might help me to see the rest of your Java code that sets everything up too.

As an aside, what type of diffuse light are you trying to simulate? An infinite direction light or a point light?
23  Discussions / General Discussions / Re: double-checked locking... in the JDK core?! on: 2012-09-05 17:33:30
Here is an example where threads can see half-constructed instances:
class MyReallyDumbType {
   private OtherObject dep;

   MyReallyDumbConstructor() {
      dep = new OtherObject();
      new Thread(new Runnable() {
         public void run() {
            // start modifying dep here

Here, without any synchronization or volatile going on, the 2nd thread might have an inconsistent view of the memory modified by the first thread.  Although thread 1 sees dep's reference fully constructed, thread 2 might only have seen the assignment to the dep variable, and not the memory initialized by OtherObject's constructor. 

So in that rare situation, thread 2 sees a partially constructed object.

Going back to the original, bad double-checked lock in Math.random(), the problem is that the first check against the randomNumberGenerator field is not synchronized. The calling thread could see a non-null reference written by another thread that just completed initRNG() and think it doesn't need to instantiate the RNG.  Since there was no synchronization, though, the actual instance might be in an inconsistent state to the calling thread and all bets of correctness are off.
24  Java Game APIs & Engines / OpenGL Development / Re: Compressing vertex normals on: 2012-07-30 02:11:25
Reading your problem from, it sounds like compressing normals isn't really the best solution to your problem.  If you have that much terrain data, but only a small amount of it is visible, you have a prime candidate for culling and LOD.  That way you only really have to swap in the high-detail geometry for the small area around the player and the distance rendering uses a simpler mesh.  If you combine this with normal mapping, it will be very likely nobody can notice it.

If you're set on compressing the coordinates, you might look into using the integer vertex attribute types, but that might require masks and shifts and I can't recall how well that's supported (or if it's even available in the newer shader models).  I'm pretty sure that the floating point attributes are a fixed size, unlike with texture formats.

If you use object space normals in a normal map, then you don't need vertex normals, and then you can compress those into a 2 component texture and reconstruct the z value.
25  Game Development / Shared Code / Re: MappedObject library on: 2012-07-24 06:34:22
Wait, I made a public maven repository, I thought by doing that I actually went through the hassle - believe me, it was. And now you insinuate I didn't bother.
You didn't go through the hassle of getting your library hosted on the Maven central repository (which is managed by Sonatype). It's "nice" to host things on the central repository because all Maven projects will check that location for libraries. With your way, we have to update our own project to use the additional repository Tongue

I use Maven quite a bit with work and really like it, and it sounds like some people have misconceptions or just don't know much about Maven so here's my take on what it can do and why it's cuddly:

Maven is a combined dependency management system and project build/lifecycle manager.  The build system is powerful but can be largely ignored if conventions are followed.  The dependency manager is nice because it forces you to document the exact libraries AND their versions that you depend on. As said before, it will download the JARs for those dependencies, and the JARs of any transitive dependencies, etc.  It will also resolve as best version conflicts between dependencies.

At work before Maven, my classpaths might grow to 50 jars in some of our servers, with libraries I'd never use personally but were a dependency. If I wanted to update Struts or Hibernate, it was a very bug prone hassle to try and get the correct new versions of their dependencies.  This is trivially easy to do with Maven and should not be sneezed at.  I doubt my games will ever need that many dependencies, but it's still nice to have as a feature.

There is a very nice Maven plugin for Eclipse so you still create your project through Eclipse (just a different type than plain Java). Eclipse still does all of the compiling and it can still do its magic classpath sharing between projects (even other Maven ones in your workspace). The plugin will automatically download the Javadocs and source associated with a dependency when you go to inspect an element, and links it for you into the normal Eclipse source inspection system.

By the time you need to build your final application, you might have to mess with some XML funny business, but there's a good chance you'd have done that with ant.  Maven has much better fat-jar support compared with Eclipse.

IMO Maven helps keep your own projects more modularized because you can split them into separate modules. Do you have custom math functions and vectors, etc. It's a module. Physics library or helper code; it's a module. Input system or event system, or core AI routines? Module. Then you can have them depend on each other as needed, and have a last module that brings them all together and implements your game.

Want to make a new game, just pull in your modules you want to reuse instead of trying to gut pieces by hand.
26  Game Development / Shared Code / Re: MappedObject library on: 2012-07-22 00:03:44
It's not too bad, I've drunk the Maven cool-aid and although it infects everything you do, I don't find I'm bothered by it.
27  Discussions / Business and Project Management Discussions / Re: DRM on: 2012-07-10 07:40:03
Steam was created for Half Life 2.  HL1 used pretty much standard CD key systems without any internet activation IIRC.

I read Half life and instantly thought Steam :/ didn't stop to think about the timeline.
28  Discussions / Business and Project Management Discussions / Re: DRM on: 2012-07-10 01:05:54
I mean, how did this work back then, when you bought Half life 1, which came on 3 discs with a serial key ?

I think it was a key that got linked to your steam account, and then the DRM was tied to logging in with steam, and that is basically like how I described above.  It auto-logs in and remembers credentials locally, which is convenient, and is fine for DRM purposes since it really only needs to stop multi-comp logins.
29  Discussions / Business and Project Management Discussions / Re: DRM on: 2012-07-10 00:37:04
Just have them create accounts so they have to log in before they play. Then it doesn't matter how many times they copy it since you can just allow one authentication at a time.

If you're worried about people wanting to play offline, just keep them "logged in" for an hour if they disconnect without going through the proper protocols.  That way that can't just unplug their comp and let someone else log in.
30  Game Development / Newbie & Debugging Questions / Re: FREE .ms3d ANIMATED LOADER! [also a little help?] on: 2012-07-08 18:10:14
My problem (and the reason for the cranky post last night) was that this isn't really a gift. 90% of the reason he's releasing the code is so someone else can solve his problems.  This appears to be a valuable project, so he ought to use bitbucket, googlecode or github to create an opensource project for it.

Then the help he gets is contributions, but we know he's serious about actually sharing it. Instead it looks like he got stuck, and instead of coming back a few days with progress to show he's still trying to solve it, we get a bump. It looks like he is expecting us to lay down our own work, dig through his code, and then solve his problems while he relaxes.
Pages: [1] 2 3 ... 41
Galdo (321 views)
2017-01-12 13:44:09

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

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

0AndrewShepherd0 (881 views)
2016-12-15 21:50:57

Lunch (1013 views)
2016-12-06 16:01:40

ral0r2 (1246 views)
2016-11-23 16:08:26

ClaasJG (1343 views)
2016-11-10 17:36:32

CoffeeChemist (1357 views)
2016-11-05 00:46:53

jay4842 (1439 views)
2016-11-01 19:04:52

theagentd (1228 views)
2016-10-24 17:51:53
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!