D and the world
Jeff Nowakowski
jeff at dilacero.org
Fri Apr 27 17:09:44 PDT 2007
David B. Held wrote:
>> I think this number is much bigger than 5%. Consider that much of PC
>> advancement has come at the hands of gamers, and gamers demand the
>> kind of performance that will never be delivered by a VM.
Mike Parker wrote:
> I don't see Epic rewriting the Unreal Engine in Java, C#, or D.
Funny you should mention Epic. A lot of their game code is not written
in C++. The high performance bits like rendering are, but tons of code
that makes up a game is written using a scripting language inside a
virtual machine.
From http://wiki.beyondunreal.com/wiki/Unreal_Engine_Core:
====
"The native software also creates a virtual machine, similar to the Java
virtual machine. This is like a programming environment that sits on top
of the native stuff. The language for this is UnrealScript; it's similar
to Java and JavaScript. It is compiled into bytecodes, like Java, but
the source remains visible, and it's this that allows the modding of the
Unreal engine games. Tim Sweeney's Design goals for UnrealScript explain
this idea further.
"In very simple terms, every single object in the game is a piece of
UnrealScript code. The engine runs all these scripts, and they decide
what to do. So when the rocket hits a wall, a function in its script
called something like HitAWall says: "I have hit a wall. I should now
produce an explosion, make a noise, and remove myself from the game."
How does the rocket know it hit a wall? The native part of the engine
told it. How does the engine know? Every single moment of the game, it
is checking where objects are and what they are touching."
====
Also of interest is Tim Sweeney's (architect behind Unreal) "The Next
Mainstream Programming Language: A Game Developer's Perspective":
http://www.st.cs.uni-sb.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf
A good read if you want to see what a real-world, hugely successful game
developer wants from a language.
-Jeff
More information about the Digitalmars-d
mailing list