RapidGame: what is your opinion on this?

Hi guys. Please check the following link if you don’t know what RapidGame is.

Have you used it? If you have please share your experience.

On a side note, I think there should be a cocos command to create a new game which uses pre-built Cocos2D library for faster build times. I know that pre-built libraries can be built using cocos command (cocos gen-libs) but we still need to configure the projects manually to link to the library.

This is not entirely true. I believe cocos new will create projects using the prebuilt libraries if your env vars are set a specific way. I do this now. Not in front of a computer right now to check.

1 Like

@slackmoehrle can you share what you use as env vars?

When I get in front of a computer. And please don’t tag a bunch of people to imply you need help. This doesn’t help anything.

@slackmoehrle how do you force it to create using pre-built template? I don’t think it does this out-of-box
@mr746866 RapidGame is currently superior, until cocos-creator is improved quite a bit, except for the fact that RapidGame is now lagging behind in the engine version … sadly neither is a great option for getting a pre-built project setup without extra work (unless someone confirms otherwise with a full command-line example).

I’ll look at my setup. I remember when I was creating tests for SDKBOX qa that I was always using cocos new and getting projects that used the pre-built libraries. I think this was all environment variables.

I also tried to get Prebuilt libraries to work at some point, but it was quite hard and inefficient, since I change some minor things in the engine’s code from time to time.

I’m now using ccache which automatically caches everything you compile and re-uses already compiled code.
This way compiling is nearly as fast a with a prebuilt lib for a full rebuild and additionally, it also speeds up the compilation of your own codebase.
This is literally the best thing that ever happened to my daily workflow.

These two posts here are a good way to start:


http://www.cocos2d-x.org/wiki/How_to_use_CCache_to_speed_up_cocos2d-x_android_compilation

I’ve spent around a day to get it to work, play around with the settings, build up a huge cache (compiling with various settings) and it was totally worth it. Maybe this is the solution for you.

1 Like

@framusrock thanks for the info about ccache (I’ve read about, but never took the time since pre-builts work well enough).

I’ve been updating my own fork of cocos console to support caching generated pre-builts into version/arch/target path hierarchy, but it may be the case that ccache removes any need for this. I will test it out.

@stevetranby Prebuilt is still faster for sure, since ccache has to go through all the source files quickly and check that they are already in the cache. Though it is very very fast and it just works automatically once it’s set up.

Does that mean that you modified cocos console, so that it automatically re-prebuilds the cocos library once you do any changes?

If you’ve got any trouble getting ccache to work, I can probably help.

Guys do you know how to link the prebuilt libraries to the Android Studio project?

@framusrock yeah it’s not fully automated, but partially. I have modified the cocos-console fork (as well as the cocos2d-x fork) and we reference tagged commits instead of using submodules. Then we have scripts that sync up to a given tag (e.g. game_name.major.minor.patch or game_name.build#).

I try to remove modifications of the engine since it’s of course best to not modify it if possible. We’ve removed a lot of custom fixes in the past year, which has been nice.

Using a dynamic cache system like ccache is probably the smarter way to go and hopefully v4 will be designed with clang modules (and other compilers) in mind.

Until then, however, I’d like to see some improvements to the prebuilt workflow.

Unfortunately not in studio, yet. I’ve been focused on Xcode only for our needs. We don’t mind full rebuilds for android/win one time (or a few with compiler errors) every release.

That said if you use gen-libs to get the .so android prebuilt libraries you should be able to hook them into your build with -lcocos2d or similar. The android build process is a little tricky because some config is done through android.mk, others in application.mk, and it cascades.

CMakeList might be the best place to configure this, but I’m not fluent with that either.

Godspeed :smiley: (and hopefully someone else knows)

Edit: there’s some brief info her if you haven’t already read it:

@slackmoehrle please share your env vars.

Hi, I do not know anything about env vars but this works for me:

1- prebuild libraries
2- Create project:

cocos new ProjectName -p projectname.com.name -l cpp -t binary

Thats it.

1 Like

@jrosich thanks for sharing that -t binary gives a template of projects with linked in prebuilts
@slackmoehrle prob should document that in the help usage output of the command line tool

I’ll document that and update the production docs.

@jrosich Thanks for bringing this up.

I figured out that mine works without -t because I still have my env vars pointed to my Cocos GUI folder.

Thank you for sharing.

Your method would be perfect for me except for one thing. It does not produce template for Android Studio (no proj.android-studio).

Do you know of any way we can link the prebuilt libraries to an Android Studio project?

@stevetranby draft text:

Using the pre-built libraries in your projects.

Once you built the pre-built libraries, you can tell cocos to use them when creating a
new project. You may have heard developers refer to using static libraries. This is exactly
what you have created by running the cocos gen-libs command above. Doing this you have told the
compilation process that these files don’t need to be compiled again, just use them. Using
static libraries will speed up your compilation time. To create a new project and have it use
static libraries rather than the raw engine source you specify the -t binary flag to your cocos new ... command. Example:

cocos new ProjectName -p projectname.com.name -l cpp -t binary

Sorry, I dont work with Android yet so I have no clue. Have you prebuilt the libraries for Android Studio too?