Load CCBI files from latest CocosBuilder(SpriteBuilder v1.5)

Hello,

I’ve developed my game using cocos2d-iphone v3.4.9. Now I need to port my game to cocos2d-x.
In my game I’m using this CocosBuilder - https://github.com/KAMIKAZEUA/CocosBuilder
This is actually an old SpriteBuilder v1.4 that was dropped by apportable.

I’ve a lot of ccbi files - these are levels in my game and I want to load them using latest cocos2d-x 3.13.1.
Using this example: http://www.plungeinteractive.com/blog/2012/12/26/cocosbuilder-and-cocos2d-x-helloworld-example/ and with some additional fixes I tried to load a simple blank scene created in CocosBuilder.

include "editor-support/cocosbuilder/CocosBuilder.h"
using namespace cocosbuilder;

auto nodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary();
auto reader = new CCBReader(nodeLoaderLibrary);
auto node = reader->readNodeGraphFromFile("MainScene.ccbi", this);
this->addChild(node);

First error was:

"WARNING! Incompatible ccbi file version: 10 reader: 5

So, I just changed CCB_VERSION to 10 in CCBReader.h file.

After that I got this bad access error(as reminder scene is just blank, nothing on it):

I have to idea how to fix this. Maybe someone already tried to load ccbi files from cocos2d-iphone v3?

I have a tons of levels, so I really want to use CocosBuilder as editor for my game.

Also, here is compiled CocosBuilder Dropbox - File Deleted - Simplify your life what I’m using.

And ccb\ccbi files of MainScene that I’m trying to load: Dropbox - File Deleted - Simplify your life

Looking forward for some help, really stuck with this.
@stevetranby I saw you answered in other old topics about such kind of problem, can you please take a look at mine?

1 Like

First question. Have you written all the levels yet? If not consider possibly using another tool like CocosCreator (there’s a new C++ export mostly ready to go, I can post a link to the discussion topic if you want). Some other options include Tiled, LevelHelper, your own custom level editor where you create an edit mode so that you can create and play your game in the same app.

If you have a bunch of CCB files or really want to use CocosBuilder instead then:
I believe the Apportable version is actually technically newer and somewhat different than the very old CocosBuilder.
alpha5 I think is the latest version that works with the CCBI loader (CCBReader). It may have been alpha4
https://github.com/cocos2d/CocosBuilder/tree/v3.0-alpha5 .

I definitely have a copy (and I think a fork in my repo, I’d have to check further though) if your compiled version is “too new”.

I can check your .ccb files once the final decision is to in fact continue using CocosBuilder instead of finding another tool that is still in active development.

Another option would be to get or write a loader for the most recent SpriteBuilder/CocosBuilder CCB/CCBI spec based on the github repo - assuming one is still in development.

Let me know your thoughts.

Further reference (mainly for me, I’d like to help work on a new version and write a loader for it).

There’s supposedly a recently worked on fork of Apportable’s SpriteBuilder being renamed back to CocosBuilder. Not sure if there’ll be any more work in the future since the most recent commit is August, but I’ll be keeping an eye on it.

Forum Topic: http://forum.cocos2d-objc.org/t/unofficial-spritebuilder-1-5-0/17973 .
Alpha7: https://github.com/oxeron/CocosBuilder/releases/tag/1.5.0-alpha7 .
Latest Commit: https://github.com/oxeron/CocosBuilder/commits/v1.5 .

Other possible repo that contains the version that supports cocos2d-x.
https://github.com/sandyruoyu/cocosBuilder/tree/master/CocosBuilder-3.0.alpha5-src .
https://github.com/JerryWong0119/CocosBuilder-3.0-alpha5 .

Edit:
Oh and it looks like you’re maintaining a fork of this new version, eh?
https://github.com/KAMIKAZEUA/CocosBuilder/commits/v1.5 .

No, but some of them ready. I’m using my CocosBuilder(SpriteBuilder) and I don’t want to use any other editor like cocos studio or creator because they sucks.

Cocos2d-spritebuilder was abandoned by apportable and they just gone without any explanations. It’s a dick move.
Now we have improved and updated SpriteBuilder editor was renamed to CocosBuilder and it’s working with latest cocos2d-iphone. But actually only a few people use it, because only a few people using cocos2d-iphone because it’s not cross-platfrom.

I was just thinking that cocos2d-x CCBreader requires just some quick fixes to load .ccbi files created in latest CocosBuilder, but after some investigation I did in these past days, after I created this topic - I understand thats this is really heavy task…
However, I really like idea of using new CocosBuilder with cocos2d-x, because it’s native editor for macOS and all things designed almost ideally compare to any editors that cocos2d-x team ever developed. I tried all of them.

So, finally I decided to export my levels from CocosBuilder in my specific .plist format and write a simple parser for cocos2d-x that will load them. Actually, my levels are simple, there is no animations or complex structures, but just a couple of main nodes with many sprite children objects with own properties.

After apportable died I tried to push community to upgrade SpriteBuilder. In that time it was removed from the App Store, but source code available on github. However it’s not compiles even with new Xcode. I did fixes for that and introduced them on cocos2d-spritebuilder and cocos2d-iphone forums as I remember, but no result…
Later @oxeron picked up this idea and was really interested to update and improve it. Big thanks for that. He did many updates, some of them was consulted with me and tested by me. But finally oxeron gave up and stopped that development, because as I see that updates was just for only few people who still uses cocos2d-iphone, so there is no community which can support and and push to action… if you know what I mean.
Thanks anyway for your research. Also I’ve found these with mostly latest .ccbi format:

https://github.com/ZhaoTianze/spritebuilder_cocos2dx
GitHub - nguyenduong/spritebuilder_cocos2dx_sample: Sample with sprite builder for cocos2d-x

But reader still not compatible with my and @oxeron CocosBuilder. However, if use .ccbi files created in old SpriteBuilder 1.1 cocos2d-x will load them. I tested on latest 3.13.1

Also - GitHub - newnon/SpriteBuilderX - looks very promising, need to check it out if it works. @oxeron are you here? This SB looks very interesting and cocos2d-x looks promising, what do you think?

Maybe we should just add the latest version to the parser CCBReader?
It shouldn’t take too much work, and maybe one is already out there that works or is close?

Which is the exact version are you using (or plan to use) to edit your CCB files right now? Download Link or Github Repo.

We could even just skip over the unsupported features, and even just support your needed features. So it’ll need to read all the CCB/CCBI node keys, but wouldn’t need to create the actual Node or other class instances.

I believe this is hard and will take much [quote=“stevetranby, post:5, topic:33854”]
Which is the exact version are you using (or plan to use) to edit your CCB files right now? Download Link or Github Repo.
[/quote]
https://github.com/KAMIKAZEUA/CocosBuilder

Now I’m thinking thats better just export my leves into plist files(that’s east way) and liad them in cocos-x.

Not really. But I’m thinking more along the same idea you have when you say “I’ll just read plist version”. Exactly. granted xml or binary parsing really isn’t hard, just a little tedious and only if the spec isn’t documented well.

I’ll see if I can upgrade or transform my older .ccb files into a version that your repo’s Cocosbuilder supports. Then I’ll try export and upgrade the reader.

That was one of the fork I was using to help improve cocos builder yes

1 Like

Yea, I’ve just tested it - worked really well!