Thursday Feb 17, 2005

Java For CMT Clients

Last week, at the end of my entry in CMT for games, I made the assertion that Java would be the perfect platform for the upcoming explosion of CMT enabled client devices - next generation game consoles being the most obvious. In this entry I will expand upon that statement and explain why I believe this to be true.

The games industry is deeply entrenched in using native environments, C and C++, to build their client technologies today. One principle that I truly believe in is inertia. For someone to change what they are doing, there needs to be sufficient inertia - or value - in the change. So, for game developers to change from native environments to Java, we need to show the value.

The benefits of Java to the game development community is not necessarily the same than that of traditional developers. Let's take, for example, the most talked about value of Java - cross platform. This is a great value in markets where the number of devices to support is great - like the cell phone market. The traditional game development market has now consolidated down to four basic platforms - Playstation 2, XBox, GameCube, and PC. Most game developers have figured out how to do cross platform development using native environments on these platforms. This makes cross platform on current devices not a huge benefit. In some cases, however, things diverge dramatically on these devices - like threading models and co-processors. Since Java is a multithreaded platform from the ground up, it naturally maps to all kinds of threaded devices, and therefore could provide a new level of cross platform consistency to these new devices. So, even though cross platform is a minor feature today, in next generation consoles, this will be a big win.

In current consoles, the support for operating systems is quite limited. Much of this is due to the limited memory available to the devices. When CMT enters the picture, a robust but compact operating environment will be required to manage all of the resources. Java has proven that it can manage massively threaded environments. There will need to be specialized thread schedulers tuned for each platform, but that should be done by the platform provider when putting Java on the device - not left as an exercise to the game developer.

I believe that not nearly enough attention is given to the ability of Java and its dynamic compilers to adapt to the workloads being presented. This is a great asset of the system and could be exploited to maximum benefit on CMT client machines. For example, some information about the cell processor for the Playstation 3 indicates that different cores will be better suited for different tasks. The combination of an optimized just in time compiler and thread scheduler could ensure that every task in the game workload could be optimally compiled and scheduled based upon the characteristics of the device.

Another area that Java could benefit these platforms in is what I call "managing complexity". Time and time again I here developers telling me that there is no way that they could have implemented their complicated simulations without using Java. Next generation games will be far more complex than the ones we have today. Input systems, physics systems, collision systems, behavior systems, effects systems, animation systems, and rendering systems all cleanly interacting with each other at 30-60 frames per second. The Java platform has proven that it can be used to build large systems that interact with each other in complex ways - like big enterprise apps. Next generation game developers will need platforms like these to get these systems done.

Another touchy-feely attribute of the Java platform that can greatly advantage game developers is gains in productivity. There have been studies that have shown that programmer productivity is much higher with the Java platform compared to native platforms. There are a few reasons for this, some of which include strong typing, automatic garbage collection, and thanks to the business enterprise world, a extremely large selection of tools for Java development.

Hopefully this starts to give you an idea of all the benefits that the Java platform can bring to these new devices and game development. There are still a few topics that I have not covered yet, and I will do that next week when I continue this thread. Those will fall under the topic of many myths about developing games with the Java platform.