I’m making a Pool/Billiards sport in cocos creator.
For AI calculation, I’m working physics in whereas loop for some iterations and choose finest shot. Subject is every little thing works instantaneous in browser (<2 seconds for full 30 photographs), however once I run it in simulator or gadget (iOS/Android) it takes ~30 seconds of time.
There’s nothing a lot in scene, solely 16 balls (sphere inflexible our bodies), and a Set off to examine if ball is pocketed or not.
I attempted “await nextFrame()” form of logic after each few iterations inside whereas loop however nothing a lot improved.
I looked for Multithreading in cocos creator however didn’t discover any documentation associated to it.
Please assist me on this.
When publishing to native platforms, PhysX physics is really useful for higher physics efficiency, you may strive it.