News for hackers. Stuff that matters.
Re:Jai Language Primer by hacker_9 on Friday February 12, 2016 @09:53AM (#11087550)
Minecraft is a special case, as the amount of voxels in memory and the constant loading and deloading of blocks of the map every few seconds, means that memory management is incredibly important to the game. That's why the C++ version was more performant, as John Carmack had full control of both the memory layouts and lifetimes, and could fine tune it all to fit the game.

This is the only reason C++ is still in wide use today, in order for games to limit load times they have to do nasty 'unsafe' tricks (such as loading a block of memory from disk straight into an address space, and just assigning pointers to it), in order to get good performance. But if your game isn't open world (such as minecraft, GTA, Fallout), then using a garbage collected language will be fine (as long it's not stop the world, but runs concurrently).

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:04AM (#11087630)
Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?
Re:Jai Language Primer by greggman on Friday February 12, 2016 @10:16AM (#11087712)
I'm not sure what a soft real time game is. Here's two lists of some games with garbage collection

https://en.wikipedia.org/wiki/List_of_Unreal_Engine_games

https://unity3d.com/showcase/gallery

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:23AM (#11087776)
Unreal and Unity were built using C++.

They offer garbage collected languages on top of their C++ game engines for scripting game logic. Any significant modifications to the engine will need to be done in C++

Re:Jai Language Primer by greggman on Friday February 12, 2016 @04:17PM (#11090683)
https://wiki.unrealengine.com/Garbage_Collection_Overview

The link is for C++ garbage collection in UnrealEngine, not UnrealScript nor Blueprints

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @09:45PM (#11092196)
> Unreal's game-level memory management system uses reflection to implement garbage collection.

Yep. Game-level garbage collected C++. Which is exactly what I said, I just a didn't mention GC on C++ to avoid obscuring my point. I promise you the code at the game-engine-level is manually memory managed C++

Re:Jai Language Primer by greggman on Saturday February 13, 2016 @02:07AM (#11092995)
You do realize that reference counting is considered a form of garbage collection right? https://en.wikipedia.org/wiki/Garbage_collection_(computer_s...

BTW: I've written 6 engines for AAA games. 3 of them used reference counting. AAA C++ games use garbage collection all the time. Maybe yours didn't. Mine did. Unreal does. So does Unity

Re:Jai Language Primer by CyberDildonics on Saturday February 13, 2016 @11:02AM (#11094426)
That's like saying World of Warcarft uses garbage collection because it uses Lua. The higher level language on top of an engine isn't what was being talked about since Minecraft was written completely in Java and thus dealt with the garbage collector at every level.
Re:Jai Language Primer by hacker_9 on Friday February 12, 2016 @10:16AM (#11087709)
Anything built with Unity, such as Cities Skylines. Additionally anything built with unreal engine [0] like Gears of War, the Arkham KNight series etc

[0] https://wiki.unrealengine.com/Garbage_Collection_Overview

Re:Jai Language Primer by gregstula on Friday February 12, 2016 @10:24AM (#11087789)
Right, you use C++ to build game engines, you can use scripting languages on top of that once the engine is built.