Effekseer icon indicating copy to clipboard operation
Effekseer copied to clipboard

performance bottlenecks in iOS and android

Open huachangmiao opened this issue 7 years ago • 71 comments

Is there a better way to optimize?

huachangmiao avatar Apr 09 '18 10:04 huachangmiao

-Program I have four ideas.

SIMD. Some parts can be improved with NEON Multicore. parallel computing with multi thread. It is required to many changes. Reduce a calculation. If parameters are default, skip calculations. GPU. Some calculations moves to GPU from CPU. It is required to many changes.

durswd avatar Apr 09 '18 23:04 durswd

I saw cocos2d-x form. I think it is strange.

durswd avatar Apr 12 '18 09:04 durswd

sorry. what does form mean?

huachangmiao avatar Apr 12 '18 09:04 huachangmiao

Cocos2d-x Forums. I'm sorry for typo

durswd avatar Apr 12 '18 09:04 durswd

i think so too. the performance increase a lot of when i mark the drawElement function.

huachangmiao avatar Apr 12 '18 09:04 huachangmiao

maybe something wrong in rendering

huachangmiao avatar Apr 12 '18 09:04 huachangmiao

I think the effects call 4 or 5 times drawElement by a frame. Otherwise, it is bug in Effekseer for cocos2d-x or Effekseer1.4(this is beta version) I'll check it after few days.

durswd avatar Apr 12 '18 11:04 durswd

I'm checking how many times drawElement is called by a frame at first. drawElement is called 3 or 5 times and vertices is not many. Is it same on your environment?

I think that bottle neck is a sending time of vertecies data between gpu and cpu.

Next I check it on smartphone and find bottle necks.

Homing_Laser01 3 image

Simple_Distortion 5 image

Sword_Ember is only for PC.

durswd avatar Apr 15 '18 17:04 durswd

And do you mean that "i mark" is comment out?

durswd avatar Apr 15 '18 17:04 durswd

yes.

huachangmiao avatar Apr 15 '18 23:04 huachangmiao

I'm very sorry for my iPhone's connector is something wrong. I changed a lightning cable, but it is not recognized. So, I buy new smartphones. Please wait for few days.

durswd avatar Apr 16 '18 14:04 durswd

I bought iPhoneSE which has a same spec to iPhone6s. I played homing and distortion. But it maintains 60 fps. Would you please send your project to me?

durswd avatar Apr 17 '18 15:04 durswd

Add a few more items, how many can maintain fps60?

huachangmiao avatar Apr 17 '18 15:04 huachangmiao

I try it

durswd avatar Apr 17 '18 15:04 durswd

I'm sleeping. In japan, it is 1 o'clock. I return a result tommorow

durswd avatar Apr 17 '18 15:04 durswd

have a good dream

huachangmiao avatar Apr 17 '18 15:04 huachangmiao

Three homings decreases FPS under 60fps (40~60fps) But I got a good hint for improving. I try to optimize it on this weekend.

durswd avatar Apr 18 '18 15:04 durswd

Looking forward to your good news.

huachangmiao avatar Apr 18 '18 15:04 huachangmiao

Good news. I realized to improve performance on iOS. 2 times faster at leaset.

This version has not be tested yet on Android, so this version is on branch optimized

https://github.com/effekseer/EffekseerForCocos2d-x/tree/optimized

And you need to change as follows.

manager = efk::EffectManager::create(rsize, 8000);

8000 is the maximum number of sprites generated in an application.

durswd avatar Apr 22 '18 12:04 durswd

How about the performance of the unity platform in iOS? There are more than 100 roles in my game's battle scene. I think play 10 homings maintains 60 fps is OK. now still 3. T _ T

huachangmiao avatar Apr 23 '18 11:04 huachangmiao

This is my personal opinion.

Effekseer is optimizing and update a few days after. But even if Effekseer for Unity is updated, I think 4 or 5 is maximum homings maintaining 60 fps.

It is not opinion for effects. Unity is difficult to maintain 60 fps than cocos2d-x because C# and GC (C++ is very fast)

I think that to realize 100 roles and rich effects at the same time is very difficult on current smartphone. To reduce effect sprites and contrive roles is required.

durswd avatar Apr 23 '18 13:04 durswd

Still thank you for everything. This is my game. Already released. http://yxwd.qq.com In this time, we want to make a 3D game. Let's optimize together.

huachangmiao avatar Apr 23 '18 14:04 huachangmiao

Looks very good. I will help you.

To optimize it, I have any ideas.

  1. Homing is not light effect. Homing is a sample for PC. So it is not optimized. Heavier than it looks.

We are implementing Effekseer 1.4, which is multi platform version and going to show draw call on the editor. It can easy to optimize.

  1. Culling Effekseer has a culling system to hide effects on out of view. But it is not used current Effekseer for cocos2d-x. If this function is enabled, effects on the view is only shown.

3, Multithreading I need to some time to implement it.

  1. OpenGL ES3.0 If We can use opengl ES 3.0, It may improve a performance.

I have questions.

  1. Is your 3D game TPS, FPS or isometric?

  2. Many large effects like Homing is shown at the same time? Or 2 or 3 large effects and many hit effects?

If you cannot show an information on a public, please send a mail.

durswd avatar Apr 23 '18 14:04 durswd

just like http://yxwd.qq.com this game. but 3D scene, 3D roles, 3D effect and more roles.

huachangmiao avatar Apr 23 '18 14:04 huachangmiao

When does the 1.4 version be released? There are still many users using android by opengl 2.0. so I have to use the opengl2.0.

huachangmiao avatar Apr 23 '18 14:04 huachangmiao

Thank you. I'll play your game and check it.

I plan to release 1.4 beta in early May on Github.

durswd avatar Apr 23 '18 15:04 durswd

thx. I will follow it.

huachangmiao avatar Apr 23 '18 15:04 huachangmiao

It's can play 50 homings maintaining 60 fps. You just need build the iOS project by release mode. orz. that's great.

huachangmiao avatar Apr 25 '18 10:04 huachangmiao

When the number of vertices exceeds a certain value, the display will be wrong. maybe vertices > 65535. You can try play 50 Laser03.efk. 8000 is the maximum number of sprites generated in an application. may I set this param more than 8000?

huachangmiao avatar Apr 25 '18 10:04 huachangmiao

  1. performance I try it (I checked on release mode. But i check it up to 6, because a display is filled.)

  2. vertices > 65535 Because vertex id is managed as short. I need to sprite rendering.

You can set this param more than 8000. But if this parameter is larger than 65535 / 6(the number of index on a sprite), rendering may be something wrong or invalid.

Thank you your information, I can fix these bugs.

durswd avatar Apr 25 '18 14:04 durswd