Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / HTML5 Version Has Low Frames Per Second On Decent Win 10 Desktop?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 8th Dec 2017 13:23 Edited at: 8th Dec 2017 13:33
Hi,

We plan to support both Android smartphones/tablets & desktop/notebook Internet browsers.
Everything is perfect on both test Android devices here in the studio.

On HTML5 version we are seeing low Frames Per Second on a decent native Windows 10 test desktop.
We tested the game on both Mozilla Firefox and Google Chrome and the low F.P.S. is in both.

Is there something easy we can do to improve performance on Internet browsers?

Current HTML5 build is at below URL web page:
http://16bitsoft.com/files/DigitalCrack/DC-HTML5/DigitalCrack.html

Any help would be appreciated, thanks!

Game's AGK2 project with full source code can be downloaded below:
http://16bitsoft.com/files/DigitalCrack/PreAlpha/DigitalCrack.zip
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 13th Dec 2017 00:29
Hi,

Battled all day today, but eventually finished the game engine "Shell".
Runs fairly fast on Android, but HTML5 is having big performance issues.

The links above have been update to the current stable build.
Was hoping someone can look at the source code and make some suggestions on improving the performance?
(source code is 100% clean)

Let me know, thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Dec 2017 10:09 Edited at: 13th Dec 2017 10:10
this part looks odd
Render2DFront()
Sync()

Quote: "Called automatically by Sync, you may either use Sync or Update(), Render(), Swap() to manually sync. If you wish to have more control you can break this down further by replacing Update with Update2D, Update3D()"

u see Render2DFront is part of Render() which is called in sync

Quote: " If you wish to have more control you can break this down further and replace Render with Render2DBack, ClearDepthBuffer, Render3D, ClearDepthBuffer, Render2DFront
"


do you know which part of select ScreenToDisplay is slow in html,?
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.4) Radeon R7 265 : Mac mini OS High Sierra (10.13)
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 13th Dec 2017 19:01
Hi,

Thank you for looking at the code...

Removing "Render2DFront()" from the game loop improved the performance on HTML5,
but HTML5 is still too slow to be functional. ( about a 15% boost in Frames Per Second)

I made some additional changes before, but with all the changes it's still too slow on a decent Win 10 desktop(HTML5)...
(I've update the code download above if you or someone else wishes to help out)
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 13th Dec 2017 19:10
The screen with the slowest Frames Per Second is:
/screens.agc/function DisplayHowToPlayScreen( )/Starting at line # 809

Everything else is fair speed(almost acceptable on HTML5
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Dec 2017 20:11 Edited at: 13th Dec 2017 20:15
i print benchmark in it.
GetManagedSpriteCount said ~ 1000 sprites there?

and it seems you draw 40+ overlapped transparent sprites unnecessary?

+ if you have any opaque sprites (background or something) you can turn off Transparency with SetSpriteTransparency

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.4) Radeon R7 265 : Mac mini OS High Sierra (10.13)
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 13th Dec 2017 20:52
Hi Again!

I'll take a look tonight and will report back.
Thanks for your help with the game
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 14th Dec 2017 12:30
Hi,

I've updated the source to have less colored boxes (was 99 each, now is 49 each as 7x7=49)

I can't find where I am drawing 40 transparent sprites unnecessarily.
Can you look at the new source and tell me where to change it?

Thanks, I'll put you in the next build as the "Game Optimizer"
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Dec 2017 15:14 Edited at: 14th Dec 2017 15:16
in this how to play screen there are still ~ 600 sprites.
i made a function that delete any sprite under mouse cursor.
sometimes you can see the count of managed sprite go down often at the same location.
this DisplayHowToPlayScreen is also very long, you should try to make it more functional.
something like this i would put into a type, then you have only one variable that you can give a function by reference


AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.4) Radeon R7 265 : Mac mini OS High Sierra (10.13)
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 14th Dec 2017 15:25
Ok, let me hit the game with a hammer today and I'll report back later, thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 14th Dec 2017 19:11
Hi...

Your suggestion about the # of sprites on the screen was helpful.
I made some improvements in Frames Per Second on HTML5.

You can download the new stable build below:
http://16bitsoft.com/files/DigitalCrack/Alpha/DigitalCrack.zip

You can put debug info on screen by selecting "Secret Code": 2 7 7 7 in [Options] screen.
Any other suggestions for improvement of HTML5 version? (it's still too slow to be viable)

Also what are the system requirements for HTML5?
The 5 year old desktop I am running the game on has the following:
- Genuine Windows(R) 10 Pro 64Bit native
- AMD 2.6GHz 6-core CPU
- 12GB DDR3
- AMD Radeon HD 7800 2GB GDDR5 GPU

Thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 14th Dec 2017 21:36
Hi,

I see where else I can optimize, should be ok now, thanks - you are in the game [About] staff screen.
Game is running at about 80% full speed now on a 4 year old $40 Android tablet...
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 02:26
Hi,

Battled all damn day and night to optimize.
I've pushed it to practically the limit now.

Android is 100% full speed now.
HTML5 is close, but needs improvement and I am running out of ideas.

The links above have been updated.
Anyone else have any suggestions?

Thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 15th Dec 2017 12:11
you can get more speed with setsyncrate(30,1)
btw, your options windows is very slow and it not respond at button pressed.
it seems the text are slow, i put this test direct in main loop after do.
you can open this options dialog, then right mouse click, and then there is 30 fps.

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.4) Radeon R7 265 : Mac mini OS High Sierra (10.13)
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 13:16
I'll see what I can do today, thanks for your help
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 14:49
@Markus

Hi,

Everything should be ok on HTML5 now I think...

You've been extremely helpful with optimizations.
Do you have a website or something I can promote in the [About] staff screen?
(would be happy to add anything you want there)

Many thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 15th Dec 2017 17:37
ok,fine.
i not have something to promote but thanks.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.4) Radeon R7 265 : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2024-11-24 05:42:06
Your offset time is: 2024-11-24 05:42:06