<< Back to Map Development Forum   Search

Posts 1 - 20 of 31   1  2  Next >>   
The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/1/2011 21:42:37


Matma Rex 
Level 12
Report

1.09 update brought the Set map details API, and I already love it.

And I already started using it! I made a tool to automatically generate centerpoints of a map! Now obviously, it has some limitations - it might produce insane values for any "weird" territories (multi-part, with holes, U-shaped), but it sorta kinda works.

The tool will need your e-mail and password to work. This data is not used for any malicious purposes.

It was written in Ruby. Source code available on request. (I'll release it freely later, when I clean it up.)


Executable file for Windows: http://dl.dropbox.com/u/10983006/tmp/centerpoints_uploader.exe

It will have to be placed in the same directory as your .svg file.

If something blows up, make a screenshot of the window before exiting and show it to me.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/1/2011 21:48:21


Moros 
Level 50
Report

I think this will work great for hex maps, they're all the same shape. But I'm not downloading it yet, I'll first watch what others think of it.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/1/2011 21:55:41

RvW 
Level 54
Report

So far I didn't get around to creating maps yet, but nevertheless: great job! (Especially for someone who only a week or two ago was convinced it's an impossible task... ;) )

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/1/2011 23:07:07


Matma Rex 
Level 12
Report

Well, the addition of set map details API changed the grade of this task from "nearly impossible" to "pretty tricky, but can be done" ;)

Also, it still doesn't really work. I tried it out on a couple of "real
SVGs (of my public maps) and encountered nothing but problems. I'll have to implement SVG transforms in my code, and I can already feel how awful it will turn out.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/7/2011 17:06:54


Matma Rex 
Level 12
Report

Bumping.

Has anyone tried using it? I'm anxiously waiting for any feedback!

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/16/2011 20:52:18


Richard Sharpe 
Level 59
Report

I may have the perfect map for this Matma... but I can't download it right now (firewall). Should be able to grab it tonight and will let you know what I think.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/16/2011 23:10:06


Richard Sharpe 
Level 59
Report

Didn't work... kept saying I had no territories.

Do I have to name them before using it?

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/16/2011 23:15:48


Matma Rex 
Level 12
Report

You need to set the "Territory_N" ids, and upload the map to Warlight - that should be it.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/16/2011 23:17:35


Richard Sharpe 
Level 59
Report

That is done. It is in development mode.

http://warlight.net/SinglePlayer.aspx?PreviewMap=7718

Did a couple of the center points first on my own and made a few connections, don't know if thats part of the problem.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 15:01:40


Matma Rex 
Level 12
Report

I get a "Sorry, the map you're trying to view does not exist. It may have been deleted by the map creator." error when trying to click your link.

My script shouldn't touch any connection, but will reset any previously added centerpoints.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 15:03:45


Richard Sharpe 
Level 59
Report

I deleted and reloaded the map to see if it had something to do with having added them. The new link is:

http://warlight.net/SinglePlayer.aspx?PreviewMap=7738

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 17:24:27

emoose 
Level 7
Report

Richard, you just made my day.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 18:18:50


Matma Rex 
Level 12
Report

Wait - does it work for you or not? (One can't see the centerpoints in the preview mode, unfortunately)

If it doesn't work, does it give any error? Can I see a screenshot of it? Are you sure you're typing in e-mail/password correctly, and that the script is working on the same SVG as the uploaded one?

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 18:33:35


Richard Sharpe 
Level 59
Report

Doesn't work.

Keeps saying it found 0 territories and completed successfully.

What do you want a screenshot of?
Email and password should be correct (I even signed out to confirm) and the script is in the same folder as the SVG which is the same that is loaded. I typed just the SVG name (Mario) without the extension.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/17/2011 21:58:09

RvW 
Level 54
Report

ROTFL, brilliant map!

And, nice test case for automatic centre points!

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/18/2011 00:41:01


Matma Rex 
Level 12
Report

Well, Richard, that's interesting. If you don't mind, you could post the SVG here or mail me (matma.rex@gmail.com), and I'll try to find the problem.

I also have one idea - you're using rectangles on your map, and if Inkscape decided to store them as <rect> elements instead of <path>, the script will fail - I'll try it out tomorrow (it's 2 am here already and I'm off).

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/18/2011 01:43:23


Richard Sharpe 
Level 59
Report

Let me look at that rectangle possibility first and then I'll get back to you.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/18/2011 01:51:34


Richard Sharpe 
Level 59
Report

Well the rectangle thing was the issue... it recognized the territories now.

However, it put the centerpoints about 200 pixels below where they should be.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/18/2011 09:47:23


Matma Rex 
Level 12
Report

Your rectangles - or a group they're in - probably has transform="translate(...)" attribute, which my tool doesn't yet support (Inkscape sometimes generates them instead of just chaning the path, for example when you're moving stuff around). Grouping everything together in Inkscape and then ungrouping it should help.

This is on my to-do list; it's just that problems like these rarely show up on "regular" maps, so I didn't implement them out of laziness.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/18/2011 13:18:03


Matma Rex 
Level 12
Report

Try this exe, Richard: http://dl.dropbox.com/u/10983006/tmp/centerpoints_uploader_pre.exe - I do not guarantee it will work, I haven't tested it properly, but it should support both <rect>s and translate transforms.

Posts 1 - 20 of 31   1  2  Next >>