<< Back to Map Development Forum   Search

Posts 1 - 16 of 16   
SVG file size problems: 2/1/2019 08:59:36


Koen27
Level 54
Report
I am having issues with the size of my svg file. No matter what I do, I can't bring the size under 2,1 MB. Is there anything I can do to reduce it without having to simplify the territories?
SVG file size problems: 2/1/2019 10:22:55


Mudderducker 
Level 59
Report
Save your file as a plain SVG rather than an Inkscape SVG, then upload it to warzone. However don't close Inkscape until you have re-saved it as an Inkscape SVG, otherwise it deletes the layering and it screws it up a little (have another backup save also)

You can also go around deleting nods rather than simplifying, this is time consuming but allows you to keep detail but cut space

Edited 2/1/2019 10:24:43
SVG file size problems: 2/1/2019 10:29:29


Koen27
Level 54
Report
I already saved it as a Plain SVG, deleted the background and all other unnecessary objects. Deleting nods will be a useless, because in that case I would have to delete a lot of them in order to effectively reduce the size. And by a lot I mean A LOT.

Edited 2/1/2019 10:31:46
SVG file size problems: 2/1/2019 10:50:13


ℳℛᐤƬrαńɋℰ✕
Level 59
Report
SVG file size problems: 2/1/2019 11:20:39


Mudderducker 
Level 59
Report
Did you use the pencil tool or the Beizer ? your territories seem to have a lot of detail. Cause <1000 territories (unless you have added loads since your last link) without any design should easily make the size limit

Edited 2/1/2019 11:21:04
SVG file size problems: 2/1/2019 12:17:44


DanWL 
Level 63
Report
With an object selected, use ctrl+l to simplify it. Simplifying deletes nodes. Only do it a once or twice as it can change the original shape a lot.
SVG file size problems: 2/1/2019 13:08:47


Koen27
Level 54
Report
I used the bezier only. Is that good or not? I am now just over the 1000 limit. And what do you mean with loads?

Edited 2/1/2019 13:11:30
SVG file size problems: 2/1/2019 13:50:18


Mudderducker 
Level 59
Report
Bezier is better for saving space, as long as you didn't go wild with it lol. Double check you don't have any pictures or stuff in the background, cause with around 1000 territories I really cant see why you are over... :/

You are gonna have to simplify or delete nods unfortunately if there is no other explanation

If your mountains are territories (not on warzone but drawn on Inkscape) delete them and put a layer behind it instead

Edited 2/1/2019 13:53:11
SVG file size problems: 2/1/2019 14:08:33


Koen27
Level 54
Report
The mountains are just nothing. No path, just empty space
https://www.warzone.com/SinglePlayer?PreviewMap=77082

But I wonder why the maximum size is 2 MB. Why can't it be more?

Edited 2/1/2019 14:32:30
SVG file size problems: 2/1/2019 15:16:45


Gallien
Level 56
Report
Your ships are a little bit too detailed, don't you think? At least the blue waves under the ships are unnessesary...
SVG file size problems: 2/1/2019 16:51:54


Koen27
Level 54
Report
I already deleted those, and simplified the sails of the ships.

Something really weird is now that I have simplified about 100 territories, the size of the map got larger. Any possible explanation?

Edited 2/1/2019 19:42:36
SVG file size problems: 2/1/2019 20:04:03


Koen27
Level 54
Report
I just found something really weird. I removed all the territories and other paths, only leaving the bonuses and bridges and that kind of things (including the ships) and they were 1,8 MB. Perhaps I should seek out what is causing the large size of the file. Since it is not the territories.
SVG file size problems: 2/1/2019 20:17:46


Koen27
Level 54
Report
This whole Inkscape is just genius. If I remove everything except the bridges and cities and ships the file size is 1,8 MB
BUT, when I remove nothing the file is 3,8 MB. Which means that if I remove the bridges and stuff the size should be 2 MB. Well it was 3,5 MB. I don't get it anymore.
SVG file size problems: 2/1/2019 22:08:13


DanWL 
Level 63
Report
You could edit the raw text representation of the SVG (using a plain-text editor such as Notepad) and delete unnecessary parts. Try not to remove the important parts though!
SVG file size problems: 2/2/2019 08:04:36


Murk 
Level 57
Report
With such detailed territories, staying under the file size limit can be hard.
I'm pretty sure it can be done, though.

First a few general tips to keep file size low:
- Only draw with the bezier tool (but you've already done this). Straight lines are much better than curves.
- Clone instead of duplicate/copy-paste
- Combine (ctrl-K) everything that can be combined (all visuals that have the same colour can be combined - all the bottoms of the boats, all the bridges, all those dotted lines). Group everything else (ctrl-G)
- If you use duplicates or layers, make sure you haven't accidentally doubled objects without noticing.


Then, there is some clean-up you can do with the file, especially if you've changed a lot of things throughout the process.
-Saving as "plain svg", reopening and then saving as regular svg will sometimes get rid of unnecessary layers.
- Under "File" is the option "Clean up document" (symbol of a little vacuum cleaner), which will get rid of unnecessary meta data and temporary data.
- Under "Edit" - "Inkscape Preferences" - "Input/Output" - "SVG output", play around with the "Numeric precision" value. Depending on your map, you can often lower that number (it minimises the amount of decimals in the svg data).


Lastly, there are quite a few svg-compressors online. I like SVGomg (https://jakearchibald.github.io/svgomg/) best, since it gives a lot of options.
Be careful, though, because it can mess up your file pretty badly. Be sure to make a few backups, and take some time to try out the settings (don't be discouraged if it messes the file up the first time).
In general you can keep all the options checked except for "rewrite paths" and "cleanup ID's". Play around with the precision slider; there's a fine balance between precision and file size.



Using mostly the above I've gotten a >4MB file down to <2MB, so I'm sure it should work out with yours too.
If you're really desperate, you can also send me the file and I'll see if I can get it to behave.
Good luck!



---


I think I can answer the questions you had too:


But I wonder why the maximum size is 2 MB. Why can't it be more?

Because the game needs to be available to everyone, even those with shitty computers and ten-year-old phones. Compressed maps of 2MB can already be tough for a lot of devices; anything bigger would be unplayable for a lot of people.

Something really weird is now that I have simplified about 100 territories, the size of the map got larger. Any possible explanation?

Yes, this is why I wouldn't recommend simplifying (ctr-L). When simplifying, you'll often see that the amount of nodes decrease, but the remaining lines get curved (Inkscape tries to decrease the nodes but keep the shape). Curved lines are complex. Multiple straight lines < a few curved lines.
Simplify can make things look more smooth, but if you used the bezier tool often increases file size.

BUT, when I remove nothing the file is 3,8 MB. Which means that if I remove the bridges and stuff the size should be 2 MB. Well it was 3,5 MB. I don't get it anymore.

SVG files data isn't just all your objects. It's chock full with metadata, lay-out etc. too. Having said that, 1.8 MB for just your boats and bridges is way too much. I don't know what you've done with it, but there is bound to be redundancies in there. See if you can get it down with everything above; if not, I would love to take a look at it. There's just no way those boats and bridges alone should be 1.8MB.

Edited 2/2/2019 08:14:23
SVG file size problems: 2/2/2019 10:42:56


Koen27
Level 54
Report
- Clone instead of duplicate/copy-paste
Sadly I duplicated all the bonuses and ships. I don't think there is anything I can do about that now.

- Combine (ctrl-K) everything that can be combined (all visuals that have the same colour can be combined - all the bottoms of the boats, all the bridges, all those dotted lines). Group everything else (ctrl-G)
I combined the bottoms of the ships and all the bridges. I made the dotted lines from the ships normal lines, and combined them as well. I grouped the bonuses, but not the territories.

For the rest:
I saved it as a 'Plain svg" and used the "Clean up document" tool. I also lowered the "Numeric precision" value.
I haven't used the online compressor, maybe I'll try it later. Thanks for that by the way.

Unfortunately the size didn't drop anything at all. I have no idea what is wrong. If you could take a look that would be great. How should I send it to you? And before I do that, is there something I forgot?
Many thanks

Edited 2/2/2019 12:16:27
Posts 1 - 16 of 16