[1.3b89] VBL poly line tool

Confirmed bugs should get a single post here. Check the READ ME FIRST sticky thread for the format.

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice, MapTool BugReport Manager

Forum rules
Posts that do not conform to the READ ME FIRST sticky thread are subject to deletion.
Post Reply
User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

[1.3b89] VBL poly line tool

Post by aliasmask »

I almost never had problems with VBL, but I know my GM does. I attribute the difference in the VBL drawing style. But I was noticing difference in what is considered VBL based on the tool used. First here is the menu:
VBL Menu.jpg
VBL Menu.jpg (9.54 KiB) Viewed 1357 times
From left to right you have the rectangle, hollow rectangle, oval, hollow oval, closed polygon and polygon line (or line tool).

If I use the line tool from holding the ctrl key to snap to grid from left to right, it draws the line just fine. If I do the same thing and draw right to left the VBL is at an angle going from bottom right to top left of VBL line.

This also happens if I draw a 2x2 C snapping to grid like this:
VBL example.jpg
VBL example.jpg (16.84 KiB) Viewed 1357 times
When it should be like this:
VBL correct.jpg
VBL correct.jpg (18.48 KiB) Viewed 1357 times
Note: I beveled the corners, but they should probably be square.

I believe this is why gaps sometimes show up in the VBL although it is difficult to reproduce. But, one result of the bad VBL is that because token select borders extend 1 pixel beyond the grid line that enemies can be seen behind the VBL.

I seem to recall somewhere that this may have been mentioned, but in a different context, but it's difficult to search for "VBL" in the forums.

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

Re: Bug b89 - VBL poly line tool

Post by JamzTheMan »

Ya, I found all that when developing the macro's. It's a PITA. Basically a "line" is used to draw the lines and then a "basic stoke" is used to "thicken" the line but that is for "visual" purposes only and is not used for actual VBL. At one point I did also change the "ends" from rounded to square ends to what you draw is more aligned to what you get but I'm not sure that made it into the official build or not.

I believe we did change the pixel width down 1 point to make lines a but more precise. But to be honest, it's not new in b89, it has always drawn that way AFAIK, at least in the b80's.
-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: Bug b89 - VBL poly line tool

Post by Lee »

There must be something going on during the extensions. The polyline VBL tool extends on the same line tool, so the result should(?) be the same.

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

Re: Bug b89 - VBL poly line tool

Post by JamzTheMan »

Lee wrote:There must be something going on during the extensions. The polyline VBL tool extends on the same line tool, so the result should(?) be the same.
Correct, But polyline is always a "closed" polygon, the Line tool "externally" draws an open polygon (a line), but internally it closes it turning the line into a polygon, so you have that line going back to the last point creating that triangle "point".

Changing it to a "Path" may fix the issue, it's been a while since I looked at that code.

PS Sorry if that's clear as mud... :)
-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: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Bug b89 - VBL poly line tool

Post by aliasmask »

If I use the line tool from holding the ctrl key to snap to grid from left to right, it draws the line just fine. If I do the same thing and draw right to left the VBL is at an angle going from bottom right to top left of VBL line.
This is fairly confusing to me since the code can obviously do things right when going in the positive direction (left to right), but glitches when going in negative direction (right to left). I haven't tested all possible combinations of the drawing tools and shapes, but this one is the easiest to demonstrate what is wrong.

edit: Actually, I take that back. Going from left to right thickens the top, but below it still slants creating a wedge shape similar to the pic above. While going from right to left doesn't thicken at all and is slanted.

I would like to note that if I were to close off the C with another line, every thing merges and does the VBL properly, but only if I stop the point to close it off. If I continue to draw, it does not fix it.

How this VBL affects my life is when I drew a spriral (square) staircase, someone on the interior could see places they shouldn't because of that one pixel adjustment. Also, I have code that will stop movement if cutting a corner, but if that pixel is missing, they can cut that corner.

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

Re: Bug b89 - VBL poly line tool

Post by Lee »

@Jamz Ooooo. It might come down to a problem with precision, I'm not sure if it's easily solvable in Java2D.

@A.M. Hmm. That's interesting. Perhaps if we throw in something in the algorithm to "snip" at line intersections, consolidate the resulting shape, and treat the still active drawing action as a new topology object? Honestly, I haven't ran much VBL since shifting from writing macros to the actual source code, so I wouldn't know how that will perform practically.

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

Re: Bug b89 - VBL poly line tool

Post by JamzTheMan »

Next time I'm in the code this week, I will take a look at it.

@Lee, i don't think it is a problem with precision, but yea, it may not be practical to solve using Java 2d also like you said, at least how we use it for VBL. I have an idea to try though, I will see...
-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 “Bug Reports”