Problem with collection.max_instances

I’m trying to write a bunny mark but I can’t get it to work. First I got an error about the maximum number of sprites, then I increased it to 65536. Then I got another error: ‘collection.max_instances’.

If I put any value above 32k the game won’t even launch and I got this line on the console: ‘FATAL:ENGINE: Failed to set max instance count for collections (-7)’.

Some seconds later an error window shows up: https://i.imgur.com/9dwMIJk.png

Does anyone knows where can I find info about it? There is nothing on the docs specifying a limit to those settings.

PS: I know that I won’t be able to put more than 30k bunnies on the screen since even with luajit + raylib I only got ~50k. But would be nice to have some details about the ‘limits’.

After digging through the engine code, the max value for that setting is 32765 (set by this constant which is checked here). It should definitely be added to the docs. A better solution could be a way to set a max value for a project setting and have the editor/Bob check it?

1 Like

Yes, we shouldn’t accept a value that is too large.

I created such a test, with some variations here:

4 Likes

Amazing :open_mouth:

Thanks @Potota