The Daily Click ::. Forums ::. Klik Coding Help ::. Optimisation? Memory Stuff
 

Post Reply  Post Oekaki 
 

Posted By Message

Disthron



Registered
  08/02/2005
Points
  1101

VIP Member
28th May, 2011 at 00:57:05 -

Hi, this is not a code question per say but rather a question on optimizing my game and memory management I guess. I've been working on a game and for the graphics I'm using pre-rendered 3D sprites. Most of the graphics I use have an alpha channel and I've noticed that levels take a loooong time to load. Once it's loaded it runs fine but I'm afraid that without some kind of loading animation people will think the game has frozen. I have an idea that maybe switching some of them to use a transparency colour would make it load faster but at this stage going back and redoing my composites and such would be a pretty large task. I figure I'd have to do most of them in order to see a noticeble improvement. So you know, I don't wont to go to all that trouble and then have it NOT work.

Another idea I had was to try creating some of the larger active objects in the over world map when you select a level. So I could load those sprites into memory before changing frames so the game wouldn't have to do it all at once. Would that work or would the game simply kill those instances and reload them new for the next frame?

Any ideas on how to deal with this kind of issue?

 
"Oh, my god! A lightning monster just ripped out this poor woman's eyes, and your mocking her shrubbery!" - The Spoony One

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
28th May, 2011 at 01:50:07 -

If you make the object global (read the "common properties" section in the MMF2 help file), you should be able to load the graphics in one frame, and then not have to reload them again in the next frame.

You might also want to try the "load on call" option, which only loads them as and when they are required, instead of automatically loading everything at the start of the frame. This should mean there won't be a long pause at the start of the frame, but it may affect performance during the frame, if it suddenly needs to load a lot of data while other stuff is going on.

I'm not sure, but I suspect removing the alpha channel probably won't help all that much. Logically speaking, it should only cut loading times by around 25% (since it's loading RGB instead of RGBA).

Edited by Sketchy

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
28th May, 2011 at 02:52:42 -

Load on call is a great way to stop loading objects until they're truly needed - especially if not all of your objects are created at the start of your frame. I've used it in a few games that had memory problems and it worked well

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Disthron



Registered
  08/02/2005
Points
  1101

VIP Member
28th May, 2011 at 19:52:06 -

Thanks Andy and Sketchy, I did what you suggested and made stuff like smoke and explosions, and quite a few other things, load on call and it's working grate so fare. I honestly didn't know what the "Load on Call" option was really for. I thought it was like the inactive if too fare from screen thing.

 
"Oh, my god! A lightning monster just ripped out this poor woman's eyes, and your mocking her shrubbery!" - The Spoony One

HorrendousGames

Sourpuss

Registered
  31/10/2009
Points
  481

VIP MemberEvil klikerGame Of The Week Winner
31st May, 2011 at 16:30:55 -


Originally Posted by Sketchy
I'm not sure, but I suspect removing the alpha channel probably won't help all that much. Logically speaking, it should only cut loading times by around 25% (since it's loading RGB instead of RGBA).



I'm not sure this would help with loading times at all, but it does cut down on the file size, depending on how large the file is. From a performance perspective, it should increase the framerate if you are having framerate issues, but I'm not sure on the loading time itself.

 
/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/-=?=-/
That Really Hot Chick
now on the Xbox Live Marketplace!

http://marketplace.xbox.com/en-US/Product/That-Really-Hot-Chick/66acd000-77fe-1000-9115-d80258550942

http://www.create-games.com/project.asp?view=main&id=2160
   

Post Reply



 



Advertisement

Worth A Click