I’m trying to find a way to set different compressions for different atlases. I tried adding my one image to images.xcassets, but memory usage increases since the benefits of atlases aren’t being used. Sprite Kit seems to convert atlases at build time, so setting one image to be RGB565 won’t work.Group files in texture atlases according to use.Create a smaller file for smaller resolution devices as fallback.Breaking apart large images into tiles, and removing tiles that would be covered by other gameplay elements, shows minor gains.This would work well for my base background. RGB565 seems to hold up quality, but does not support transparency.I’m not sure if it is my art style, but I couldn’t get them to look right (even with dithering). Change build settings to RGBA4444 if your images still look good at that setting.Compress png’s to improve download size, not memory management.Product -> Clean in Xcode between each test.You can just read my lessons learned below if you don’t want to follow my detective work. In hindsight, most of this is basic to an experienced game developer, but I found the process to be quite fun. That memory usage seemed a bit high, so I decided this was an issue that I needed to delve into. This was also prompted by my current level running at 55-60MB before any gameplay action or characters loaded on screen. Idle_010.Now that I’m receiving real art for my game, I thought it would be a good time to learn about memory usage and limits. Many times developers group the source images in different folders with a special meaning, for example, the images are grouped in an Attacking and Idle folders, so, by enabling this parameter, the names of the folders are prepended to the name of the frames: Attacking_001. Prepend the parent folders name to the frames name. You can use this together with the Indexes option to create spritesheets. To sort the sprites by using a _01.png suffix in the source files. If your source images have extra space (transparent areas) around the picture, then activating these parameters the editor generates a texture that removes that spaces and a JSON file that specify to Phaser to render the sprites with the right spacing. It is useful to remove artifacts from sprites animations, tile sprites, in general when the source images has color pixels in the borders. It controls the spacing between the sprites. In some platforms this kind of textures performs better. In the second case the editor generates a texture with a size power of 2. You can select Any Size (default) or POT (Power of 2). However you can change the max size of the texture to make space for all the sprites. It is because the texture has no space for all images so it creates another atlas to put there the remaining images. There are cases where the editor generates more than one Phaser (JSON) atlas files. To change these parameters click the “settings icon” in the editor toolbar. Often you should adjust the parameters of the packer to get a texture applicable to the different functions. Texture MAPS can be used in different objects of your game like sprites, tile sprites, sprite-sheets, etc. To load the atlas in your game you can use the () method or load the Asset Pack file. Phaser Editor creates the Design folder and encourages the developers to put there the files are not included in the game but are used to generate the game assets, like is the case of the atlas source images. Also, note the source images are not placed under the WebContent folder else under the Design folder. These are the files you should load in your game. So when you save the editor a myatlas.json and myatlas.png files are generated. The last step, to save, is very important, remember myatlas.atlas file is an internal Phaser Editor file, it is a configuration file used to generate the final JSON atlas and PNG texture file to be used in the game. It generates the Phaser atlas JSON file (with the JSON Hash format) and the texture image (PNG) file. Save the atlas file ( Ctrl+S or File > Save).Drag the files and drop them into the atlas editor.
0 Comments
Leave a Reply. |