Sign in to follow this  
austincap

How many simultaneous sprites can Phaser 3.6.0 handle?

Recommended Posts

I typed "how many sprites can phaser handle" in the search bar and didn't get any relevant results.

My game can't seem to handle more than 1,000 sprites simultaneously on-screen before the FPS dips below 40 (what I deem acceptable). Is this reasonable? From what I've read other games typically don't have more than 300 sprites loaded into the game world simultaneously, but I'm trying to make a game that let's users add content dynamically and I want to know what the upper limit should be.

According to the Chrome profiler tool, "Animation Frame Fired" is taking up most of my resources. Is there anyway around this?

Thanks.

Share this post


Link to post
Share on other sites
23 minutes ago, austincap said:

According to the Chrome profiler tool, "Animation Frame Fired" is taking up most of my resources. Is there anyway around this?

Look for the functions taking up the most "self" time.

Share this post


Link to post
Share on other sites

Are you using SpriteBatch? If it's implemented correctly in Phaser, batched sprites (i.e. sprites that use parts of the same texture) can be drawn with a single WebGL draw call, which can mean tens of thousands of sprites without a noticable dip in framerate.

I use a Chrome extension called Spector to inspect the WebGL calls made by web pages, which can help you determine how much room for improvement there is available.

Share this post


Link to post
Share on other sites
11 hours ago, austincap said:

I typed "how many sprites can phaser handle" in the search bar and didn't get any relevant results.

It's not a question with a single simple answer as it depends on what hardware its running on

Share this post


Link to post
Share on other sites

I'm not using SpriteBatch but I don't think it's relevant for my purposes. Basically in my "game" players make posts, like you would on a message board. Each "post" is comprised of 4 sprites: the post-type (basically the block outline), an identicon representing the text data, the text data itself, and the sprite for the number of upvotes it currently has. On top of that, there's enemy sprites, bullet sprites, and image sprites of the post is for a picture. Also replies have dynamically drawn reply lines.

For the record, my system is Windows 7 x64, 8GB ram, 3.3 GHz quadcore, and 2GB video memory.

 

 

memewar.png

Share this post


Link to post
Share on other sites

I don't see more than 1000 sprites in your screenshot. Are you drawing off-screen sprites too? That can slow things down quite a bit. Are you able to skip drawing sprites outside of an (AABB) rectangle which represents your viewable screen size?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.