• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion Slow loading

My "game" does not contain too many objects or code for these objects, but I began to notice that when starting, I already have to wait about 5 seconds. It's a little annoying. The computer is powerful, I can send the characteristics, but I think that the problem is different. Maybe there is some possibility to use more computer resources to speed up the compilation of the project, or is it normal that you have to wait so long ?
 
D

Deleted member 13992

Guest
I think 5 seconds for compilation is perfectly normal. Fast, even. Compilation does not exactly mean "loading". There's a lot it has to do behind the scenes when it compiles. But other people might have a different take, though.

That said, you can check to see if your AV isn't hijjacking things. That can slow down the process.
 

gnysek

Member
does not contain too many objects
Is there a definition of too many? I saw games with 500+ sprites, 300+ objects and 1000+ scripts, is that too many?

5 seconds isn't that slow, in my 18-years history I was making games which had 40+ seconds of compilation.
 

TsukaYuriko

☄️
Forum Staff
Moderator
This is normal and universal to all software. Be glad that it only takes 5 seconds and take a sip of your favorite beverage. Take it as an incentive to stay hydrated! :)

On a more serious note, it's perfectly normal for relatively sizable games that are near completion to take a long time to compile. When I say "long time", I mean anywhere between minutes to an hour. Or even multiple hours. It all depends on the complexity.
 

T2008

Member
My game takes minutes to compile, but I do have a large game. It's annoying. I wish there was something that could be done about this. Once, my antivirus software was causing it to be even longer so I changed virus software.
 

Joe Ellis

Member
My game takes minutes to compile, but I do have a large game. It's annoying. I wish there was something that could be done about this. Once, my antivirus software was causing it to be even longer so I changed virus software.
I remember a few months ago gm had a bug with included files and duplicated them all about 1000 times. I noticed when I opened the project file in notepad and it had a zillion lines declaring included files. And I only had about 30. The reason why I looked at the project file was cus it started taking longer and longer to compile, and ended up a standard of at least 3 minutes, whereas lot too long ago it would be a few seconds, and nothing had changed really. I think the bug made it add the same included files every time it compiled, so each time it took longer..
I fixed it by manually removing all included file definitions from the project file, which I think I made a script that did it for me cus doing it in notepad would've taken a long time.. But I've noticed this bug doesn't happen anymore, so it's fixed. But I'm not sure if it will remove all the duplicates, say if you save the project as a new one I think it'll just copy all of the definitions with it..
If this is the case with you I can help fix the project file like I did with mine.
 

T2008

Member
Thanks for this information. I actually did have a problem with file folders being messed up and redundancy, and I ran someone's program to fix. The GM update did fix the issue, though I might still have the redundant files. I'm afraid to delete stuff because I might accidentally do something to wreck my whole project. I'd be very interested in how you fixed your problem if you don't mind helping.
 

Joe Ellis

Member
Well with getting rid of included file definitions in the project file, it's fine cus if they get deleted and still exist in the datafiles folder gm just adds them again. So I just made it read through every line in the project and if it had "CopyToMask" in it it wouldn't write it to the new file:

GML:
function project_remove_included_files(fname)
{

    var
    f1 = file_text_open_read(fname),
    f2 = file_text_open_write(fname + ".new"),
    line;

    while file_text_oef(f1)
    {
        line = file_text_readln(f1)
        if !string_pos("CopyToMask", line)
        {
            file_text_write_string(f2, line)
            file_text_writeln(f2)
        }
    }
    file_text_close(f1)
    file_text_close(f2)
}
I made a backup before doing it, then renamed the original project file to ".old" and removed the ".new" from the new one. It worked fine though. And yeah one of the gm updates has stopped this from happening anymore.

-EDIT Make sure to disable file system sandbox in the project settings and put in the full path of the project file
eg."C:\Users\Joe\Documents\GameMakerStudio2\Project Name\Project Name.yyp"
 
Last edited:

T2008

Member
Thanks so much! I'm actually traveling now but when I get back in town and can do a backup, I will definitely try this code. I really appreciate your help!
 
Top