Skip to main content
Inspiring
July 10, 2013
Answered

Central folder for images and sounds to reuse them or NOT???

  • July 10, 2013
  • 1 reply
  • 6764 views

Hi.

I am producing a large amount of graphics and sounds for an online elearning course.

Can I just confirm one thing please?

Should I put most of my graphics that are going to be shared with other swfs into its own dedicated swf.

As it is cached I suppose that would be the best idea.

BUT

Doesn't it also take longer for a game or screen to load if it has to import the particular mc inside the large resources.swf.

Also, how exactly does it get to that mc.

For example I want mountain mc (which resides inside resources.swf) in my flyingGame.swf.

Does flyingGame have to import resources.swf and then "look inside" for mountain mc EVERYTIME.

Is this good or bad.

I getconfused as to the best way to go about this. So,ebody mentioned RSLs - is that better or am I in fact doing that already as the libraries are cached and shared anyway?

This topic has been closed for replies.
Correct answer sinious

Nesting libraries inside others will do exactly as you've said, cause you to load unnecessary things. It also creates a dependancy that could be highly unnecessary. If one game is updated that uses a shared asset, all the other games will update for nothing. 

To take an example for speedy web design (other than sprite sheets), it's always been highly suggested to limit the number of HTTP requests. If you need to load 50 images, 30 audio files, etc, this isn't going to work terribly efficiently as external assets.

If you can manage to get the assets on sprite sheets, I feel these are the most flexible overall, especially with an atlas. Keep in mind external files are easy to edit, don't have the SWF bloat and are also cached.

The only thing SWF gives you is development speed and perhaps a speed advantage if you're loading dozens and dozens of external assets. If you went external and found you needed to load 50-100+ assets then wrapping it in a single SWF is far more advantageous.

Audio is an ideal target to bundle in SWF if you can because each file must be a separate download. That said, there's nothing SWF is doing to make the audio any smaller than you could make it at similar settings in any other audio encoder at the right settings. MP3 is MP3, etc.

Your answer could lie in between multiple per-game strategies. SWFs for some games, external assets where possible elsewhere and a combination of both as well. It really depends on your game.

1 reply

sinious
Legend
July 10, 2013

How complex are the graphics assets? Any reason not to load them off the server as regular graphics and audio rather than in a SWF? The most efficient way is going to be literally only loading what you need and nothing more. If there's tons of little graphics in games then you'll optimize it even more with sprite sheets.

Inspiring
July 10, 2013

Hi.

Well, I should say that they are not pictures as such but vocabulary.

Food: has orange, apple etc...

These mcs are used hundreds of times by different games so are imported as you comment at the end.

The other example is more for larger game apps such as a crossword I have. I import the graphics because I thought I would use them in other games and I certainly will but for now I'm thinking that there is a lag because of what I am doing.

The game has to import another swf and look for the assets it needs etc... So in that repect would it be better to put those graphics back into the game fla that requires them.

I just thought it would be a great idea especially for music because some tracks can get up to 500k. I am looping them but they are still big.

btw: when I put sounds inside a swf they get compressed even more so that should be good shouldn't it?

Inspiring
July 16, 2013

OK - because I like torturing myself.

Hit a record.

500kb loaded menu after 28 seconds. Now I think you know how I feel. I could also ask the hosting company if they know anything about all this and as I say my code and what exactly is going on. Where is this friggin bottleneck.

Off to bed. Wil investigate over the next two days.


Hi guys.

Just a quick update.

I have decided to interrogate the hosting company. I am on a shared server and so I asked if loading times would be better on a dedicated server and they said, of course. OK but please have a look at my situation and tell me if I am getting my moneys worth. I am fine about paying ten times the fee if I get ten times the results. So hopefully tomorrow I will get some good answers.

AKAMI and amazon cloud etc... Well I go on the site and understand nothing but here in Spain there is a large company called Arsys which have monthly rents of around 200-250 euros. If I see the loads at where they should be then I'm there next week.

btw: reading about CLOUD vs DEDICATED server. Mixed reviews. If I have an elearning site with 1MB here 1MB there and 100 concurrent users I need it to work fast, so I suppose I should have a dedicated server anyway. I suppose if I give them my details they can advise me which plan to take out. Cloud instead of dedicated server - is that best?

Anyway, I'll keep you guys posted as know you can't sleep at night till you find out

Cheers