Author Topic: Using SVG for maps  (Read 1846 times)

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Using SVG for maps
« on: January 11, 2011, 09:49:09 pm »
I tried to load a map into a blank one, but it expects it's own internal format. Using the built in editor is a rather painful process. May be you can switch to using SVG? It's a perfect generic vector graphics XML format. In such case one can create maps in any editor, and then just load them into the empty game map! This convenience is enabled for books, why not enable it for maps too?

weltall

  • Associate Developer
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Using SVG for maps
« Reply #1 on: January 12, 2011, 12:27:57 am »
1) it's complex and heavy (64k is the max for a packet it can't be overrun without a major blow to the net code)
2) not all it's primitives are available as primitive to the g2d backend, plus emulating them would be extremely expensive and would require implementation of r2t in order to have decent performance (fill is an example)
3) there are convertors.

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Using SVG for maps
« Reply #2 on: January 12, 2011, 01:16:13 am »
So a convertor from SVG to PS maps XML format is available? Where can it be downloaded? And as I understood, the final map file shouldn't exceed 64k?

If packet size is the issue, XML can be compressed by the way.

weltall

  • Associate Developer
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Using SVG for maps
« Reply #3 on: January 12, 2011, 06:43:06 am »
search for it in this forum. yes it shouldn't. libz from time to time is affected from code execution exploits and we don't want big maps in the db.

Tumaini

  • Traveller
  • *
  • Posts: 21
    • View Profile
Re: Using SVG for maps
« Reply #4 on: January 12, 2011, 10:44:51 am »
Here is an SVG<->PlaneShift Sketch XML script in Ruby.
http://www.hydlaaplaza.com/smf/index.php?topic=35557.0

Vakachehk

  • Veteran
  • *
  • Posts: 1468
    • View Profile
Re: Using SVG for maps
« Reply #5 on: January 12, 2011, 01:39:46 pm »
Here is an SVG<->PlaneShift Sketch XML script in Ruby.
http://www.hydlaaplaza.com/smf/index.php?topic=35557.0

Well I have tried using Ruby and have NO IDEA how to get it to work. So I gave up, even after talking with other people.

So I'm still stuck from the beginning how do I make a picture and convert it onto a map into PS?
You maybe roleplaying but you could still be OOC.

weltall

  • Associate Developer
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: Using SVG for maps
« Reply #6 on: January 12, 2011, 06:35:50 pm »
script.rb ./file.svg ./gamefile.xml?

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Using SVG for maps
« Reply #7 on: January 12, 2011, 07:29:06 pm »
Thanks, it worked! It converted some simple SVG to PS xml map. Now I just need to figure out which SVG elements are supported.
« Last Edit: January 12, 2011, 07:41:21 pm by Gilrond »

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Using SVG for maps
« Reply #8 on: January 12, 2011, 07:35:50 pm »
For those who are interested, it seems that script only supports path, line, rect, image, g elements from SVG.