Hacker News new | past | comments | ask | show | jobs | submit login

False. Do you mean that performant games tend not to allocate each frame? That is generally true. Performant games very certainly do release memory, though their allocation patterns tend to vary - lots of modern games actually use a garbage collector of some sort, whether it's for lua scripts or for larger parts of the game code. Sometimes their GC is a weak form of refcounting, sometimes it's a conservative stack-scanning GC, sometimes it's a precise one.

Lots of modern 'performant' games are written in Java or C# and in those cases too, you have a GC and occasional allocation/freeing of memory, however they do tend to make an effort not to allocate from frame to frame or allocate temporary objects.

For console games it's definitely false that they don't release memory; memory usage has to be precisely controlled on console so subsystems that don't happen to be using memory at the moment are definitely not holding onto it - that memory's being used for something else.




> Lots of modern 'performant' games are written in Java or C# and in those cases too...

I keep wondering whether it is possible to write a game like BattleField4 or Crysis in Java/C#/etc. Do you have any insights on this issue?


It's probably possible, but it's not really worthwhile.

In the best case scenerio, it's the same amount of work as writing one in C++. The benefits and nice features of those languages would cancel out the drawback of lack of control.

In the worse case, the lack of control means you can't use the features of those languages which would make development easier, and you'd miss C++'s low level features which have no equivalent in higher level languages.

Since the reality is somewhere between these (in my experience, it's pretty close to the worse case), and implementing a high performance game engine is such a large task, it's a much better engineering decision to just go with C++ (or another language which allows a similar level of control) from the start.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: