Android 2D game programming: using OpenGL or not? [closed] - android

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I've just started to develop games on Android. My first game is a 2D game and I'm wondering whether I should use OpenGL or not.
Does anyone have some advice on this?
Thanks a lot,
Viet

OpenGL ES all the way! There are some good videos from last years IO on android game dev and the frame rates you can achieve going opengl vs canvas.
http://www.youtube.com/watch?v=7-62tRHLcHk&feature=player_embedded
http://www.youtube.com/watch?v=U4Bk5rmIpic
Also there are a handful of great 2d frameworks to simplify the process, the best in my opinion being AndEngine

As far as I know OpenGL ES will give better performance (especially on Tegra 2 devices). OpenGL ES is also harder to learn, but there are good tutorials and support libraries.

I recommend you not to use OpenGL directly as it may seem difficult. Instead you can use a library like LIBGDX which provides easier functionality.
Check this tutorial:
http://m3ph1st0s.blogspot.ro/2012/12/create-games-with-libgdx-library-in.html

You will want to use OpenGL ES if you want anything close to a respectable frame rate. OpenGL ES is hardware accelerated (uses the GPU), while other libraries mostly use the CPU.

Related

Why is C++ code needed for opengl es on android? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am referring to the using of c++ code in strings in this official android training post. Why hasn't google eliminated all need for native languages inside it's ' java world '?
Link:http://developer.android.com/training/graphics/opengl/draw.html
Under "draw a shape".
Thanks in advance for satisfying my curiosity.
Also, this may be a stupid question, and if so, please say so kindly while still giving me an answer.
The GLES20 class provides you Java wrapper methods, so you are not really using C++ yourself. Under the hood, Android uses JNI to bind these Java wrapper methods to their corresponding C/C++ implementation.
If you are referring to the shaders, it is not C++ what is being used. OpenGL ES 2.0 provides more flexibility by allowing you to specify how the pipeline should draw each vertex and fragment. It does so by using the OpenGL Shading Language which is what is shown on the docs.
Because C and C++ are at a minimum 30% faster than Java code, and often even better. If you want high performance (and base 3d graphics libraries need high performance), you need to use C.

How should i proceed with game development? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I have developed a few android applications. Now, I was thinking about developing some games for android. I have a few doubts, I need to be clear about. I have never created any game before. I know Java at intermediate level.
Should I consider using a game engine to develop my games?
What are benefits of using a game engine? Does it allow me to build specific type of games or any kind that I like? How long will it take to learn how to use a specific game engine?
What does game engine do for me, like does it provide me with built in collision detection? Exactly how it would be useful?
I have also heard that we can also develop games using HTML5 and the games would be cross platform. Why or why not should O consider developing games in HTML5?
Some questions might not make any sense because I have just started.
Consider posting that on the game development instead.
Anyway, it really depends of the game you want to code. For 2-Dimensional games, i don't really see the use of a game engine. Tilemapping, 2D physics / collision, AI implementation and things are quite easy (but very instructive) to implement.
For 3D games it's another thing. Collisions are a pain to implement yourself, just as a decent physic engine (in the case of a racing game for instance). There you should consider using a prebuilt engine.
There is nothing better than using a library that has already solved your problem and is stable and ready to use. Never re-invent the wheel. You need collision detection? Make a list of other things you need. Find a set of library that covers your problems and you are ready to take off.

Android library for small 2D game [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm relatively new to Android (about 1 year experience on standard apps), and I have a great idea for a small 2D Game.
My question is : Should I code it in native code only (using shapes, listeners, backgrounds, or some components I don't even know) or is there a library to use that will ease the development and/or improve user experience ?
This game will not be an advanced 2D game, but more "CandyCrush-like" little games.
If you come up with some nice libraries or SDK to use, please note that portability to other platforms is very important.
Thanks!
I'd strongly suggest to use a game engine, even for a simple game such as a CandyCrush-like.
It will save you a lot of effort for basic things which are common to all games and quite long to properly implement (such as game loop management, sprite animations,...). Most of them are based on OpenGL ES which is quite a nightmare to program manually but provides great performance.
Then you should decide which language you're most familiar with (C++, Java, Javascript, Lua, Ruby, whatever...): it will improve your learning curve.
Choosing a cross-platform game engine might also be a good idea (porting a native game is a huge work).
Take a look at those:
cocos2d-x (C++)
corona SDK
Unity
...
Note that this discussion would be more relevant on https://gamedev.stackexchange.com/ (and you might get better answers too).
If your game is really simple, you can try developing with either
Android Canvas or
OpenGL ES
Especially for developers that are not that experienced, who want to develop simple games, the Canvas is a good option in combination with a SurfaceView. Alternatively, I can recommend this engine:
AndEngine
or
Unity Engine with 2D extension could also be a good option.

How to create a game engine for android? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am new to android development and I plan to make a 2d game engine but I don't really know where to start. I read something on the internet but I don't find any good opengl es documentation for android, I don't even know where to start.
If you have no idea where to start, I will point you to the excellent book Beginning Android Games. If you are serious about this, then it is more than worth the investment.
This is a beginner/intermediate text, but in the book the authors (Mario Zechner & Robert Green) create a fairly decent game development framework - not exactly a fully blown engine but it is highly reusable and easily expandable and, unless you've created a game engine before, I would advise you to walk before you try running. Creating a game engine is very complicated so start off with something that you will be able to finish and use, then once you've got that down you will have the confidence you need to build your own.
For me this book was the perfect introduction to android development - I had a great deal of programming experience but mostly in C/C++ with DirectX, some basic OpenGL, and software rendering and had no knowledge of Android, Java, or OpenGL ES. With this text I was up and running in a very short period and got some games done, which is always a great boost to keep going :)
COCOS2d is an open source framework for android and iphone and you will also found good tutorial for this framework. Find here
cocos2d-android

Android open source game engines + tutorials [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Hey iam pretty new to the android platform and wondering what the best open source game engine is and ples link some tutorials.
i just want to make something like a simple 2d platformer
ThX =)
I'm going to have to plug Andengine - http://www.andengine.org/
It's free, it's open (source included) and it offers extensions for Box2D Physics, Live Wallpapers, Aug. Reality (Camera games) and allsorts of other stuff - LOADS of game in the market using it already (no royalties)
Downside is that the documentation is patchy (it's basically a lot of examples) and the author now works for Zynga and has been awfully quiet since he got a proper job :(
You can do amazing things with it tho - and it's easier than most of it's alternatives.
Unity - lovely idea but Unity-based Android Apps are horribly bloated.
If you already 'speak' Open/GL and/or you like the idea of developing/deploying on PC as well as Android, there's libgdx too - http://code.google.com/p/libgdx/
Andengine sort of sits on-top of that anyway - it's harder-work to learn but obviously being able to test/deploy on PC as well as Android has it's benefits.
Here is a list.
Many people recommend Cocos-2d
I mostly recommend Unity3d as it is simply awesome! It has a great documentation and many resources and tutorials. But for Android development, it is not free. Here is the price details and comparison of features.
i recommend libgdx ! best fps out of all of them!
http://libgdx.badlogicgames.com/features.html

Categories

Resources