Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Best Practice:Load All Resource At Start OR Load Resources As Needed?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 2nd May 2017 21:51
Hi,

Developing a 2-D game engine from AppGameKit now which we will use to target HTML5 & Android.
What would be best practice?:
- Load all resources at game start
OR
- Load resources as needed
?

We estimate a final game size of about 30-40MB.
Let us know, thanks!
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd May 2017 23:21
It depends. Resources that are level specific, I'd load and unload when you switch levels. Stuff used throughout the game or pretty regularly I'd keep loaded from the start.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 2nd May 2017 23:53
Ok, thanks for the reply...

We are targeting just HTML5 Internet and Google Android smartphones/tablets.
Are there any size limits for the game on either HTML5 or Android?
(not sure about HTML5, but I think Android is maximum 50MB?)

Thanks!
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 2nd May 2017 23:57
A good way of thinking about it is to find the natural breaks - such as transitioning from the main menu to the start of the level - and this is where you can delete and load media, as the player will expect a bit of a pause anyway.

Normally I split the media up in the following way (pretty much as Phaelax has described):

intro media - deleted when the player exits the intro and goes to the main menu
main menu media - deleted when the player starts playing the game
media that is used throughout the entirety of the game (bullets, explosion sound effects) - is only deleted when the player exits the game and goes back to the main menu
level specific media (map, npcs) - deleted when the level is over

It really depends on how much is being loaded. Sometime you can just load everything before the splash screen and it's quick enough not to cause an issue.
Hover Car Race Challenge! - available now on Google Play
Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB

Login to post a reply

Server time is: 2024-04-19 12:04:16
Your offset time is: 2024-04-19 12:04:16