Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 ... 6
1  Discussions / General Discussions / Re: Most graphically polished (HD)3D games developed in Java? on: 2015-01-21 14:34:51
Unity being based on C# means it very much is a real programming language though...

A "real" language? Is Lua not real? Is JavaScript not real? I don't see why not. The core engine to Unity and most game engines is written in C/C++.

If you write enough Java, you will want to upgrade to something else. Even on the JVM, Scala is a more elegant, fancier, higher level language. I also love Haskell and would like to try writing more serious stuff in that.
2  Discussions / General Discussions / Re: Most graphically polished (HD)3D games developed in Java? on: 2015-01-21 14:31:18
- Java and C# are almost identical at a pure language level. The ecosystems are very different.
- The game engine is probably more important than the programming language. If you want to use jME or libGdx, then you have to use Java. If you want Unity, you have to code in C#. If you want Corona or CryEngine you code in Lua.
- If you want to code straight to OpenGL, without a high level game engine, then you can really choose any language, and Java is relevant.
- If you are really enjoying doing Java programming, that's a reason to stick with that for the time being. If you get sick of it later, you can always change course.
- Coding great graphic games in Java is definitely possible. But great graphically polished games require art talent that most programmers do not have access to.
3  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-17 17:19:36
An interface still can have no kind of member state, so using them as traits is not as straight forward as you might think.

Interfaces can't have variables. So what? They can have getter/setter methods which are almost the same thing. That is basically like Scala traits.
4  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-16 18:22:51
You can "override" extension methods in subclasses. Assuming both of these are available in the current scope:

Point taken. Each approach seems like it could substitute for the other. Neither seem absolutely necessary.

Extension methods have more confusion potential (where did that method come from), but no worse than Scala's implicits.
5  Discussions / General Discussions / Re: Java 8 Default Methods and Multiple Inheritance on: 2014-09-15 16:32:37
... support extension methods, which have the same benefits as default methods, but without polluting the interface. They have their own scope and their own visibility level. You can even define them locally inside another method. So, if you're thinking about designing a system around default methods, what you really want is extension methods.

Extension methods allow


Where in classic Java you would have had to do:

func(oi, param);

The only benefit is arguably IDE code completion. IMO, this value doesn't justify a new feature. default implementations are arguably better because implementations can override behavior

I prefer Haskell's approach where there are no instance methods/functions. You write functions that take parameters, but there is no special "this" parameter. Haskell's analog to interfaces is called "type classes" and they support default function implementations that can be overridden.
6  Game Development / Game Mechanics / Re: Getting into multi-threading. on: 2014-08-25 15:45:49
Hello! I was digging around online and heard something about multi-threaded game loops. Right now mine are single-threaded, and I wanted to know if multi-threading them is the way to go. And if it is, how would I do it?

- Async programming is generally faster than multithreading. Generalize both and you have parallelization.
- Parallelization is critical for server programming. For games, almost everything you write should be thread agnostic.
- Most hobbyist developers expressing interest in parallelization are more interested in the tech itself rather than the applied value.
- If your focus is really games, get your game mostly finished or at least playable. Then if you really want some extra runtime performance, try parallelization techniques.
- If you are really just more interested in threading/async tech than games, then go that direction: in the Java ecosystem I'd suggest understanding Future/Callable/ExecutorService really well. Then ForkJoinPool, understand the Scala extensions to Future/ExecutorService. Understand how you can use flatMap with a Future and then the for comprehension sugar. Understand async vs multithreading. Understand Akka.
7  Discussions / Miscellaneous Topics / Re: Best books for programming in general? on: 2014-08-25 15:35:09
Are there any good educational books on programming conventions/techniques in general? I've been looking into 'Code Complete 2', but it seems kinda drawn-out.

If you want to improve general programming convention/technique, learn Haskell (presuming you have not). Try the book The online version is free. This approach is way more fruitful than reading Code Complete or the like.

8  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-28 20:58:27
No comment on Haskell.   It just isn't suited for system programming.  That whole hammer/nail meme thing.

No comment on Haskell? Followed by a comment on Haskell?

Java + Scala probably aren't suited for real systems programming either. All three are more for applications programming + server programming.

There are definitely advantages to mutability for certain data structures, and while I love Haskell and its extreme immutability, I'm not arguing that that is always the best tool. But for a three integer tuple, I see a completely pareto improvement for immutability with zero drawback.
9  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-26 22:38:56
Zero drawback?  How it's required to be lowered = large drawback.  And yes, a tuple shouldn't require any type definition.

I don't comprehend "How it's required to be lowered = large drawback"

On second thought, a tuple with an optional type alias is a better choice than a distinct type.


// Alias to tuple
type Vec3i = (Int, Int, Int)
// Function
def addVec3i(v1: Vec3i, v2: Vec3i) = (v1._1 + v2._1, v1._2 + v2._2, v1._3 + v2._3)
// Example usage


-- Alias to tuple
type Vec3i = (Int, Int, Int)
-- Function
addVec3i :: Vec3i -> Vec3i -> Vec3i
addVec3i (x1, y1, z1) (x2, y2, z2) = (x1 + x2, y1 + y2, z1 + z2)
-- Example usage
addVec3i (1,2,3) (5,5,5)

10  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-26 15:49:51
Immutable is overrated for hard/soft realtime and system programming.  In many languages you don't even need to define a type for this.

Overrated? There are several advantages and zero drawbacks.

Many languages will let you use a tuple... A simple type is appropriate in a statically typed language. And ideally, it's a single line like Scala/Haskell/others.
11  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-25 21:19:04
Java, Java, Java... structs are way overdo. Why do you allow people to write code like the OP when you can have us write it in 5 lines... maybe less?

struct Troint{
       public int n;
       public int p;
       public int v;

Come on Java, stop holding out on us.  Clueless

- The Scala and Haskell versions in my previous post are way more concise. One line rather than a bulky 5.
- Even in Java, I would write that much more concise. Use immutable final fields and don't bother with getter functions.

    public class Vec3i {
        public final int a1, a2, a3;

        public Vec3i(int a1, int a2, int a3) { this.a1 = a1; this.a2 = a2; this.a3 = a3; }

- The C# version has the disadvantage of being mutable and having really obscure rules around that. C# architect says that this was a mistake in the language:
- C# has internal efficiency advantages with structs over Java, Scala, and Haskell.
- Java 9 will have proper value types in Java, that are fully immutable and runtime efficient. I'm sure Scala will take advantage of this.
- Haskell has newtype and Scala has it's single field value types, but those are limited to single fields. JDK 9 will be better.

12  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-25 16:50:35
And you may be asking yourself, wtf is a TROINT? It's just a Point with 3 coordinates instead of 2 like a normal point. Dealing with Hexagons that is....

Don't make up your own wacky name. It's a Vec3i. Or a Point3i.

You probably should use one of the zillions of existing classes rather than rolling your own, unless you're doing your own engine.

This code highlights Java's flaws in making something so simple, so verbose and filled with lots of details that distract from it's function. Look at the Scala version:

case class Vec3i(val a1: Int, val a2: Int, val a3: Int)

Or the Haskell version:

data Vec3i = Vec3i Int Int Int deriving (Show)

Such a simple type should really be a one-liner.
13  Discussions / General Discussions / Re: [Swing] Can swing look sexy? on: 2014-05-24 22:24:58
JavaFX was originally designed for rich web applications

JavaFX is basically a Swing competitor... It was publicized as a Web-centric RIA platform, which was a failure, but the technology itself isn't tied to the web in any way.

The main problem I had with JavaFX is that it might enable slick 'web-like' looking stuff relatively easily, but Swing always felt much more responsive in more complex GUIs.

I don't believe this at all.

OTOH if you're making GUI-heavy game for the desktop (or some other desktop application that needs to look exotic) for whatever reason and you don't want to go OpenGL, JavaFX might still be a better option though.

Swing and JavaFX are widget frameworks with data grids and buttons and checkboxes; that really doesn't make sense for the majority of games.

If you are making some odd game that uses lots of checkboxes and radio buttons and data app GUI stuff, then sure, go for it, but otherwise, you should use a more appropriate tool.
14  Discussions / General Discussions / Re: FastTuple - fast primitive tuples via bytecode generation on: 2014-05-20 20:40:14
Everybody dealing with performance and throughput cares a lot about configurable identity (it makes mapping possible).

Clarify. I know what maps are but I don't see how the proposed immutable value types inhibit "mapping".
15  Discussions / General Discussions / Re: Libgdx Monogame & backend on: 2014-05-20 20:38:15
But remember while eclipse is loved by many, most game developers across the board do use Visual Studio

Sure, Microsoft tools are dominant, which is why I like this site as one of the very few voices for non-Microsoft centric tool chains.

... BTW, I don't really like Eclipse. I like Gradle/SBT for project definition and builds, and something like IntelliJ for editing/browsing.
16  Discussions / General Discussions / Re: FastTuple - fast primitive tuples via bytecode generation on: 2014-05-20 16:58:03
In hindsight, the C# architects think allowing mutable structs was a bad idea:

The tl;dr version quoted from C# senior architect Eric Lippert:

Once again the moral of the story is: mutable value types are enough pure evil to turn you all into hermit crabs, and therefore should be avoided.
17  Discussions / General Discussions / Re: Libgdx Monogame & backend on: 2014-05-20 16:55:22
Hmm... I really love Eclipse, because you can hot swap code.. I don't know about C# compile times, but C++ seems to take 10 times more time before it starts for me.. Thats another draw back for me Cheesy

C# is closer to Java than C++. It's just the name that is similar. Like JavaScript has a similar name to Java, but the technologies are quite different.

And the title is really misleading.. I thought it will be a how to port libgdx game to monogame, but.. Owell..

Well, it is about how to port your game off of libgdx and get rid of libgdx... I expected this was some Mono backend for libgdx.
18  Discussions / General Discussions / Re: FastTuple - fast primitive tuples via bytecode generation on: 2014-05-20 16:53:02
This isn't mine, but I just saw it on /r/programming and thought I'd share here.


Blog post:

There's been a lot of talk about value types and the like recently, and here's another related development: heterogeneous primitive tuples bia bytecode generation. At least mildly ingenious, what do you guys think?

It's technically impressive, but I wouldn't use it. I would just make do without value types until the next JVM alpha builds are available. I definitely trust the official JVM alpha builds over an amateur effort for correctness, stability, performance, and of course future compatibility. No one will use or support this once the JVM alpha builds have this functionality.

Notice that the linked github project and the linked blog post are all after the JDK architects started making public noise about value types being the next big JDK feature.

Famous JDK architect John Rose from Oracle went public with this on April 30:

BTW, the big difference I see between Java value types and C# structs is the immutability constraint. In hindsight, the C# architects think allowing mutable structs was a bad idea:

Java, is fortunately doing it correctly from the start.

19  Discussions / General Discussions / Re: Libgdx Monogame & backend on: 2014-05-20 16:31:55
From MonoGame's side people have actually already acknowledged how good libgdx is and wrote code and made guides like this: Port a 2D libgdx game to MonoGame

While this is a possibility I am seriously considering, it would be much nicer of course if there was a direct backend.

Since libgdx is very popular and everyone wants a route to PS4, this seems... not that bad.

At the least, the thread title is misleading... This isn't really about making games in libgdx, it's about getting rid of libgdx+Java and replacing with MonoGame/C#/VisualStudio.

You have a point that libgdx+Java doesn't have a good path to PS4, while all the other major engines including Mono, Unity, Unreal, etc do.

Hopefully, the RoboVM guys can flesh out a PS4 production path, like they have with iOS, and give developers options, and let people who want to use libgdx or jMonkeyEngine the choice to do so.
20  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-15 20:38:58
Unity succeeded because of Mono. Mono runs everywhere - really everywhere. It may not exactly be fast everywhere but it's a step up from Python. Java on the other hand is all super fast and whizzy and clever... and unavailable on any console hardware. At least with RoboVM there's iOS support now.

So they got a head start and built a lot of mindshare over many, many years. It's taken them the best part of a decade to get to the point of almost total domination that they currently exist at.

C/C++, Lua, and Haskell run everywhere too. Sure, JVM does not.

Isn't much of Unity internally done in C/C++?
21  Discussions / General Discussions / Re: Is it just me, or does everyone's GUI code look like spaghetti? on: 2014-05-15 16:25:17
- Break large functions/procs into smaller functions/procs
- Code is usually easier to write than it is to read. Especially large code bases.
- If you have lots of functionality, you will have lots of code.
- Study functional programming in languages like Scala/Haskell, if you want some more advanced ideas on code elegance and organization.

22  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-15 16:14:08
Unity is where it's at. We've got a Unity game in development. It makes working with Java like being in the stone age  Emo

Cas Smiley

Wow, for the poster child for Java game development, that's quite a damning statement.

What's stopping competition to Unity? Why not build a Unity competitor?
23  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-07 16:13:29

There's no route from Java to PlayStation, end of. At least not one that is easier than simply porting the entire thing to another language or platform that the PlayStation supports. As it happens we have a C# version running under Mono, but the PlayStation stuff is C++, ported by Curve Studios (and it took them twice as long to port the game as it took us to write it from scratch in the first place in Java - and they had all the design and graphics done for them - food for thought)

Cas Smiley

RoboVM gets Java apps running on iOS. There is nothing stopping that same route from working with PS4. However, the RoboVM guys probably haven't put much effort into PlayStation support.

Why did you do the C#/Mono version? How does that compare to the Java version on Win/Mac/Linux? Why not use the Mono version for PS4 since Mono is baked into the PS4 OS?
24  Games Center / Featured Games / Re: Titan Attacks on: 2014-05-07 00:57:32
Wow, I see this came out for PS4 + PS Vita today!!!

What tech stack does this use? Does this use Java in any way?
25  Discussions / General Discussions / Re: Value Types Proposal for Java on: 2014-05-06 19:56:17
Stack allocated and/or mapped mutable datastructures are invaluable for high performance games

Can you point to an example of such a data structure?

I also can't see myself doing vector math with value types... for every operation you have to figure out how to get the value(s) back to the callsite(s). Without mutable state you'll feel severely restricted, and the game related use cases disappear quickly.

Working with persistent vectors shouldn't be any more difficult than working with immutable ints/floats/doubles. Can you show me a simple code example that illustrates the complexity with persistent types?
26  Discussions / General Discussions / Re: Value Types Proposal for Java on: 2014-05-06 19:35:36
Would be nice to see this in Java 9 or even sooner.

There is no way that they will ship this for pre Java 9.

An issue with the Java 9 proposal seems that value types are 'final' (makes sense), so to use them as structs, the compiler (javac) will do boxing/unboxing like with primitives (since java 5).

value types are "persistent" like Strings or Java 8 date/time types. By "use them as structs", you want traditional field modification. Why? Can't you just write your class like any other persistent class? I don't see where you think Java would do boxing on value types.

I'm not confident it will be usable for games - yet.

I guarantee you that these will be usable for games. Point, vector, matrix would all use this. So would general purpose tuple types. An Optional value type would be useful as well.

The problem with the current proposal seems to be that you can't have pointers/references to value types.

One of the main uses of value types might be in developing complex memory-efficient structures, which is going to need some way to do "pointers to structs"

The main purpose of this whole concept is the efficiency you gain by not having a pointer. For the scenarios where you really need pointers, keep using regular class.

The JVM doesn't allow direct pointers/references to primitives like ints and floats without workarounds. That doesn't seem to be a problem.

Data structures like linked lists require recursive references and fundamentally could not use this value type construct.

has anyone else given it a fine examination?

This looks like C# structs with the big difference being the mandatory requirement of (immutable) persistence.

The official Microsoft guidelines for choosing between classes vs structs ( says only use a struct when:

- It logically represents a single value, similar to primitive types (int, double, etc.).
- It has an instance size under 16 bytes.
- It is immutable.
- It will not have to be boxed frequently.

Microsoft recommends you only use structs with immutable values, but the language doesn't require it. This Java proposal requires persistent immutability. The downside of having large structs is that pass-by-value copy operations become expensive. When the runtime has a guarantee of immutability, it can internally pass by reference instead.

Persistent data structures are inherently thread safe and logically easy to work with, but I don't see what other advantage that requirement provides. There must be some advantage or the Java proposal wouldn't require it, but I don't see what that is.

Even the relatively new tuple classes introduced in C# 4.5 uses regular classes, not structs, just like you would do in current versions of Java. I wonder why?

Also, even third party "Option" types in C# all seem to use classes, not structs. And Scala with its limited value type support, doesn't use value types for Option and implements Option as a regular class.

27  Discussions / General Discussions / Re: Must have Software for Game Creation on: 2014-05-06 18:36:51
Notepad++ (
The bare basics for code editing. Not recommended for serious programmers.

Notepad++ is good, but there are tons of great options. Many swear by a particular editor, but I suspect they are all valid choices, and it's largely personal taste and usage patterns.

Every programmer I know uses a text editor. Even those that use a more full featured IDE use a text editor for working with code snippets, loose scripts, writing notes, and working with text data. Some advanced programmers swear by going IDE-free. I don't. IDEs are particularly important for navigating large code bases.

Netbeans (
Like Eclipse, but developed by Oracle.

There are a few tasks where I prefer Eclipse, a lot where I prefer IntelliJ, but I can't think of any reason to use NetBeans any more.


- Linux or Mac OS. Windows has terrible shell options.
- oh-my-zsh ( A better shell than bash.
- git for version control. Mercurial is fine too. I prefer git simply because it won the "war" for critical mass of this type of hash based open source version control system.
- Gradle for builds. Gradle is a far more cleaner, concise, flexible version of Maven. IDE-specific scripts are terrible.
- pandoc. You should write your docs and notes in some markup format or "markdown" or something similar. Pandoc is excellent at converting to pdf or web.
- Scala. The only good reason to not use Scala is Android, where getting Scala to work is a headache. For desktop work, Scala is a must.
- R + ggplot2. If you need to track any kind of data, or make any type of data plots, this is the best.
28  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-06 03:42:42
What IDE will the team use?
- This is no choose, you need to have eclipse to join the team or this wont work out!.

Why not standardize on one of the great build tools like Gradle or SBT and let devs use any IDE or no IDE?

What version of Java? What is the rest of the tech stack?
29  Discussions / General Discussions / Re: Libraries You Wish For on: 2014-04-06 03:35:36
I'm sure some of you have at some point been annoyed at having to open a file reader with:
new BufferedReader(new InputStreamReader(new FileInputStream(file)));

If you are using Java 7+, you can use the NIO.2 API which is pretty simple:

Files.newBufferedReader(filePath, Charset.defaultCharset());

IMO, the Java community has pretty amazing libraries that cover all the basics.
30  Discussions / General Discussions / Re: The Big Linux Distro Thread on: 2014-04-04 04:07:32
I've used cygwin. I've used msys bash shell on Windows much more heavily. It's distantly inferior to Linux/Mac. First, all Windows GUI apps use "C:\dir\path\file.txt" while the shell uses "/C/dir/path/file.txt" so you have to usually manually convert between the two notations.
Define "distantly inferior".  In what way?  Same source compiled with the same compiler...the only difference is the POSIX glue services.  The filesystem differences are pretty much: so what?  It's true if you directly launch something like bash in cygwin you're not going to get what you expect in terms of GUI, but that's because it's a console app so it's limited by its launching GUI this case  Which we all can agree blows chunks.  So don't do that and launch in it emacs instead if you plan on doing any serious work.

I'm doing quite a bit of work on a Windows VM and I've installed msys Git + Bash. Define "distantly inferior":

- The GUI window for the shell is all crappy and cmd.exe style. To resize the shell window, I have to right click -> props and futz with GUI settings.
- all the main things work: grep works, ls works, find works. but it's less integrated into the rest of the OS. I mentioned the hassle in copy/pasting paths. But Linux is fundamentally designed around a shell something like a bash shell, in Windows it's a foreign transplant. I haven't tried to use Bash more seriously on Windows to articulate more specific details. If I did, I probably would try cygwin instead of msys bash and I would try soft links, which I know exist on Windows with NTFS.

There's no such animal as a "linux shell".  There are POSIX shells and there are UNIX shells.  Linux is a kernel...

You are pedantic, but right. Most people call casually call bash a Linux shell because it is a common default, but you are more technically specific.
Pages: [1] 2 3 ... 6
nelsongames (20 views)
2018-04-24 18:15:36

nelsongames (17 views)
2018-04-24 18:14:32

ivj94 (608 views)
2018-03-24 14:47:39

ivj94 (54 views)
2018-03-24 14:46:31

ivj94 (402 views)
2018-03-24 14:43:53

Solater (66 views)
2018-03-17 05:04:08

nelsongames (111 views)
2018-03-05 17:56:34

Gornova (177 views)
2018-03-02 22:15:33

buddyBro (747 views)
2018-02-28 16:59:18

buddyBro (94 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!