Cocos Creator few questions :)

Cocos Creator few questions :)
0

Hi, we need to create a game, and we want choose cocos creator as engine/tools. Our question are:

  1. How are the performance with this engine as HTML5 version on mobile?
  2. Android phone entry level? (our game is a 2d fighting game)
  3. When cocos creator compile the apk or the app(iOS), the game is in javascript inside a web view? or is a native engine for single OS?
  4. There are some way to integrate differente SDK outside SDKBOX?

Many thanks in advance for help!

Stefano

  1. I don’t think you need to worry about performance these days.

  2. There are so many low-end Android phones that play Creator games just fine.

  3. You can compile to web or native.

  4. you should be able to integrate most anything. Creator isn’t a walled garden in that sense.

So, can we use javascript and will make a native build, no a webview but a app with a c++ core engine (cocos2d-x)? because we have tried but we don’t found how. :sweat_smile: when we set android in build form the build will be in native?

Thanks!

for native iOS app, it will convert to jsb and you can compile it in xcode. just remember to make sure your code works in c++

Hi smellypotato, what do you mean with ‘make sure your code works in c++’? Inside CocosCreator, can we use c++? Or the javascript scripts that we wrote, it must follow some policies?

Thanks! :blush:

sometimes you missed a parameter for a function and javascript will treat that as 0, but c++ will have error

So, (to understand well :slight_smile:)) when we export in Xcode or Android Studio, the project has a core cocos2d-x c++, and all our javascript is converted with jsb? Sorry for all these questions, but we are new in cocos creator and we would to understand it works it inside :blush:

Thanks!

I think all will be converted to jsb, otherwise it should not be running in xcode. that’s why you can bind jsb code manually if you know how

@C_Stefano. I was also curious about the native thing. Most JS game engines wrapp it into a webView. But with CC v2.11 you are able to compile it to native. In a Windows OS you just need CC, android-NDK_r16b, android-SDK_28, Python too, not sure which version & Gradle. No need for a “Android Studio” (hate it). You can compile it via CC Build-window This setup worked for me ! The APK was really small ~ 5mb, and it is performant on low-end devices (i used a very old 1x core android 4.0 phone). I was really surprised.

@slackmoehrle, Its true that nowadays you don´t need to take care about performance on smartphones. BUT, i would say it is really good, if you write elegant code, so you can ONLY test it on old low-end devices. Otherwise you have bloated code and it runs fine on high-end phones and you even don´t recognize that you wrote bad code. Also if it runs fine on high-end, the downside of a bad code is, it consume more energy f.e. This is also one reason why i like game engines that runs super smooth on old low-end devices.

@sledgehammer what I meant was the OP doesn’t have to worry about our performance on low-end devices. NOT that the OP can write crappy code and not worry about performance from it. Bad design will tank any hardware.

Hi @sledgehammer thanks for answer. So, inside CC(cocoscreator) we set NDK and SDK-28 and ‘CC’ will compile out project for native mode? I have understood right? :slight_smile: (so not a web view). Because our entry-level will be 4.0… or minor.
Thanks! :star_struck:

@slackmoehrle , k got it.
@C_Stefano. Yes, this is correct. Inside CC, under the “Build-Settings” you can first “build” second “compile”. Before you do this, you need to specifiy the path of NDK & SDK inside the CC-“settings”. I would say it is also important to set / to check your whole “evironment”-pathes (for Gradle, python, etc) in your OS, so any software can find it. Thats it … And yes, it worked out of the box on my Android 4.00 (really the old one). So no need to change anything in the “gradle.properties” file. But if you wish, you can edit it and specify more lower entry-levels, i guess. I didn´t test this. I am happy i can catch all Android 4.0 + devices. :grinning:

1 Like

maybe you need doc : Cross-platform Game Publish

1 Like

@C_Stefano
Something about performance:
What i found out, is that 3D Sprites (unlit mat) are much much smoother when moving / rotating as the usual sprites you would use ! And i used the same code in both versions. Can´t tell you why 3D is smoother in movements, but its the case. Maybe you can try it out.

2 Likes

Thank you, I will certainly try it!

Stefano