[video:youtube:5cqpFr0LDNw]
This is is about the process of converting from C++ to Java. I took over fixing alternate reality X. I found this game a couple of years ago, Acrin has done a great job recreating alternate reality. This is a game I played many hours during high school as an young adult. When I found this game on the internet several years ago, I was very excited. The Acrin started this but is not able to complete it, so I’ve taken up the quest to complete it. Not being able to complete it is no surprise to me, the original was not completed either. Maybe it is devine to not be completed. The Acrin had many visions for alternate reality, one of those visions was to be able to play it on multiple operating systems. I have taken it over and decided that I will try and continue his visions. So I have converted the game to Java, this way it will be an easy switch to other operating systems. I’m using the Java Light Weight Gaming Library, it has support for Windows, Mac and Linux. This way as the programmer there is nothing to be done to support all three different operating systems we will not have to maintain any differences between revision.
I have been programming since the 80s but as graphical programmer. My background is business software and website design. I started converting this back into in December. It took me several weeks of looking into openGL. During this time I wrote several test applications to figure out how to use opengl and LWJGL.
The major challenge in the conversion was the opengl and the sound libraries. Java lightweight Java gaming Library did not have support for PNG picture files and OGG audio files. I wanted to use version 3 of the library to be current with openGL and with the library. So I had to take the time to learn to go to read those in and convert them into it opengl format. Between the graphics Library the audio library that took the better part of December.
So all of the opengl code has been changed and rewritten into JAVA, the openGL calls are the same but little to no of the original code is left. All the drawing of thecity walls have be deleted and created into a new classes and more optimize. Not really need since when it comes to openGL this game is very little of a challenge. This is not a true 3D world, what you see is the only part of the world that is draw. I think that is GREAT, Acrin kepted it like the original concept. Many pluses to the attention to details of the original 8-bit game.
The Next Step was converting C++ to Java. That part was not to hard of the project, luckly this is a very small project from what I’m used to handling. So it only took about 2 weeks to convert the entire project. Some of the bigger things to convert into Java is that there is no “STRUCT” in Java. Closest thing is a class, so I converted all the “STRUCTS” into a Java class. The next things is the lack of UNSIGNED variables in Java. This made reading in the binary files handling to be rewritten. Because when using a byte to read in a single byte, it converted it to a SIGNED number so many values end up negative. So every byte had to converted so you cast bits to prevent a signed value.
Nice thing about the conversion and being simply is String conversion. Strings in Java are use easy to use and do much more then C++.
Check out my short youtube video of a small clip of the game running in Java.