How to speed up load/save times in C2?

Discussion and feedback on Construct 2

Post » Wed Apr 16, 2014 4:18 pm

Hey there,
So I just read through the new blog entry here: https://www.scirra.com/blog/141/common- ... nd-gotchas
It was very informative and taught me a few things (Especially that "abs(Sprite.X - 100) < 0.01" formula), but after reading the stuff about project files (Using project files for long amounts of string data is a good way to speed things up), it made me wonder what else could speed up loading/saving/previewing times.
I generally find that when I save my current project, it takes 10 seconds, (then saves a backup which takes another 10 I think). When it autosaves, it takes a lot longer than this, about 30 seconds altogether. When I preview, it can take up to about 20 seconds to load.

I feel it's dumb to say all this considering 20 seconds sounds very low and I should just be patient, but I've been dealing with this for a long time and when I work on emptier projects and have near-instant load times, it's making me realise how much time I'm spending sitting there waiting for a loading bar just to see 1 little difference I made (I preview quite frequently)

My project has 4000 events, and according to the info in c2, it uses 36mb of memory, and is 14mb download. I don't have any music in the game and there's quite a lot of images and a few sounds, and I preview locally on the same computer via Chrome (and sometimes Node-Webkit). My computers specs aren't bad, quad core with 6gb ram, so I'm pretty sure it's not my computer, just something I'm doing wrong in C2. :P

So considering that using project files for strings of data is a good way to speed up things (I have a few hard-coded events for SpriteFonts to space the letters out but I think that's pretty mild and don't really use long strings of data), I was wondering what else could be done too?

Thanks!
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Wed Apr 16, 2014 4:38 pm

Are you using a project folder? If so it only saves what you change and doesn't have to compress a zip, which should be fast. So if you've only changed one event sheet since your last save, it will only replace the .xml file for that event sheet when you next press save. (When using a .capx it has to zip the entire project every time you save regardless of how small the changes are, which for large projects can get slow.)

If you have 1000 events in one sheet, it will have to save 1000 events every time you make even a small modification to the sheet - so splitting large sheets in to multiple sheets and including them could make it faster.

Not sure what to do about preview times, it doesn't do anything particularly CPU intense on preview other than generate the project data for javascript. Could you send me your project so I can see how long it takes to preview myself and maybe profile it?
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993

Post » Wed Apr 16, 2014 5:02 pm

I have all 4000 events in one sheet haha, I will split them up and will report back. And sure, though maybe having 4000 events is why it takes a short while to preview. I'll have to break the project by removing third-party plugins (I think I remember all the ones I've used) I've used but I'll give it in it's current state. I'll email it soon :P

EDIT:
@Ashley I think I just figured it out myself actually. I looked back through old emails we had and you mentioned how on my last project, it had over 5000 images which was bad, I've basically done that again, looking in my projects' folder I have around 1500 images. This is due to having multiple weapons/clothing in my game that can be equipped dynamically with different characters. I think I remember trying out using external images + "Load image from URL" for animations but I couldn't get what I wanted (I tried using 1 object that had multiple isntances, but they all have to share the same image data so I couldn't have more than 1 clothed player/weapon when using external images) So I've ended up repeating the same process again without realising :( I mean the game runs brilliantly at 60fps (even on older laptops), but C2 itself is chugging since I'm designing it pretty poorly I suppose.
B
51
S
20
G
10
Posts: 571
Reputation: 9,819


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests