RPTools.net

Discussion and Support

Skip to content

It is currently Fri Dec 15, 2017 8:42 pm 




Forum rules


Posting now open to all registered forum users.



Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Feature: Auto Resize Map
PostPosted: Sat Mar 21, 2015 1:32 am 
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.

Attachment:
auto-resize.PNG
auto-resize.PNG [ 17.77 KiB | Viewed 1707 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... :(

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


Last edited by JamzTheMan on Thu Apr 28, 2016 2:07 am, edited 2 times in total.

Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sat Mar 21, 2015 5:21 am 
woot!

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3484
Location: Austin, Tx
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sat Mar 21, 2015 1:57 pm 
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sat Mar 21, 2015 6:41 pm 
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Fri Feb 19, 2016 4:54 pm 
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

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3782
Location: MD
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sat Feb 20, 2016 1:45 am 
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?


image auto resize dialog issue.jpg
image auto resize dialog issue.jpg [ 37.14 KiB | Viewed 1451 times ]

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sun Feb 21, 2016 6:43 pm 
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Sun Feb 21, 2016 6:53 pm 
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


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7967
Location: Bay Area
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Mon Feb 22, 2016 12:49 am 
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.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Sun Aug 10, 2008 8:29 pm
Posts: 91
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Wed Apr 27, 2016 7:23 pm 
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Thu Apr 28, 2016 2:13 am 
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


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Sun Aug 10, 2008 8:29 pm
Posts: 91
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Thu Apr 28, 2016 7:03 am 
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


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Thu Apr 28, 2016 3:44 pm 
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


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Sun Aug 10, 2008 8:29 pm
Posts: 91
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Tue May 03, 2016 7:48 am 
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


Top
 Profile  
 
User avatar  Offline
RPTools Team
 
Joined: Thu Jun 01, 2006 1:05 pm
Posts: 5538
Location: Buffalo, NY
 Post subject: Re: Feature: Auto Resize Map
PostPosted: Wed May 04, 2016 11:03 am 
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman