Feedback: master volume, project-based build template, time scale

Hi,

I like using Cocos Creator. After creating a game with it to test this powerful editor, I have some feedback regarding to Cocos Creator. I hope this can be a good help for the editor and other users.

  1. Master volume & stop all sound regardless of the trigger
    I think it’s great to have a master volume for all audio played through cc.audioEngine (including AudioSource, if it’s related). The problem I had was when I need to do “mute all sounds”, I need to mute AudioSource one by one. I also got to immediately mute any audio to play from cc.audioEngine because stop/pause all only stops the one that is currently playing, not the one that is about to be played. My solution was to wrap it in some sort of audio player class, but it doesn’t seem necessary because it’s more of a patch more than specific features for a specific game.

    An internal master volume feature can be helpful to turn down and up all the sounds currently played and about to be played automatically. And if there is any, say required for a specific game, each of the audio already has its own volume that should respect the master volume. The stop all sound, while not replacing the old one, it might be better if there is an API that could disable sound entirely and not playing anything until it is enabled again.

    In practice, this is mute button and master volume button. It’s useful, such as the situation where many web game publishers demand these as their requirement.

  2. Project-based build template
    In web only build, it has splash screen enabled for loading display. In my case, I need to customize these based on each project, especially when there are many third parties asking to put their logo in it where I am expecting to cram them inside a single screen and not waste more of Player’s time by adding another in-game splash screen, or when I simply want to put the game title or loading illustration. Sometimes this involves different styling format that requires changes in HTML and CSS itself per project (custom loading bar, for example), which also depends on the screen orientation.

    I just realized this issue extremely important after I finished a game with the editor and moving into the next one, where I am expected to patch the first one occasionally. This forces me to copy-paste each build templates one by one to CocosCreator’s build folder every time I switch between projects, and editing them can be a hassle. This is quite a problem especially when the development time is short, say roughly 2 - 3 months per project.

    It would be nice to at least have project-based build template, where by default located in the project’s folder right after a new project is created.

  3. Time scale
    It will be nice if there is an API that can “bend” the render speed for slow motion effects down to 0 (similar to Unity Time.timeScale). This may be game specific though which seems to be okay to be done manually, so it’s optional.

If any of these have been actually implemented, please let me know, as I’ve searched all these and they end up required to be done manually as answers.

Thanks for reading. :grinning:

Thank you for the feedback. I will pass this along to the engineering team to read.

1 Like

Thanks for the feedback. You can set project-based template in this way http://www.cocos2d-x.org/docs/creator/en/publish/custom-project-build-template.html. The time scale only available for scheduler now(by using scheduler.setTimeScale), we will implement a new one for global use.

Thank you for the reply, my bad that I missed the project-based template! :joy:

I’ve tried the project-based build template you suggested it doesn’t seem to work. I have an already opened project and tried to copy the build-template and customize from there with the given structures (including the jsb-binary and jsb-default folders), but when I build it, it still use the default from CocosCreator folder.

The console log says this:

Generating main.js from E:\CocosCreator\resources\static\build-templates\shares\main.js
Generating html from E:\CocosCreator\resources\static\build-templates\web-mobile\template\index.html

It generates the files from the CocosCreator instead of my build-templates. Is there anything I should do with this?

Cheers.

What version are you using?

version 1.8.1.

Could you submit a demo project including the build-templates?

Sorry it was my mistake for not investigating further. I’ve copied the custom CSS and the splash image to the web-mobile folder and it works now (it refers to the custom build-template folder and displays the splash and the style).

However this leads to another problem; it throws error on my main.js file:

main.js:78 Uncaught SyntaxError: Unexpected token <

Which is <%=isWeChatGame%>, <%=renderMode%>. it also doesn’t render <%=project%> in my index.html as my game title, but literally "<%=project%>. basically everything wrapped with <%= %> is not working.

This happens as I put the main.js in the web-mobile folder as I need to modify the main.js directly to control when the loadscene should happen (I want user to tap the screen first before loading the launch scene, after the asset loading is done). I wonder if this is related the console log I gave, where it doesn’t generate main.js and index.html from the custom build-template.

As for step to reproduce, using Cocos Creator 1.8.1, create new empty project, create new empty scene, build a new one using custom build-template folder containing default index.html and main.js found on the CocosCreator.

But this is not crucial on my end as I can remove them (except renderMode I got to set it manually, but since it’s a custom template it doesn’t matter for me to hardcode).

This issue can be further discussed on the same question that’s being asked: http://discuss.cocos2d-x.org/t/custom-build-templates-parameters/41443

Thanks again, cheers.

You should not use < *** >, it’s source templates we use internally. You can copy the formatted main.js from the file after building.

Why you don’t just add a scene named something like ‘launch’, to achieve this?

Thanks for the build-templates solution, that would work just fine. :grinning:

As for why I don’t use “launch” scene, there are a few reasons. In mobile web iOS, there’s an issue where audio cannot run/autoplay unless user trigger it by touch, and this is not Cocos related-issue. It’s iOS issue (Android is fine). The other reason is auto fullscreen. Same as the previous issue, fullscreen cannot work unless there’s a user input (touch) in Android Chrome (this doesn’t even work in iOS browsers).
So I need a trigger to work these issues out, therefore the tap button.

Now for the answer, if I create a “launch” scene, and say I put that launch button there, that means I have to load that scene first before getting to the proper scene, which is unnecessary. Now let’s just say it’s okay, but then I also have to imitate the HTML-based loading splash so the “launch” scene looks the same, or throw the user with a simple “launch” button in that “launch” scene which I don’t really want.

I want that “launch” button, right after the loading is done, in the same splash screen (sadly in this case the HTML-based loading splash).

I see

…123456789

can you add custom param option in project settings like cocos analytics. It can be useful when you need to change something like facebook appid, firebase…