libGDX or Cocos2d-X which is more powerful?

libGDX or Cocos2d-X which is more powerful for 2D and 3D???

I’m not sure if anyone here uses both and can give you an answer. I am bias and could say that we are, but I haven’t used libGDX

The performance difference is not significant for the game you are able to do.
Cocos2d-X is better. Mainly because libGDX tutorial is rare.

More powerful in what regards? Performance or features?

@iQD Features as well as performance and cross platform.
for 3D which one will be better…

You should also consider recently started with getting attention Urho3D engine and it’s C# bindings version UrhoSharp.

1 Like

I’m using both. Or more exactly I was using libgdx and switched to cocos2d-x. Both are good anyway. I prefer cocos2d-x, but some stuff is better in libgdx (primitives drawing is so much faster).

My General Overview of the two:- I switched to Cocos2d-x about two years back, back then it was a good experience to develop in libgdx for android always felt like home because of java. Initially i found Cocos2d-x a little vague as setting it up for 2.x was a pain. But as i started to understand it better it was fun and i felt it more powerful and user-friendly, i liked the way how cocos2d-x wraps OPENGL apis and allow complex UI hierarchy with ease. The way engine dev team is putting together Cocos studio is also promising and shows their commitment to take this technology forward. Recently i didn’t got time to put back my java and libgdx shoes so literally i can’t comment on libgdx or how far they have come. Any one with experience with libgdx is more then welcome to share :slight_smile:

1 Like

First just keep in mind, that the 2D rendering mode is just 3D with orthogonal projection. There is no “real” 2D. Every concept is still 3D.

Judging from the feature list, I would say they are on par. The same goes for cross platform. Both support the same targets.
The main difference is, that cocos2d-x’s main language is C++ and libGDX’s is Java (some C and C++ components for performance dependent code).

If you want to measure real world performance, you would need to run some standard benchmarks on both engines.
First tests suggest, that libGDX is much faster:

Both support the basics of what you need, so I cannot see a clear winner. It’s just personal preference. Do you prefer C++ to Java? Does the libGDX API fit you better?
There are also editors for particles, tilemaps and other stuff, which are engine agnostic or supported by both.

What both engines share is, that they are no multi-threaded engines. They leave a lot of performance potential behind. Neither they are component-based, nor they use modern features like lightweight threads. This might change in the future for cocos2d-x. A multi-threaded engine with a component based approach is kinda on the list.
In the future, performance could increase dramatically by implementing the mentioned features and also switching from OpenGL(ES) to Metal or Vulkan.

3 Likes

I’ve used both for 2D. I like both. They’re probably more or less on a par feature-wise, though Cocos might be ahead in 3D (not sure). Both will be plenty “powerful” enough to make your game unless you’re planning something epic, in which case you should probably stop and have a good think about what you’re doing :wink:

Each takes a different approach. Cocos is more of an “engine” in that it provides a structure for you to build your game around and trying to go outside this will cause you pain. libGDX is slightly lower level, more of a toolkit in that it gives you a box of parts that can be assembled more flexibly to make your game, at the cost of having more to think about.

The Bunnymark example quoted shows this. Cocos suffers in this benchmark because of updating the hierarchical scene graph structure it enforces (the benchmark is CPU limited on Cocos), whereas libGDX has scene graph features but you don’t have to use them. libGDX can just blit quads to the screen at high speed which is why it performs so much better on this benchmark. If you rewrote the benchmark using libGDX’s scene graph I suspect Cocos might win.

FWIW I wrote a little more on benchmarking.

Other differences…

Cocos runs on Windows Phone, doesn’t need a (free) RoboVM licence to target iOS, produces ~6Mb (iOS) smaller executables that run faster, use less memory and can’t be decompiled (if you use C++), has deterministic memory management and it’s probably easier to integrate 3rd party SDKs.

libGDX runs on WebGL (does Cocos?) and RaspberryPi. To counter the previous paragraph, work has begun to get it to run on Windows Phone, it has ready to go bindings for most common SDKs and memory isn’t really an issue if you take a little care. It’s also arguably a better desktop platform with good Steam, controller and monitor support.

There’s a couple of mature entity/component systems available for libGDX if that’s your thing. There’s actually quite a good ecosystem of clever, open source add on modules outside the core library in general. There’s an active forum and IRC channel and the main developers are easily contactable on Twitter.

Java vs. C++ is up to you. I have cough years experience in both, though I do find Java more productive (and you can use other more modern languages with libGDX too). You might find this a good read (by the main dev of libGDX): reddit

Maybe you can answer your own question now? :smile:

Yes, it does:

Cocos2d-html5 is an important module of Cocos2d-JS. It is a pure HTML5 game engine, which is based on Canvas/WEBGL and is 100% compatible with HTML5. This ensures that a Cocos2d-JS project can easily be run on HTML5-ready browsers

This is where the different SDL modules come in :smile:

Eh I meant can you compile your C++ codebase to a web target (maybe via emscripten?) like you can with libGDX’s Java?

Sorry, I don’t get it. Neither Cocos or libGDX use libSDL as far as I’m aware. Unless you mean using parts of SDL with Cocos?

Ah, sorry.

It’s on the list:
http://discuss.cocos2d-x.org/t/are-you-interested-in-emscripten-platform/18251

Yeah, I meant using the appropriate modules of SDL for e.g. controller support(as you were mentioning it).

And no, there is no SDL backend for libGDX or cocos2d-x. There were only people on the forum asking, if it can be implemented.

LibGDX only runs in an emulated virtual machine on iOS (RoboVM), I think that’s a major flaw.

libGDX is compiled to native ARM code on iOS. On CPU bound tasks it outperforms Unity by a factor of 3 or 4 and even outperforms native Objective-C, and you can always add C++ libraries if you’re really stuck. CPU performance is not an issue.

I’d had this notion myself when looking at implementing a Windows Phone backend for GDX :slight_smile:

i have searched lot its looking very tough to compete Unity3D for 3D game development.

Are you referring to 3D mobile game development or 3D game development in general?

Compete in which category?

In my opinion for IOS cocos2dx and for android libGDX.
I used both for 2d only never use for 3d.
My favorite language is JAVA so I will choose libGDX over cocos.

Deploying to iOS is a pain on libGDX, it is not on cocos2dx (as far as my tests go). There are a lot more tutorials on libGDX tho.