Glimmr performance speed and numbers of sprites

Photoshop is being a giant pain, so right now I have a bunch of layers in the mock-up for a graphic window. I was going to merge these into groups, so there would be fewer for the engine to deal with, but I wasn’t sure whether it would help, and it’s a bunch of work that is going to make things (very slightly) less flexible. Is several smallish sprites worse than a single slightly-bigger sprite? Is it worse enough that it’s worth changing? (It’s not like these are animated - there are checks that run through all the sprites, but there’s not so many that I’m worried about internal calculations being an issue - I’m just wondering about the display window end of things.)

Also, was there at one time a little application you could drag and drop and scale images on that would let you mock-up Glimmr canvases, complete with some output code? Or did I hallucinate that?

The more important limiting factor will usually be the size of the images you’re displaying, not the number. For a point of comparison, take a look at the canvas editor*–it displays, I believe, over a hundred images before the user even places a single custom sprite, but it’s still pretty snappy (in the up-to-date interpreters). The UI images are pretty small, which is one reason for the lack of slowdown, but they are in fact actually twice the maximum size at which they will be displayed; I left the extra information in because it didn’t seem to affect performance at all.

Anyway, I wouldn’t worry too much about optimizing right now–wait until you identify a performance problem. Make the images as big as you think you’ll need them, and as numerous as is convenient. You can automate the process of reducing the size later if you need to (using a Photoshop batch operation, for example). There’s less chance that you’d need to reduce the number of sprites, but of course that can also be done as needed as well.

  • The canvas editor is, I believe, the code-generating mock-up application you’re thinking of, but there’s no dragging and dropping images onto it (because I7 needs to compile any images used). It’s an extension (called Glimmr Canvas Editor): fire up a new Inform project, add a list of figure names, and press Release. You’ll then be able to place, scale, and otherwise manipulate the images, exporting source code as needed along the way.


Thanks, Erik.