Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411482 Posts in 69370 Topics- by 58426 Members - Latest Member: shelton786

April 24, 2024, 01:42:35 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Best way to reduce server calls with multiple sprite sheets
Pages: [1]
Print
Author Topic: Best way to reduce server calls with multiple sprite sheets  (Read 1122 times)
pitaman
Level 0
*


South Florida based Animator & Designer


View Profile WWW
« on: June 26, 2015, 11:51:07 AM »

Hi everyone.
 
I have a few questions that I would like some assistance with. As I'm getting into HTML5 game development as a technical designer/artist...I know that with an online game (especially html5), having your game assets require too many server calls is undesirable.
 
What is a comfortable/safe number of server calls?
When your dealing with multiple sprite sheets, is there a way to wrap multiple sprite sheets into one file? Not one big sprite sheet.

What would be best practices for this?
I am concerned because of mobile and/or other countries where bandwidth is an issue. I have the image asset file size part covered with Texturepacker, TinyPNG Re-using certain assets in smart ways, but I know that server calls can be a problem.
 
Any help would be appreciated.
 
 
Sincerely,
 
 
Carlos
Logged

South Florida based Animator, Illustrator, Web Designer & Designer. Saving the universe one pixel at a time. http://carlospita.tumblr.com  - http://instagram.com/carlos.pita.art
Cheezmeister
Level 3
***



View Profile
« Reply #1 on: June 29, 2015, 09:28:24 PM »

What is a comfortable/safe number of server calls?

I think you're asking the wrong question here. There's no magic number that guarantees you a good player experience. Instead, think in terms of milliseconds. What is an acceptable wait time for...whatever it is you're doing? 100ms? 500ms? Maybe it's five seconds.

Next, find out how long each server call actually is. Without going into too much detail, this will depend on (a) round-trip-time AKA latency, which varies a lot and depends on geography; and also (b) the amount of data that needs to be loaded and the end-to-end throughput (player's carrier, your uplink, or any bottlenecks in between can crush this). No amount of file concatentation will help if you have gobs of megabytes in the first place. Luckily, Chrome's dev tools (or any modern browser, really) allow you to collect really juicy information on exactly how long your server calls are taking, how many there are, and why. Look there first.

Remember, conserving bandwidth is a form of optimization, and the first rule about optimization is to measure it first.

When your dealing with multiple sprite sheets, is there a way to wrap multiple sprite sheets into one file? Not one big sprite sheet.

There are so many ways to do this; in some cases I think HTTP will even do it for you (transparently). You can always zip or lzma "manually" but that's extra code to worry about, and then you're consuming CPU instead of bandwidth, not a real improvement. The best way really depends on the specifics of your scenario. How many files do you have? Are they all png? Etcetera, etcetera.
Logged

෴Me෴ @chzmstr | www.luchenlabs.com ቒMadeቓ RA | Nextris | Chromathud   ᙍMakingᙌCheezus II (Devlog)
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic