cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
7.08k stars 1.82k forks source link

[抖音小游戏] 引擎没有自动解决 手机高刷 的问题. #17267

Open finscn opened 2 months ago

finscn commented 2 months ago

Cocos Creator version

3.8.3

System information

android

Issue description

cocos creator 2.x 时代 是要开发者自己解决的. 但是 3.8 微信小游戏是自动解决了这个问题.

但是 在抖音小游戏下还是不行. cc.game.frameRate = 60 , 但是游戏还是按高刷屏在跑. 经常上到 90 120fps.

Relevant error log output

No response

Steps to reproduce

Minimal reproduction project

No response

qiuguohua commented 1 month ago

@finscn 2.x时代 是怎么解决的 你知道么?我用小米10pro测试,好像是锁帧到60,部分手机好像是可以设置60帧以上。 我看了下代码,设置帧率都是微信或者小游戏的接口。感觉应该是接口问题?

qiuguohua commented 1 month ago

@finscn 抖音平台有个历史的问题,如果帧率设置成60,会不限制帧率。建议设置成60以下在试试看?

finscn commented 1 month ago

@finscn 2.x时代 是怎么解决的 你知道么?我用小米10pro测试,好像是锁帧到60,部分手机好像是可以设置60帧以上。 我看了下代码,设置帧率都是微信或者小游戏的接口。感觉应该是接口问题?

2.x 时代是 设置帧率为非60, 比如 60.1 59.9 就会是60fps. 但是2.x 是cocos自己实现的, 非60时, 用 setTimeout+ rAF, 但是 3.x 好像不是i这么设计的了

qiuguohua commented 1 month ago

2.x 时代是 设置帧率为非60, 比如 60.1 59.9 就会是60fps.

对,这个是字节平台的问题,我们引擎不会处理。 他们下个版本会修复的。

但是2.x 是cocos自己实现的, 非60时, 用 setTimeout+ rAF, 但是 3.x 好像不是i这么设计的了

3.x我看了下代码,都是调用微信或者是字节的接口的。

@finscn