What does "Sprite could not be created since the sprite buffer is full" mean? (SOLVED)

The following error message occured when trying to create a game object

ERROR:GAMESYS: Sprite could not be created since the sprite buffer is full (128).
ERROR:GAMEOBJECT: Could not spawn an instance of prototype /main/Asteroid.goc.

Im unsure what it means

1 Like

Everything in Defold is pre-allocated and you’ve created more sprites than you configured your game to support. Open game.project and scroll down to the Sprite section and increase the number from 128 up to a value that works for your game.

As you can see there are lots of these max counts in game.project and it’s up to you as a developer to decide how large they should be.

5 Likes

Ok Thanks, I just deleted some useless Game Objects and Ill increase it if I need to.

2 Likes

these kinds of limits might seem arbitrary, but the fact is they’re a useful way of knowing “how much is too much”. And, as britzl says, it’s very easy to change them.

3 Likes

Hi Bjorn, Is this limit for all sprites in one collection or for same sprites or sprites which comes frome same factory or something else?

“Max number of sprites per collection”

2 Likes

does an sprite animation with 5 pics counts as 5 or one?

It counts as one (1). It is the number of sprite components attached to game objects that you set a cap for. Not the number of images in the atlas or tilesource used by the sprite or the number of animations.

1 Like

I’m following war battles tutorial, I’m just before “Set the direction of the rocket”, on main collection there is a 45X45 cells tile map which has just two different type of tile on it, one player which has one sprite itself and one factory to instantiate rockets, after making 20 rocket from factory it gives me buffer full message. I can’t calculate what it counts that it reaches 128 sprite!

That sounds strange. Open the profiler and check the right hand side of the profiler. There is a list of counters. What does the “spritec” count say?

1 Like

before checking profiler i found it i think, the problem is in on_input, I don’t have action.pressed, so i press one space but it instantiate more than one, I’ll change it and i’ll check again :smiley:

one minute later, edit: Yes that is, it’s ok now. :+1:

2 Likes