To some extend, the same applies to _loading_ the texture atlas. This is the single most expensive _TexturePacker_ operation. They are saved as PNG files, which compress super nice, but _devour_ CPU time. In fact, the profiler showed that _TexturePacker_ spends almost all of its time in image I/O. _Reading and decoding_ all the tiny PNG files to _fill_ the atlas with pixel data _is slow_. Still, this wasn't the biggest offender by far. Also, it doesn't help that we do this twice: first for checking if something has changed and the atlas needs to be rebuilt, then again with _TexturePacker_ itself. Searching directory trees and collecting all source files is slow, especially on a Windows file system. Surprisingly, my initial assumptions - for example, that the _TexturePacker_ code by itself is slow, because it does _a ton_ of stuff we don't need - was proven wrong. Recently, I sat down again to figure out how to speed up both updating and loading our texture atlases. Load sprites/anims atlas - action executed in 1887 ms After we applied some optimizations to the game loading process during the past few months, it's one of our biggest load-time performance hogs right now. Now, _loading_ sprite sheets is a lot faster of course. Run it on a HDD, and you can go enjoy your coffee break. With a cold file cache, this can take twice as long. This is how it looks today, on an i7-4790K with a decent SSD:Īsset builder executed in 36.162198 seconds But nowadays, _if_ a rebuild is required, it surely takes its time. Early in development of the game, we took some measures to only rebuild assets when needed. ![]() At the moment I write this article, Pathway _quadruples_ this size already.īuilding texture atlases of this size is a time-consuming process, as well as loading them. 's previous game,, shipped with an atlas of 11 2048x2048 pages, which approximates about 2 1/2 sheets of size 4096x4096. ![]() !(heinrich_atlas.jpg border=1) The tool used to build this atlas is the. In terms, sprite sheets are grouped into what's called a _texture atlas_. For use in the game, they are all gathered in large sprite sheets, which is a common technique to ensure good render performance, as well as to reduce load times. In Pathway, there are many sprites like Heinrich. The other one helps to cast Heinrich's shadow in a plausible manner. One is responsible for making Heinrich look darn handsome when lighted. !(heinrich_siblings.png)Īs a matter of fact, in Pathway, unlike many other pixel art games, Heinrich has two siblings, Heinrich#Normal and Heinrich#Depth. He's a German soldier in our upcoming game. But sometimes, it's worth pushing that direction even if the pain seems. ![]() Interestingly, over the years in games development I met many people who are notably resistant to this kind of pain. I've never heard this term before that day, so I don't know if he came up with it by himself, but it surely was fitting at the time and place. > until there is some pain the current approach is In a previous job, one of my fellow co-workers coined the phrase "pain-driven development".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |