Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
88 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 API Selection
 The Compiler
 The JIT

 Printable version

 


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:
1. Don't do it.
2.(For experts only) Don't do it yet"
- M.A. Jackson

The three main things which affect performance in Java are:


Next : API Selection