[patch - MapTool] FoW mods + path computation fix

Notes on testing the latest builds of MapTool

Moderators: dorpond, trevor, Azhrei

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [patch - MapTool] FoW mods + path computation fix

Post by Lee »

That does sound sensible indeed. I'll look into it in the future. Good luck with the DIY :)

@Jamz et. al. I hope the patch checks out fine. Do let me know how the testing goes. Thanks.

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

Re: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

OK, patch applied and everything is looking pretty good! (I was able to revert/back out the old code using last patch and apply this one without issue.)

Even without the new ExposeOnlyAtWaypoints toggle, it seems faster. I loaded up an older campaign that has a cavern that's a couple thousand feet large and remember moving 1000 feet (200 cells) and it would take a could 30+ seconds. It's now going in a couple seconds and almost instant with way point toggle!

Also tested in our dungeon builder with lots of VBL. I was able to run through VBL, stop in VBL, etc, no issues. And +1 for Unsnapped to grid expose FoW, same tests as above, no issues.

I've packaged this in my build (1.3b89h) for those who wish to test it. I highly recommend it! I'll also put it through additional testing this Sunday during our weekly game. (I live on the edge! besides, technical issues during games just gives everyone a break to get a beer lol)
-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
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch - MapTool] FoW mods + path computation fix

Post by Azhrei »

JamzTheMan wrote:I'll also put it through additional testing this Sunday during our weekly game.
Okay, sounds good. I had been holding off due to the lockup but since that's (apparently) been solved we just need the latest code to be tested and I'll include it.

I was targeting last Sunday for b90 and it didn't happen (long story, to be included in the eventual announcement thread). I now have Lee's launcher code and I'm adding some translation support and a few other things, then I'll do b90. I'll wait until Monday so you can provide feedback on your experiences with this patch.

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

Re: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

Cool. And ya, if anyone can break it, it'll be my players. 90% of the issues I find are on Sunday and it's always a "darn, been using it all week and it never did that!" as Morphy's law dictates. We usually end around midnight CDT, I'll try and post results then.
-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
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: [patch - MapTool] FoW mods + path computation fix

Post by Azhrei »

Great. I've been doing some miscellaneous cleanup on the launcher and decided to change how the XML log files are handled, so I'll put out a new launcher JAR for testing tomorrow, then it can go into the build on Monday. Woohoo! ;)

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

Re: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

OK, so for the most part things worked great, not lock ups, etc. But...about 3-4 times over the night we had a weird issue where after moving a Token, it snapped back to where it was a turn ago.

So, move token from location A to B. Move token from B to C. Token snaps back to location A.

I couldn't figure out any criteria. If we went back and moved everything exactly the same way it wouldn't duplicate. It's the first time I've seen this issue so I'm "assuming" it's due to the path computation fix?

Windows 8x64 using Java 1.7_14 as server
Windows 8x64 using Java 1.7_14 as client

Happened during PC movements on client.
-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

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [patch - MapTool] FoW mods + path computation fix

Post by Lee »

I made a reply on wolph's bug thread here in Testing.

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

Re: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

Lee wrote:Edit #4: Taking the patch out as it didn't apply cleanly to b90 (i.e. missing code)
Lee, when you say missing code/doesn't apply cleanly, are you meaning this patch is missing code or when applying the patch it doesn't apply cleanly?

I just got a fresh checkout of pre-b90 and it seems to apply correctly. I can test this version to see if the token jump bug goes away? Well, I sort of HAVE to test it now as I can't load some campaigns without it (oops).
-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: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

FYI: Under this build I'm able to duplicate the issue. It happens if you select the token, move it, and put it back to the same cell (ie canceling your move), it snaps you back to your previous move.

eg Move token from 0,0 to 5,5. Move token from 5,5 to 15,10. Move token from 15,10 to 15,10, token goes to 5,5.


Edit: OK, so I found the issue and have a fix?

In ZoneRenderer.java, you check for token movement:
Spoiler

Code: Select all

/*
 * Lee: if the lead token is snapped-to-grid and has not moved, every
 * follower should return to where they were. Flag set at PointerTool
 * and StampTool's stopTokenDrag() Handling the rest here.
 */
Set<GUID> selectionSet = set.getTokens();

boolean stg = false;
if (set.getWalker() != null) {
	if (set.getWalker().getDistance() > 0)
		stg = true;
} else
	stg = true;

Which then skips through and calls:
Spoiler

Code: Select all

for (GUID tokenGUID : selectionSet)
	denyMovement(zone.getToken(tokenGUID));
Which relocates the token back to the last path:
Spoiler

Code: Select all

private void denyMovement(final Token token) {
		Path<?> path = token.getLastPath();
		if (path != null) {
			ZonePoint zp = null;
			if (path.getCellPath().get(0) instanceof CellPoint) {
				zp = zone.getGrid().convert((CellPoint) path.getCellPath().get(0));
			} else {
				zp = (ZonePoint) path.getCellPath().get(0);
			}
			// Relocate
			token.setX(zp.x);
			token.setY(zp.y);

			// Do it again to cancel out the last move position
			token.setX(zp.x);
			token.setY(zp.y);

			// No more last path
			token.setLastPath(null);
			MapTool.serverCommand().putToken(zone.getId(), token);

			// Cache clearing
			flush(token);
		}
	}
I'm not sure when this code can be invoked other than putting the token back in the same spot (ie there is no way to cancel moving a token once you start).

But in case of null, I just changed if (set.getWalker().getDistance() > 0) to if (set.getWalker().getDistance() >= 0) in case there was a use case where you need to deny movement and go back to last path? At least everything seems to be working fine now in this build & patch.
-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

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [patch - MapTool] FoW mods + path computation fix

Post by Lee »

@Jamz: Not cleanly meaning after doing the repo relocation process, it kind of "wrecked" the project where I write patches from. Nothing catastrophic but there was a lot of red on the tree before I shut it down :lol: I didn't have time to sort it all out, with RL and all getting in the way.

Yeah, as I suspected, there's something missing that I didn't port over, specifically a part where certain path information gets updated to the latest when a token touches down on the map. Since that critical update isn't there, the rest of the code snaps the token back to the previous path. Note this information is separate from the path info used by stuff that relies on last path information (e.g. getLastPath()?)

Hmm. It's great if that fix worked for you. My logic may be wrong, but the whole point of distance > 0 was to check if the token actually moved somewhere beyond its origin point. Doing ">= 0" defeats that, I believe, but hey, if it works, it works! :lol:

It won't be anytime soon, but I'll eventually get around to putting up a correct patch. Sorry, Jamz.

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

Re: [patch - MapTool] FoW mods + path computation fix

Post by JamzTheMan »

Thanks for the reply and no problem. The "fix" is sort of a quick work-around being that it basically allows a "0 ft" movement and last path is just that. In fact, It's the easiest way to clear the "last-path" which is nice because I use Wolf's BoT to show "the path", ie, it puts the blue/red footprints. When moving out of combat though, or a mistake is made, sometimes I need to clear that path anyway.

The logic though looks like it always goes back to last path on 0-ft move, so in one case it cancels the move but doesn't cancel the further logic and so it jumps the token back to the last location/path.

Just FYI in case you are working on it for your own use. Otherwise it's been working great! Thanks for the patch.
-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

Post Reply

Return to “Testing”