RPTools.net

Discussion and Support

Skip to content

It is currently Fri Dec 15, 2017 9:05 am 




Forum rules


PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)



Reply to topic  [ 14 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: [BUG] (un)Snap to grid and FoW
PostPosted: Mon Oct 29, 2012 8:48 am 
I've not been able to recreate this issue on another map so im still missing some point.
First download this:
Attachment:
test movement.cmpgn [488.2 KiB]
Downloaded 74 times


The issue is this:
- load the test map (b87)
- select both tokens (truck and hero)
- now move the hero (which is snapped to grid), the truck will move along as its also selected
- then move the truck (whicj is unsnapped to grid), the hero will also move along and will be placed within a grid cell so thats ok however I ALSO get the following
Quote:
java.lang.ClassCastException: net.rptools.maptool.model.ZonePoint cannot be cast to net.rptools.maptool.model.CellPoint
at net.rptools.maptool.client.ui.zone.FogUtil.exposeLastPath(FogUtil.java:250)
at net.rptools.maptool.client.tool.PointerTool.stopTokenDrag(PointerTool.java:267)
at net.rptools.maptool.client.tool.PointerTool.mouseReleased(PointerTool.java:541)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(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.dispatchEvent(Unknown Source)
at net.rptools.maptool.client.swing.MapToolEventQueue.dispatchEvent(MapToolEventQueue.java:38)
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)


If you turn the FoW off then the error does not occur.
If you snap the truck to grid, then the issue does not occur.
If you unsnap the hero to grid, then the issue does not occur.
If you recreate the entire map in a new campaign file... the issue does not occur (probly cause there's another factor I'm missing)

_________________
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  
 
 Offline
Cave Troll
 
Joined: Fri Aug 24, 2012 7:56 am
Posts: 84
Location: Germany
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Mon Oct 29, 2012 10:02 am 
Interesting, I could look into the issue tomorrow.


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1722
Location: Chicagoland
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Mon Oct 29, 2012 2:03 pm 
Was the campaign also initially creating in b87?

_________________
-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: [BUG] (un)Snap to grid and FoW
PostPosted: Mon Oct 29, 2012 2:28 pm 
FYI: I'm able to reproduce and isolate this to the Hero 2 token. I saved both tokens and imported just the tokens to a new campaign. If I add new tokens, they move with the truck, but basically any token that is not snapToGrid and moved while Hero 2 is selected it throws the error.

Copying the Hero 2 token does not rid the error (any copy of Hero 2 generates errror).

Not a solution but may help narrow the issue down. Might just be bad data stored in the token?

_________________
-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: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Mon Oct 29, 2012 4:32 pm 
not sure about the build of the campaign file as it from the BoT and I refresh that from time to time. The map was certainly created in b87.

_________________
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
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9427
Location: Netherlands
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 3:19 am 
JamzTheMan wrote:
FYI: I'm able to reproduce and isolate this to the Hero 2 token. I saved both tokens and imported just the tokens to a new campaign. If I add new tokens, they move with the truck, but basically any token that is not snapToGrid and moved while Hero 2 is selected it throws the error.

Copying the Hero 2 token does not rid the error (any copy of Hero 2 generates errror).

Not a solution but may help narrow the issue down. Might just be bad data stored in the token?


ok this is interesting: if I delete the Hero and drag a new hero from the library (you know the ones that come with MT per default): same error

_________________
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  
 
 Offline
Cave Troll
 
Joined: Fri Aug 24, 2012 7:56 am
Posts: 84
Location: Germany
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 6:16 am 
This is an actual bug.

It is caused by the following (you can test that on a fresh map):
- fog of war must be active
- auto exposure upon token movement must be active
- you have multiple tokens selected of which at least one has snap to grid active and one has snap to grid deactivated
- move the non-snap-to-grid token

When moved like that, the snap-to-grid token moves independently form the map grid. FogUtil.exposeLastPath() (the method that throws the exception here) does not check how the token is moved. Since it is a snap-to-grid token, it just assumes that it was moved to a CellPoint (which is a grid position) and not a ZonePoint (which is a pixel position on the map).

I'm not yet sure in which place to fix that. Since I cannot be sure that no other function assumes that a snap-to-grid token always returns CellPoints I currently favour a patch that fixes how the token is moved in a selection group.
I understand that there has been a movement related patch by Phergus, which has been deactivated? I suppose that viewtopic.php?f=60&t=19072 is the patch?


Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 6:51 am 
I was about to write a reply. It's in the part I worked on in fixing the bug aliasMask reported. So, I guess I'll check on it since I have an idea already on what's causing it, not to mention the classes affected are part of a patch of mine.

Actually, the one that triggers the exception is the snapped token. Since it's following an unsnapped key token, it's path is saved in Zone Points. An additional criteria for triggering this is that the token(s) at fault should be PCs, since an optimization was done to have only PC tokens reveal FoW. It's not really a bug per se, it's just that little or no support for unsnapped scenarios were written in the code; implying that everything really rides on a grid-ed foundation to function smoothly. It even says so in the fog class. I'm working on something that might touch on this. I'd rather not do the quick fix I have in mind.

In reality, mixing types can and will cause problems because the implementation can only mostly handle homogeneous groups.

_________________
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in


Last edited by Lee on Tue Oct 30, 2012 7:11 am, edited 1 time in total.

Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 7:06 am 
tiorthan wrote:
This is an actual bug.
..I currently favour a patch that fixes how the token is moved in a selection group.


When I worked on that bug I mentioned, that was my first assumption for a broad fix to a lot of problems. It's not that cut and dry, however, without rewriting a big chunk of the movement classes. Tokens in a selection group rely on the key token that's being dragged for their transit, and for what finally gets saved as their path information. Untangling that and taking it to an individualized level would mean we might as well rewrite the whole thing while we're at it; which I think shouldn't be done because apart from these exotic (my term) occurrences, it has served well being what it is.

tiorthan wrote:
I understand that there has been a movement related patch by Phergus, which has been deactivated? I suppose that viewtopic.php?f=60&t=19072 is the patch?


I think it's actually applied. It's what makes keyboard movement smooth, and I think was returned on b87. It seems to have broken whatever patch was in b86 for that nice behavior of picking a token up, and moving the mouse cursor just around the token area without it snapping on a bad offset. Either that or something else that affected the pointer tool.

_________________
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5412
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 2:42 pm 
Lee wrote:
...stuff..
Replied to Private Message, hopefully with something helpful.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Fri Aug 24, 2012 7:56 am
Posts: 84
Location: Germany
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 3:09 pm 
Lee wrote:
It's not that cut and dry, however, without rewriting a big chunk of the movement classes.

I was prepared to clean things up, but I gather that your patch is going to fix this as well?


Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 3:45 pm 
Hopefully, it will. Currently, there are 2 viable options that I'm experimenting with. In the event I upload the patch and it's found wanting, I won't mind if you supplant it with your idea of a fix.

_________________
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in


Top
 Profile  
 
 Offline
Cave Troll
 
Joined: Fri Aug 24, 2012 7:56 am
Posts: 84
Location: Germany
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Tue Oct 30, 2012 4:16 pm 
Well, I'll wait how your idea turns out then.


Top
 Profile  
 
 Offline
Dragon
 
Joined: Wed Oct 19, 2011 1:07 am
Posts: 958
 Post subject: Re: [BUG] (un)Snap to grid and FoW
PostPosted: Sun Dec 02, 2012 1:23 pm 
patch uploaded to the Testing section.

@tiorthan the complete fix was extensive and too invasive to upload all in one go. It's been decided to do simpler fixes in favor of an earlier release.

_________________
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 14 posts ] 

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 are 3 users online :: 1 registered, 0 hidden and 2 guests (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: Bing [Bot] and 2 guests





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman