Skip to content

u/teokk

In this archive from Mar 2018 to Mar 2021

1
posts
5
comments
0
media
11
score

Eh... I'm not really sure what to say. When I first saw your question, I was still pretty furious so my answer would've been a hard no. Now that I've cleared my head a bit, I might be inclined to give a slightly more balanced answer.

When it's good, it's great. It's a really fast and efficient engine and my game runs amazingly well on even the shittiest phone and drains no more battery than just the screen itself.

The engine itself is relatively respectful of C++ conventions for the most part. The biggest offender of course being the construct, init() and autorelease() model taken from Objective-C instead of a RAII approach. It's really up to date on some C++11 features and not at all on others.

The code of the engine itself is mostly decent or good, but there are some places with really questionable decisions and practices. The biggest advantage comes from the fact that's it's completely open source and very simple to understand under the hood for the most so you can modify the engine to your liking. You're really free to do things exactly your way in almost every regard, but at a large time cost.

There are four main things which I think are the biggest drawbacks and of which I am, frankly, really fucking tired of.

First is the complete lack of direction, focus and a plan. There are some great people behind the project but no one's a good leader at all. There are things like the cocos2d::Vector class which is a wrapper around std::vector and manages to be worse in every way and no one uses it. There are like 17 different GUI tools that were developed and scrapped. There are two different audio engines, both of which are crap. It can be difficult to understand which of these things you need, which you don't and how to use them. And the worst of all is just the obscene amount of time and effort put into them which could've been used so much more productively.

Second is the astounding lack of documentation. What little documentation exists is so bad, incomplete and outdated. Most of it is written in horrible, barely understandable English which is an even larger detriment than it sounds at first. After a while, I guess I understand the engine but I can still never be sure that I get it get it because there's just no even semi-official right way of doing anything.

Third is the hell that's outside of the actual engine and actual programming. Getting everything to work and setting everything up properly is such an incredibly frustrating, laborious, time consuming and unrewarding process. You have to manually fiddle with dozens of different components and configurations without really knowing what the hell you're doing before you manage to do anything. Every new, outside thing you add basically restarts the process. I added a small JSON library that's just a .h file and everything blew up and it took me four days and like 6 versions of Android NDK before I managed to get it to even compile for Android again. Once again you're mostly on your own in all this. It's slightly easier because you can consult general Android documentation and stuff, but much of it ends up being cocos specific.

Finally, the engine itself is huge, but actually rather poor. I basically ended up writing a GUI framework from scratch with a game somewhere in there. There is of course a decent looking GUI part of cocos, but I just never managed to get it to play by my rules and I found that writing everything myself was far less frustrating. It's just one example of many, many thing I had to take into my own hands, whether by actual necessity or just to make some things make sense. I added like 400 lines to the base Node class just so I wouldn't constantly have to calculate the desired scaling and positions all the time.

So basically, if you want something that you can pend a lot of time on and make your own in the end and do exactly what you want, cocos2d-x might (still just might) be for you. That's without all the hassle not directly related to programming in it. If you just want to write a game painlessly, might be better to use Unity or something more supported and focused. At this point, I think I'll most likely end up trying Godot, despite all the time I've sunk into cocos and all the things I learned. I'm just really tired of dealing with bucketloads of problems that have absolutely nothing to do with code.

EDIT: Another thing to consider is that cocos lets you a lot of things outside its purview in just vanilla C++. If you were so inclined you could just learn how to make a scene and draw a sprite on screen and do the whole game without ever calling any other cocos functions. Which is pretty good while learning it, because you can almost always just do things even if you don't know how they're supposed to be done in cocos. It also gives a rather "pure" C++ feel (apart from the garbage collector / memory scheme it uses, which you could also skip, I guess) that you definitely wouldn't come remotely near to in, for instance, Unreal Engine. It doesn't force its own types on you (doesn't really have that many) like UE, or really doesn't force anything on you.

2 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.