Flatbuffers version or binary

Maybe you could fix this if you are familiar with flatbuffers?
Then @zhangxm could update the version.

Or I can look at it if @zhangxm provides more information about the issue. But it will be by the end of the month …in the best case.

1 Like

Right, more information from @zhangxm about the issue would be nice.


And there are many other developers complained it in Chinese forum. What i did for updating flatbuffer are:

  • update flatbuffer
  • use new version of flatbuffer to regenerate header files used in studio reader
  • modify reader to adapt new flatbuffer

More detail information can refer to: https://github.com/cocos2d/cocos2d-x/pull/17349.

The dropbox link is broken. Where can I find the uncompiled old scheme file?

It is here: https://github.com/cocos2d/cocos2d-x/tree/v3/cocos/editor-support/cocostudio/fbs-files. But i am not sure if it is the one used in last version of Cocos Studio.

Actually, the problem is not triggered by newer flatbuffers version.

Could you explain this in more detail please?

It’s triggered by different field sequence at fbs.

you can compare the cocos2d-x 3.15 and 3.16 .fbs files.

1 Like

As @halx99 mentioned, the FBS files changed and that’s why the latest flatbuffers doesn’t work.

I don’t remember why i need to modify .fbs in v3.15. You can try to update flatbuffer without breaking.

Thank you! I will look at it.

Any progress on that?

Okay, I downloaded the sources of flatbuffers 1.0.0 (https://github.com/google/flatbuffers/releases) and compiled a flatc command line tool for me. After that I created a schema and generated the cpp header files (flatc -c *.fbs).

After including your flatbuffers folder into my project I wanted to compile and get errors. Because my generated file used e.g. FLATBUFFERS_FINAL_CLASS.

After that I copied your sources/headers into the folder structure from 1.0.0 and tried to compile (make flatc). It was not possible, because the idl_gen_java.cpp was not able to compile.

Are you sure it’s an unaltered 1.0.0 release version? I would be happy, if you can create a flatc binary (mainly macOS) and can attach it to this thread. So everybody can use the bundled flatbuffers version until someone figured out, what’s wrong with your schema files.

Maybe @slackmoehrle can help with it?

The schema files are copied from Cocos Studio source code by @zhangbin, he kept a copy of Cocos Studio source code after the project is canceled. But @zhangbin is not a member of cocos studio team,
and we don’t know if the schema files are correct or not, and we can not find a guy for help. These schema files are not in cocos2d-x repo until some developer ask to add it.

Not the bundled schema files are the problem. My current problem is, that I can’t generate valid header files for usage with your bundled flatbuffer sources. It don’t want to alter them, because I don’t know what will break. I want to use your flatbuffers sources (from 3.16), but this isn’t possible, because they are not from v1.0.0 (even the header named it).

I do need the original git commit from the flatbuffer sources (in the google repo), to be able to create my own flatc binary.

PS: @slackmoehrle Do you understand my question or is it too confusing?

Why don’t you e-mail me so we don’t clog the thread with gaining understanding? slackmoehrle@cocos2d-x.org. I can get some people involved after I understand. I don’t want to make an assumption.

1 Like

I am sorry, I was busy and forgot to check this post.
There is no progress now, I will notify you when I have something.

I’m again on this issue. I want to update the flatbuffer source to the latest stable version (v1.10.0), but where can I find any Cocos Studio files to check if the new _generated.h are valid. In my own project, I can exclude the Cocos Studio support, but I want to give back something to the community, that’s why I ask. @Priority10 Do you have any files?

PS: Is it possible to deprecate Cocos Studio support in cocos v3.18 and remove it with v4, so that everyone can include newer flatbuffer versions or is there a way to include two separate versions? @slackmoehrle what’s your opinion about that?

1 Like

Let me have @drelaptop read this.

1 Like

So, the new generated files and changed Cocos Studio support files are compiling very well (I like long train journeys home for christmas). Now I need some real test files to check if everything works fine. Can someone send me via PM some, so I can confirm everything ist working like before or change the FBS if needed.

1 Like