We need a friendly ENGINE, not a dysfunction EDITOR

@anon98020523, Big Fish Casino is using the tech stack of JavaScript + JSB to run on both iOS and Android natively. I just checked AppStore US, Big Fish Casino is on top grossing chart #19. Well, sometimes it can rank in top10.

It’s totally no problem of running a JavaScript Bindings on iOS Android natively. Big Fish Casino is a good sample. Perhaps you don’t know that in China, at least 60% of successful cocos2d-x games are using Lua script. Tencent started to port their 2D games onto HTML5 title by title.

I don’t mean HTML5 is the only thing, but to use JavaScript to cross both HTML5 and mobile native easily. After all, we have JSB technology for 4 years.

1 Like

Thats not an example, it’s simple game in terms of technical realization for most things.
Better to show games like Badland or Kingdom Rush developed in javascript. Anyone?

Again, I’m talking about developing, not just running. Not a question - how to developed games using javascript in Xcode?

And again, moving to javascript it’s moving engine back to China for those developers, ok for them. But again, it’s a chance for other engine… that market really needed at this time, with normal editor, performance, get started guide, tutorials and language…

2 Likes

@walzer like i said there is a big difference in what the Developers in China want and what rest of the world wants.

2 Likes

wait wat? [citation needed] :worried:

@walzer I must mention here that I support this overall shift towards javascript. Please add to your plans support for Cordova and Electron as an alternate to JSB. Then we can have ‘native’ javascript and use all the Cordova/Electron APIs/Plugins to keep more of our code cross platform in javascript, along with html/css support for building the UI.

Like most people here, I am a C++/Java/ObjC developer with a huge investment in existing apps and games built using C++ and Cocos2dx. Just the shift from Cocos2dx 2.x to 3.x was painful and took a lot of effort but overall it was worth it. We have been building using Cocos2dx C++ for 5+ years now, and are very happy with it.

But the world is changing, and javascript has established itself as the language of choice for full-stack development. For everything including client side apps and UI using Cordova, Electron or Ionic, Games using JSB or WebGL, server side code with Node.js, etc… The entire Visual Studio Code IDE is built in JS (using Electron) and same with Cocos Creator.

The advantage of not having to work with multiple languages is huge for individual developers. And it becomes even more important when there are multiple people in team. Companies can deliver much better and bigger projects with smaller team sizes. Instead of hiring 2 developers each for Cocos2dx C++, Android Java, iOS ObjC and Server C# etc… and then all of them switching between different projects for their ‘part’ of the project etc… Now a team of 2-3 JS developers can focus on only one project and do all of it. Much more productive and economical for businesses.

It will be a slow painful shift, almost a rewrite from scratch. But it needs to be done. We have moved many of our native java/objc projects to js/cordova/ionic etc and it takes time but worth it. We haven’t run into any app performance issues until now. We started working on this almost a year ago and it will take many more months for some of our projects. You can at least start the new projects in JS while you learn, and decide upon migrating existing projects later.

We are also reconsidering how and where we use cocos2d-js. There are many other js libraries like threejs which are better for some projects. But cocos2d-js is still the best option for many projects. And we are moving a lot of UI/HUD components like settings pages etc to plain html/css instead of building them with cocos2d UI components. That is 10x less code, looks better and less bugs.

And current Cocos2dx C++ is still well maintained with new features (android c++ debugging coming next) and updates so there is no rush or crisis. If you don’t want to move or want to wait some more time before the trend with js is more clear, you can continue to use Cocos2dx C++ for another year or more before deciding if you need to move or not.

Good Luck to all of us :slight_smile:

Farewell to our friends: Chukong U.S office is closing March 31, 2017.

1 Like

how big is the performance gap between cocos2d-x and cocos2d-js?

U need to make benchmarks

With JSB, you shouldn’t notice any speed difference as all the core engine is same as existing C++, and the JS files are precompiled to jsc for JSB. But you should test and benchmark to make sure how it will be for your game.

We are not using JSB, but loading the web build in a webview which runs using WebGL (similar to what cordova/phonegap/ionic do). We noticed some frame rate drop when there is a lot of text on the screen. But now we are using plain html/css for most of the text/settings UI so its even better. Takes the load off from main game loop.

One thing to note about cocos is that it redraws everything in every frame. Which is how it should be for games that have constantly moving animations etc. The browser usually only redraws something which has changed. So the ‘non-animating’ hud/ui/text elements drawn using html/css help improve the performance.

2 Likes

I can see your point. For us critters, chipping con c++ wood is good. :yum: C++ wood is healthy, fast, and makes us powerful. Js is so snowflakhishly…:sleepy:
Jokes apart, if you, like me, have a code base that’s not convenient to port to js, or cannot be ported for any reason, then we have no other choices than look elsewhere for those use cases…
I dig it recently for a couple of months, and after having discarded fiber2d (because of swift), oxygine (because being good but too light on features for me), godot (really tempted by no components, sorry need that), bgfx (cannot find something working as an engine on os x, a shame bgfx is really good), libgdx (i don’t trust the ios connector and ji-ji-java), i set myself on urho3d.
It sports both 2d and 3d engine. Sure, It’s not a specialized 2d engine like cocos so don’t expect Spawnthisandthat but I’m evaluting it and I think can be good for my C++ needs. Moreover, the forum guys rocks, really clever people. So…

5+ years ago when we started, C++ was the only way to develop cross platform games and apps, JavaScript is now another option.

You can choose cocos2dx or some other framework, but I would strongly recommend giving a second thought to JavaScript.

(Or TypeScript, which I find to be a better JS as it gives better auto-complete while coding and better compile time error checking. For JavaScript I will recommend using WebStorm, and for TypeScript you should use Visual Studio Code).

Languages are just tools. I have moved between C++, Java, ObjC, Swift, JavaScript, Python, PHP, C# over the years and differences aren’t much. Javascript is only becoming special because there are now JS frameworks that can do everything from server (NodeJS) to mobile apps (Cordova) to desktop apps (Electron) to games (WebGL) to WebVR and IOT etc… Making it possible to not work with multiple languages for a single project. Or in case of companies, not hire people with different language skills.

If you are happy with current C++ cocos2dx why not just stay with the current cocos2dx releases? Why migrate to another similar framework? I think the Cocos2dx team is doing a good job of giving more options for developers who want to use an Editor for development, or for developers who prefer JS. They haven’t stopped development of the core C++ engine that we all love.

We are doing the extra work of moving to JS because it gives some advantages in development/maintenance time/cost. And makes it possible to target more platforms that need html/css/js apps. Where this is not the case, we are continuing with cocos2dx C++. Moving to another framework is just too much work with no benefits.

I love C++ and Cocos2dx, but I am not biased against other languages or frameworks. Some of our projects are using ThreeJS while others are going to stay Cocos2dx C++. Most of them are now Cocos2d-JS, and we are ‘trying’ Cocos Creator for one. It really depends on the project and its needs.

exactly that. on your last sentence is the truth. I’m currently evaluating a use case where I probably have to use libnoise, voro++, ozz-animation, and some. so no cocos, because i cannot change the (now lower) c++ chain.
Cannot modify update cycle; it’s trapped into unreadable bindings, let alone possible performance problems.
Cannot use components; they only work up the chain(creator), not down (cocos2dx).
Clearly using cocos for such an use case is an error… moreover, I don’t even know if it’s going to be done, just evaluating…
I will use cocos chain when i see fit. I like sdkbox idea. I’m probably use it even outside of cocos, if it’s possible.
I’m evaluating other engines because they have what i need without me having to “rebuild the wheel” about componentization, factories, and so on. just that. saving time.
About js: because everyone is doing a thing, doesn’t mean is to be taken without the right consideration.
At the moment, if I take a c++ code base, I can port to emscripten. Unity and Unreal do this, if i’m not mistaken. It’s the inverse path. Not that I like it particularly; it’s just saved time. As I said in many other places, doubling your code base because there’s a new kid on the block it’s not a sound business behaviour. The same reasons who moved cocos to the choice of html-first (which I approve, considering the challenges of chinese market) applies for me…
Until someone convinces me that emscripten is not a viable solution for whatever the reason, i will not port. That doesn’t mean i won’t uses cocos; i will probably use on something new, which needs fast execution, 2d only kind of games, widespread diffusion. Facebook channel? Hope so, If we find a way to monetize/gain audience. Apple just launched its message channel, and already appears to be dead…:confused: So…

1 Like

I wanted to port my game to JavaScript but there’s almost no documentation for it, or it’s all in Chinese. The JS-Bindings scripts are very buggy and undocumented. There’s no smooth migration path other than just using the new tools (that sometimes do things in a much different way), and just rewriting the whole game.

I was just trying to test out cocos2d-js… Do i need to install something on xcode because I’m getting no intellisense and jump to definition etc.

Yes, documentation is a problem with entire cocos2dx family, both C++ and JS. But Cocos2d JS not very different from cocos2d C++ once you figure out the build process, config files and folder structure. Actual code follows exactly the same API and parameters etc…

I am also not a huge fan of Creator. Both because its new for me and because it is itself new. And porting existing apps and games to creator will mean almost a rewrite from scratch. For new projects its a good option.

I would suggest using webstorm and running js version in chrome. You will get all the autocomplete and go-to-definition etc. For some of our other JS projects using Cordova/Ionic/ThreeJS etc we prefer using VisualStudioCode and TypeScript but Cocos2dJS does not provide TypeScript definitions due to which autocomplete etc does not work with VisualStudioCode. Debugging works just fine.

And the entire run/debug sequence with webstorm+chrome is 100x faster than xcode/android-studio/device/simulator etc… Just refresh the page to see all your changes. A lot more productive. Google has been trying to give the same for native android apps with Instant Run but it still doesn’t work and its been out since 2 years now.

Good to know.
And, moreover, istant run only works on java code. No way with ndk and c++.

They did plan to add ndk support for instant run too, of course it might happen tomorrow or not happen for 6 months.

It won’t be too fast as they will still need to do the ndk-build and then copy over the new .so file(s). But it will at least skip the apk packaging step which does take a lot of time.

@walzer Actually it’s all that simple - ideal language for cross-platform development of 2d games it’s that is supported by “native” IDE’s, so for iOS & android it’s Xcode & Android Studio respectively.

That why I will not use any other language for development 2d games for major platforms iOS & android. Moreover, I’m developing game in Xcode by 95% and then adopt it to android in studio. Who also thinks and doing this same way?

p.s. another fun option currently maybe a SWIFT, but it’s not supported by android, however who knows… it’s so popular and so pushed by Apple, so even google will support it soon :smiley:
p.s.2: https://news.realm.io/news/swift-on-android/

1 Like

“That why I will not use any other language for development 2d games for major platforms iOS & android. Moreover, I’m developing game in Xcode by 95% and then adopt it to android in studio. Who also thinks and doing this same way?”
I do exactly the same, xcode + eclipse for android.
I will never choose another language then c++. Because of portability, and to extend with functionality.

4 Likes