• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Chrysalis

Techniques for reducing memory usage on HD sprite sheets

4 posts in this topic

This is my first post on here, and I'm posting to hopefully get a solution to my problem.

I have several HD sprite sheets (512 by 512 frames) in a 4096 x 4096 sprite sheet, and I'm having a real heck of a time regarding memory, loading in even one of them to use. The game I am making itself runs at about 16,000 memory usage, according to Windows Task Manager. Loading in one single Character sprite sheet pushes the memory usage of the program to 100K+ memory usage.

I'm aware the size of these is utterly ridiculous but I want to keep things HD, without taking up a whole lot of memory. Are there any techniques anyone here can suggest that'll help me keep the overall quality of the image, but reduce it's impact on memory.
0

Share this post


Link to post
Share on other sites
Assuming the texture is uncompressed in VRAM, 4096×4096 at RGBA8 or equivalent (which is 32-bit per pixel) amounts to 64MB. Texture compression can help bring this down (e.g. 16MB, maybe 8MB if you don't mind being limited to on/off alpha only), albeit with some loss in quality, which may or may not be noticeable, depending on the art style.

But yeah, this situation you describe is pretty much the reason why I refuse to use sprites in HD, especially since increasing the screen resolution can easily make their texels big enough to cover over a pixel (with very low resolutions you can at least give an excuse to not provide more detail since it's so low you could argue it's the art style and not just a technical limitation).

You could try splitting them into smaller sprites and combine them when drawing the objects (i.e. make objects out of multiple sprites instead of one). This also has the advantage of potentially being able to get smoother animation out of less sprites, albeit it's hard to do it without it looking robotic (some serious effort will be needed). Alternatively, switching to 2D vector graphics (with texturing, etc.) takes up much less memory as well, and scales up regardless of resolution too. Requires a completely different skillset for the artist, though.

If texture compression doesn't do for you then you'll have to look into alternatives like those two.
2

Share this post


Link to post
Share on other sites
If your current sprite sheets contain a lot of potentially unrelated sprites, you can try storing the sprites individually in single files (or group together the ones you know that will always be used in tandem), and perform the atlasing dynamically at runtime, when the sprites are about to be rendered.

Another potential way to optimize animations is to subdivide them down into multiple sprites to avoid having to store full animation frames for parts that don't change. E.g. a sprite of a building with a flashing neon sign "Open" could only store the rectangle around the Open sign in the animations, and not the full building, if the other parts of the building sprite don't animate.
1

Share this post


Link to post
Share on other sites
Also relevant to the above advice, may want to look how mobile games stored graphics (especially old J2ME ones which were required to fit in a few KB). Not only they tried to fit as many sprites into a single PNG as possible, in some cases they'd split a sprite just for the sake of being able to put its pieces into tighter places. This made more effective use of the sprite sheet. This same technique can easily be applied for HD sprites, the size doesn't matter really.
0

Share this post


Link to post
Share on other sites
[quote name='clb' timestamp='1339842011' post='4949758']
Another potential way to optimize animations is to subdivide them down into multiple sprites to avoid having to store full animation frames for parts that don't change.
[/quote]
In general, you could assemble your sprites from an arbitrary number of pieces that are shared within the same frame and across different animation frames; they don't even need to match a regular tile grid, and you can also assemble semi-transparent pieces on top of each other.
An ideal job for an automated search, but you should take care to avoid using too many colours.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0