Live data from Hacker News

LWJGL: Lightweight Java Game Library 3

lwjgl.org

51–60 of 67 posts

Re: LWJGL: Lightweight Java Game Library 3

#51
post #46
post #43

Earlier quoted context omitted.

You don't think it has anything to do with the abstraction and indirection levels that java operates at? Where are these well coded java games that look like something from this decade?

Good Java programmers are better payed to write High Performance Trading systems, than working on games with their low salaries and crazy schedules. Yes, there are some performance issues regarding lack of value types, but not every single game is going to be the next Crysis. Yet it appears by some in the game community that if language X cannot be used for doing Crysis than it is not worth it, let alone that most li…

I've noted this to be true in regards to salary. I've been writing high-performance Java code since years (chewing a few trillion computer files as fast as possible) and we certainly would have switched to anything else such as C++ if it was faster.

Our internal performance testing is ranking Java on par with the C++ implementations of the same algorithm (performance typically flattens until a bottleneck is reached such as disk read speed) or completing the same tasks faster. In one side this is due to the JVM optimizations done automatically, the other side is having developers that understand how to write efficient code. This does require an experienced developer which understands how his code is impacting performance.

For example, avoiding ArrayLists or String objects and learning to use direct arrays or char objects. I can see LWJGL being useful, most particularly to help keep the infrastructure under the same language so that development and long-term maintenance are not a nightmare.

Re: LWJGL: Lightweight Java Game Library 3

#52
post #46
post #43

Earlier quoted context omitted.

You don't think it has anything to do with the abstraction and indirection levels that java operates at? Where are these well coded java games that look like something from this decade?

Good Java programmers are better payed to write High Performance Trading systems, than working on games with their low salaries and crazy schedules. Yes, there are some performance issues regarding lack of value types, but not every single game is going to be the next Crysis. Yet it appears by some in the game community that if language X cannot be used for doing Crysis than it is not worth it, let alone that most li…

> Good Java programmers are better payed to write High Performance Trading systems, than working on games with their low salaries and crazy schedules.

So do good c/c++ programmers, especially now that it's increasingly rarely taught in university and there is less fresh meat coming into the industry, yet games still get made.

> Yes, there are some performance issues regarding lack of value types, but not every single game is going to be the next Crysis.

It's not just value types, it's reference indirection everywhere. You can't declare an array of objects for example, only an array of references to objects, which isn't cache friendly. There are similar issues if you want to actually use many of the features higher level languages come with. It's why java/c# will never be as fast as c.

As far as unity goes, all the heavy lifting in the game engine is still done in c/c++, c# is only used as a scripting language. As far as I understand LWJGL, it is not analogous to unity, it's not a game engine but a low level library to write a game engine with.

Re: LWJGL: Lightweight Java Game Library 3

#53
post #40

Earlier quoted context omitted.

It also performs horribly on a modern Windows PC with a 1070 (wanting to make sure I'm not slandering the game, just double checked with reduced settings, still barely runs). That performance (along with Mincraft's) convinced me personally the JVM isn't a place you want to build a game like that.

It has more to do with the quality of the programmers than with Java. Actually Java and the JVM are the heroes here, because the guys that took over after Notch, just wrote shitty code allocating several hundred MB per second on the game loop. Also the majority of Mincraft plugins are written by kids, whose understanding about how to write game code is nonexistent.

The guys that took over after Notch are Microsoft.

Re: LWJGL: Lightweight Java Game Library 3

#54

Earlier quoted context omitted.

This probably does not qualify as "popular game", but talking about Java games I'd like to mention Terasology ( https://github.com/MovingBlocks/Terasology ). It's an open source voxel game (Minecraft-like) and the LWJGL-based graphics engine looks very impressive to me (some screenshots here: http://terasology.org/gallery.html ).

It also performs horribly on a modern Windows PC with a 1070 (wanting to make sure I'm not slandering the game, just double checked with reduced settings, still barely runs). That performance (along with Mincraft's) convinced me personally the JVM isn't a place you want to build a game like that.

The main reason for those game very poor performance is mainly that they rolled out their own 3d engine.

Having programmed several 3d engine, I can say it's really simple to program a 3d engine but it's really hard and time consuming to program one that has reasonnable performance.

Minecraft was especially bad because it used very old version of OpenGL (the 1.5 - 2.0 OpenGL with fixed pipeline) which is really not adapted to modern GPU.

Re: LWJGL: Lightweight Java Game Library 3

#55
post #34
post #31

Now that the JVM is a multi-programming language platform, I hope things like this become more popular. Kotlin, Frege, Clojure, Fantom, Ceylon, JRuby, etc. There's a language for everyone. So building more value into the JVM with projects like that would be really great. The JVM is probably the most advance VM currently, and hopefully it'll just keep getting better, maybe faster startups with the new module system, h…

co-sign 100%...we are trying to make that polyglot dream a reality with Solvent (codesolvent.com)...using JSR-223 to allow multiple languages to be used for building web apps...you can see demo videos here: http://codesolvent.com/web-dev/

JSR-223 is nothing, compared to what will come with Graal and Truffle. Also since indy and lmf you can already create a lot of fast implementations for a huge set of languages.

Re: LWJGL: Lightweight Java Game Library 3

#56
post #40

Earlier quoted context omitted.

It has more to do with the quality of the programmers than with Java. Actually Java and the JVM are the heroes here, because the guys that took over after Notch, just wrote shitty code allocating several hundred MB per second on the game loop. Also the majority of Mincraft plugins are written by kids, whose understanding about how to write game code is nonexistent.

The guys that took over after Notch are Microsoft.

No you are skipping the part between Notch stop coding Minecraft, the company hiring new developers and only a couple of years later being bought by Microsoft.

Microsoft's first decision was to port everything into C++, which they finished doing this year.

Re: LWJGL: Lightweight Java Game Library 3

#57
post #31

Now that the JVM is a multi-programming language platform, I hope things like this become more popular. Kotlin, Frege, Clojure, Fantom, Ceylon, JRuby, etc. There's a language for everyone. So building more value into the JVM with projects like that would be really great. The JVM is probably the most advance VM currently, and hopefully it'll just keep getting better, maybe faster startups with the new module system, h…

> hopefully in java 9 they add value types

Won't happen in 9. The way it currently looks like there will be a experimental support on the VM-level in 10 and language level support no earlier than 11.

Re: LWJGL: Lightweight Java Game Library 3

#58

Earlier quoted context omitted.

Java, not the jvm may be the issue here. Look at the X10 language for example, which focuses more on array, parallel and numerical performance, but is on the jvm. The issue with Java for voxels is that Java does not have fortran arrays. It because nested objects, so that will give a lot of performance hits for a game built entirely on ndimensional arrays.

That's pretty true for stuff like that you want to use sideways arrays typically, where you decompose the fields in your object to each be in their own array (and sometimes recursively if the fields are themselves objects). With that and avoiding allocation (aka cache invalidation / garbage generation) at all costs you can get things fast.

The java ecosystem offers annotation driven bytecode mangling/generation tools for all kinds of stuff, is there something for "sideways arrays"? The compiler plugin model used by immutables.org (generate a bunch of implementations for the fields implied by an interface) could hopefully make that relatively painless to work with.

Re: LWJGL: Lightweight Java Game Library 3

#59
post #9

Is there a way to use LWJGL for mobile games?

Absolutely. A somewhat higher level library building on lwjgl (2) called libgdx has good documentation and examples on it - The Google Pixel live wallpapers (3D models of places, with some parallax effect) are written using it. There is also a framework called flixel building on top of libgdx, which also has demos for Android.

I think Ingress (by Niantic Labs) is a more prominent project using LibGDX

Re: LWJGL: Lightweight Java Game Library 3

#60
post #52
post #46

Earlier quoted context omitted.

Good Java programmers are better payed to write High Performance Trading systems, than working on games with their low salaries and crazy schedules. Yes, there are some performance issues regarding lack of value types, but not every single game is going to be the next Crysis. Yet it appears by some in the game community that if language X cannot be used for doing Crysis than it is not worth it, let alone that most li…

> Good Java programmers are better payed to write High Performance Trading systems, than working on games with their low salaries and crazy schedules. So do good c/c++ programmers, especially now that it's increasingly rarely taught in university and there is less fresh meat coming into the industry, yet games still get made. > Yes, there are some performance issues regarding lack of value types, but not every single…

> It's why java/c# will never be as fast as c.

C# has value types, added local references and reference returns on C# 7, and they will be adding more features from System C# (Midori) in the 7.1, 7.2 and 8.0 releases.

https://github.com/dotnet/roslyn/blob/master/docs/Language%2...

Microsoft recently did an interview where they admitted they only cared to make their native code compilers for .NET "good enough" and are now planning on changing that.

https://www.infoq.com/articles/high-performance-dotnet

Also .NET Native actually makes use of the same backend as Visual C++.

Java is not yet there with value types, but in about 5 years time, Java 10 will be here with them. They are also available in prototype form today for anyone that wants to play with them.

I wrote my first games on a Timex 2068, since then I have witness and took part in many variations of this subject.

Started with, no serious game programmer would use anything other than Assembly. C, Pascal, Basic, Modula-2 lack the register control, memory layouts, instruction count, ability to self modifying code that Assembly allows for.

Followed by, no serious game programmer would use anything other than C or Pascal. C++ adds too much bloat to make any game worthwhile playing.

Now he are on, no serious game programmer would use anything other than C or C++. Java, C# and other type safe languages will never perform as good as C and C++.

Fact is that the majority of games I see on the stores aren't really AAA pushing the hardware limit, many of which have graphics and gameplay that could have been done with AMOS on an Amiga 500 and people would hardly notice.

> As far as unity goes, all the heavy lifting in the game engine is still done in c/c++, c# is only used as a scripting language

Since IL2CPP got mature some of that C++ code is actually C# code. If you pay attention to the Unite 2016 and 2017 keynotes they are rewriting the not so performance critical components from C++ to C#.

Finally the programming language compilers that come with the games consoles and OS SDKs also play a big role, and games developers tend to stick with what they get with the SDKs.

Post reply on HN