Posts Tagged ‘cocos2d’

Thursday, May 17th, 2012

cocos2d-x is the natural evolution of the cocos2d-iphone engine to C++ and it is stable and producing multiplatform games.

cocos2d-iphone is a great Objective-C game engine (and the first really) that began as a python engine called cocos2d and was ported to Objective-C + iOS early on in the iPhone SDK days.  Arguably Unity and cocos2d are the two biggest indie engines on the App store.  Cocos2D is a very simple engine and coming from Flash development many of the concepts are similar (i.e. Sprite, Actions/easing, Layers/Scenes (although slightly different), etc).  But getting your Objective-C game to Android and other platforms is not a fun task. There are other options like andengine for android from cocos2d port but each port only gets you so far as you still have two codebases for one game on iOS and Android.

Unity obviously can open up platforms for you but cocos2D-x can also do that for 2D games across iOS, Android, Blackberry Playbook, Windows, Linux and more! This is possible because like oolong engine and other custom multiplatform engines for mobile the core is in C++ with presentation view wrappers/stubs in Objective-C++/C for iOS, Java/C++/NDK for Android, etc. The list of games shows that it is stable and a well treaded engine including games like Hero Academy from Robot Entertainment.

cocos2D-x even has a port of cocos to C#/XNA for Windows Phone development using all the classes you know and love from cocos2d. That is actually pretty sweet to have similar logic to reach Windows Phone (Unity and others bypass because there is no native access by developers sadly still, must, use, XNA — strange considering Unity pushes C# development quite heavily but I digress).

drawlogic originally mentioned cocos2d-x over a year ago in a post about cocos2d-javascript just in an ‘other ports’ category but it has really come along and is quite stable as the game lists are showing. Take it for a spin if you need a cross platform 2D game! If I need to work on cocos2D games I would definitely go with the C++/Objective-C++ engine since it is now stable and gets you many platforms, I also still like developing in C++ which is very common in games for performance and multiplatform performance especially.

Other mentions

Sunday, April 17th, 2011

Recently cocos2d (iphone) reached version 1.0 and they have started a new cocos3d project!

cocos2d is a great objective-c engine for iOS development (and Mac development).  It has it’s limitations but for small 2d based games with physics or platformers with sprites it rocks.  It has made it to 1.0 and many games are made with it on the Appstore.  Unity and Cocos2D make up a good portion of the games in terms of engines used on the Apple Appstore for small to midsize game studios and indies (2500+ games are made with cocos2d).

cocos3d

cocos2d is getting a 3d extension in cocos3d for using 3d mesh/models etc.  Currently it only imports POD models but this could be good for smaller isometric 3d games or 2d using 3d models.  It is early so this will take some time to mature but good news for improving engine performance needed to handle 3d.

This could easily become the most popular/used 3d engine made with objective-c as cocos2d has done with 2d… there aren’t many pure objective-c game engines. The one downfall is multi-platform even though Objective-C is fun.  Unless it is solely a iOS or Mac title then going with a  multi-platform engine or a custom C++ engine and using Android NDK and an Objective-C wrapper on iOS is best for port economics and performance.  That can also be used as desktop and other platforms this way. But for iOS development cocos2D is great.

cocos3d Features

Some of the key features of cocos3d are highlighted in the following list:

  • Seamless integration with cocos2d. Rendering of all 3D model objects occurs within a special cocos2d layer, which fits seamlessly into the cocos2d node hierarchy, allowing 2D nodes such as controls, labels, and health bars to be drawn under, over, or beside 3D model objects.
  • Pluggable loading framework for 3D models exported from familiar 3D editors such as Blender3ds Max orCheetah3D, or through industry standard 3D object files such as Collada or PowerVR POD, or even from your own customized object file formats.
  • Imported 3D models can include animation sequences.
  • 3D model objects can be arranged in sophisticated structural assemblies, allowing child objects to be moved and oriented relative to their parent structure.
  • 3D models, cameras, and lighting can be manipulated and animated using familiar cocos2d CCActions, allowing you to quickly and easily control the dynamics of your 3D world, in a familiar, and easy-to-use programming paradigm.
  • 3D objects can be covered with dynamic materials and textures to create rich, realistic imagery.
  • Mesh data can be shared between 3D objects, thereby saving precious device memory.
  • Mesh data can freely, and automatically, use OpenGL vertex buffer objects to improve performance and memory management.
  • Culling of 3D objects outside of the camera frustum is automatic, based on pluggable, customizable object bounding volumes.
  • Automatic ordering and grouping of 3D objects minimizes OpenGL state changes and improves rendering performance. Pluggable sorters allow easy customization of object sorting, ordering, and grouping for optimal application performance.
  • Automatic OpenGL state machine shadowing means that the OpenGL functions are invoked only when a state really has changed, thereby reducing OpenGL engine calls, and increasing OpenGL throughput.
  • Sophisticated math library eliminates the need to use OpenGL ES function calls for matrix mathematics.
  • Fully documented API written entirely in familiar Objective-C. No need to switch to C or C++ to work with 3D artifacts.
  • Extensive logging framework to trace program execution, including all OpenGL ES function calls.
  • Includes demo applications and Xcode templates to get you up and running quickly.

Learn cocos3d

You can learn more about writing 3D iOS applications using cocos3d, by referring to:

 

 

Sunday, January 16th, 2011

Cocos2D has been ported to run in javascript and called cocos2d-javascript by Ryan Williams.

Cocos2D is a game engine similar to Flash in that it is a 2d engine but it natively renders to OpenGL ES.  Cocos2D-iphone was originally a port of Cocos2D, a python game engine.  But the similarities to Flash and DisplayObjects = Nodes, Sprites, Scenes, Layers etc. This helps to port games over fairly quickly or start in productive in cocos2D.

Having this in javascript is a great thing! It runs on html5/canvas/javascript.

What is cocos2d-javascript?

Cocos2d-javascript is a 2D game/graphics engine based on cocos2d-iphone but designed to run in the web browser. It uses the latest features available in HTML 5 allowing real-time rendering of 2D graphics without the need for plug-ins such as Adobe Flash.

While HTML 5 is still new and not fully supported across all browsers it won’t be long before the vast majority of web users are able to enjoy all that it offers. When this time comes cocos2d-javascript will be an excellent way to develop games and applications.

To see a small sample of what is on offer, please check out the demo section.

cocos2d engines are now available on almost all platforms, so if you are building a 2d game and need a 2d engine typically with Box2D physics, cocos2d offers lots of ways to get the game out there with some porting work.

Saturday, July 24th, 2010

A sweet engine for getting started with Android game development is the andengine 2D OpenGL ES engine. This is very simple and compares with cocos2d-iphone for iOS development in 2D with OpenGL ES.  They both support a wide range of 2d techniques with an OpenGL renderer.  Some great videos are posted on the andengine google code page showing a box2D example, multiplayer example and more.

Mobile games are on slower hardware, similar to later 90′s computers so native is a great way to go for 3d and 2d game development because of this limitation at the current time and well into the next few years.  Take this time to learn you some native gamedev. andengine isn’t native directly as it is Java based but compiled with the Dalvik JIT virtual machine. Another way to go native on Android is the Android NDK which allows C and C++.

The engine also has extensions that can be easily added and some great ones exist already.