I recently got my hands on Vampire the Masquerade: Redemption (VTM:R), the game is brilliant and got me hooked for a whole weekend completing it. At the end of it the beast within me rose and I wanted more blood, so I downloaded the SDK. Much to my horror and perverse delight, I discovered that the scripting engine at the heart of VTM:R, is embedded Java. All of the game mechanics can be controlled and overridden via Java. A lot of games are probably going to be following suit for a lot of reasons, Java is a freely available language, supported on just about every platform. It has the Java Native Interface (JNI), the two way link between Java and the native code, so all you have to do is generate a load of Java classes which link into you game's functions and allow the game access to Java objects. Anyway this is very exciting for me as I've been working with Java for a year now, and my ambition is to get into the games industry. The problem is though, that despite all the advances with Just In Time compilers (JITs) and other speed improvements, Java is still slower than native languages. All is not lost though, there are a few things, which if you remember to do while coding, can increase the execution of your Java code by up to 250% in places! Games need to be fast, so here's some ways of squeezing that last caffeinated drop of performance from Java... Rules of Optimization: The three main things which affect performance in Java are:
|
|||||||||||