News for hackers. Stuff that matters.
Re:Minecraft arrives on the Nintendo Switch by ungzd on Friday May 12, 2017 @11:25AM (#14324805)
Why Java doesn't work on Nintendo Switch? Only for political reasons (forbidden by Nintendo)? They fear JIT or GC?
Re:Minecraft arrives on the Nintendo Switch by PhasmaFelis on Friday May 12, 2017 @02:16PM (#14326399)
Java is a horribly inefficient language for gaming. Every console and mobile port of Minecraft has been written in C++, and Microsoft is working on getting their Windows C++ version up to speed. It has nothing to do with Nintendo.
Re:Minecraft arrives on the Nintendo Switch by webkike on Friday May 12, 2017 @11:52AM (#14325049)
GC is the killer of hard real time constraints
Re:Minecraft arrives on the Nintendo Switch by BoorishBears on Friday May 12, 2017 @11:57AM (#14325087)
GC doesn't kill constraints for games. Unity3D games have been dealing with the GC for ages now, it's not that bad. Cautious use of memory allocations and calling the GC at convenient times go a long way. But on the other hand Java doesn't have value types, which is pretty terrible.
Re:Minecraft arrives on the Nintendo Switch by glenneroo on Friday May 12, 2017 @12:33PM (#14325425)
I can only speak for Kerbal Space Program, but Unity 5's GC causes stutters on many people's systems, regardless how much RAM is available. There is a wonderful plugin called MemGraph[0] which lets you view GC events and more importantly, to change the time and frequency of GC activation, which has almost completely alleviated stuttering on many systems (my own included).

[0]http://forum.kerbalspaceprogram.com/index.php?/topic/139128-...

Re:Minecraft arrives on the Nintendo Switch by BoorishBears on Friday May 12, 2017 @01:34PM (#14325963)
Working with the GC is definitely tricky, but I think it's a feature that works well for the majority of the games made with Unity and really only rears it's head in specific types of games of a specific size. Saying it kills realtime constraints for gaming is definitely a stretch. Open world games with no transitions for example, leave little room for natural GC calls, where as level based games can do things like call the GC at the start of each level and carefully budget allocations through out the level.
Re:Minecraft arrives on the Nintendo Switch by ferongr on Friday May 12, 2017 @02:04PM (#14326283)
The "majority" of games made in Unity are very constrained mechanically and developers have control over the complete experience.
Re:Minecraft arrives on the Nintendo Switch by Thaxll on Friday May 12, 2017 @12:05PM (#14325166)
Yes it kills it, there is no big AAA game running on Unity, try to do a Battlefield like game with a GC language where every ms count.
Re:Minecraft arrives on the Nintendo Switch by BoorishBears on Friday May 12, 2017 @01:30PM (#14325928)
That's actually exactly my point, "kills real time constraints" is very strong language, you end up having to look at AAA games the size of Battlefield to see where it falls short. Minecraft-like games with similar voxel rendering can, and have been, done in Unity. In fact on the internal Nintendo Wii U dev forums I recall a Minecraft-clone was deep in development in Unity, but I think a lack of demand on the platform killed it
Re:Minecraft arrives on the Nintendo Switch by ferongr on Friday May 12, 2017 @02:05PM (#14326292)
A "demo" (with all the limitations and corner-cutting that demos usually employ) is one thing, a complete product is a different beast.
Re:Minecraft arrives on the Nintendo Switch by vvanders on Friday May 12, 2017 @12:32PM (#14325413)
> Cautious use of memory allocations...

I believe you're arguing against a GC there.

Re:Minecraft arrives on the Nintendo Switch by webkike on Friday May 12, 2017 @01:20PM (#14325843)
"not that bad" is still something that "I don't want to deal with" when I'm making a game. Get rid of GC pauses and let me allocate memory.
Re:Minecraft arrives on the Nintendo Switch by BoorishBears on Friday May 12, 2017 @01:40PM (#14326029)
It's great that works for you, and there's plenty of ways to take that approach outside of Unity. Like anything technology there are trade offs, having a GC while minimizing allocations can save a lot of time and effort upfront. I see it as Python vs Java, or NoSQL vs SQL, or a host of other similar comparisons that rage on in programming.
Re:Minecraft arrives on the Nintendo Switch by devrandomguy on Friday May 12, 2017 @03:09PM (#14326919)
What memory management paradigm would you recommend, for an application like this? Let's say, a 1 hour game session generates ~100 GB of transient data, but only 100 MB is needed for what is currently within the camera's view at any one time. How do you keep track of which data is still important, and when do you release memory?
Re:Minecraft arrives on the Nintendo Switch by webkike on Friday May 12, 2017 @08:16PM (#14328931)
Probably spatial partitioning, although who knows. These things are suitable for theoretics. One must find the best solution.
Re:Minecraft arrives on the Nintendo Switch by pkulak on Friday May 12, 2017 @01:57PM (#14326212)
That's true, but no game is hard real time.
Re:Minecraft arrives on the Nintendo Switch by ungzd on Friday May 12, 2017 @12:03PM (#14325151)
Why then Minecraft works perfectly on PC (even worked perfectly in 2009)?
Re:Minecraft arrives on the Nintendo Switch by jamesgeck0 on Friday May 12, 2017 @02:12PM (#14326352)
Java Minecraft definitely used to have lots of issues with large worlds on my 2009 laptop. Low framerates with freezes every time a new region was loaded, even with draw distance on the lowest setting.
Re:Minecraft arrives on the Nintendo Switch by skybrian on Friday May 12, 2017 @01:38PM (#14326008)
On my Mac back when I used to play a couple years ago, I saw random slowdowns. I tried various voodoo Java VM parameter tweaking and it didn't entirely fix it. Based on my searches I'm not alone.

Maybe it worked perfectly on your boxes, but there's something rather fragile and machine-dependent about Minecraft performance.

Re:Minecraft arrives on the Nintendo Switch by PhasmaFelis on Friday May 12, 2017 @02:12PM (#14326350)
It certainly didn't work perfectly in 2009. I had to turn off transparent blocks and greatly reduce the draw distance to get decent framerates on my laptop at the time. Maybe you had a better PC then I did. Java Minecraft still requires at least 10x more processing power than it would in a more suitable language.
Re:Minecraft arrives on the Nintendo Switch by khedoros1 on Friday May 12, 2017 @06:38PM (#14328501)
Did you ever look at the framerate graph and see the stutter caused by GC? Every time the "allocated memory" counter jumps down, you've got a few frames worth of pause in the graphics, and a big red latency line in the graph.
Re:Minecraft arrives on the Nintendo Switch by webkike on Friday May 12, 2017 @01:19PM (#14325826)
I personally never checked the fps when playing Minecraft but Minecraft was not extremely computationally intensive. Despite that they still needed to port it to a non GC language to get it running on phones
Re:Minecraft arrives on the Nintendo Switch by favorited on Friday May 12, 2017 @05:31PM (#14328110)
Beyond just getting it running on phones, C++ is the industry standard for cross-platform games.
Re:Minecraft arrives on the Nintendo Switch by tdb7893 on Friday May 12, 2017 @12:09PM (#14325202)
Is there a jvm for the switch?