Page 1 of 1

SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:12 pm
by raptor
Here is the program I wrote to convert an SVG to BarrierMaker code.

This is a Java Runnable JAR and should run on Windows/Mac/Linux systems just fine.

For those who don't know:

SVG stands for 'Scalable Vector Graphic'. It is a graphic file format like PNG, JPG, BMP. SVG however will scale to any resolution without losing quality whereas those other types can't do that. This makes SVG an excellent format for things like graphs and curves. You can create SVGs using a program like InkScape.

How to use this program:
  1. Download the JAR file below
  2. Run the JAR file. (Usually double-clicking it will work.) A very ugly GUI will pop up
  3. Click 'Open File' to load an SVG file with the GUI. (A good place to get SVGs: http://commons.wikimedia.org/wiki/Main_Page. Example: Search for "SVG spiral")
  4. Adjust the settings to how you see fit. There are tooltips with a little more description on each one.
  5. Click 'Convert'
  6. Copy the output text in the bottom window into your .level file
  7. Open the .level file with the editor
  8. Cross your fingers that you didn't make it too big...

Notes:
  • This can create REALLY large level files that may take forever for the editor to load and/or crash it. Use wisely - try to avoid creating monstrosities that take forever to load in-game and over the network.

Caveats:
I will not provide support for this application. This means:
  • I will not give further instructions
  • I will not fix bugs in it
  • I will not add features
  • I will not answer questions about it in the forums (I may answer quick ones in IRC... maybe)
  • I will not be responsible if this program sets fire to your computer and turns it into a burning pile of goo

Enjoy!

The program:
BitfighterSvgConversion.jar.zip


The next attachment is the eclipse project with the source code from which I created the JAR. I used:
BitfighterSvgConversion-eclipse_project_with_source_code.zip



Edit: Added link to wikimedia commons for SVG searching
Edit2: Explain what an SVG is
Edit3: Fixed eclipse project to include the JARs needed to build... sorry

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:15 pm
by karamazovapy
I thought this was a really clever way to generate point data for maps. Well done!

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:35 pm
by Skybax
What's a SVG?

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:47 pm
by raptor
OK OK, I added information about what an SVG is to my post. :)

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:51 pm
by BlackBird
What about converting an .img to an .svc?

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 12:55 pm
by raptor
I goofed up the source code eclipse project - I re-uploaded it with all the necessary dependencies fixed. Sorry.

Re: SVG to BarrierMaker converter

PostPosted: Fri Jan 13, 2012 5:13 pm
by Skybax
Oh so it's essentially turning a picture into a level. Got it.

Re: SVG to BarrierMaker converter

PostPosted: Mon Jan 16, 2012 7:54 am
by watusimoto
But not any picture -- a jpg is just a collection of pixels, whereas an SVG actually has structure (lines, points, polygons, etc.) that somewhat parallel the feature types in Bitfighter.

Re: SVG to BarrierMaker converter

PostPosted: Mon Jan 16, 2012 8:01 am
by karamazovapy
Yeah, you'd have to be some kind of genius or something *cough* to turn a JPEG into level code...

Re: SVG to BarrierMaker converter

PostPosted: Mon Jan 16, 2012 10:56 am
by Skybax
I turned a couple JPEGs into levels.
It just required a lot of tracing. And measuring. And time.
Can you convert JPEGs and PNGs and stuff into SVGs, though? Like, how would one obtain an SVG.

Re: SVG to BarrierMaker converter

PostPosted: Mon Jan 16, 2012 12:28 pm
by karamazovapy
There's an easier and far more accurate way to go from JPEG to Level that doesn't involve tracing...

...I mean, if you were some kind of genius *cough* you might be able to find a way...