Java > Scala

bigsandwich bigsandwich at gmail.com
Wed Nov 30 13:48:38 PST 2011


Jeff Nowakowski Wrote:

> On 11/30/2011 03:58 PM, bigsandwich wrote:
> >
> > "Usually garbage collected" in the case of Unreal refers to Unreal
> > Script which is not C++ at all.  Its a language similar to Java that
> > is compiled into bytecode.
> 
> It doesn't say that in the slides. It says that they use C++ *and* 
> script code. The slides are also talking about Gears of War, too, not 
> just Unreal.
> 

No, it says "Simulation Code" which in every Unreal game I've worked on is all written in Unreal Script, which is garbage collected.  The C++ code isn't, and the simulation is not written in C++.  I'm not saying there aren't games that use some form of GC in C++, I'm just saying that the kind of code he's talking about in the slide isn't written in C++ AT ALL if you are using Unreal.

> > Most games use allocations schemes for different parts of the game,
> > including garbage collection.
> 
> Which just repeats what I said, "I assume by this he means that for C++ 
> the developers end up writing their own garbage collector inside the 
> program."
> 

Why would you assume this?

> > You wouldn't want to use GC in performance critical code anyway, so
> > it probably doesn't matter that its that slow.
> 
> Check the slides again. It has to run at 30-60 frames per second. This 
> is "soft" real-time.
> 

Yes, thats why you can get away with scripting language and a GC for "some" parts of the game - parts of the game that are not perf intensive.  Also notice that he talks about concurrency.  Modern game engines need to be multi-threaded and the sim may update at a different rate then, for example, rendering.

> > What does matter is having a way to isolate GC to the few libraries
> > where your willing to pay for it and turn it off for everything
> > else.
> 
> Interestingly enough, under Musings he says, "Memory model: Garbage 
> collection should be the only option". Real-time garbage collection that 
> actually works well in a game setting would be the ideal.

I think you are reading too much into those slides.  He's talking about an ideal DSL for game programming that can cover all the bases.  That doesn't exist, and I'm not sure its even possible to create such a thing.  I think you could probably get close though.



More information about the Digitalmars-d mailing list