Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 ... 88
1  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-17 11:21:06
An interface still can have no kind of member state, so using them as traits is not as straight forward as you might think.
Came across this article, which describes a possible implementation for Mixins and how to workaround this limitation.
2  Discussions / General Discussions / Java 8 Default Methods and Multiple Inheritance on: 2014-09-15 13:30:29
As most of you are probably aware 'default interface methods' was one of the new features introduced in Java 8. The stated purpose of such a feature seems to be to allow extending existing interfaces without breaking backward compatibility.

However since its now part of the core language I've been thinking that such a feature could potentially be pretty useful for other use cases such as implementing a clean and lightweight entity component systems (such as those described by Adam Martin).

You could for example have code like the following:

1  
2  
3  
public class Ship implements Logic, Render, Collision {
...
}


You would just implement the interfaces/components each class/entity would need. You then only need to override a few default methods as needed and the bulk of code can be contained in the interfaces/components. Using Java's 'instanceof' you can easily tell which class implements which types of interfaces/components.

As far as I can tell, this type of usage would potentially allows faster, smaller, cleaner and more flexible code for these types of use cases. However many articles recommend against such usage and consider it an abuse of the feature.

Not really found any detailed discussion on the topic, so wanted to get some opinions on such usage or if others have been using default methods in a similar way?
3  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-10 06:40:45
The bean-counter in my head can't come up with an equation where 2b makes sense.  There'd need to be some secret plan to make more than that back that isn't insane wishful thinking.  While it's true that some web calendar thing sold for a couple hundred mill in the 90s....but that was the 90s when everything tech was nuts.
Do keep in mind that there is a Minecraft movie in the works and its being written by the people that did the Lego movie (which was really well done and has made over $1/2 billion on a budget of just $60m).

Add in media franchising (toys, lunch boxes, books, etc) which can make more money then the movie if done right. Further add in a Minecraft game sequel (possibly even a movie sequel or two) and the benefits to the XBOX brand for having an exclusive like Minecraft. Then its not too far fetched for a company like Microsoft to make its $2 billion back.
4  Games Center / Featured Games / Re: Altitude on: 2014-09-08 21:44:55
Just noticed that this game is now free to play on Steam, Windows, Mac and Linux link.
5  Games Center / Cube World Projects / Re: Open source cube world projects on: 2014-09-08 10:21:47
Terasology is a nice open source clone.

If you are looking to learn then the best way would be to start from scratch rather than learning from an already complex code base. Learn to draw a simple opengl textured cube. Thereafter its mostly just about implementing voxel optimisations to allow you to draw lots of them. There are plenty of tutorials covering such techniques.
6  Discussions / General Discussions / Re: String deduplication coming in Java8U20 in the G1 GC on: 2014-09-03 10:19:07
So far I've not seen any convincing arguments in favour of the G1 garbage collector being that much better than the default CMS collector for real time games (in fact some here have mentioned that CMS is still better).

It seems a lot of these optimisations are aimed at server side applications rather than real world desktop applications.
7  Game Development / Newbie & Debugging Questions / Re: Take shortest rotation on: 2014-09-03 09:35:39
If working with angles in degrees, I usually use the code below for this problem.

1  
2  
3  
4  
public static boolean rotateCounterClockwise(float currentAngle, float targetAngle) {
      float diff = (currentAngle - targetAngle) % 360;
      return diff > 0 ? diff < 180 : diff < -180;
}


Simply put in the current angle and the target angle you want to face, and it will return the direction which is shortest i.e. true if you should rotate counter clockwise or false if you should rotate clockwise.
8  Discussions / General Discussions / Re: dart on: 2014-08-28 09:31:25
The idea is that a stricter language than javascript could allow for better compiler optimization. Though I doubt Dart itself will become huge, I could see another language, or some changes to Javascript (a 'use strict' type mode) coming out of the idea of Dart.
asm.js is practically that, this strict subset of javascript is already optimised by browsers like firefox and chrome. Reports state that it already runs at about half the speed of native code.

Its been hugely popular (along with Emscripten) as the tech used to port some of the big C/C++ game engines (unreal, unity, etc) to html5/webgl.
9  Game Development / Newbie & Debugging Questions / Re: Slick2D&LWJGL Font Rendering on: 2014-08-24 11:16:28
If i was to guess, i'd say you are disabling textures before drawing the slick text, try enable them using glEnable(GL_TEXTURE_2D); before you draw.
10  Game Development / Newbie & Debugging Questions / Re: Struggling to get going with 3D libraries + JavaFX on: 2014-08-21 09:48:37
Another option you could consider is using one of the many GUI libraries that work inside OpenGL, some good options include TWL and LibGDX's Scene2D UI.

I know some people prefer native frameworks rather than a GUI running inside OpenGL, but in the long run you get a lot more flexibility, better integration with OpenGL and doesn't break the atmosphere of your game (probably why all AAA titles use in game GUI's).

Integrating OpenGL with GUI frameworks which and not designed for such integration (Swing, AWT, JavaFX, etc), especially if they themselves have their own OpenGL backends or hardware accelerated paths is always problematic and you'll have to jump through various hoops to get it to work properly (if at all).
11  Discussions / Miscellaneous Topics / Re: A rant on OpenGL's future on: 2014-08-14 20:11:12
interestingly see this news story: AMD Offers Mantle For OpenGL-Next
12  Discussions / Miscellaneous Topics / Re: A rant on OpenGL's future on: 2014-08-11 17:08:08
a ground up rewrite for OpenGL sounds great (and long overdue) and they seem to have ticked all the right boxes, however judging by the description of how they intend to work with so many parties and being aimed at mobile, desktop and console platforms (and probably the web), I'm guessing it'll be a couple of years before they get anywhere (e.g. html5).
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-08-05 20:35:24
Started animating some sprites:
Cheers,

Kev
Really nice work, your art is definitely getting really good, that last animation has a nice 3d looking effect on that spear movement.
14  Game Development / Newbie & Debugging Questions / Re: Should I move to LWJGL on: 2014-08-04 11:54:51
I'd also recommend you stick with LibGDX, not liking the starter LibGDX classes isn't a  very good reason to switch (you could always wrap them with your own API).

With LWJGL you'll have to write your own starter classes and rewrite much of the utility code that LibGDX already provides (which is time you could probably better spend on a game). In any event switching could be a fun learning exercise if you enjoy writing engine/library code rather than actual game code.
15  Discussions / General Discussions / Re: So... state of the art 3D "engines" in Java on: 2014-07-30 15:32:44
Then, what is it? JMonkeyEngine showcase
http://jmonkeyengine.org/showcase/
Most of those listed there are tech demo's, using old engine code, abandoned, unfinished or WIP's.
16  Discussions / General Discussions / Re: So... state of the art 3D "engines" in Java on: 2014-07-30 14:28:18
IMO 3D engines written from scratch to be 3d engines without being driven by an actual game are rarely very good or useful. All the best engines UnrealEngine, idTech, Source Engine, etc all started of as code for actual games, the reusable parts and tools of which were later re-factored into the standalone engines they are today and continue to be developed by needs of actual products. The development of the above mentioned 3d java engines aren't really driven by any (or many) actual products or companies that use them.

One choice that is rarely mentioned but might be worth looking into is Clyde (seems more like a collection of useful libraries rather than a full blown engine). Its the code that powers the impressive looking Spiral Knights, contains all the useful bits like GUI, working MMO networking code, distribution, model loading, maths, etc.
17  Games Center / WIP games, tools & toy projects / Re: [Slick2D] JavaRA - Command&Conquer: Red Alert with taste of Java on: 2014-07-15 16:49:54
This project looks really cool. If memory serves me correctly, something doesn't look right about the lightning coming out your tesla coils when compared to the original game. Your lightning seem to have a straight/diagonal movement look while the original game had more random and natural looking lightning. Anyway really nice work.
18  Discussions / Miscellaneous Topics / Re: VMKit (maybe) not dead on: 2014-06-17 11:52:36
hmm the VMKit repo shows the last change on the main branch was 6 months ago and the latest change is 4 months ago on one of the branches.

Anyway VMKit still has a way to go (e.g. no Windows support!) when compared to other solutions like Avian and RoboVM but still might be nice to someday have an easy path to compile Java (and other VM languages) to something like Emscripten/Asm.js.
19  Discussions / General Discussions / Re: Libgdx Monogame & backend on: 2014-05-20 22:52:37
IntelliJ changed my life!
Although personally use Eclipse, IntelliJ's has some really cool features e.g:

20  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-16 09:38:59
Theoretically, you could write a Java library that maps to the Unity3D C# API. You could then write your game entirely in Java using Java tools. When ready to deploy, convert the java bytecode to a CLR dll using IKVM. Then just use this dll with Unity3D as normal and create an output for one of Unity3D's supported platforms. Although seems doable it would be a ton of work.
21  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-15 13:30:39
isn't this what IKVM does?
22  Games Center / Showcase / Re: Super Spineboy on: 2014-05-09 16:30:29
love the exploding alien brains, really nice touch Smiley
23  Discussions / General Discussions / Re: Embedded JVM for Windows Native Deployment seems viable on: 2014-05-08 21:37:07
btw in case you missed it, do check out Java 8's Compact Profiles, there is a blog post about it here. Compact Profile 1 is suppose to be less than 14mb in size.
24  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-08 09:34:42
Just curious, wouldn't it be more cost effective to pay a programmer to port something like RoboVM to PlayStation (or at least enough of it to run your games) rather than paying someone to port each individual game to another language (at least four games atm right?) and again for any updates. It'd reduce development time, allow faster times to market and allow working from a single code base.

Plus since it'd be a generic solution you could even recoup some of that development cost by licensing the code out to other java/android devs (say $5k or 10k each game).

Lastly after an exclusivity period, open source it for a little fame, glory, good company rep and for others to maintain Smiley
25  Game Development / Game Mechanics / Re: Moving at a constant speed along a Bézier Curve on: 2014-05-05 15:11:25
I use Hermite splines.
just curious, why Hermite curves over Bézier curves? Noticed a lot of people using them, is there some extra advantage in using them?
26  Game Development / Newbie & Debugging Questions / Re: Exporting with JarSplice and LWJGL on: 2014-05-05 10:58:38
So nothing is printed when you run it from the command line?
27  Game Development / Game Mechanics / Re: Moving at a constant speed along a Bézier Curve on: 2014-05-05 10:55:01
You used my code, about 6 years ago, which used a whole ton of lookup tables and memory. There are no shortcuts, as far as I know.
Yup remember that super awesome spline class well (still have it in my workspace), used it many times and would probably use it again here if I could, however limited to working with quadratic bezier curves directly in this case.

Cool, that looks like pretty much what I need, some pretty dense math representation of the formula's there though, will see if I can write some code from it.
28  Game Development / Newbie & Debugging Questions / Re: Exporting with JarSplice and LWJGL on: 2014-05-05 10:47:22
My guess is that lwjgl-debug.jar and lwjgl.jar both contain all lwjgl's classes.
That is correct, don't use both those jars, use either one but not both at the same time. lwjgl-debug.jar is useful when looking for opengl errors, otherwise use the plain lwjgl.jar.

Further you also have both slick-util.jar and slick.jar on the classpath. slick-util.jar is a subset of slick.jar so it'll contain duplicate classes, so use only one of those.

Also noticed that you have AppleJavaExtension.jar on the classpath, you probably don't need that as its only useful when compiling LWJGL.

Further you probably don't need lwjgl_util_applet.jar and lzma.jar on the classpath as they are used only for LWJGL web applets.

You also probably don't want lwjgl_test.jar since that only contains lwjgl test classes, so unless you are trying to run one to those you should remove it too.

Lastly its unlikely that you need asm-debug-all.jar unless you are using it in your app or using the Mapped stuff from lwjgl_util.jar.

As for not running as mentioned above by Riven, run it in the command line (using "java -jar yourjar.jar"), and post the output.
29  Game Development / Game Mechanics / Moving at a constant speed along a Bézier Curve on: 2014-05-04 17:09:45
I've been playing with quadratic bezier curves recently, its easy enough to draw and get the points along it using something like:

1  
2  
float x = (1 - t) * (1 - t) * startX + 2 * (1 - t) * t * cx + t * t * endX;
float y = (1 - t) * (1 - t) * startY + 2 * (1 - t) * t * cy + t * t * endY;


Where start/end is the beginning/end point on the curve and c being the control point.

t is a value between 0 and 1 which can be used to move along the curve, 0 being the start and 1 being the end, however the problem is that this value can't be used to move along the curve at a constant speed since t=0.5 is not necessarily at the middle of the curve or t=0.25 the first quarter.

I've got an approximation of the length of the curve using

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
public float getApproxLength() {
      float t = 0;
      length = 0; // reset length
     
      float oldX = startX;
      float oldY = startY;
     
      // scroll through curve and update length
     for (int i = 0; i < 100; i++) {
         t += 0.01f;
         
         float x = (1 - t) * (1 - t) * startX + 2 * (1 - t) * t * cx1 + t * t * endX;
         float y = (1 - t) * (1 - t) * startY + 2 * (1 - t) * t * cy1 + t * t * endY;
         
         length += getLineLength(x, y, oldX, oldY);
         
         oldX = x;
         oldY = y;
      }
     
      return length;
   }


Are there any easy solutions to achieve this other than to use a whole ton of look up tables and memory? doesn't need to be super accurate just something good enough to get a decent constant looking movement along the curve.
30  Discussions / General Discussions / Re: Anyone remember this game? on: 2014-05-04 13:30:39
'Fort Apocalypse' maybe?
Pages: [1] 2 3 ... 88
 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (16 views)
2014-09-19 03:14:18

Dwinin (34 views)
2014-09-12 09:08:26

Norakomi (61 views)
2014-09-10 13:57:51

TehJavaDev (83 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (64 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (39 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!