Sign in to follow this  

jojos2d-x anyone?

Recommended Posts

I have been thinking about a large project and am wondering if anyone else would be interested in this besides me.
I'm thinking of forking the cocos2d-x codebase and cutting out a lot of crap and turnig what remains into something cleaner that attempts to do less. The motivation here is that
  1. Cocos2d-x v3.2 is a mess. It was a major release that added features that I don't care about without fixing what is obviously broken and made the terrible documentation situation even worse because it broke backwards compatibility with all existing tutorials for an increasingly complicated framework that essentially doesn't have English language documentation.
  2. I don't like the sort of high-level direction that cocos2d-x is going in. They've now released an IDE for putting together script-based games and this is what they seem to care about. To support the IDE they are bringing more and more stuff into the framework proper to facilitate the scripting of these features by making them cocos2d-x objects e.g. physics is now in the framework itself, 3d is now in the framework itself, etc. If you use this stuff you get locked into the development choices of the cocos2d-x developers who make cavalier choices driven by the fact that they are entirely interested in creating a framework that allows developing certain kinds of generic games quickly not with creating an elegant framework for any kind of 2d game.
Specifically what I want to do is the following
  1. From the cocos2d-x v3.2 codebase take just the following: The Sprite hierarchy and the node tree model -- scenes, scene transitions (maybe), layers, basic sprite types, input handling, audio, and the action model and nothing else. No integrated physics, no 3D nodes, no javascript integration.
  2. Get rid of the current memory management stuff entirely and replace with std::shared_ptr, std:weak_ptr, and std::unique_ptr.
  3. Get rid of all internal usage and exposed to the framework user usage of nonstandard container types. Replace with std::vector, std::list, et al.
  4. Support only iOS and Android.
  5. Write English as a first language documentation for the above.
Edited by jwezorek

Share this post

Link to post
Share on other sites

It is licensed under the MIT license, so most of those things are perfectly fine.



First off, I'd wonder about the usefulness of removing the features. It may make it easier for you to understand, but the purpose of the library is to help build games. Create your fork, remove the features that you don't use in your actual games, that is fine.  But removing features simply to remove them (rather than because they impair usage) just makes it less usable to the masses.  There is an enormous difference between saying "I don't think I will use this so I'll remove it" versus "my entire set of potential users will not use this feature so I'll remove it" versus "this feature adds unnecessary complexity or otherwise harms the purpose of the system, so I'll remove it."  The three are very different.  You might not use 3D nodes or JavaScript integration, but does that mean others will not, and does it mean the features complicate it unnecessarily? Adding functionality you need is a great reason to make changes, but removing existing functionality is generally questionable.


I'd worry somewhat about the documentation, since documentation found outside the source files is potentially covered under something other than the MIT license and represents a copyright concern. Also the name you picked might be a problem in terms of trademark. Those are legal issues rather than technical issues, but something to consider.

Share this post

Link to post
Share on other sites

First off, I'd wonder about the usefulness of removing the features. It may make it easier for you to understand

It's mostly about making it easier for me to do.


I want to rip out the memory stuff that is basically a port of the way cocoa/nextstep handles allocation because of cocos2d-x's roots in cocos2d-iphone which is Objective-C. Cutting features makes for less stuff that I am going to break in the process of doing this and therefore less stuff that I have to make sure works again. (and to be honest it is also partially about philosophical differences but if I could push a button that would magically clean everything up without removing anything I would probably push it).


Doing something with memory management was actually one of the big motivations for version 3 in the first place -- there was a lot of discussion about this in the forums last summer. Me and a few other people were arguing to just move to standard C++ smart pointers, but it ultimately didn't go that way, with the people who did the work on version 3, citing performance concerns, not touching memory at all. I never really bought into the performance argument and just lost interest in version 3, although the new renderer thing is nice.


But regardless, this is basically why I am posting about something that I am going to do for my use ... I am interested if anyone else wants this. My hypothesis is that most of the advanced features aren't being used anyway because they aren't sufficiently well documented and aren't implemented in a general enough way to be particularly useful. From reading the forums, I think most people use the node tree and actions, period. I don't know for sure but am guessing this is what is happening. 


Didn't actually think about possible legal issues but you are right. 

Edited by jwezorek

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this