FAQ FAQ   Search Search  Register Register   Login Login  
   Main Site   Wiki  



Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

Author Message
 PostPosted: Thu Jul 20, 2006 5:41 pm  Post subject: svg2aamap
Offline
Formerly That OS X Guy
User avatar

Joined: Fri Jan 02, 2004 12:05 am
Posts: 2015
= svg<->aamap

== What?

svg<->aamap takes a SVG file and converts it to an Armagetron Advanced map file. This allows you to draw your map in a vector drawing program, such as Adobe Illustrator or Inkscape.

== Usage

=== Zones

To create zones you must put them in their own layer/group. The groups should be named “Win-zones”, “Death-zones”, or “Fortress-zones”. You should use the element “circle”. You may use groups in these layers.

=== Walls

Any shape that is not in a zones group will be converted into a AA Wall element. The supported SVG elements are:

* line
* rect
* polyline
* polygon

== What's Next?

* aamap2svg
* Spawn points? Arrows?
* circles converted to wall
* ellipse http://www.w3.org/TR/2003/REC-SVG11-200 ... pseElement
* path http://www.w3.org/TR/2003/REC-SVG11-20030114/paths.html
* Web version
* Move to SVN?

== Dependencies

* Ruby 1.8

http://generalconsumption.org/armagetronad/svg<->aamap-0.1.zip


Attachments:
File comment: The map in Illustrator.
Illustrator.png
Illustrator.png [ 209 KiB | Viewed 2505 times ]
File comment: No spawn points.
blah-1.aamap.xml.png
blah-1.aamap.xml.png [ 55.15 KiB | Viewed 2411 times ]
File comment: An example.
blah-1.aamap.xml [8.96 KiB]
Downloaded 276 times

_________________
gridstats.comgeneralconsumption.org


Last edited by dlh on Wed Oct 11, 2006 9:40 pm, edited 1 time in total.
Top
Profile
 
 PostPosted: Thu Jul 20, 2006 11:16 pm  Post subject:
Offline
Formerly That OS X Guy
User avatar

Joined: Fri Jan 02, 2004 12:05 am
Posts: 2015
I've taken a look at SVG created by Inkscape, and it uses the “path” tag for shapes, which I will have to implement for this to be usable outside of Illustrator (not all of it at once, just basic stuff first). It also doesn't set the id attribute for “g” tags, instead opting to extend SVG with its own attribute.

Looking back, SVG would be a better base for our map format, and we could extend it to support new features.

_________________
gridstats.comgeneralconsumption.org


Top
Profile
 
 PostPosted: Fri Jul 21, 2006 10:44 pm  Post subject:
Offline
Long Poster - Project Developer - Sage
User avatar

Joined: Mon Jul 12, 2004 8:55 am
Posts: 1526
Location: Stockholm
nemostultae wrote:
Looking back, SVG would be a better base for our map format, and we could extend it to support new features.


Talking converting to SVG, what would be the gain(s)? I guess that editing tools would be one, but I'm not that well versed in SVG. Also, what would be the cost beside a new "format" and a new parser?

-ph

_________________
Canis meus id comedit.


Top
Profile
 
 PostPosted: Sat Jul 22, 2006 10:09 am  Post subject:
Offline
God & Project Admin
User avatar

Joined: Sun Jan 23, 2005 6:01 pm
Posts: 10575
Location: Cologne, Jabber: z-man@amessage.de
We've been discussing this before; my feeling was that svg, being purely 2d, won't get us the semi-3d stuff we're going to need some time, and assigning spawn points and stuff could be awkward. svg editors may not respect our possible additions and delete them.

What we could do at zero loss and potential big gain is to allow references to svg files for geometry from within the map file. The map could say "Give me a wall; the geometry of the wall is to be taken from this layer of this svg file. Oh, and please transform the brightness of the lines into wall height." Then we wouldn't be restricted by svg's constraints.


Top
Profile
 
 PostPosted: Wed Oct 11, 2006 5:13 pm  Post subject:
Offline
Formerly That OS X Guy
User avatar

Joined: Fri Jan 02, 2004 12:05 am
Posts: 2015
This version works better with Inkscape (be sure to choose Plain SVG in the save window). It parses <path> elements. There is still a bug with closepaths, so it doesn't work 100% yet.

Edit: Now in SVN @ tools/svg2map


Attachments:
svg2aamap-0.2.zip [12.24 KiB]
Downloaded 408 times

_________________
gridstats.comgeneralconsumption.org
Top
Profile
 
 PostPosted: Wed Oct 11, 2006 9:28 pm  Post subject:
Offline
Reverse Outside Corner Grinder
User avatar

Joined: Wed Jan 04, 2006 4:42 am
Posts: 1679
Location: 0x08048000
Committed some fun stuff to SVN :)

It can now convert paths, as long as they only consist of the commands M, m, l, L, C, S and z, don't have m or M commands in the middle and don't use a too crazy syntax (omitting separators where they aren't strictly needed breaks the script).

A quick example featuring my great drawing skills (or not):


Attachments:
File comment: the preview
weird.aamap.xml.png
weird.aamap.xml.png [ 98.07 KiB | Viewed 2315 times ]
File comment: the map
weird.aamap.xml [14.32 KiB]
Downloaded 206 times

_________________
There's no place like ::1
Top
Profile
 
 PostPosted: Wed Oct 11, 2006 9:40 pm  Post subject:
Offline
Formerly That OS X Guy
User avatar

Joined: Fri Jan 02, 2004 12:05 am
Posts: 2015
Nice job wrtlprnft. I'll put up a web version later.

I added the circle and ellipse elements. We just need to add the A and a path commands and we'll have a pretty good range of SVG supported.

Edit: web version @ http://generalconsumption.org/armagetronad/svg2aamap/

_________________
gridstats.comgeneralconsumption.org


Top
Profile
 
 PostPosted: Wed Oct 11, 2006 11:24 pm  Post subject:
Offline
God & Project Admin
User avatar

Joined: Sun Jan 23, 2005 6:01 pm
Posts: 10575
Location: Cologne, Jabber: z-man@amessage.de
Looks groovy :)


Top
Profile
 
 PostPosted: Wed Oct 11, 2006 11:40 pm  Post subject:
Offline
Match Winner
User avatar

Joined: Mon Feb 13, 2006 12:34 pm
Posts: 613
Location: UK
It is. Very Groovy.
I'm trying to learn Inkscape now. It seems to give me all the map making features I've always wanted from Armabell. Just very fiddly, whenever I've dabbled with vector programs I've always found them fiddly.
Useful things I've found for map making-
Go to Document properies, Grid, tick them all.
set the x and y spacing to about 25px (or less depending on map intricacy).
on page, set the canvas size to 500x500 this is the same as normal fortress, so will give you a guide to how large your map will be.
With this it's very easy to make any 4/8 axes map.
Thanks.

_________________
Some Armagetron Advanced Map Tools.


Top
Profile
 
 PostPosted: Thu Oct 12, 2006 12:01 am  Post subject:
Offline
Outside Corner Grinder
User avatar

Joined: Thu Jun 08, 2006 3:33 pm
Posts: 1592
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
I like it too; still trying to learn Inkscape.
It will be real easy to make maps now.
a lot better than armabel
i'm still going to try to make a JAVA program later on though.


Top
Profile
 
 PostPosted: Thu Oct 12, 2006 1:20 am  Post subject:
Offline
Outside Corner Grinder
User avatar

Joined: Thu Jun 08, 2006 3:33 pm
Posts: 1592
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
I tried the Fortress-zones layer and it just made them walls for some reason.

any reason that you know of why this happened

I'm using Inkscape and used circles
I would post my SVG file but i can't here


Top
Profile
 
 PostPosted: Thu Oct 12, 2006 1:33 am  Post subject:
Offline
Formerly That OS X Guy
User avatar

Joined: Fri Jan 02, 2004 12:05 am
Posts: 2015
-ct-kyle wrote:
I tried the Fortress-zones layer and it just made them walls for some reason.

any reason that you know of why this happened

I'm using Inkscape and used circles
I would post my SVG file but i can't here
Right now the zones layers only look for SVG circle elements. Inkscape outputs circles as SVG path elements. I'll try to get a fix in for that. I think inkscape does something weird with groups, too.

_________________
gridstats.comgeneralconsumption.org


Top
Profile
 
 PostPosted: Thu Oct 12, 2006 1:42 am  Post subject:
Offline
Outside Corner Grinder
User avatar

Joined: Thu Jun 08, 2006 3:33 pm
Posts: 1592
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
it does a lot of weird stuff.
it does not even draw everything correctly.

it dose not print from the Fortress-zone layer.
also does not have everything centered like i had it
i tried both export methods


Attachments:
File comment: here are all my files
sawblade2.zip [8.46 KiB]
Downloaded 325 times
Top
Profile
 
 PostPosted: Thu Oct 12, 2006 7:01 am  Post subject:
Offline
Reverse Outside Corner Grinder
User avatar

Joined: Wed Jan 04, 2006 4:42 am
Posts: 1679
Location: 0x08048000
Note that the SVG implementation is far from complete. You'll especially notice that when you use the select tool (F1) to move, rotate and skew things around. This adds translate commands to the SVG, which aren't implemented. I'm currently reading the specs and hope that i can implement it soon :)

For now, never move things with that tool. Instead, go to the edit path tool and drag those handles around.

_________________
There's no place like ::1


Top
Profile
 
 PostPosted: Thu Oct 12, 2006 10:41 am  Post subject:
Offline
Match Winner
User avatar

Joined: Mon Feb 13, 2006 12:34 pm
Posts: 613
Location: UK
Can I ask why all x values are + and all y values are - ?
It makes it very difficult to add spawn points later.
I can look at the image in Inkscape and see I want to later put a spawn point at x=80, y=160 for example.
But this would be in xml x=x y=(max y val - (max y val * 2))-y
or something. All I know is that it's a pain to add multiple spawn/zones afterwards. It kind of limits me to symmetrical maps where I can just y = -y.
But that messes up angles as the whole thing is flipped.
I guess I could just to a search on "y=\"-" and replace with "y=\"", but then the map must be symmetrical to be any good to me later.
Waffling now.

edit: another option is to build the map, work out the desired spawn cordinates in Inkscape, flip the map horizontically in Inkscape before you save it.
Then convert to xml, remove all the "-"'s.
Then you have your map correct with positive values as it was first built.
edit: this doesn't work properly either. Like Kyle said, it has flaws. Still a good tool, but involves extra work. I'm able to map maps now I could never before.


Anyway, great apps. I appreciate the new tools, but if you could take a look at this, it would be great.
Or some way to represent spawn points with angles would work too.

_________________
Some Armagetron Advanced Map Tools.


Last edited by ed on Thu Oct 12, 2006 3:39 pm, edited 1 time in total.

Top
Profile
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by two camels and phpBB © 2000, 2002, 2005, 2007 phpBB Group