Author Topic: game load (generated traffic)  (Read 1343 times)

Offline Doidel

  • Level 16
  • *
  • Posts: 141
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
game load (generated traffic)
« on: May 03, 2009, 04:03:12 PM »
Good evening :)

It was difficult to find a title for this topic, so it might seem a little inappropriate.
I'd like to talk about the generated traffic per user. Goal of this topic is an estimation of what is needed to play my game (both user and server side).
Therefore I made some measurements & notes, here's the list:
  • averagely 14 ajax requests in 20 seconds (none cached), average chars contained in response: 140
  • preloader on index-site loads 2 megabytes
  • in-game another 2 megabyte.
  • Later in development the preloader-images shall be gzipped (if possible)
  • Javascript will be minified (300kb -> 120kb)

What also would be cool is if you told me what further data is or could be relevant (Just tell me, I'll list it :) ). Or maybe tell me the reason why such an estimation / pre-measurement is not possible.

Thanks a lot in advance for your help!

Best regards
Doidel
* Keep it simple *

Offline Dasein Fiasco

  • Level 15
  • *
  • Posts: 132
  • Reputation: +2/-0
    • View Profile
    • Travis Dunn
Re: game load (generated traffic)
« Reply #1 on: May 03, 2009, 07:23:20 PM »
  • preloader on index-site loads 2 megabytes
  • in-game another 2 megabyte.

4 MB? Is that all graphics?
Personal Site: www.travisdunn.com
There is neither speech nor language but their voice is heard among them

Offline Doidel

  • Level 16
  • *
  • Posts: 141
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
Re: game load (generated traffic)
« Reply #2 on: May 03, 2009, 11:48:12 PM »
Hmm nope, you're right, there are more. There are about 20 item graphics to load (each 20kb), and then there's the singleplayer / questing system, where you load maps you play on (but just one a time, 200kb), meaning if you leave a map, the next one is loaded. But there has to be considered that a player does not always play this modus and if he does, he might just walk from map to map (10 seconds) or might play all the quests (max. 20 minutes I guess).
Finally there are mob/critter/character graphics while most are loaded on game start (100 kb) and the others are loaded when you fight (~80kb/fight).

That should be all.
Thanks for the reply!

regards
Doidel
* Keep it simple *

Offline Doidel

  • Level 16
  • *
  • Posts: 141
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
Re: game load (generated traffic)
« Reply #3 on: May 04, 2009, 10:41:44 AM »
Ok, back from work, here's my first try. First I only calculate what the server has to send including initial load (empty cache) for 1 hour:
14 requests : 20 seconds x (140 chars + ~200 from response header) = 238 bytes/sec = 858 kbyte/h
2 megabytes initial load
ingame 2 megabytes
120kb JavaScript
20 item graphics x 20kbytes = 400kbytes
200kb map x (1hour : 5 minutes) = 12 times per hour x 200kbytes = 2.4 mbytes
mobs are difficult.. I'd estimate 700 kbytes / hour.

...makes a total of  8.56 megabytes for 1 hour of play, while ~4.6 are loaded before the actual begin of play.

So if this estimation comes close to reality that would be quite a load. With a 1 mbit download you'd have to load 36 seconds.. can this be?   ???

I'd love to hear comments or suggesions. Feel free to post whatever you want.

Kind regards
Doidel
* Keep it simple *

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: game load (generated traffic)
« Reply #4 on: May 04, 2009, 12:53:55 PM »
Empty cache case is irrelevant, unless your game is so extremelly pathetic that most users close the browser after arriving :D I think empty cache generates 1-2% of bandwidth usage.


Offline Doidel

  • Level 16
  • *
  • Posts: 141
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
Re: game load (generated traffic)
« Reply #5 on: May 04, 2009, 01:36:57 PM »
oh, really? Didn't know that :) Good to know, thank you. That would shrink the traffic above calculated massively ^^
What about changing E-Tags, is this worthwile? (Never did that)

Thank for the reply, greetings
Doidel
* Keep it simple *

Offline Dasein Fiasco

  • Level 15
  • *
  • Posts: 132
  • Reputation: +2/-0
    • View Profile
    • Travis Dunn
Re: game load (generated traffic)
« Reply #6 on: May 05, 2009, 12:57:00 AM »
That sounds like a LOT of data to me, especially when scaled to a large number of users and you're talking about at minimum 4 MB+ per user / per visit. But I assume that's a tradeoff you're making for a good reason, and thus can't reduce any of the graphic load which would be my first suggestion. Minification and such are important steps, but won't really matter too much in terms of speed if your users are loading tons of images anyway; a glass of water in the ocean, as it were.

My only suggestions are:

- Turn off etags, and explicitly set a far-future expiration date for your files.
- Use CSS sprite sheets whenever possible to group your graphics.
- Serve all your images from a Content Delivery Network

For a site like yours where it sounds like everything revolves around rich graphics, these are the most efficient steps you can take at reducing load.

Finally, I'd suggest using running something like Firebug (http://getfirebug.com/) and watching how your site behaves. This will give you a more organic picture of where the pain points are and visually connect performance issues with specific user actions or game states.
Personal Site: www.travisdunn.com
There is neither speech nor language but their voice is heard among them

Offline Doidel

  • Level 16
  • *
  • Posts: 141
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
Re: game load (generated traffic)
« Reply #7 on: May 05, 2009, 01:53:24 AM »
Thanks for your suggestions! I've never heard of the sprite trick ^^ Very good idea, but hard to implement in my case.. (e.g. too many items, maps handdrawn, too many mobs & sometimes animated, and so forth)
CDN, load balancing & stuff will probably soon be necessary (For this a financial source would be needed oO but that's another subject..)

Thanks again for your great post
Best regards
Doidel
* Keep it simple *

Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: game load (generated traffic)
« Reply #8 on: May 05, 2009, 02:39:44 AM »
re-consider the sprite trick....particularly when you have lots of images is when it really pays off...

Of course this is something to do once you have a reasonably stabile graphic set, if your changing things all the time then it might get a bit tricky....but perhapes even then with a little bit of support code it may be easy enough to overcome.

There are also free CDN services if you look around, sure most limit the actual bandwidth but if your using far future dates then that should be ok to get things rolling...

As for downloading 4MB before you can play....that would rule me out as a potential player...on my slow internet connection Ill get bored waiting and move on to something else. Perhapes you can consider if you can re-group your data and only supply it on an as needed basis. so that images that arnt immediately required arnt served until theyre needed.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal