Building a game on Mobile. Native or Engine? - android

I would like to start getting involved into mobile game programming.
I already have modest experience in Android development and iPhone development.
Previously, I have built a proof of concept 2D JRPG game and a 3D FPS Engine using XNA, and I have a good idea about game programming concepts.
I am lost whether I start looking into OpenGL on Android or if I should directly take a shortcut into a game engine, such as Unity3D.
Base on my experience, would it be more efficient to invest the time into Native graphics programming on Android/iPhone? I am not only looking for "fast" development, I'm also looking to have efficient results.
Also, how portable is opengl-es from one platform to another?

A game engine involves much more than graphics: audio, resource management, networking, scripting, etc. In order to be cross-platform, all those subsystems must be implemented natively for each platform. This implies having a very good design and architecture, and of course lots of code. Unfortunately, you should use C/C++ for efficiency and portability concerns. Although now is possible to develop such engines with with higher level languages like C#, you are limited to its platform support.
Also, you need to consider the gameplay code.
I wouldn't worry about the engines speed thought. The guys who write engines, know what they are doing and unless you spend lots of time optimizing things you won't get considerable improvements.
So, writing portable games takes a lot of work without an engine resolving all the problems involved.
OpenGL-ES is a standard. As with all the standards, there are always some minor tweaks for each platform, but nothing really disturbing.
Resuming, the correct answers depends on you. Everything in computer science is a trade-off and you only know the values involved.
Hope it helps.

Related

Does it make sense to build a music making app on top of a game engine?

I'm interested in making an app which would allow sequencing audio instruments and drums in real time, which would work on several mobile platforms. The visual interface I designed is quite elaborate, and I'm definitely going to need custom graphics capabilities.
The way I see it, I have two options. 1. Learn OpenGL ES and build something relatively cross-platform, and then wrap it with layers that can interact with specific OS API's. 2. Use a 2d game engine, e.g Unity 2D, and utilize that to build a responsive interface.
Option 1 is the most difficult, since I've never programmed graphics before, while option 2 may be an overkill since audio processing apps require lots of processing power lots of low-level optimization for DSP routines. Losing some of this power to an entire game engine may be undesirable.
It's very important that I don't have to reimplement the interface from scratch for every platform. It's buggy and error prone, and a pain to manage.
I'd like some feedback on the best way to go about evaluating my options. Has someone looked into something like this already?
It has been done already, i believe i saw it on the unity forums,
as for whether or not it makes sense, sure it does,
Unity does something that is truly amazing, you can develop it once and deploy to iPhone, Android and WP and more, instead of using xCode with sound effect plugins unity comes with fmod that is easy to tap into.
Not something i am going to do, but if i did, unity would be perfect for it especially when you think that you can have play functions with amazing visual ques that unity is made for.
Lol, sounds like a sales pitch, but no, its not a bad idea to choose unity for such a thing. since you can always write the missing features in plugins if needed. beats going to OpenGL which is a pain in the {bug}

Is the NDK required for good performance in the development of an Android Game?

I heard if I develop Android Game without using the NDK, the performance is significantly lower. Is this the truth?
I see 3 main reasons to use NDK:
you want to reuse C/C++ code base (e.g. game engine written in C++, crossplatform games)
get more memory (you can use much more memory via NDK)
your game is very CPU intensive and you need all your device power.
In all other cases you can choose whatever you like. SDK/Java allows you to use OpenGL same way as NDK, so your graphics won't slow. You should be careful with GC to get smooth gameplay. If your game is very CPU intensive you can write some methods in C++ and call them via JNI. By the way, Dalvik has JIT so Java code can be as fast (even faster sometimes) as C code.
No, that is simply not true.
It very much depends on what your particular game is doing. The essential question is: is your game going to be CPU intensive (or require larger amounts of memory).
If it's not, stick to the SDK.
If you don't know, because you haven't written many games yet in the past, by all means stick to the SDK.
Even it there turn out to be parts of the game that could do with the extra processing power, you can always extract those parts to native code during development as needed.
One reason to choose the NDK over the SDK is having a huge background in C++, which might make you more productive in that environment. However, given the current state of the toolsets (convenient debugging, build times, easy access to SDK libraries etc), this is rarely effective.
No you dont need to use the ndk unless you want to make a super-realistic 3d game such as Real Racing 3 if it is a game with simple graphics or not much time critical stuff java is ok

how to make Art for mobile apps?

I am starting to build my first Android app. I have reached the point where I need to start adding custom graphics and Art to make it look good. However I have also realized I have no skills or knowledge in this area at all.
What practical steps can a programmer take to develop the basic skills necessary to draw/render the kind of small, low resolution artwork suitable for mobile devices (I don't want to be able to paint a full painting or anything)?
I am particularly interested in any tools that may be of assistance, either software or devices like drawing tablets, as well as guides and tutorials.
NOTE: I know this is not strictly a programming question, and there are probably other Art forums out there, but I want to specifically hear from other programmers in a similar situation how they have acquired the skills to make mobile art.
When it comes to the tools and soft, there is nothing better than Adobe Photoshop (it's very expensive but you can download CS6 beta for free for limited time now) with a Wacom tablet (Bamboo would suffice here, or Intuos if you have too much money).
Colors are extremely important and color palettes are hard to do for a beginner. It's not simply a matter of combining two or three hexes. Check out Adobe Kuler and ColourLovers for a little help with that.
Also if you don't like beginning the work from scratch, there are plenty of PSD templates, just like this one.
And looks are nothing without feeling, so UX (user experience) is extremely important, it's also an art:). Personally I find the tips in Android Design Guidelines very useful, even if they cover mostly ICS features. You can copy most of the functionality to the pre-Honeycomb apps. There are also lots of tips on UX in the SmashingMagazine.

Android 3d Graphics library that supports shadow and reflection

I've been digging since while for 3D graphics tutorials for Android. I tried raw opengl (es). I also tried min3d. I found out that things can be very complex or very easy if someone else did the math for you. Min3D is really great and easy to use, but is also really minimalistic. I can't find how to make lights actually cast shadows (and I doubt it's supported), I can't find how to make the surface reflect, how to change the surface to diffuse more or less.
Is there any library that has scene handling and supports shadows (also shadow cast by diffused light), control materials to achieve different levels of diffusion, reflections and transparency.
Note: I forgot to mention I need free framework.
Since the answer of Eric convinced me that realistic 3d is hard to achieve on mobile devices I would accept answers that explain how to fake these effects (or links). Again effects I need are:
shadows
reflections
from glossy material
from matte material
transparency (I think that's in the min3d examples, but it's here for completeness
I've seen shadows in 3d android games, although I'm not 100% convinced that are real (cast by objects).
I can't think of any libraries that meet your requirements for a mobile platform, but there are several middleware products to choose from:
Unity3d : http://unity3d.com/
Unreal SDK : http://udk.com
Ogre : http://www.ogre3d.org/
All of these offer scene management, lighting, material management, etc... yet, I doubt any of these are a silver bullet for what you are asking. Regardless of pricing and licensing - upto 3500 dollars for Unity3D pro mobile - you will still have to do a serious amount of coding yourself and often in a language you may not be familar with.
Also, keep in mind that a lot of the gfx in opengl-es based products (mostly games) are often faked. While it's perfectly possible to have dynamic lighting, shadows and transparency, these things can be crippling for your performance if you have a lot of geometry. After all, a phone or tablet is not the powerhouse that a desktop cpu/gpu is these days. Not yet anyway.
Another thing to note: I'm not sure what level of realism you are trying to achieve, but all the things you mention are typically associated with raytracing/raycasting. And that's a whole other bag of tricks as you can forget about real-time interaction, especially on mobile devices.
No way around it: coding and creating with real-time graphics in mind is hard and it's even harder on mobile platforms.

Would WebGL be a good prototype for code that will work on the Android platform

I am going to start on my first graphics program on the Android(http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/), but it would seem faster to use use javascript, and so use WebGL (http://en.wikipedia.org/wiki/WebGL) to prototype the graphical part of the game.
One difference is in how textures are done, I expect, but for the main part of the game, which is this case is something similar to Tetris, in that you try to pack various shapes into a container optimally.
I would like to prototype it in javascript, but if it will be work to get it to work on the Android then it may not be worth it, hence my question as to how similar is OpenGL on these two platforms?
both use the OpenGL ES 2.0 version. Still, for ease of use, some things are adapted for javascript (webgl). But if you worry about how different the "OpenGL Versions are" the answer is, you don't really need to worry.
I've started a Tetris WebGL application here, tested in Firefox Fennec, but still many more items to get done. http://phillihp.com/projects/creating-tetris-with-opengl-and-webgl/
I would say it is a question of taste. No doubt webgl shaders compatible with androids shaders as good as webgl shader written for one desktop compatible with mac or visa verse. Always little caveats, but not a big deal to overcome them. Moreover you can make Android application from HTML application and ship it to end user. It is possible.

Categories

Resources