Few basic questions in Game development

Started by
12 comments, last by Gr3yMatter 11 years, 2 months ago

Hello everyone,

Good morning. I am totally new to game development but i have good understanding of C++. So, i am thinking of writing some 2D games for mobile platforms (only iOS and Android) in C++.

the basic questions I have are -

1. Can i use C++, OpenGL ES and Box2D (for physics) alone to create iOS and Android games? my understanding is i can use these to create games graphics, logic and Android/iOS APIs to detect user actions like swiping/touching etc. Pls. correct me if i am wrong.

2. If i am right in the above question, then is that approach a difficult one compared to using frameworks like Coco2dx, mosync to create games

sorry if these questions seem too silly...am very new to game programming and just started smile.png

thank you

Advertisement

You might want to also do some research into the app store's for your respective targets. I might be wrong on this but from my understanding apple's app store only allows Objective-C written apps while Google's play store prefer's maybe even requires Java written apps.

Beyond that cross platform hassle's always occur, you will need to gain access to the device specific rendering and input API's either building your own mobile engine of sorts or using something pre built. There are many options for this however most are Java or HTML5 / JS related. I'm sorry that I'm not answering your questions but I would suggest that you research in to what technologies are available for cross platform development and what will best suit you and not focus on the fact that you want to use C++.

From just some quick google'ing it looks like OpenGL ES is mainly an iOS thing, I can't find any reference of it's usage on android devices. Android does use open gl and here is a reference page that should get you started (directly from the android developers network)

http://developer.android.com/guide/topics/graphics/opengl.html

Here is the apple reference for using OpenGL on the iOS platform (which does make particular note of the ES flavor)

http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html

Box2D on iOS...

http://www.iforce2d.net/b2dtut/setup-ios

Port of Box2D for android (it's java...)

http://code.google.com/p/androidbox2d/

If nothing else these sites should get you started understanding the differences between the implementations of these technologies on the two different platforms.

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post

I might be wrong on this but from my understanding apple's app store only allows Objective-C written apps while Google's play store prefer's maybe even requires Java written apps.

Neither of those is this case. C++ is a viable route for both Android and iOS game development (though less so for app development, since the UI frameworks are in different languages)

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

1) Yes you absolutely can. Andriod has its Native Development Kit and xCode can mix C++/Objective C. They both use OpenGL Es for rendering. That being said however you are going to have to deal with a lot of cross platform coding and writing a lot of bridges.

Which brings me to number 2.

It will probably take you a lot of time to make all the platform brides for interacting with differing devices......most of which will not have ANYTHING to do with creating a game. If you want to make your game and make it fast, use the tools that have already been created. These frameworks will vastly speed the process for you.

My recommendation is to take a look at your project and see if you really need that fine grain control. For most projects it wont be necessary and you can save a ton of time by using those frameworks.

thanks everyone for your reply

what i am thinking of doing is -

1. write a simple game in C++ (with openGL ES and Box2D) and test it in OpenGL ES emulator

2. deploy it in Android and iOS devices and test

my understanding is (not sure if this is 100% right) - Both Google and Apple says they support openGL ES and I believe my game should run properly if i am 100% compliant with openGL ES.

Let me give it a try and come to this forum if i am struck

reg other tools, i had a look at few (both commercial and free ones). Good commercial one's are costly and coco2dx seems good.

If my approach doesn't work, i am thinking of using coco2dx.

thanks again

my understanding is (not sure if this is 100% right) - Both Google and Apple says they support openGL ES and I believe my game should run properly if i am 100% compliant with openGL ES.

Two items you may wish to consider (or ignore till later):

  • Both platforms support OpenGL ES, but you still have to write quite a lot of platform-specific code to actually obtain an OpenGL ES context, not to mention handling input, application lifecycle, and actually compiling for that platform in the first place.
  • OpenGL ES support varies from device to device, even those running the same OS. You need to choose between fixed-function (ES 1.x) and programmable shaders (ES 2.x) right off the bat. And even then, that basics should be entirely portable, but complex shader effects will often need tweaking for various driver/GPU combinations.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

The quickest and easiest way is to code a game on an existing game engine using a Software Development Kit which includes some assets which you can use as placeholders until you replace them with finished art. There is quite a selection of such systems, so you will have to partner with Mr. Search on that one.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

thanks swiftcoder and 3Ddreamer...now i am pretty clear that I can use OpenGL but its going to take lot of time...google'ed for some game engines/tools... looks like coco2d-x, carona, marmalade, moai etc are good... But Carona is expensive...I am an indie developer :)

I am thinking of using coco2dx or moai (though this is not C++)

if anyone knows any other good game engine, pls. let me know. I am looking only for cross platform game engines so that a single code can work in iOS and Android

thanks everyone...gamedev.net is awesome :)

Hi VJ1,

I hope this will helpful for u. No initial cost for u till u publish to app stores..plz let me know it's helpful :)

http://www.batterytechsdk.com/

There is on gotcha I dont believe has been mentioned in this thread.

If you want to support OpenGL ES and in C++ only, on Android, that means 2.3 and higher devices only. That shouldn't be a huge deal, but still something to be aware of.

You will also find in Android that not 100% of the the Java APIs have been provided in C++, so you will find you will have to work around this on occasion. Generally though, these aren't the APIs you would need in your game.

This topic is closed to new replies.

Advertisement