RPTools.net

Discussion and Support

Skip to content

It is currently Thu Oct 19, 2017 6:03 am 




Forum rules


Posting now open to all registered forum users.



Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7885
Location: Bay Area
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Wed Jul 26, 2017 11:00 am 
I use to get this on my TV/Monitor too because it wasn't at it's natural resolution. I had to adjust it to fit the screen properly using the NVidia resizing tool. I guess one thing to check is to make sure your monitor is at it's native size.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Wed Jul 26, 2017 1:32 pm 
aliasmask wrote:
I use to get this on my TV/Monitor too because it wasn't at it's natural resolution. I had to adjust it to fit the screen properly using the NVidia resizing tool. I guess one thing to check is to make sure your monitor is at it's native size.

I'm definitely running at native sizes on my monitors so it's not that.

JamzTheMan wrote:
Have you tried adjusting the theme at all? If you search the forums there are some premade larger font themes and instructions.

Tinylaf doesn't really give you anything to address this except maybe changing the font. I just tried using Arial over the Tahoma default and nothing changed.


But I bet if a dev looks at how the text is rendered in that token text-pop-up box and in the other text-tool like boxes there might be some options to address it... could start by seeing what it looks like with text anti-aliasing on or off for that rendering.

_________________
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
Dragon
 
Joined: Wed Aug 31, 2011 8:49 pm
Posts: 495
Location: Somewhere between Heaven and Hell
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Wed Jul 26, 2017 3:35 pm 
A lot of things discussed that I can't really wrap my head around entirely, so I'll address what I can:

Monitor is native, because it is literally that one thing that 'dithers' as I believe it was called; never on any other program or Windows itself. I've used the text tool and not noticed any similar effects, though that could just the fact that particular feature is used to track global abilities active, and goes away fairly often.

Invisible tokens, and npc tokens never get this - it is quite literally just 'PC' tokens without the greyed-out coloration to them. It starts very normal and I've noticed no change based on zoom, but I'll play around with that to confirm. [Confirmed - font is identical at 800% as 100% when Maptools first launches.] It just seems to decay after a certain amount of time of being active on Mapptools. I really don't know if that excludes anything being discussed here, but it never used to happen on b89 (the last version I used before upgrading to 1.4) and I played that for up to 12 hours a day back then.

_________________
"An arrogant person considers himself perfect. This is the chief harm of arrogance. It interferes with a person's main task in life - becoming a better person." - Leo Tolstoy

Image


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Wed Jul 26, 2017 9:56 pm 
Xaelvaen wrote:
I've used the text tool and not noticed any similar effects

No, you're right. It's not happening with the text tool. I had some single letters on a map and thought I could see some artifacting, but when tested with full strings it's not.

That means that there is probably an easy fix for this... they just need to render the token names the same way they render the text tool text.

Quote:
Invisible tokens, and npc tokens never get this - it is quite literally just 'PC' tokens

You're right again. Which, again, proves that it's probably just a simple rendering setting that will clear this up.

Quote:
It starts very normal and I've noticed no change based on zoom, but I'll play around with that to confirm. [Confirmed - font is identical at 800% as 100% when Maptools first launches.] It just seems to decay after a certain amount of time of being active on Mapptools.

This is where I will diverge from your observation. This has been around a long time... I just never thought it was important enough to mention... figuring it was just the way it was and something I only saw when hovering on a token. But this is present with PC labels on start up and exacerbated with zooming for me... there is not "decay". Pic included.

The first label is at 100%, the second around 206%, the 3rd at 395%.


File comment: PC Token Label Artifacting.
Text Dithering.jpg
Text Dithering.jpg [ 22.34 KiB | Viewed 256 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: 1680
Location: Chicagoland
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Thu Jul 27, 2017 9:28 am 
That's really a strange one indeed. Does it ever do it on "text drawings" (the text boxes labels you can add on the map via draw tools)? Just curious, I think they both draw pretty much the same way.

And there isn't anything really special being done here. Pretty standard Swing calls. The only difference between PC & NPC is the background color.

BTW, did you try the direct3d/openGL options via the launcher?

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Thu Jul 27, 2017 2:49 pm 
JamzTheMan wrote:
That's really a strange one indeed. Does it ever do it on "text drawings" (the text boxes labels you can add on the map via draw tools)? Just curious, I think they both draw pretty much the same way.

I thought so too, but as noted about the Text Tool above, it does *not* have the issue.

Have you checked the actual text rendering settings for the PC token box? I bet that something is different in there (or there is a typo).

Quote:
BTW, did you try the direct3d/openGL options via the launcher?

I'm using 1.4.0.2 so I don't have those options. But I seriously doubt it would matter for this.

_________________
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: 1680
Location: Chicagoland
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Fri Jul 28, 2017 2:13 pm 
Correct me if I'm wrong but it's only on PC vs NPC tokens, correct? There's really just the one difference and that is the background. Here's the code, you can check it for typos...

Code:
// Token names and labels
         boolean showCurrentTokenLabel = AppState.isShowTokenNames() || token == tokenUnderMouse;
         if (showCurrentTokenLabel) {
            GUID tokId = token.getId();
            int offset = 3; // Keep it from tramping on the token border.
            ImageLabel background;
            Color foreground;

            if (token.isVisible()) {
               if (token.getType() == Token.Type.NPC) {
                  background = GraphicsUtil.BLUE_LABEL;
                  foreground = Color.WHITE;
               } else {
                  background = GraphicsUtil.GREY_LABEL;
                  foreground = Color.BLACK;
               }
            } else {
               background = GraphicsUtil.DARK_GREY_LABEL;
               foreground = Color.WHITE;
            }
            String name = token.getName();
            if (isGMView && token.getGMName() != null && !StringUtil.isEmpty(token.getGMName())) {
               name += " (" + token.getGMName() + ")";
            }
            if (!view.equals(lastView) || !labelRenderingCache.containsKey(tokId)) {
               //            if ((lastView != null && !lastView.equals(view)) || !labelRenderingCache.containsKey(tokId)) {
               boolean hasLabel = false;

               // Calculate image dimensions
               FontMetrics fm = g.getFontMetrics();
               Font f = g.getFont();
               int strWidth = SwingUtilities.computeStringWidth(fm, name);

               int width = strWidth + GraphicsUtil.BOX_PADDINGX * 2;
               int height = fm.getHeight() + GraphicsUtil.BOX_PADDINGY * 2;
               int labelHeight = height;

               // If token has a label (in addition to name).
               if (token.getLabel() != null && token.getLabel().trim().length() > 0) {
                  hasLabel = true;
                  height = height * 2; // Double the image height for two boxed strings.
                  int labelWidth = SwingUtilities.computeStringWidth(fm, token.getLabel()) + GraphicsUtil.BOX_PADDINGX * 2;
                  width = (width > labelWidth) ? width : labelWidth;
               }

               // Set up the image
               BufferedImage labelRender = new BufferedImage(width, height, Transparency.TRANSLUCENT);
               Graphics2D gLabelRender = labelRender.createGraphics();
               gLabelRender.setFont(f); // Match font used in the main graphics context.
               gLabelRender.setRenderingHints(g.getRenderingHints()); // Match rendering style.

               // Draw name and label to image
               if (hasLabel) {
                  GraphicsUtil.drawBoxedString(gLabelRender, token.getLabel(), width / 2, height - (labelHeight / 2), SwingUtilities.CENTER, background, foreground);
               }
               GraphicsUtil.drawBoxedString(gLabelRender, name, width / 2, labelHeight / 2, SwingUtilities.CENTER, background, foreground);

               // Add image to cache
               labelRenderingCache.put(tokId, labelRender);
            }
            // Create LabelRenderer using cached label.
            Rectangle r = bounds.getBounds();
            delayRendering(new LabelRenderer(name, r.x + r.width / 2, r.y + r.height + offset, SwingUtilities.CENTER, background, foreground, tokId));
         }


Now, there IS a third render, and that's if token Is Visible. So, if you would like to test that for me, it will probably narrow it down to the image, which is where I suspect it lies. It looks like the background uses a PNG and not a "Color" so you have Swing rendering text and this image into a new image and maybe that grayLabelbox just doesn't play well with the render engine?

If one was inclined, they could extract/edit the MapTool jar file (just a zip file really) and edit/replace the grayLabelBox.png below and it should pick up your changes. (vs building the whole project in eclipse). It's a little hard for me to test these myself as I don't see the ARtifacting on my system.

public static final ImageLabel GREY_LABEL = new ImageLabel("net/rptools/maptool/client/image/grayLabelbox.png", 4, 4);
public static final ImageLabel BLUE_LABEL = new ImageLabel("net/rptools/maptool/client/image/blueLabelbox.png", 4, 4);
public static final ImageLabel DARK_GREY_LABEL = new ImageLabel("net/rptools/maptool/client/image/darkGreyLabelbox.png", 4, 4);

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Fri Jul 28, 2017 6:40 pm 
JamzTheMan wrote:
Correct me if I'm wrong but it's only on PC vs NPC tokens, correct?

Now, there IS a third render, and that's if token Is Visible. So, if you would like to test that for me, it will probably narrow it down to the image, which is where I suspect it lies. It looks like the background uses a PNG and not a "Color" so you have Swing rendering text and this image into a new image and maybe that grayLabelbox just doesn't play well with the render engine?

Good catch... you're right--if the token isn't visible it renders correctly (white on the dark grey label).

So I went ahead and tested by swapping the dark grey background with the black text and it renders fine.

I did notice a potential typo... the image is named "grayLabelbox.png" the code uses "GraphicsUtil.GREY_LABEL". I renamed the file to "greyLabelbox.png" and it threw an error on loading... I also kept the existing image and added a copy of it called "greyLabelbox.png" and it didn't fix the problem... but there may still be some other crossed wires elsewhere...

I also opened and re-saved the grayLabelbox.png in photoshop to make sure there wasn't something non-standard about it... didn't change anything.

_________________
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: 1680
Location: Chicagoland
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Fri Jul 28, 2017 11:27 pm 
Thanks for checking. And no typo there, well, bad naming but code wise its ok.

Try taking the current grey box you have and in photoshop try slightly adjusting the shade up/down and resaving. Could just be a color gradient not meshing well.

If you find a shade that works, post it and I can incorporate it. (heck, ANYone can submit it as a PR via gitgub really) but no problem, I can easily do it. Just an FYI that people can contribute without coding skills on graphics and language files and such...

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sat Jul 29, 2017 2:18 am 
JamzTheMan wrote:
Thanks for checking. And no typo there, well, bad naming but code wise its ok.

Try taking the current grey box you have and in photoshop try slightly adjusting the shade up/down and resaving. Could just be a color gradient not meshing well.

Is the same graphic being used with the Text Tool?

_________________
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: 1680
Location: Chicagoland
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sun Jul 30, 2017 7:20 am 
It is actually. It's also using the same method to generate the output as well.

FYI: Initiative Panel also uses the same method to generate the output. Is the text corrupted there as well?

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sun Jul 30, 2017 9:03 am 
JamzTheMan wrote:
It is actually. It's also using the same method to generate the output as well.

FYI: Initiative Panel also uses the same method to generate the output. Is the text corrupted there as well?

No.

That means something *has* to be different with the PC token label... especially compared to the text tool label, which scales/dithers the same way and looks virtually identical otherwise (same label background and text color.)

_________________
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: 1680
Location: Chicagoland
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sun Jul 30, 2017 2:34 pm 
I posted the code and I'm not seeing anything different other than the background image. Only difference is the order in which things are rendered and you have the tokens rendering over the map zone (between Init panel and tokens).

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Wed Aug 31, 2011 8:49 pm
Posts: 495
Location: Somewhere between Heaven and Hell
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sun Jul 30, 2017 4:23 pm 
When it comes to coding, maptools macros are about all I even dabble in, so I'm afraid this conversation has completely lost me - but thank you guys sincerely for looking into this issue. It's obviously not a game-breaker at all, but sometimes the names do actually become hard to read. Luckily, the tokens identify easily enough so it doesn't really matter. So if there does become a fix at some point, a guideline of how I could mimic that fix would be greatly appreciated.

_________________
"An arrogant person considers himself perfect. This is the chief harm of arrogance. It interferes with a person's main task in life - becoming a better person." - Leo Tolstoy

Image


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3728
Location: MD
 Post subject: Re: Strange Maptools Behavior (Described inside)
PostPosted: Sun Jul 30, 2017 10:01 pm 
JamzTheMan wrote:
I posted the code and I'm not seeing anything different other than the background image. Only difference is the order in which things are rendered and you have the tokens rendering over the map zone (between Init panel and tokens).

Must be something up with the png...

I made a similar image that fixes the problem. Maybe you can swap it into the next build. I didn't rename it so it would be an easy swap.


grayLabelbox.png
grayLabelbox.png [ 3.5 KiB | Viewed 173 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  
 
Display posts from previous:  Sort by  
Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  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