Feature: Auto Resize Map

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Feature: Auto Resize Map

Post by JamzTheMan »

This topic is to discuss a new feature I call "Auto Resize Map".

It is accessed by right clicking on a "Stamp" (an asset on the Hidden/Object/Background layer) and choosing "Auto Resize..."

The cursor changes to a cross hair and lets you create a bounding selection box over the "Map" stamp. Once you select a certain number of grid cells (on the image, not MapTool grid cells!) a dialog will open. Here you can enter the number of cells you selected and "tweak" the selection area.

Once you hit ok, it will then resize the image so that one "Map cell" will equal one "MapTool Grid Cell" and also align the image so the "Map Cells" should match the Grid. This is done by adjusting the "Anchor points" so the map will/can still be set to "Snap to Grid".

You are allowed to "tweak" the selection in case your mouse hands are not steady and can not exactly select an area perfectly, or the map is bad or pixelated, etc. A lot of times you may find a map has exact dimensions, eg 2000x1800, so if your select is showing 298 x 302, most likely the grid would be in even multiples and you should change it to 300x300 for better results.

You can resize as many times as you want. Sometimes it may be easier to resize it to blow it up and get it close, turn the MapTool Grid on/off, check things, resize again to fine tune it.

Caveat, not all maps will be perfect. Some maps get skewed or have large grids lines so finding good start/stop points can be difficult. But for the most part, I think it will get you decent results and you can still resize it manually to fine tune.

An example of the dialog can be found here. Feel free to comment or make suggestions on the UI. I also externalized all dialog text so it can be translated to other languages.
Dialog
auto-resize.PNG
auto-resize.PNG (17.77 KiB) Viewed 4478 times
*Currently in MapTool as of 1.4.0.0

*POC Video: https://www.youtube.com/watch?v=aaw-_rrBQVI
*Some things fixed, like auto-correction of anchor points for snap-to grid.
*Sorry, I forgot to capture the mouse in the video encoding, so when I was counting the grid with the mouse pointer, you just get static video for several seconds... :(
Last edited by JamzTheMan on Thu Apr 28, 2016 3:07 am, edited 2 times in total.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: Feature: Auto Resize Map

Post by RPTroll »

Your warning is a good one. For some of the older maps the grids are not perfect and there will be drift but there isn't much you can do about that.

Otherwise, awesome! The dialog is simple and understandable.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Feature: Auto Resize Map

Post by JamzTheMan »

Thanks. I must say I had fun doing this one and have "played" with it more than I've "used" it lol.

I wasn't sure if the "Adjust Vertical Anchor" was clear in purpose? I do have some tool tips in there as well.

...and as I read this, I see I have a copy paste error as Vertical is in there twice, doh! Hey craig, feel free to update that before merging :)
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Feature: Auto Resize Map

Post by aliasmask »

I thought I remember you having a video to demonstrate but I couldn't find, so I made my own video: https://www.youtube.com/watch?v=GCV7FmXlmYE

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Feature: Auto Resize Map

Post by Full Bleed »

aliasmask wrote:I thought I remember you having a video to demonstrate but I couldn't find, so I made my own video: https://www.youtube.com/watch?v=GCV7FmXlmYE
Thanks for the vid Alias... this feature totally slipped past me.

I had to go in and do a test run (even after watching the video) to get a feel for it... but very useful for a quick irregular map import. Not as "perfect" as using image software, but a very nice tool to have in MT. Nice work Jamz!


Couple issues:

1) It looks like the two "Verticals" were not fixed before the 1.4 release.
2) Since I'm using a slightly modified default theme, the dialog is not drawing very nicely at all. I'm not having any trouble with other dialogs in MT. Any chance something can be done about that?
Attachments
image auto resize dialog issue.jpg
image auto resize dialog issue.jpg (37.14 KiB) Viewed 4222 times
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Feature: Auto Resize Map

Post by JamzTheMan »

Thanks Alias! And ya, there was a video during "beta" so an updated one is always appreciated.

@FB, hmm, ya, IIRC I didn't use the Abilie (spelling?) forms and had used normal Java commands to build the dialog (forget reason, maybe wanted to go JavaFX? Or just didn't have the older tool up and running) So probably why the theme doesn't translate over. Probably could just size the dialog a little larger or see if we can autosize it?
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Feature: Auto Resize Map

Post by JamzTheMan »

aliasmask wrote:I thought I remember you having a video to demonstrate but I couldn't find, so I made my own video: https://www.youtube.com/watch?v=GCV7FmXlmYE
Just watched the video. Question, did you (or can you) turn the SnapToGrid back on? It "should" snap nicely after that, as that map is a good example of maps that have "half grid" cells as the border. You should be able to do all of it without turning the grid on and moving the image anywhere, skipping turning off the snapToGrid, etc. Just right-click, select some cells!

What I do behind the scenes is "assume" you clicked on a grid intersection. So from that I can extrapolate where the grids should line up in MT. So if there is, say, an extra 25 pixels, I set the AnchorX/Y coords to 25,25 (or -25,-25) and so it should snap nicely. It's basically the same as if you manually opened up the properties for a token/stamp and moved the image off center (in the lower left image box).
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Feature: Auto Resize Map

Post by aliasmask »

I could have gone with a smaller sampling to get my resizing done, but because the image was a circle the upper left corner was outside the map grid which is why I first lined up the map grid (top and left) to the campaign grid so I knew where to start my box.

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Feature: Auto Resize Map

Post by Darcphaze »

I was so glad when I read this article. Somehow I had managed to miss this feature. (DOH) But it came in the nick of time.

I too have a HUGE campaign cartographer city street map, but try as I might to export it, it just wouldn't load. So, I cut it into 99 pieces, most 47X30, some 28X30, so it was easy on the eyes in 5' grid. The Auto Resize made the process of putting them back together pretty easy. I was surprised because without it, I was doomed to do this by hand. I'm not photoshop/gimp saavy, and I have to say the video did help. I watched it at least 3 times intermittently, because of fine points. I did NOT snap the maps into place, as there was lots of half-grid cell overlap and 'not part of the map' involved. I'll try snapping once I got the whole thing together.
No matter what a GM plans for, the players are certain to find another way to do it

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Feature: Auto Resize Map

Post by JamzTheMan »

Glad it's helping. I use to have to use PhotoShop as well and my other GM friends were terrible at it so I figured it was a solution meant for MapTool...

PS I attached my original video to the OP, but it was POC at the time so Alias's video is more up to date. But if you want want to see more examples, its' still up on youtube. Note, I show moving the maps manually to align with the grid if they had that half grid cell on the edge of the map. If you SnapToGrid though, I internally adjust the "Anchor Points" for you, ie, the Image footprint is offset. Since you are selecting a grid, your mouse tells me where the grid line starts so I know to adjust the map with <insert math!>
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Feature: Auto Resize Map

Post by Darcphaze »

Yes, I did use Aliasmask's video. Thanks a bunch guys. This program just gets better all the time.

BTW, I'm a big fan of the older, larger dungeons, like Undermountain. I do have Undermountain in Maptools. It's not square on, never could be, but when my players ran through it, they didn't mind at all :D
No matter what a GM plans for, the players are certain to find another way to do it

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: Feature: Auto Resize Map

Post by JamzTheMan »

Did you redraw the undermountain or just import the map? I wouldn't mind taking a peek at that if you don't mind, I was a huge Forgotten Realms fan back in 2nd edition AD&D...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Darcphaze
Cave Troll
Posts: 91
Joined: Sun Aug 10, 2008 9:29 pm
Contact:

Re: Feature: Auto Resize Map

Post by Darcphaze »

JamzTheMan wrote:Did you redraw the undermountain or just import the map? I wouldn't mind taking a peek at that if you don't mind, I was a huge Forgotten Realms fan back in 2nd edition AD&D...
I imported it. It was way too large to redraw. Just saw this this morning, so let me find the campaign file. Been a while since I used it. I'll edit this post when I find it.

I found Level 1. I don't find the others, but I think I did something else with them, integrated into some lost dungeon somewhere. I put it in my online RP Maptools folder: http://www.darcphaze.com/RPMaptools/Undermountain.cmpgn

I left the file right where we ended it, so you may have GM lines all over it, which denoted various areas being patrolled by certain critters and various pathways used and not used. Not even sure what other gems you may find in this file, but you're welcome to them.

I went through the rest of the campaigns in that 2013 series, but I must not have been able to find the boxed maps, because I'm not finding the other levels.
No matter what a GM plans for, the players are certain to find another way to do it

dorpond
RPTools Team
Posts: 5534
Joined: Thu Jun 01, 2006 2:05 pm
Location: Buffalo, NY

Re: Feature: Auto Resize Map

Post by dorpond »

FYI: I tested out this cool feature in 1.4.0.2 for the first time. Cool stuff!

I did stumble across a bug though that seems to happen when I right click -> Auto Resize -> And then hold the right mouse down on the map and drag, instead of the left button.

java.lang.NullPointerException
at net.rptools.maptool.client.tool.StampTool.mouseDragged(StampTool.java:547)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:36)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
How to use my bundled artwork (MT1.3B60+): http://forums.rptools.net/viewtopic.php?f=8&t=11759

Post Reply

Return to “MapTool 1.4”