• 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
SillyCow

Reloading openGL assets on android

9 posts in this topic

My new game on android has bigger models and textures than my previous game.

 

The design I used for my previous game is a menu activity which would then call my play-level activity.

The player would choose an item from the menu, and the game activity would load.

 

This worked fairly well when I didn't have alot of assets. On good devices loading was almost instantaneous.

But now, my new game needs about 15 seconds to load the models and textures.

Most of the time is spent on parsing the model files and turning them into binary data for VBOs.

The other part is spent decompressing JPEGs & turning them into texture bitmaps.

 

I know I can reduce loading time by having my models saved in binary VBO  format in the first place, and saving my textures in a GPU compressed format. But I view that as a messy solution. I only want one set of data, I shouldn't have to load it over and over. From my PC experience, I'd tackle this problem by keeping everything in global RAM, load it once when the game starts, and keep it in RAM until the game is closed. Perhaps even keep it the GPU if possible.

 

As far as I can tell Android requires me to have isolated RAM for different activities. So when the play-level activity ends, my data goes bye bye. And thus every time the player goes back to the menu, I reload the assets.

 

Of course, I can start with the play-level activity first, and have that then call the menu. But again that seems messy, why should I load the play-level activity before the player started playing?

 

Does anyone have a good suggestion for a design pattern here?

Edited by SillyCow
0

Share this post


Link to post
Share on other sites

But now, my new game needs about 15 seconds to load the models and textures.
Most of the time is spent on parsing the model files and turning them into binary data for VBOs.
The other part is spent decompressing JPEGs & turning them into texture bitmaps.

Sounds like you've got the problem solved already.

 

 

For PC and major consoles you use a DDS format.  No decompression necessary and it is handled by the card on PC and on the big consoles.  This dramatically improves texture memory sizes and texture loading speeds.

 

For Android you get to choose between ETC1 (supported by everyone) and optionally choose between PVRTC, ATITC, and S3TC, depending on which specialized hardware you want to support.

 

That will get rid of much of your known bottleneck.

1

Share this post


Link to post
Share on other sites

I still have the problem of my models, and level files

 

I really can't think of anything other then going for custom binary format file. I think its well worth the trouble of implementing it though. I was using .dae(collada) models before, it was taking anywhere around 30 second to 1 minute depeding how many models to read. After implementing a CBF it took around 5 seconds to load all models. So my advice would be none other then CBF.

Edited by Nusakan
0

Share this post


Link to post
Share on other sites
But even 5 seconds is plenty of time. After I've got the models in memory loading them over and over seems like a waste of the user's time.
0

Share this post


Link to post
Share on other sites

But even 5 seconds is plenty of time. After I've got the models in memory loading them over and over seems like a waste of the user's time.

I am sorry if I m missing something but I am not sure what you ment by loading them over and over. your models should be loaded on the memory before you start your game. you shouldn't be loading models again and again during game play. that will surely slow things down. Once you got your models all loaded, you just show what you want to show and ignore the ones you don't need.

 

Also you don't need to load the same models again once you loaded them to the  memory once. As an example , lets say you have a zombie npc model. and if you have 10 of these zombies on your game, you only need to load the zombie once. not 10 times. same things applies to your textures. if you have a textures that is shared by different models, you don't need to load textures for these models again. you simply use the same texture.

0

Share this post


Link to post
Share on other sites
The problem is that my menu is a different android activity. It is the activity that launches the "play level" activity. Think "angry birds" here. When the user exits to the menu, and then re-enters the "play level" mode, I relaunch the activity and have to load everything again. This is because once the activity is disposed of, all the memory it allocated is also gone.
0

Share this post


Link to post
Share on other sites

The problem is that my menu is a different android activity. It is the activity that launches the "play level" activity. Think "angry birds" here. When the user exits to the menu, and then re-enters the "play level" mode, I relaunch the activity and have to load everything again. This is because once the activity is disposed of, all the memory it allocated is also gone.

Well. I still don't see a problem here. waiting couple of seconds before a level loads is perfectly acceptable. even angry bird has that. my 5 second example was in a 3D game environment where models has skeletal animation data, position vertices, normal vertices and text coords as well as vertex weights. The entire scene is made by approximately 20k vertices. I am not sure how complex your scene is but I would suggest you not  to disregard  CBF without trying it.   

0

Share this post


Link to post
Share on other sites

I advise using compressed textures (i.e PVR), or if quality is an issue use compressed Targa. RLE compressed Targa loads much faster than PNG or jpg.

Also, if loading a file do not load it byte by byte, load it all in one block.

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