<< Back to Map Development Forum   Search

Posts 1 - 30 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 46
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 3
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 46
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.

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


Richard Sharpe 
Level 59
Report

Matma

Just tried your updated program with my Ireland map and the original Mario one and here are the results

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

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

Worked perfectly on the second map which is no surprise given the regular nature of it. The Ireland map was a bit trickier as it had difficulty handling the erratic shapes of some territories and did not like islands. Still a pretty handy tool though.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 12/30/2011 11:43:14


Moros 
Level 50
Report

Well damn, something didn't work. :( It might be a good idea to report the error along with the data below.
#<Net::HTTPOK 200 OK readbody=true>
#<Net::HTTPOK:0x2c97fc0>
<root><termsOfUse>Please use this API responsibly, as it can consume significant amounts of server resources if used excessively.<termsOfUse>
<error>ServerMapKeyNotFound<error><\root>
Press enter to exit.

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


Moros 
Level 50
Report

Could the problem be that it's in testing mode now and there's a testing game going on right now?

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


Matma Rex 
Level 12
Report

If you can't edit the map with the built-in editor, you won't be able to do it with my tool (or via API in any other way). Just duplicate it first.

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


Moros 
Level 50
Report

Duplicated, run the program again, worked, beside that almost all of the centerpoints were off-screen, and 2 random ones were in the right place but a lot of pixels to the left.

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


Matma Rex 
Level 12
Report

Are you sure you've got the most recent version of the tool? I added partial support for SVG transform attributes some time ago.

Are you sure you were working on the same SVG as the one uploaded to Warlight?

If you are sure about both these things and it still doesn't work, then I'd certainly like to see that SVG :) - if you don't mind sharing it, you can mail me at matma.rex@gmail.com.

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 4/22/2012 06:57:23


Domenico
Level 16
Report

I'm getting the same error as Moros. I've used it on an editable version of the map with the same svg as the map. So what went wrong?

The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 7/2/2012 09:50:19


Smok 
Level 30
Report
Sorry - not working.
The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 8/3/2012 00:14:00


Nate
Level 18
Report
This Works really Well I used it on My Mexico Map and It worked perfectly thanks Matma Rex
The new map details API and usage (tl;dr: Generate your centerpoints automatically!): 1/3/2013 23:15:17


< UIT > Stag
Level 30
Report
I cannot seem to find the file. The dropbox says that the page is missing. Is there a new link for this file?
Posts 1 - 30 of 31   1  2  Next >>