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 / [SOLVED] AGK Tier 2 limit number of sprites

Author
Message
Maindric
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 26th Apr 2015 16:33 Edited at: 28th Apr 2015 02:02
Simply put, I made an animated sprite, and I decided to test performance to see how many clones of a sprite I can have on screen at a time before I hit 60 FPS.

The animation comes from a 512x512 atlas, and the sprites are 32x32. I hit 12570 sprites before I hit 60 FPS, and then they all disappear. Does anyone get this? I uploaded the .exe in the zip.

**EDIT**

As my next post points out, the issue is not a limit of allowable sprites, but seems to be an incompatibility issue with AppGameKit and AMD hardware/software. That makes the title to the thread now invalid. I am running more tests to see if this effects anything else.

I recreated the app in tier 1, and I am still getting the issue. This time it happened after 12500 was created. Here is the tier 1 code:



**UPDATE**
It seems adding particles does not effect it. Also, once the sprites disappear, the particles are still visible.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

Maindric
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 27th Apr 2015 20:35 Edited at: 28th Apr 2015 00:27
So this is interesting. I decided to run the included .exe on my little i3 PC I have, and it runs fine. It is using on board graphics, and is currently at 56500 sprites, and still running (at 15.8 fps mind you). So this leads me to think it is either hardware or software outside of AppGameKit that is affecting the results. My main desktop is running an AMD 8350, and HIS 7970 GHz. I will test this on my wife's Phenom II/7870 Ghz machine in a bit, and my i7/760m laptop next... It could either be AppGameKit dislikes AMD or Windows 8/8.1, have not discovered quite yet.

**EDIT**

I think I narrowed down the problem. I tested the app on 4 separate computers. It worked on two of them, and failed on two.

PASSED:
Windows 7
Intel i3-4160
Intel HD Graphics 4400
4GB Ram

Windows 8.1
Intel i7-4700MQ
Nvidia GT 750M
8GB Ram

FAILED:
Windows 7
AMD Phenom II 940
AMD Radeon 7870 GHz Edition
16GB Ram

Windows 8.1
AMD FX-8350
AMD Radeon 7970 GHz Edition
16GB Ram


I am leaning towards AppGameKit having issues with AMD GPUs or CPUs. I am unable to test specifically which one presents the issues. Can someone else run the test to see what you get? Both fail in the 12700-12800 range.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Apr 2015 23:57
Unlikely that you would ever need anything close to that many sprites in a game anyway...

Using AppGameKit V2 Tier 1
Maindric
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 28th Apr 2015 00:25 Edited at: 28th Apr 2015 00:26
It is not about reaching those many sprites. I plan on running tests to see if particles and bitmap fonts also presents that issue. And as it now stands, it seems like a stability issue with AMD hardware (or more likely, software). The last thing anyone should want is for every single sprite in their game to disappear all at once.
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 28th Apr 2015 02:46
It seems to be an AMD GPU problem (which makes sense) I am currently getting over 46,700 sprites at 15FPS.

My Specs:

Windows 7 (64 bit) Home Premium
AMD Phenom II X4 945 CPU
Nvidia GTX 460 GPU
8GB RAM


Sean

Maindric
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 28th Apr 2015 03:36
Quote: "It seems to be an AMD GPU problem (which makes sense) I am currently getting over 46,700 sprites at 15FPS.
"

If that's the case, then I may throw this into a bug report. I am unable to test lower end GPUs which could bring this error up faster. If this situation occurs when using the app, it is essentially useless. Is there anyone using an AMD APU iGPU? Or have access to one or something lower than a 7870 GHz?

Also, thanks for testing it.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 6th May 2015 16:30
This post has been marked by the post author as the answer.
This sounds like a batching issue, AppGameKit combines sprites into as few draw calls as possible but if all the sprites are the same that could theoretically be a single draw call. OpenGL 2.0 has a limit on the number of vertex indices that can be drawn in a single call so if AppGameKit tried to draw too many it came out blank. Originally I had this problem on my machine at around 15000 sprites so I'll decrease the maximum number of sprites AppGameKit will batch into a single call to 12000 which should fix it.
Maindric
15
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 7th May 2015 03:16
Quote: "This sounds like a batching issue, AppGameKit combines sprites into as few draw calls as possible but if all the sprites are the same that could theoretically be a single draw call. OpenGL 2.0 has a limit on the number of vertex indices that can be drawn in a single call so if AppGameKit tried to draw too many it came out blank. Originally I had this problem on my machine at around 15000 sprites so I'll decrease the maximum number of sprites AppGameKit will batch into a single call to 12000 which should fix it."


Which makes sense. Thanks for the explanation.

Login to post a reply

Server time is: 2024-11-25 21:39:41
Your offset time is: 2024-11-25 21:39:41