<< Back to Map Development Forum   Search

Posts 1 - 5 of 5   
Circles and curves distrorted: 3/29/2014 11:41:59

Basil...
Level 56
Report
I'm currently trying to construct my second map. http://warlight.net/SinglePlayer?PreviewMap=31170

It's based on the board game 'Escape from Colditz' (not sure how well known it is, so that would also be a useful point for this thread). The territories will be small and circular as the counter spaces are in the game:



The problem is this: I've just created my first territory. I used the 'object to path' tool in Inkscape so the territory will show up in Warlight. Although it appears perfectly circular in the .svg file, in translation to Warlight it's noticeably distorted (see link). I've also noticed this distortion in other areas of the map, but it is not such a problem, only it makes parts of the map look less well drawn than they perhaps are.

Is this normal/is there any way of overcoming this?
Circles and curves distrorted: 3/29/2014 12:03:38

Fizzer 
Level 58

Warzone Creator
Report
This happens due to a limitation in Flash.

There are two kinds of curves, cubic and quadratic. Flash can only render quadratic curves (at least in the version WarLight uses). SVG supports both, but Inkscape renders all of its curves as cubic curves.

Therefore, WarLight has to convert all cubic curves to quadratic curves when the map is uploaded. It tries its best, but the formula to convert them is not simple and it doesn't always get it perfect. This is why they're slightly distorted.

Part of the issue, as well, is that Inkscape doesn't save circles as "circles" in the svg file. Instead, it seems to always convert circles into a series of cubic curves. This is unfortunate, as WarLight understands what an SVG circle is and can render that perfectly. There may be a way to get Inkscape to render the objects out as circles but I'm not sure how.

Other things you can try are to try messing with the vertices that make up the circle. Try making them into straights and then back into curves (there are buttons to do this). I'm not sure exactly what will work but there's surely a way to work around it if you play with it for a while.
Circles and curves distrorted: 3/29/2014 13:36:15

Basil...
Level 56
Report
Thank you for the reply. I think I've resolved it, the best way seemed to be simply making the circles into polygons with a large number of sides to eliminate the use of curves all together.
Circles and curves distrorted: 3/29/2014 13:40:15


Green 
Level 56
Report
If you're going to mass produce these shapes you may have to worry about lag issues and file size. But at the scale you're working at I think it'll probably be fine.
Circles and curves distrorted: 3/29/2014 14:11:36

Basil...
Level 56
Report
I agree, and that's another of my worries, but I guess I'll just have to see how it goes.
Posts 1 - 5 of 5