I've been developing iOS apps, but I think I may want to get into game development for Mac/PC in the future. I'm just wondering what language to learn, because although I could build for Macs in objective-c I don't think this would be good for a game. I've seen Java be pretty popular for cross-compatible games. But there may be other languages that are easier to get into or just work better.
C and C++ have been the preferred choice from game devs, and probably the language where you can target more platforms (iOS, Android, Mac, Windows, Linux), sure you can use other easier and nicer languages like Java, C# or ObjectiveC, but you will end with totally different codes for each version, and that will just be much more work for each of your games.
I use C++ for my games, right now I only have iOS and Mac available (ObjC use is minimal) but I'm sure I can have them ready in the other platforms without too much effort, it's just a matter of port one, then the others should come quick. The Key here is using the same language (C++), same graphics API (OpenGL), and separate the engine from the actual game code.
Then porting should consist of:
- Program setup (init app, create window, etc, probably in other language).
- Audio, either platform native API or use a 3rd party library.
- Inputs (touches, mouse, keyboard, gamepads)
- File handling (platform native API)
- Graphics performance/optimizations dependent of platform/devices.
I've been developing iOS apps, but I think I may want to get into game development for Mac/PC in the future. I'm just wondering what language to learn, because although I could build for Macs in objective-c I don't think this would be good for a game. I've seen Java be pretty popular for cross-compatible games. But there may be other languages that are easier to get into or just work better.
So if anyone can help, it would be great.
iOS and Mac OS share a huge amount of common design and code. I'd say about 60 percent of the application frameworks are identical between the two, and Objective C is the native language for development in both.
If you're interacting with the Cocoa frameworks, you will almost have to use Objective C.
It is possible to mix Objective C and C++ in Mac/iOS programs. However, all the native tools are written in Objective C, so you will spend a lot of time and energy writing an abstraction/interface layer that lets your C++ code talk to the Objective C based system frameworks. In fact, it would probably make sense to write all the code that deals with system frameworks in Objective C, and write cross-platform game logic in C++.
I would stay away from Java. The Java runtime is limited and clunky, and apps written in Java are locked into a clunky, Java look. It works, but do you want to limit yourself?
Another option is to write an immersive game in OpenGL and just ignore the native user interface framework like Cocoa or the Windows toolkit. OpenGL is a 3D rendering API that is supported on both platforms. Windows isn't great about supporting it, since Windows uses a proprietary graphics API called DirectX which isn't used anywhere but on Windows. (Microsoft seems to take pleasure in thumbing their noses at standards, and go to great lengths to subvert those standards.) By contrast, OpenGL is supported on Mac, Windows, Unix and Unix work-alike platforms like LINUX, a wide variety of mobile devices, and even some of the game consoles. However, OpenGL is a complex, rather balky API and it has a steep learning curve.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
I've been developing iOS apps, but I think I may want to get into game development for Mac/PC in the future. I'm just wondering what language to learn, because although I could build for Macs in objective-c I don't think this would be good for a game. I've seen Java be pretty popular for cross-compatible games. But there may be other languages that are easier to get into or just work better.
So if anyone can help, it would be great.
Just don't use Java. That would be just dumb, and you couldn't sell it on the Mac App Store. I would recommend learning C, then Objective-C/Cocoa.
If you want things to be easy for you, you can try GameSalad, but don't expect to earn a lot of money unless you create a game with great graphics and many levels.
Or just face it: there are way to many games on the App Stores, so just try something else.
s to subvert those standards.) By contrast, OpenGL is supported on Mac, Windows, Unix and Unix work-alike platforms like LINUX, a wide variety of mobile devices, and even some of the game consoles.
Say you wrote a mac game in Objective-C/OpenGL - how much effort would be involved in porting it to OpenGL ES for iPhone? Is it as simple as changing a few calls or would it likely involve extensive re-engineering?
how much effort would be involved in porting it to OpenGL ES for iPhone? Is it as simple as changing a few calls or would it likely involve extensive re-engineering?
OpenGL ES is a subset of OpenGL, it does not have several of the functions available in standard OpenGL, so it depends on what you used on your existing game.
The most noticeable functions removed on ES is immediate mode API calls: glBegin, glEnd, etc. so you need to use vertex arrays or FBOs.
iOS has OpenGL ES version 1.1 and 2.0, ES 1.1 is similar as 1.5 standard minus removed functions, I would recommend you to get the specification of them from OpenGL.org and see what functions it actually has removed from the standard versions.
Say you wrote a mac game in Objective-C/OpenGL - how much effort would be involved in porting it to OpenGL ES for iPhone? Is it as simple as changing a few calls or would it likely involve extensive re-engineering?
You can write OpenGL code that works on both Mac and iOS platforms. However, you would need to factor it carefully.
If you just wrote OpenGL for Mac without a deep understanding of the limitations of OpenGL ES, you'd be in for a complete rewrite.
Writing for iOS and then moving to Mac would be easier, since OpenGL ES is a smaller API than desktop OpenGL.
One thing you have to decide is whether to use OpenGL ES 1.1 or 2.0. Version 2.0 removes all the "fixed graphics pipeline" code from the API. You have to do a lot more work yourself using shaders, or use code libraries that provide equivalent functions. OpenGL ES 2.0 offers better performance and more control, but at the cost of being harder to use.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.