How do I deal with too many assets for the server problem

Get help using Construct 2

Post » Tue Oct 18, 2016 8:13 am

Hi everyone,

I've been working on a game for the company which employs me ( @IMPS ) in the past 3 months. The game is finished and works great, but the IT manager came back to me because we had a server alert because the game has a bit more than 400 assets in it. The third party company holding the server thought it was an attack and put additional security. They told us that 400 requests for a single page is more than can be allowed, so I have been asked to rework the game and reduce the number of assets.

Before doing so, I would like to ask you guys if someone already has this problem, and if there is something we can do server-wise, without recoding anything, to work around a lengthy process. A solution allowing me to automatically reduce the number of assets (I doubt this ever existed) could also do the trick.

Thanks a lot!
B
24
S
5
G
1
Posts: 336
Reputation: 2,433

Post » Tue Oct 18, 2016 8:33 am

Are you using tilesets to manage graphical assets for maps/static background object sprites?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
47
S
24
G
30
Posts: 517
Reputation: 19,464

Post » Tue Oct 18, 2016 8:40 am

It's a musical game, so 210 of these assets are sounds. I'm currently in the process of regrouping all the small sounds on large audio files (see this post), but I still have a lot of work on this. The rest is a lot of UI elements which are separate objects, so the other changes will be regrouping them as different animations of one object.

I don't have major problems reducing the number of assets though, but I would like to know if it is necessary to do it or if there is another solution (probably a server trick).
B
24
S
5
G
1
Posts: 336
Reputation: 2,433

Post » Tue Oct 18, 2016 9:14 am

On the graphical side?
Tilesets are a lot more efficient, even with processing and memory usage. Take a 13x16 tileset (assuming each tile is 16x16)...that tileset is only generally around 24 kb while each tile on it's own would only be 4 KB...but 4 KB multiplied by 208 tiles would probably take up a fair bit more space than 24 kb. 832 Kb but still, it can add up if you have several tilesets that are more than 512x512 in size, I mean comparatively if you were to use several amounts of 512 singletile sprites.

I'm not sure about the sound files, though.
Are you using the recommended audio filetypes with Construct 2, i.e aac/ogg? I don't think it would effect compatibility but you could try including only ogg files. I'm doing that with a project of mine (well, initially inadvertently) but my game seems to run fine on both NWJS and browser.
Besides that, I'm not sure what else to suggest. I mostly only know visual/graphical optimization, as for why. I'll try looking into more tips for you, though.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
47
S
24
G
30
Posts: 517
Reputation: 19,464

Post » Tue Oct 18, 2016 9:32 am

Thanks for the advice. I generally use tileset only for... tilesets, but it seems like it could be used for other things as well. I'll look into this as I still have to rework the graphical side of the game. And yes, I'm using both aac/ogg as I need support on ALL browsers. If you don't include AAC, Safari will not be able to play any sound, as stated in the manual.
B
24
S
5
G
1
Posts: 336
Reputation: 2,433

Post » Tue Oct 18, 2016 9:35 am

Is your project set to preload all sounds on start ?
If so, that's maybe a property of the project you want to turn to "No".

This way you may preload only the sounds you need at first, allowing for less requests toward the server at once, and preloading "as you go along" navigating through different layouts and preloading sounds you will need in the next layout.
That might be worth a try and would be less recoding than the major regrouping you are attempting.

@LaDestitute - Using only a single audio format (ogg), if you are doing a web game that could possibly be executed on Internet Explorer/Safari, is not a proper solution.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Tue Oct 18, 2016 9:58 am

Hi @Kyatric and thanks for the reply.
Yes, I set the preloading of all sounds on start, because it is a music composition game, and there is only one layout. So I'm afraid every sound should be available on start if possible. :-/
Maybe could I delay the loading of some sounds a couple seconds after the layout appears, loading them manually in the event sheet if that's possible. But overall I need most of them from the very beginning of the game, or the player will just quit, thinking it doesn't work.

Here is the latest build of the game, if it could help you see what it's all about : http://test.smurf.com/musicgame23/
As you will probably see, the loading is VERY slow. Most of the time it even fails and should be restarted several times before being able to play (due to the server problem this post is about).
B
24
S
5
G
1
Posts: 336
Reputation: 2,433

Post » Tue Oct 18, 2016 10:17 am

You might check out some of the sound generation plugs.
You would have to learn how to get acceptable results, but in turn your downloads would be greatly reduced.

Also tilemaps assume you have a grid to work with.
If you have used subpixel placement you should probably go with sprite instancing.
Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Post » Tue Oct 18, 2016 10:34 am

Thanks for the idea. When you say "sound generation", you mean that the sound is generated in the code? If that's the case I'm afraid it will simply ruin the whole game, as I'm using sampled instruments. If I'm misunderstanding something, could you include a link to one of these plugins you're talking about?

A quick search brought me on this but at this point I don't see how it could help.
B
24
S
5
G
1
Posts: 336
Reputation: 2,433

Post » Tue Oct 18, 2016 10:59 am

Image ImageImage
B
168
S
50
G
164
Posts: 8,239
Reputation: 105,597

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests