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.

Author
Message
metamorpho
8
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 2nd Nov 2019 15:28
Tell me which resource packer can be used with AppGameKit Classic (for Windows) ?
metamorpho
8
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 5th Nov 2019 18:54
The tests revealed an interesting point:



In both cases, the result is the same, and FPS is the same - then what is the point of creating 400 sprites and complicating the level creation code?
It is much easier to use the "Drawsprite" command - with it, you do not need to create separate sprites for each element of the level, and then delete them, as well as other troubles of building and displaying the level on the screen.

It turns out the "Drawsprite" team does not harm the FPS.

Explain to me if I'm wrong.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 5th Nov 2019 20:09 Edited at: 5th Nov 2019 20:14
Quote: "It turns out the "Drawsprite" team does not harm the FPS."

um...

Quote: "In both cases, the result is the same"

from some of my own testing (using 40,000 sprites), i'm seeing that DrawSprite () is actually much faster (~50%?) !?

add: i expect DrawSprite internally checks whether or not the sprite is visible before it bothers to draw it? i'll continue testing by adding the same notion to CreateSprite() when i get a chance.

sorry for assuming/misleading, meta

GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 5th Nov 2019 23:00 Edited at: 5th Nov 2019 23:22
@metamorpho
You are not wrong. If you are GPU bound and the limiting factor for speed is fillrate (which is very likely the case with so few sprites spread out on the screen), then your results make sense. In this case speed will be dictated by the pixels drawn on the screen.
It's similar to the results of the 3D instancing tests. You need to cross certain (hardware dependent) thresholds for the CPU side and drawcalls to start mattering.
You will have to test in the complete game setting to determine how each method will actually influence the speed of your game though. Because all the other things going on may contribute to pushing you across those thresholds.
In your new test you are using and redrawing one image, so you are getting the benefit of lower memory consumption, that's great. Expand that approach to the full level drawing system and you already solved one potential issue that can cause problems.

Quote: " i expect DrawSprite internally checks whether or not the sprite is visible before it bothers to draw it?"

Most likely. Sprites are internally 3D objects, I am guessing they get frustum culled like 3D objects. Unfortunately there is no setSpriteScreenCulling() command to exactly test it.
Which brings up an interesting idea... maybe in this regard the auto batching can work against you when having tons of sprites that are off-screen, because if they get batched together, they could eventually be screen culled on that basis and not individually, which would explain why in this special case drawSprite can actually be faster. Just a blind guess that could explain your results.
More testing is needed for sure.
metamorpho
8
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 6th Nov 2019 06:41
Quote: "In your new test you are using and redrawing one image, so you are getting the benefit of lower memory consumption, that's great. Expand that approach to the full level drawing system and you already solved one potential issue that can cause problems. "


The fact is that this is exactly how my code works - using the DrawSprite command. I thought it was a problem, but it comes out in something else. So I will look for something else - what can raise the FPS in my game.

Login to post a reply

Server time is: 2024-11-24 03:16:33
Your offset time is: 2024-11-24 03:16:33