The Dink Network

How many sprites?

October 9th 2023, 12:57 AM
anon.gif
David706
Ghost They/Them
 
How many sprites can Dink Smallwood have on screen at any one time before suffering slowdown? Especially on modern hardware. I believe DinkEdit only lets you place 100 sprites at any one time, but has anyone ever experimented with removing this limit?
October 9th 2023, 07:38 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
You can technically have up to 300 sprites on the screen at any time. However, once you get near that limit, strange things will occur due to the inability to display new text. To increase the map sprite limit would mean breaking a whole ton of stuff which means it's never going to happen. Performance should be a non-issue unless you're running a 486.
October 10th 2023, 10:21 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
I decided to do a little test in which I increased the sprite limit tenfold and wrote a script that spawned 2500 ducks. Performance on my crappy old mobile i7 was fine until around 1000 sprites, after which FPS slowly started to tank. Interestingly, it was not the integrated HD4000 that was to blame, but instead, the algorithm that determines the depth cue from the Y coordinate for the sake of drawing sprites in the proper place that was ruining performance. I'm sure a recent fast CPU would handle it fine, however.
January 12th, 12:26 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
An update to this, I finally got around to rewriting the sprite Y-sorting algo by removing a nested loop which now allows for at least 4000 ducks on the screen at any time without FPS tanking. It'll be included with the next release, assuming there'll be one.
January 13th, 12:30 PM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
Wait so the sprite screen limit is actually increased with this update?
January 13th, 11:37 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
For the 0.86 release I made a second exe with a limit of 3,000 or something just to test this out, but that was using the existing sorting algo which is quite slow, as it works by comparing each sprite to every other one. For the next release I might put the sprite limit to something crazily high such as 10,000 and release a "DuckBench" testmod to see what people get. It will probably break poorly-written dmods in hilarious ways, but that's the price of progress