Wiki Suggestions and Corrections. Please Post Here

Hi Everyone.

If you have Wiki suggestions/requests or you have found incorrect/outdated information. Please post here so we can address it.

This wiki (http://cocos2d-x.org/wiki/How_to_use_bindings-generator) does not mention info about tools to install before following the guide.

It should have a Requirements/Pre-requisites section that mentions the things and tools that are needed to follow the guide.

It should also have a Troubleshooting section that mentions the common errors and how to fix them.

For example, while following the guide, I encountered this error (http://cocos2d-x.org/forums/6/topics/53231) but there was no mention that one could encounter this issue on the guide. Turns out I had to install some things for the python library. I think these things should be added on the guide itself to avoid clutter in the forums (and by clutter, I mean posts that do not get replied by at all).

I’ll also add it here:

  • HaxeFlixel has very good documentation as well as a GitHub structure. Check it out and maybe we can learn from them.
  • Another reference doc/wiki would be the OpenFL Wiki.
  • I think it’s also good to have demos on a separate GitHub repo and wiki page.

Thanks Lance for these posts.

I am windows user,and was working with cocos2d-x v3.0 in eclipse.
In the project explorer heirarchy, I tried to modify jni->hellocpp->main.cpp, I found that it is showing syntax error for android/log.h and jni.h.
I found that jni.h is nowhere present in cocos2d-x v3.0 but jni.h is present in
cocos2d-x v2.2.2 at path cocos2d-x-2.2.2\cocos2d-x-2.2.2\external\emscripten\third_party\jni\

Also, for cocos2d-x v3.0, in $(projectDirectory)\cocos2d\cocos\2d\platform\android\jni, there is DPIjni.h. Is this the alternate for jni.h in v3.0.If yes, then, original main.cpp is not correct.

Also, I didn’t find android/log.h anywhere in cocos2d-x v3.0 directoy.

I haven’t used Eclipse on Windows for Cocos2d-x v3 and Android, but I have on OS X and everything works for me.

Just by chance, have you been through this: http://cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse

On http://www.cocos2d-x.org/wiki/Sprite_Sheet_Animation

SpriteFrame* frame = cache->spriteFrameByName( str );

is depricated and should now be

SpriteFrame* frame = cache->getSpriteFrameByName( str );

@Markmcconachie - Nice catch, I will fix it tomorrow morning.

@catch_up wrote:

I am windows user,and was working with cocos2d-x v3.0 in eclipse.
In the project explorer heirarchy, I tried to modify jni->hellocpp->main.cpp, I found that it is showing syntax error for android/log.h and jni.h.
I found that jni.h is nowhere present in cocos2d-x v3.0 but jni.h is present in
cocos2d-x v2.2.2 at path cocos2d-x-2.2.2cocos2d-x-2.2.2externalemscripten hird_partyjni\n>
Also, for cocos2d-x v3.0, in $(projectDirectory)cocos2dcocosdplatformandroidjni, there is DPIjni.h. Is this the alternate for jni.h in v3.0.If yes, then, original main.cpp is not correct.

Also, I didn’t find android/log.h anywhere in cocos2d-x v3.0 directoy.

@slackmoehrle wrote:

I haven’t used Eclipse on Windows for Cocos2d-x v3 and Android, but I have on OS X and everything works for me.

Just by chance, have you been through this: http://cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse

@slackmoehrle
Yes, I tried that, it is working and have tried a few runActions also, and they are also working, but that syntax error still remains… but the main point is, jni.h and log.h are present nowhere is cocos2d-x 3.0 , so why it is not removed from cocos2d-x v3.0

It is working but it is not the issue of working in eclipse or windows…
It is issue in using working on C++, because in main.cpp there is #include “jni.h” and #include “android/log.h” which is not valid.

Also, the documentation is not up to date for cocos2d-x v 3.0

@slackmoehrle

At page: http://www.cocos2d-x.org/wiki/Release_Notes_for_Cocos2d-x_v300

link given: https://github.com/cocos2d/cocos2d-x/blob/develop/docs/RELEASE_NOTES.md
is not correct

@catch_up - I fixed the link to the release notes.

@catch_up - I will create a windows/eclipse/android setup so I can take a closer look at this.

@catch_up - so I went through today and setup a Windows VM with Cocos2d-x v3 + eclipse and I am working fine. I cam compile, debug, run on hardware, etc.

So I’m sorry I dont know if I understand about your jni.h and log.h issue. Here is a screenshot of mine eclipse window with no errors.

i know i’ve said this before, and it’s been edited since i last posted about it, but http://cocos2d-x.org/wiki/Plugin-X_Integration_Guide_for_Android is still broken and confusing.

@bunnyhero - I have to be honest in that I dont have experience here with Plugins and Android. Let me fire up a Linux instance and see if I can get through the document to try and help see what needs to be addressed.

@slackmoehrle wrote:

@catch_up - so I went through today and setup a Windows VM with Cocos2d-x v3 + eclipse and I am working fine. I cam compile, debug, run on hardware, etc.

So I’m sorry I dont know if I understand about your jni.h and log.h issue. Here is a screenshot of mine eclipse window with no errors.

@slackmoehrle
Hello, I never said it won’t compile. Even I said that it was compiling and running for me. But as soon as you’ll open your main.cpp, it’ll mark yellow line under #include “android/log.h” and #include “jni.h”, and when hover them, it says that is cannot locate android/log.h and jni.h, saying that it is syntax error. But still it compiles and runs after this but the yellow line still remains…

http://www.cocos2d-x.org/wiki/Plugin-X_Integration_Guide_for_Android page is very confusing and not clear. I guess its not updated for cocos2d-x 3.0

I don’t know how you guys learned to use Cocos2d-x, I’ve been reading the tutorials here and I’m still trying to figure out how this all works. So here the comments from a newbie (hopefully helpful if you want to make this framework newbie friendly):

  1. What previous knowledge is required to use Cocos2d-x? I didn’t find this info so far. Obviously we need to know at least one of the supported programming languages, but if we want to make games for Android or iOS, should we have knowledge of Eclipse and xCode, or it’s optional?

  2. It’s evident the wiki was written by programmers, writing almost as if programming. In my opinion, they should be written by writers, or programmers with writing skills. The whole point is, the writer should put himself in the shoes of the reader, assuming he knows nothing, or assuming he knows xx (this leads to my previous point.)

  3. There are nice tutorials to set up the working environment for the different platforms, and another nice one “How to Start A New Cocos2D-X Game” for creating a new project. And then a list of Module tutorials. I don’t know if you realize it, but there is a gap here. How do you start modifying the default project to add new game elements like layers, sprites, etc?

I see that my project has different folders: proj.android, proj.ios_mac, etc. How do I add game elements so that they apply to different platforms? Is it possible to make my c++ code apply to all platforms at once, or we modify each project independently?

@ronaldv - Well, each platform has certain tools that the developer should use.

  1. If you read: http://cocos2d-x.org/wiki/How_to_run_cpp-tests_on_iOS At the top it does tell you that you need XCode. For Android we have 2 articles: http://cocos2d-x.org/wiki/How_to_run_cpp-tests_on_Android and http://cocos2d-x.org/wiki/How_to_Build_an_Android_Project_with_Eclipse.

  2. Yes, the Wiki is technical in nature. There are a lot of articles that explain concepts too. There is work being done to edit the Wiki content for clarity. One thing to keep in mind is that Cocos2d-x isn’t one of those tools where you can make a game without coding… i.e GameSalad, etc. It is also not Unity where it is more GUI tool driven with scripting. Cocos2d-x is really meant for programmers. This raises the entry point a bit as it is harder to get into game development. Knowing C++ (or a supported language) is a great start. Then it comes down to learning concepts to create a game as it is fundamentally different from other apps out there (i.e business apps). The API is also very extensive and intimidating. If every article assumed the user knew nothing then the wiki would be 100 times its size with articles that reference other articles, that reference other articles. A big spider web.

  3. The gap that exists is because there is more than one way to write a game. You can put 5 developers in a room and give them the same project and all 5 are going to be different. There is a lot of info in the Wiki about creating scenes, layers, sprites, etc. http://www.cocos2d-x.org/wiki/Scene_Graph

@slackmoehrle - so if we need to know Xcode and Eclipse, why would we bother with cocos2d-x? is it to use one language instead of two? there’s also physic engine for Xcode and Eclipse isn’t it?

“The API is also very extensive and intimidating”
Are you referring to the list of Module tutorials in the wiki?

Finally, the build for the default, empty project for android, using the cocos command, says:

BUILD SUCCESSFUL
Total time: 14 seconds

Although it actually took 5 minutes. For iOS it takes another 5 minutes.

Build 6 times for both platforms and you lose 1 hour! Is this normal, or my computer too slow?