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.

Newcomers AppGameKit Corner / "SetSpriteVisible()" Vs. "DeleteSprite()" - Performance?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 16:14 Edited at: 21st Oct 2019 16:23
Hi,

I am trying to optimize another slow AppGameKit Classic HTML5 game...
I am currently using: "SetSpriteVisible()" to make unused playfield sprites invisible.
It's very slow and am wondering if "DeleteSprite()" would be faster?

Let me know thanks!

Jesse

EDIT #1: Link to game:
http://fallenangelsoftware.com/spaceswap.html

SOURCE CODE:
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 21st Oct 2019 16:38
How many FPS do you have under Windows with fps set to unlimited?

DrawPlayField() is not called inside the main loop, is it?


PSY LABS Games
Coders don't die, they just gosub without return
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 17:00
Hi,

When playing I get about 8 FPS on a Raspberry Pi 3b+.
DrawPlayfield() is called every frame.

How do I set FPS to unlimited?

Jesse






JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 17:09
Setting:
SetSyncRate( 30, 1 )
to
SetSyncRate( 0, 1 )
still shows 30FPS ?

Am i doing something wrong?

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 17:35
Ok, I get "450" FPS on Linux desktop version.

Desktop is extremely fast:
- Kubuntu 18.04.3 LTS 64Bit Linux OS
- AMD FX 3.5GHz 8-Core CPU
- 32GB DDR3 RAM Memory
- nVidia GeForce GTX 970TT 4GB GDDR5 GPU
- ADATA 1TB SSD

Any ideas?
Thanks!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
Posted: 21st Oct 2019 18:35 Edited at: 21st Oct 2019 18:38
I suggest hiding those objects that are visible so as not to waste time on this.


And to reduce the time for calculations, use the select

https://www.instagram.com/qugurun/
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 21st Oct 2019 19:40
A game like this on a desktop machine like yours should run MUCH FASTER than 450fps.
There seems to be a problem with the code.


PSY LABS Games
Coders don't die, they just gosub without return
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 19:41
I agree, let me hit it more with a large hammer...
Thanks!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 21st Oct 2019 20:06
To Qugurun

Your changes to my code made a HUGE difference.
Very close to full speed now, thank you!

Jesse
JeZxLee
Fallen Angel Software
Video Game Design Studio
http://www.FallenAngelSoftware.com
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire

Login to post a reply

Server time is: 2024-03-28 11:58:32
Your offset time is: 2024-03-28 11:58:32