Archive

Archive for the ‘Games’ Category

Android and the (OpenGL) issues

December 6th, 2009 NeA 1 comment

As most people know I pretty much dig Android. I also have been a friend of OpenGL. As I come from the Java side (we have cookies ^^’) and there are two good wrapper implementations with JOGL and LWJGL, I found the perfect combination in OpenGL on Android, hence the tutorial ports.

Over the time I did some tests on Android. Not only with OpenGL but mainly overall to see what could work and how. Unfortunately Android is far from perfect (what ever is?) and has some issues also affecting OpenGL development on Android.

3D Games on Android…
Ravensword - Town BlacksmithGames are probably the main market working with 3D on Mobile Phones nowadays. On the iPhone we have some great examples of cool and nice looking 3D games such as Ravensword and many others. They look good and also run very smoothly (especially on a 3GS, loading times are most of the times much better).
Now, for Android we also have some good Game examples with the just announced winner of the Android Developer Challenge 2 in the category of games: Speed Forge 3D. The really beautiful WipeOut clone gives you a nice 3D game example on Android. Another example is Mystique by Bendroid. The 3D Ego-Survival-Horror in the style of Silent Hill and The Ring is sure to give you some creeps if you play it in a dark room, at night, feeling lonely.

…and the issues!
Now if you compare Speed Forge 3D or Mystique with Ravensword or Gameloft’s upcoming N.O.V.A you probably will get jealous and drool all over the videos. No question: SF3D and Mystique are great, Kudos to the developers, but compared to the iPhone they are far behind.
The big question should be: Why? And the answer is neither simple nor a single one in my opinion.

1. Heterogeneous Phone Market
One big thing coming up with the release of new Android handhelds is the inconsistency throughout the phones. Android itself is a specification and a referential implementation. Now, most phone manufacturer alter some things or add their own implementations of something such as OpenGL. Therefore, it is already the case that with every new release of a mobile phone based on Android you see updates of many Apps popping up because of problems or even crashes on the new device.
Let’s have a look at Speed Forge 3D: I have a HTC Magic and it runs… OK. Not absolutely fluently but playable. Now, a friend of mine has a Samsung Galaxy (or i7500) and he can barely play it until it crashes. Now the Droid from Motorola entered the market with another graphics chip and a larger screen. Many new “properties” to test against and to deal with. The iPhone on the other side may have been updated over the time but the environment stayed nearly the same. And something that runs on the 3GS will also run on the 3G, just load a little longer. So, as time goes by more and more Android devices will come out and will further diverse the market.

2. The Dalvik VM
As always when it comes to Java you will hear people say:

It’s slow because it’s Java!
Java will always be slow!
Forget Java, use the NDK!

(just saw the same posts pop up on the newsgroups and forums again)
They will argue that a Virtual Machine can never give the speed you need (some also tend to forget that .net is a VM interpreted environment). They will argue that the Garbage Collector slows everything down. And if we look back about 10 years they really had a point, but nowadays that may not be total crap but is just not that easy to say.

Poisonville by BigpointFirst of all let’s have a look around at Java-based 3D games, based on the very popular, updated and fast libraries JOGL and/or LWJGL. There would be the experiment Jake2: A Quake2 clone made in Java based on JOGL and LWJGL to have a comparison. If you have a look at the benchmarks you will see it is hard to argue that Java is that slower over the native implementation. And engines such as jMonkeyEngine support the Java faction. The demos over there such as Spirits and other games like Trible Trouble and Poisonville on the other side show that there are very good possibilities to use this object-oriented programming language as your development base.
The thing is that not Java per sé is the problem but as with every programming language the code optimization and the execution environment, in this case the Virtual Machine. Even Tim Sweeney from Epic Games suggests that functional programming and Garbage Collection is the future. The newest Sun Java VM and other VM implementations show what is possible to do with optimization within a managed environment. A good Garbage Collector (GC) and a very good Just-in-Time (JIT) Compiler such as in Suns current Java implementation speed up not only the application but also development itself because of less time spending for the memory management.
But why still the speed problems? As already said, even if Java is interpreted and helps with the memory management you still have to think about what is happening beneath. Most applications tend to just create one instance after the other and do not really care about memory management. This may work on a desktop system but will bring problems to you on Mobile Phones. Things like weak references, caches, volatile and transient are forgotten but highly important terms in Java development. Especially Mobile Applications still have to really care about memory even with all this technically highly fledged phones. Care about the memory more than about computation on modern smartphones.

Nevertheless, even with these more or less “simple” tricks Android still has some problems that you need to remember during development. Most of these result from the Dalvik VM. The current Dalvik implementation on Android phones does not support JIT nor is the Garbage Collector any good.
As no JIT is available all code is interpreted on time and not pre-compiled or anything. On a limited device such as a mobile phone this results in slowdowns. Therefore, it is important to pre-load everything you need and cache as much as you can to have a fluent gaming experience during e.g. a level.
Another thing is the current GC in Dalvik: Avoid it ^^’ Sure, you cannot really avoid the GC directly but try to not release too many objects during gameplay (or fire it by yourself) as the GC will slow your phone so down that even the OS will need time to react. This is also something that can be managed with caching and a good manual memory management. Currently, up to Android 1.6 an application may use up to 12MB of memory. With Android 2.0 this has been upped above 20MB, but as a game should support many platform versions (the issue why I am posting this), 12MB will probably be the limit for a while.

3. The Android OpenGL ES implementations
Another thing that bothers the development of OpenGL ES applications on Android is the again heterogeneous availability of specifications. Android itself by SDK supports OpenGL ES 1.0 and 1.1. The official current OpenGL ES version is already at 2.0. While 1.1 is backwards compatible to 1.0, 2.0 has no backwards compatibility. OK, its to note that 2.0 is somehow pretty fresh and you cannot ask for the newest technology in Mobile Phones. But most Android phones at the moment only support 1.0, for example the HTC Magic whereas the Motorola Droid should be able (hardware-based) to support 2.0.

As 2.0 introduced programmable shaders to the hardware the step is a large one. That is probably also the reason why OpenGL ES 2.0 is the foundation for WebGL, the upcoming and already beta-available 3D JavaScript interpreter for Browsers such as Firefox and the WebKit Engine. So, even if you argue that the newest technology may not be always available in Mobile Phones, as 2.0 is progressing so fast at the moment the diversity between 1.0 on current phones and 2.0 on more and more platforms can result in “support” or portability problems of applications.
The support/portability problem is one of the issues. But more relevant is the functionality available in 1.0 and 1.1. The iPhone is based on OpenGL ES 1.1 and by that it has a big advantage over most Android phones: Vertex Buffer Objects (VBO)! As posted before my tutorial ports, OpenGL ES does not support primitive rendering (glBegin/glEnd). This is good as it will nevertheless be dropped out of the OpenGL standard. In OpenGL ES you have to use Vertex Arrays and/or Vertex Buffer Objects, which are faster anyway. BUT 1.0 only supports Vertex Arrays and no VBOs. This is one big disadvantage not only in speed but in development. You can argue that it is possible to program an application that supports both with tagging the sections but as it comes to mobile development you always try to comprehend everything as much as possible without acting on too many specifics.
Two other important things when it comes to game development are that 1.0 does not support multi-texturing on its own (there are ways, but those are tricks) and it does not support the automatic mipmap generation. Both are necessities if you want to do such nice things like Ravensword or N.O.V.A.
Another thing are the phone specific OpenGL ES implementations. Not only versions but also manufacturers provide different implementations with their phones. For example the Samsung Galaxy has a known very weak OpenGL implementation. There are already several published articles on how to add the HTC implementation to a rooted Galaxy. And as more and more manufactures will enter the Android market in the coming month this will probably get worse.

So, what can be concluded from this? Actually not much but 1.0 <= 1.1 < 2.0! There are some tricks here and there to deal with some things under 1.0 but overall you just have to accept the fact and optimize around what is missing. Or you limit your development to 1.1 (at least for now). But by that you will loose many phones such as the Magic or G1, which probably are the most widespread Android phones at the moment.

4. General and Specific OpenGL (ES) Paradigms and Tactics
As with every programming language or library there are several Best Practices that should be remembered during development. The same thing applies to OpenGL. There are many posts in the net on how to optimize your OpenGL code and you should definitely use Google to keep you up-to-date. I just want to point out two important things (in my opinion) for mobile development.

The first thing is to reduce your draw calls! This is not limited to mobile devices but OpenGL in general. But because of the limited hardware versus a Desktop system, this is even more important. Each draw call is not necessarily bad but in sum are slow. Now, most people do enormous, cool architectures with self-drawing objects that are instanced over and over again. This is nice from an object-oriented point of view but is bad on a mobile device. If you want to do something good and fast for Android work with overall handlers. This relates to what I said about caching. To have super classes, handlers or factories that collect all changed elements or all objects that need to be drawn and only that Object fires the draw call is the way to go. This may look like a limitation but this is not only good for the speed of your application but also reduces the possibility of asynchronous errors when instances of deep objects are computed while the rest already handles another request.
The second thing correlates with what I said about memory handling and caching: Reduce your texture binding calls! To rebind your textures again and again and switch them back and forth is also bad for the overall performance. I know that it is tempting and Android with its nice resource loader somehow invites you to have hundreds of single texture files and load them again and again. But this will get you into trouble really fast. First of all, reduce the calls by utilizing again a super class, a texture handler with some kind of caching mechanism. Another possibility is to merge several textures into one large texture and offset the texture mapping coordinates accordingly. This is easy to do and just requires a small asset pipeline but the advantage is huge.

Both things suggest some very important points that have to be taken into account in the architecture and early development. Therefore, always tend to fulfil the mentioned points already while you are planing.

5. General Mobile Development Paradigms
As well as for OpenGL there are some rules regarding Mobile Development in general. There are also several posts on the net about this topic but just to sum up what I already coped in the above text: A Mobile Device is no Desktop!
Many people come from the Desktop development and are real geniuses there. They make the best applications, fast, functionality perfect and have wonderful graphical user interfaces. BUT what works on a Desktop does not necessarily work like that on a mobile device.
JavaME made it necessary to go back to Java 1.3.1 programming style; To forget about Generics; To forget about Enumerations and just use the “old ways”. Now, with something like the Android SDK, which allows to use nearly the full Java5 specification people just copy their desktop applications into the Android projects and this will make problems. All the things I pointed out above result from that premise as the desktop is the more forgiving (because more powerful) platform.
Things like creating hundreds of instances, using hundreds of different files, not working with in-memory data but reloading everything over and over again are bad… bad… and even worse, really bad! Do not get fooled by all the technical specifications of the mobile devices. You cannot compare the CPU and the RAM with the desktop pendent. I recommend to have a look “back” at the JME development and the experience people made there. Do not copy it one-to-one but use it as a guideline and convert it into a comprehensible Android project. Most problems, most errors, most failures that are posted and reported result from the unused experience made in that mobile development area. Reuse that knowledge, reuse their principles, their ideas and you will avoid many problems. And as there are enough “new” problems do not trip into the old ones.

In conclusion
Please do not get me wrong: My opinion about Android is high, I have one on my own and I love it. Love developing on it, love the SDK updates. The only thing I want to point out is that development on Android phones and Android itself has to start to keep these five things in mind. The next three to six month mark an important state with Android where to go and with at least the noted points you should be good to go.
So, go out there and really work on it to do the best f***in’ 3D Android game of them all (and comment about it here ^^’)!

Categories: Android, Code, Games, Java Tags: , , , ,

The Chronicles of Spellborn – Free to play begins now!

August 20th, 2009 NeA No comments

TCOS is coming F2PTwo days ago, the USA version of The Chronicles of Spellborn, published by Acclaim went F2P. Today they made this step official. You can go to their website, register a free account and download the about 3GB, install and start playing. I recommend it, as TCOS features a new, active and live fighting system (which I like very much). It also has a very believable world, which does not follow any large license but cooks its own soup. Something I like, as it also encourages you to explore. Now, you can make up your mind yourself as it is free! For those that already played TCOS at the beginning, please note: It has changed nearly completely in my opinion! It is far more user friendly, the interface got better, the guidance, the environment more lively…
It was announced some weeks ago that the European Servers shutdown and The Chronicles of Spellborn will nevertheless continue as a F2P, beginning from next year. This is fantastic, as so many good but not great MMOs (like Tabula Rasa) just get lost in the Windows Trashcan because of shutdowns. The European servers have been shutdown already, but now Acclaim announced that the US Version is F2P from today on but will not feature any updates or patches until the official relaunch. In my opinion it is worth it. And as it is free now it has enough content to keep you playing for a while. And let’s see… maybe you like it!

The Chronicles of Spellborn
TCOS

TCOSThe Chronicles of Spellborn was a bold try to do something completely out of line from UO, Everquest or World of Warcraft. The studio from Netherlands licensed the Unreal 2.5 engine and created their own story, their own environment, their own world! Main focus was put on the fighting system, which features a complex looking but very special and good kind of active and live fighting, with skill-based tiers. Moving, jumping, attacking from behind gets more interactive and it encourages to test your skill-tiers, similar to Guild Wars, because of the alignment and limitations in the slots.
Unfortunately TCOS could not fully keep up to the (and my) expectations. It was polished but too little content was available. Some people also argued that the quest descriptions were missing concrete directions. I liked that, as it was no following arrows and points but really reading the quests, the logs, the text. As the quest and discussion system also features some kind of answer selection, sometimes you can change your stand and the mood of NPCs to you. Something I also like.

So, just head over to the official website and download the game. It is worth at least a quick look and maybe the community will bring Spellborn back to live, somehow like Ryzom.

The Chronicles of Spellborn – Trailer

Pictures taken from the official Website: http://spellborn.acclaim.com/

3DRealms shuts down!

July 10th, 2009 NeA No comments

http://www.shacknews.com/onearticle.x/58519

How? This cannot be possible. This must be a joke. Please be joking. In reality they finished Duke Nukem 4 Ever and will release it. Broussard told everyone that they hit a milestone. This must be marketing.

Update 5

Somehow the Duke still lives (of course)! Scott Miller posted at his Facebook site that the current state is more of a pause than the death of the Duke (who can never die as we all know ^^’). Also some new images emerged with the post. I think they are great and have to still believe that I will see the Duke again.

Update 4

Now, some new footage popped up. Actually it is no new footage but the full segment not shown on the Jace Hall show, when he visited 3DRealms and had the chance to play it. I think it looks actually good and somehow finished. The idea with the controlling tentacles look good and the weapons are awesome as always. I really hope we will see this game in some time…

Duke Nukem Forever played by Jace Hall

Update 3

After more and more news about how 3DRealms possibly refused 30 Millions and Take 2’s action of suing 3DRealms for 12 Millions and Source Code as well as Assets the first, more or less official statement has been made by the remaining executives at 3DRealms. It seems that 3DRealms still exists as a company but had to let go of all their developers in the beginning of May. Everything stated can be interpreted in many ways but I still have hope. It was also reported that Miller, Broussard and other Executives will give a full official statement some time later. So let’s hope everything gets at least clarified.

Update 2

Voodoo Extreme got their hands on 28 Hi-Res Screenshots of the “probable” game. The screens also contain a set of Story Tables/World Chart offering what Duke Nukem Forever could have been. The video below already showed our favourite “Stadium” level (but I liked “L.A. Rumble” more ^^’) and it seems that this would have been the entry into the game, as Duke plays his “historical documents” as a game, in the game. I am sorry, but again I need a moment…*morphingtoweepingwillow*

Update

One of the 3DRealms Animators Bryan Brewer, who worked on Duke Nukem Forever, released a Reel of his work done for the game. If this is the real deal, and this is actual gameplay footage with some story hints and everything, this would have been exactly everything a Duke3D BNC-Net gamer could have wished for. I am sorry, but I need a moment…*cryingoutloud*

Duke Nukem Forever (2007)

The new Adventures of old Monkey Island

July 6th, 2009 NeA No comments

Update
Tales of Monkey Island is available. Head over to Telltale Games and download the demo!

Tomorrow Telltale Games will release its interpretation of new Tales of Monkey Island. Based on its known Engine, with a new Storyline split into 5 episodes of enormous fun (at least I hope… and I am pretty sure about it). I will post more about it during the week as I pre-ordered it, of course. But for now, a small trailer…

Tales of Monkey Island (2009)

Bow Street Runner

April 12th, 2008 NeA 2 comments

I just stumbled upon a very good and fascinating adventure made with Macromedia Flash (I do not accept that Adobe bought it ^^’). It is called “Bow Street Runner” on the Channel4 site. It is a historical FMV adventure (so, please have a broadband connection for this) that tells a crime story in London in its 1750s and the Runners in Covent Garden.

Bow Street Runner - Crime Scene
Bow Street Runner – Crime Scene

The wonderful created game gives you the ability to search around, look at evidence, talk to people and try to chit-chat them into giving you clues. “Bow Street Runner” uses real actors playing their parts very well and are staged into the pre-rendered backgrounds you can traverse (basically like Myst, but with far more fluent and accurate controls).
In addition to simple pixel hunting there are extremely well designed action puzzles as you have to pick a lock with specific movements with your mouse or listen to a moving conversation with a jar.
While playing through the game you get the opportunity to try yourself on some mini games as well as you can achieve higher ranks with the Runners as you progress. These can be fasten up as there are special bonus achievements (e.g. save someones life).
As it is a Shockwave game you do not have the chance to save your progress but at the end of every episode you get a special progress code that gets saved onto your computer (probably through a cookie). Additionally you can send this code to your E-Mail address. And as the episodes have a moderate length it is no big negative point.

Bow Street Runner - Suicide?
Bow Street Runner – Suicide?

I have to say the five episodes adventure impressed me. It is made in tradition to old games like Bad Mojo, Tex Murphy, Phantasmagoria, Gabriel Knight and others that were gaming hits in the mid 90s (I liked them!). But in contrary to some bad examples that just made you click yourself through pre-rendered or pre-filmed scenes this one motivates through its distinct art style, historical correctness and the interesting twist between detective work and action riddle solving.

I recommend you go over to the “Bow Street Runner” site and get a picture of what I presented you here about the game. This is a wonderful example of how it should be done to motivate the player and to make a very well furbished game. I hope there will be more games of such caliber as I think these are great games especially to speed up the online game distribution. “You don’t know Jack!” is another example of a wonderful idea predestined for Flash games.

PS: Here is an engine that could be used or extended for such projects ^^’ (No, I would never self-advertise)

Categories: Games, Internet Tags: , , , ,