So, I worked out a (very very crude) SVG to drawn map import process.

8 replies [Last post]
nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1857

Which is documented here:
https://code.google.com/p/hedgewars/wiki/SVGImport
and the results of which are here:
http://m8y.org/hw/drawn/

Note that these look much better in 0.9.18-dev where the thinnest line is used (16px wide) - 0.9.17 doesn't have variable line width so they look pretty blobby.
One can of course edit them after the load, to add/remove features, although 0.9.17 doesn't have the erase brush either, which makes removing a bit tricky.

Anyway. For those people using the test builds, or those who don't mind the blobbiness.

Anyone have any SVGs they'd like turned into drawn maps? Smile

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Star and Moon
Star and Moon's picture
User offline. Last seen 2 years 25 weeks ago. Offline
Joined: 2010-04-03
Posts: 715
nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1857

Star and Moon allegedly wrote:

https://dl.dropbox.com/u/37438655/hedgehog.svg

404, but I'm going to assume you mean
http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/hedgehog.svg

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Star and Moon
Star and Moon's picture
User offline. Last seen 2 years 25 weeks ago. Offline
Joined: 2010-04-03
Posts: 715

Yeah that's it. (It got 404 because I got the link before it had synced)

Also, I think some of those drawn maps should be included in the game as examples, such as Globe.

nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1857

Added. Actually, this one was more complex because the points needed cleaning up to simulate occlusion. Oh well. Looks ok I think.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

sphrix
sphrix's picture
User offline. Last seen 4 days 15 hours ago. Offline
Joined: 2011-04-07
Posts: 206

hum, do i understand everything ?

it would turn a basic svg in a map, but not a map as we dl from unit22 but a map in wich different theme texture can be applied, with girder and land object ?

(if i didn't understand that just mean my english is bad, not mean that you didn't explain good Wink Smiley )

https://dl.dropbox.com/u/82215817/barres2.svg

a basic one, just to see what you mean

the beachs hogs surfin hedgewars

nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1857

sphrix allegedly wrote:

hum, do i understand everything ?

it would turn a basic svg in a map, but not a map as we dl from unit22 but a map in wich different theme texture can be applied, with girder and land object ?

(if i didn't understand that just mean my english is bad, not mean that you didn't explain good Wink Smiley )

https://dl.dropbox.com/u/82215817/barres2.svg

a basic one, just to see what you mean

It makes a drawn map - you know, if you select drawing a map in the map filter, click the preview and start scribbling away, you can choose to save. The format is saves in has an extension of .hwmap

You can choose to load them as well. I'm surprised there aren't more people sharing their drawn maps on the website. Maybe they are waiting for the eraser and variable brush unc0rr added in next version. Smile
Drawing straight lines exists in 0.9.17 and 0.9.16 - click down with the mouse, press ctrl, then move the mouse, and you get a nice straight line - you could use this to very easily replicate the map that you posted in the SVG with only 18 lines, although if done in 0.9.17 you might need a few more to increase the thickness due to lack of variable brush support.

And, yes. It is decorated by the theme, so including girders and objects unless you disable those in the scheme preferences.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Star and Moon
Star and Moon's picture
User offline. Last seen 2 years 25 weeks ago. Offline
Joined: 2010-04-03
Posts: 715

Two questions: is there a size limit for this? Also, did you guys add a fill option in 9.18 too?

nemo
nemo's picture
User offline. Last seen 10 hours 12 min ago. Offline
Joined: 2009-01-28
Posts: 1857

Star and Moon allegedly wrote:

Two questions: is there a size limit for this? Also, did you guys add a fill option in 9.18 too?

There's no fill option, but most uses of fill can be handled fairly efficiently by just using the mousewheel to pick the max brush size.
For example, if you pick max brush size and use ctrl-click to draw accurate horizontal lines, you can fill the entire map using only 4 horizontal lines.

You can then use the eraser to draw a cave.

As for size, that's covered in the wiki page. Since these are SVG, you can scale them to whatever dimensions you want, but drawn map only draws to the current hedgewars land limit - that means 4096 wide and 2048 high.

If you convert an SVG and specify coordinates outside of this, they just won't get drawn and will get clipped off. You can do that, but it'd be more efficient to "crop" the SVG first if you want that effect - that would save on nodes being loaded by hedgewars.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Copyright © 2004-2021 Hedgewars Project. All rights reserved. [ contact ]