FAQ  •  Register  •  Login

SVG to BarrierMaker converter

<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Fri Jan 13, 2012 12:12 pm

SVG to BarrierMaker converter

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
You do not have the required permissions to view the files attached to this post.
<<

karamazovapy

Posts: 1567

Joined: Tue Feb 23, 2010 7:52 pm

Post Fri Jan 13, 2012 12:15 pm

Re: SVG to BarrierMaker converter

I thought this was a really clever way to generate point data for maps. Well done!
<<

Skybax

User avatar

Posts: 1035

Joined: Thu Mar 11, 2010 9:17 am

Location: Washington

Post Fri Jan 13, 2012 12:35 pm

Re: SVG to BarrierMaker converter

What's a SVG?
raptor wrote:Sorry Skybax, I hijacked your signature so I could post lots of info.
Whittling While wrote:Does this mean I finally get quoted in someone's signature?
watusimoto wrote:Who are the devs around here?!?
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Fri Jan 13, 2012 12:47 pm

Re: SVG to BarrierMaker converter

OK OK, I added information about what an SVG is to my post. :)
<<

BlackBird

User avatar

Posts: 404

Joined: Wed Jun 15, 2011 7:25 pm

Location: Maryland USA

Post Fri Jan 13, 2012 12:51 pm

Re: SVG to BarrierMaker converter

What about converting an .img to an .svc?
You cannot legislate the poor into prosperity by legislating the wealthy out of prosperity.
<<

raptor

Posts: 1046

Joined: Mon Oct 11, 2010 9:03 pm

Post Fri Jan 13, 2012 12:55 pm

Re: SVG to BarrierMaker converter

I goofed up the source code eclipse project - I re-uploaded it with all the necessary dependencies fixed. Sorry.
<<

Skybax

User avatar

Posts: 1035

Joined: Thu Mar 11, 2010 9:17 am

Location: Washington

Post Fri Jan 13, 2012 5:13 pm

Re: SVG to BarrierMaker converter

Oh so it's essentially turning a picture into a level. Got it.
raptor wrote:Sorry Skybax, I hijacked your signature so I could post lots of info.
Whittling While wrote:Does this mean I finally get quoted in someone's signature?
watusimoto wrote:Who are the devs around here?!?
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Mon Jan 16, 2012 7:54 am

Re: SVG to BarrierMaker converter

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.
<<

karamazovapy

Posts: 1567

Joined: Tue Feb 23, 2010 7:52 pm

Post Mon Jan 16, 2012 8:01 am

Re: SVG to BarrierMaker converter

Yeah, you'd have to be some kind of genius or something *cough* to turn a JPEG into level code...
<<

Skybax

User avatar

Posts: 1035

Joined: Thu Mar 11, 2010 9:17 am

Location: Washington

Post Mon Jan 16, 2012 10:56 am

Re: SVG to BarrierMaker converter

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.
raptor wrote:Sorry Skybax, I hijacked your signature so I could post lots of info.
Whittling While wrote:Does this mean I finally get quoted in someone's signature?
watusimoto wrote:Who are the devs around here?!?
<<

karamazovapy

Posts: 1567

Joined: Tue Feb 23, 2010 7:52 pm

Post Mon Jan 16, 2012 12:28 pm

Re: SVG to BarrierMaker converter

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...

Return to Misc.

Who is online

Users browsing this forum: No registered users and 1 guest

cron