Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I created a puzzle game with Unity and uploaded it to one server. This works fine, but I bought a new server and uploaded my game to it as well. There, the loading time is much longer.

These are the servers:

  1. http://pinheadsinteractive.com/Mozzie/ (fast)
  2. http://operation-mozzie-free.com/ (slow)

The Unity files are exactly the same from one server to the next.

My client is dissatisfied with the new, slow loading time. So, how can I reduce the time my Unity game takes to load?

Even in some cases they faced the problem that they could not load the game at all. For the the moment, I'm using an iframe on the new sever as a workaround, but the issue still remains unsolved.

share|improve this question
1  
This is pretty localized. What is the size of the files? What's the bandwidth of the server? Have you done a file transfer speed test? There are so many things this could be, it seems unlikely it's related to unity. What have you ruled out already? – Byte56 Jun 14 '12 at 13:51
well, the size of the file in both servers are the same, every things are the same just the servers are two different server. how can i improve it? actually this is server issue!! – Danial Jun 15 '12 at 8:36
I'm not sure other people wouldn't benefit from an answer to this question... I feel like this has been closed a bit too quickly. – Laurent Couvidou Jun 15 '12 at 9:14

closed as too localized by Jonathan Hobbs, bummzack, Byte56, Josh Petrie, jhocking Jun 14 '12 at 22:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

This sounds like a bandwidth issue, you second server is just delivering files slower than the first one.

A simple workaround would be to host your files on the first server and refer to them on the second.

It looks like you've already come to this solution yourself, as you second link now uses an iframe, and loads just as fast as the first.

Another option if you want to avoid the iframe would be to refer to the Unity file of server 1 on server 2, so in your Javascript code instead of doing this:

if (typeof unityObject != "undefined") {
    unityObject.embedUnity("unityPlayer",
        "WebPlayer.unity3d",
         960, 600);
}

Try something like that:

if (typeof unityObject != "undefined") {
    unityObject.embedUnity("unityPlayer",
        "http://pinheadsinteractive.com/Mozzie/WebPlayer.unity3d",
         960, 600);
}

Not sure if this will work but you could give it a shot.

share|improve this answer
correct, i had to put it in iframe since the client said can not load it, but actually iframe is my last option, is there any other way that the speed can be improved? – Danial Jun 15 '12 at 8:34
@Danial I updated my answer with a bit more info. – Laurent Couvidou Jun 15 '12 at 9:14
oh, i want to transfer all of my host to new server but now i can not transfer to new sever. Actually the new server is a VPS, do u think if i change the bandwith if new server will be solved? – Danial Jun 18 '12 at 8:08
If you can get a better bandwidth on your new server, yes, that might solve your issue. – Laurent Couvidou Jun 18 '12 at 8:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.