[SOLVED] How do I Reduce Tilemap Size

Get help using Construct 2

Post » Sun Apr 09, 2017 10:21 pm

I have a layout that is about 42.3mb and I was deleting objects to see why it's so huge in file size, which it turns out 42mb of that size is from the tilemaps alone. What are ways I can reduce the file size my tilemaps add to the layouts? It's only a concern because my game takes like 5 minutes to save now and it causes my computer to get jerky with bouts of machine-gun freezing.
Last edited by corlenbelspar on Mon Apr 10, 2017 6:56 am, edited 1 time in total.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Mon Apr 10, 2017 1:51 am

Reduce the number of tiles in the tile map.

Although... 42mb doesn't seem like much to me, it shouldn't result in a 5 minute save, even on an older mobile device. I would try to isolate the issue in a new project to make sure.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Apr 10, 2017 3:31 am

Well I have a bunch of layouts over 10mb, so it all adds up to like 5 minutes if they all need to save when I hit save, which half the time layouts I didn't even alter at all have to save.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Mon Apr 10, 2017 3:39 am

Do your tilemaps change during gameplay? If you don't actually need to save them, you can add the "No save" behavior to them.

If they do change, you can save them with a different method - Get the Tilemap.AsJSON and write it to localstorage. You can then load that as needed. Everything else can be saved as normal via the system save action (use "No save" on the tilemap).

AsJSON
Save the object state to a string of data in JSON format, and return it. This can be downloaded or otherwise stored, and later the state of the object restored using the Set from JSON action.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Apr 10, 2017 3:59 am

Oh no, I don't mean save games, I mean C2 itself saving them.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Mon Apr 10, 2017 4:07 am

Oh huh. How big is your tile map source file and how big are your tile maps?

Maybe use a third party tile map software like Tiled to build your maps and import them as project files to load at run time.

How big is your capx file total when saving?
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Apr 10, 2017 5:39 am

I didn't really use things like Tiled, except for the world map and for things like drawing paths, since C2's tilemap editor is kinda weak. I saved my project as a CAPX and it's 64mb.

I thought of making the tilemaps load from project files, but that's going to make it hard to tell where to place enemies and such.

Also, my stages are made up of multiple tilemaps, because I made the scrolling based on their bounding box sides.

EDIT: My tilemaps are in multiples of 320x240, with a tile size of 16x16.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Mon Apr 10, 2017 5:55 am

I'm not really sure how to help you here, your project sounds pretty normal. 64 megs is fairly hefty though, compared to what I normally work with. If you have a lot of images to process into sprite sheets, it could explains the long save times.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Apr 10, 2017 6:23 am

I experimented a bit more and for some reason my obstacle tilemaps are gigantic.

EDIT: I replaced all the tilemaps that didn't clone instantly, and now my largest layout is 6.45mb and C2 doesn't really freeze on me or take more than 30 seconds to save.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010


Return to How do I....?

Who is online

Users browsing this forum: David181 and 25 guests