Announcement: MapTool 1.5.2 Released

New build announcements plus site news and changes.

Moderators: dorpond, trevor, Azhrei, Craig

Post Reply
User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Announcement: MapTool 1.5.2 Released

Post by RPTroll »

We have released MapTool 1.5.2. You can find more information on the rptools.com.

Updates include
  • new die rolling options
  • improved macro logging
  • the ability to get and set terrain modifiers via macro
  • improvements to the macro editor
  • new line and radius template options
  • new functions to determine if a token moves over a drawing and the ability to get drawing information via macro
  • added support for multiple personal lights and setting color for personal lights
See the ChangeLog for a full list of changes.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Announcement: MapTool 1.5.2 Released

Post by Full Bleed »

So happy to see some real activity around MT builds of late. Thanks to all involved. :)

But, I do have a question about some performance issues I'm having in 1.5+.

In particular, I have a fairly complicated movement system where players click on a directional pad to move their tokens one step at a time and one of the things it does is check the square a token is moving into to see if there is a NPC or PC there...

It does this using the Wiki: getTokens() using an area offset json object and conditions json object. In 1.4.0.5 each step took about half a second. In 1.5+ it take 2-3 seconds a step. It's painful.

Was there some change in 1.5 that would create that kind of slow down when using getTokens()?
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Announcement: MapTool 1.5.2 Released

Post by Azhrei »

Full Bleed wrote:
Tue May 14, 2019 11:01 am
It does this using the Wiki: getTokens() using an area offset json object and conditions json object. In 1.4.0.5 each step took about half a second. In 1.5+ it take 2-3 seconds a step. It's painful.

Was there some change in 1.5 that would create that kind of slow down when using getTokens()?
Hm, not that comes to mind.

Have you turned on macro logging for both v1405 and v152 to see what the difference is? Since the logs include a timestamp for each line, it should give you an idea of where the difference is. If you can post the relevant sections of the logs, we could narrow down the problem. (Note that logging in 152+ is turned on via macro calls [yes, we get the irony]. Check the wiki for details.)

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Announcement: MapTool 1.5.2 Released

Post by Full Bleed »

Azhrei wrote:
Tue May 14, 2019 11:05 am
Hm, not that comes to mind.

Have you turned on macro logging for both v1405 and v152 to see what the difference is? Since the logs include a timestamp for each line, it should give you an idea of where the difference is. If you can post the relevant sections of the logs, we could narrow down the problem. (Note that logging in 152+ is turned on via macro calls [yes, we get the irony]. Check the wiki for details.)
I've used the Log Console to see how long things take and I'm not seeing the issue.

Using pause() to bracket this single line, I can tell it is what's taking so long:

Code: Select all

[h: inPathNPC = getTokens("json", npcCond)]
Before it are the jsons setting area and conditions:

Code: Select all

[h: area = json.set("{}", "token", tokID, "offsets", areaOffsets)]

[h: npcCond = json.set("{}", "area", area, "npc", 1, "unsetStates", json.append("[]","Dazzled", "Dead", "Helpless", "Sleeping", "Stunned", "DifficultTerrain"))]
Basically, if the NPC in a space a token is trying to step has any of those states a PC can move through them... if it is a token tagged "DifficultTerrain" it does something else. But reducing the number of states doesn't change anything. The getTokens line is where the performance crashes and it's not related to the states.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Announcement: MapTool 1.5.2 Released

Post by Azhrei »

I don't see that there's anything we can do without a sample campaign file or those timestamped logs, at a minimum. I've looked at the history of that source file and nothing jumps out at me as being a slowdown.

Ideally, an issue would be filed on GitHub so that I'm not the only one to review the report... :)

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Announcement: MapTool 1.5.2 Released

Post by Phergus »

At the very least, we need a map with tokens and a bare bones macro that demonstrates the issue. Preferably exported from 1.4.0.5 that can then be tested against that, 1.4.1.8, NERPS 1.4.5.4 and 1.5.0.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Announcement: MapTool 1.5.2 Released

Post by Full Bleed »

Phergus wrote:
Tue May 14, 2019 5:13 pm
At the very least, we need a map with tokens and a bare bones macro that demonstrates the issue. Preferably exported from 1.4.0.5 that can then be tested against that, 1.4.1.8, NERPS 1.4.5.4 and 1.5.0.
Yeah, there is something weird going on... I've stripped out a bunch of stuff and the performance increases... but it doesn't make a lot of sense that it should because, as I mentioned above, I put a pause() before that single getTokens function and one after... and in doing so I can clearly tell that's were the delay is. Same campaign file directly from 1.4.0.5 to 1.5.2. In 1.4 it goes from pause to pause much more quickly than in 1.5.2. But if I strip the code out to a bare bones macro on a new map it doesn't do it.

Here is some logging showing the pauses around the getTokens call:

Code: Select all

06:39:51.106 INFO  net.rptools.maptool.client.MapToolLineParser - up::Lib:MovePad::
06:39:51.108 INFO  net.rptools.maptool.client.MapToolLineParser - stepDirection::Lib:MovePad::
06:39:51.113 INFO  net.rptools.maptool.client.MapToolLineParser - changeFacing::Lib:MovePad::
06:39:51.158 INFO  net.rptools.maptool.client.MapToolLineParser - pause::Lib:Setup::
06:39:52.976 INFO  net.rptools.maptool.client.MapToolLineParser - pause::Lib:Setup::
06:39:53.134 INFO  net.rptools.maptool.client.MapToolLineParser - setSingleAttack::Lib:Combat::
I clicked through the pauses as fast as I could and you can see that the majority of the time is in the getTokens call (nearly 2 seconds.) The rest of the macro is pretty fast.

Here is the logging without the pauses:

Code: Select all

06:37:05.768 INFO  net.rptools.maptool.client.MapToolLineParser - up::Lib:MovePad::
06:37:05.770 INFO  net.rptools.maptool.client.MapToolLineParser - stepDirection::Lib:MovePad::
06:37:05.776 INFO  net.rptools.maptool.client.MapToolLineParser - changeFacing::Lib:MovePad::
06:37:07.318 INFO  net.rptools.maptool.client.MapToolLineParser - setSingleAttack::Lib:Combat::
Showing 1.5 seconds for that particular step.

Not sure how to get the same clean macro logging from 1.4.0.5 (way easier to look at the log console in 1.5)... but here is the same bit of code to see the time between the two pauses:

Code: Select all

2019-05-15 07:40:40,143 [client.MapToolLineParser:1265] DEBUG -  pause()
2019-05-15 07:40:40,144 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugVariableCount = argCount() 
2019-05-15 07:40:40,145 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugInputParameter = ".|<html>" +
    "<table cellspacing='2' cellpadding='0' style='background-color:#595751'>" +
    "<tr><td>" +
    "<table width='300px' cellspacing='0' cellpadding='2' style='background-color:#FAF9F5;'>" +
    "%{toolkit.DebugVariableRows}</table></td></tr></html>" +
    "|Debugger|LABEL|SPAN=TRUE"

2019-05-15 07:40:40,145 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugVariableRow = "<tr %{toolkit.DebugVariableRowStyle}><td>" +
    "<b>%{toolkit.DebugVariableName}</b></td><td>%{toolkit.DebugVariableContent}" +
    "</td></tr>"

2019-05-15 07:40:40,146 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugVariableRows = "<tr style='background-color:#E0DDD5; font-size:1.1em;'><td><b>Please Verify</b></td><td><b>Value</b></td></tr>" 
2019-05-15 07:40:40,147 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugVariableCount
2019-05-15 07:40:40,147 [client.MapToolLineParser:1265] DEBUG -   if(toolkit.DebugVariableCount == 0, 1, 0)
2019-05-15 07:40:40,148 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugVariableRows = "<tr><td style='font-size: 1.4em' align='center'><b>Pause</b></td></tr>" 
2019-05-15 07:40:40,149 [client.MapToolLineParser:1265] DEBUG -   toolkit.DebugBreak = input( strformat( toolkit.DebugInputParameter ) )
2019-05-15 07:40:40,364 [client.MapToolLineParser:1265] DEBUG -   abort( toolkit.DebugBreak ) 
2019-05-15 07:40:40,366 [client.MapToolLineParser:1265] DEBUG -  inPathNPC = getTokens("json", npcCond)
2019-05-15 07:40:40,389 [client.MapToolLineParser:1265] DEBUG -  pause()
Harder to read, but you can see it moves through that getTokens function really quickly in 1.4. And, in fact, the entire step takes < half a second (a multiple of at least 3 times.) That's a big difference when you're moving a token 6-12 steps a round.


And perhaps unrelated...

I also noticed that I was getting a lot of red question marks when my character sheets were loading (pulling graphics from tables) and loading into maps that should have been fully cached. It was doing it all session... I was constantly seeing flashes of the red question marks.

I do two things different than the base install of MT expects:

1) I change the default install to a folder called "MapTool" on my desktop.
2) I create a custom data directory in my root directory and I use a different one for each version of MT.

But when I went in to look at the MapTool.cfg file (Maptool\app\MapTool.cfg) in my base install the JVMUserOptions did not match what the C:\User\Username\AppData\Roaming\net.maptools.maptool.client\packager\jvmuserargs.cfg JVMUserOverrideOptions were set at.

My Thread Stack size was not the same and the data directory did not match. Once I set those to be the same, the re-caching returned to more of what I was used to seeing in 1.4.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Announcement: MapTool 1.5.2 Released

Post by Azhrei »

Full Bleed wrote:
Wed May 15, 2019 8:03 am
Phergus wrote:
Tue May 14, 2019 5:13 pm
At the very least, we need a map with tokens and a bare bones macro that demonstrates the issue. Preferably exported from 1.4.0.5 that can then be tested against that, 1.4.1.8, NERPS 1.4.5.4 and 1.5.0.
[...] Same campaign file directly from 1.4.0.5 to 1.5.2.
Perhaps you forgot to attach the campaign file? Right now we're in a holding pattern because without it, there's no way to trace the execution of MapTool while your macro is running to isolate the problem.

To be clear: please attach a campaign file that demonstrates the problem. Ideally, just a single map with a single macro.

:)

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Announcement: MapTool 1.5.2 Released

Post by Phergus »

Same campaign file directly from 1.4.0.5 to 1.5.2. In 1.4 it goes from pause to pause much more quickly than in 1.5.2. But if I strip the code out to a bare bones macro on a new map it doesn't do it.
I was afraid of that. So at the very least it is dependent upon something like the number of tokens on the map. Which make sense but why the performance got worse is unknown at this point.

Can you test it with 1.4.1.8 or Nerps 1.4.5.4 to help narrow down when the change happened?
I do two things different than the base install of MT expects:
1) I change the default install to a folder called "MapTool" on my desktop.
2) I create a custom data directory in my root directory and I use a different one for each version of MT.
I never use the default install directory but don't normally touch the data directory. What might be interesting is verifying on your end that the default data directory doesn't exist or show any recent activity.
But when I went in to look at the MapTool.cfg file (Maptool\app\MapTool.cfg) in my base install the JVMUserOptions did not match what the C:\User\Username\AppData\Roaming\net.maptools.maptool.client\packager\jvmuserargs.cfg JVMUserOverrideOptions were set at.
I expect that the first one is mostly just to establish defaults but will have to check on that. If MT is using both that probably isn't a good thing.
My Thread Stack size was not the same and the data directory did not match. Once I set those to be the same, the re-caching returned to more of what I was used to seeing in 1.4.
That's definitely something to look into.

On my system, changing the preferences in MapTool only affected the jvmuserargs.cfg file. I assume it was the same for yours?

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Announcement: MapTool 1.5.2 Released

Post by Full Bleed »

Azhrei wrote:
Wed May 15, 2019 11:17 am
Perhaps you forgot to attach the campaign file? Right now we're in a holding pattern because without it, there's no way to trace the execution of MapTool while your macro is running to isolate the problem.

To be clear: please attach a campaign file that demonstrates the problem. Ideally, just a single map with a single macro.

:)
I didn't forget... I just didn't want the framework to be a distraction and I'm headed out of town for a week and won't be able to provide any feedback on how to use it, what it's doing, and why it's doing it, etc. The ultimate point was that coming from 1.4 to 1.5 crushed the performance, I isolated that one function call, and I wasn't sure if there was some specific change made that could have caused it... unfortunately, I don't have the time for the ensuing mole hunt. :/

Thanks for the info... maybe I'll be able to provide more actionable info at a later date.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: Announcement: MapTool 1.5.2 Released

Post by Merudo »

Full Bleed wrote:
Wed May 15, 2019 7:40 pm
Azhrei wrote:
Wed May 15, 2019 11:17 am
Perhaps you forgot to attach the campaign file? Right now we're in a holding pattern because without it, there's no way to trace the execution of MapTool while your macro is running to isolate the problem.

To be clear: please attach a campaign file that demonstrates the problem. Ideally, just a single map with a single macro.

:)
I didn't forget... I just didn't want the framework to be a distraction and I'm headed out of town for a week and won't be able to provide any feedback on how to use it, what it's doing, and why it's doing it, etc. The ultimate point was that coming from 1.4 to 1.5 crushed the performance, I isolated that one function call, and I wasn't sure if there was some specific change made that could have caused it... unfortunately, I don't have the time for the ensuing mole hunt. :/

Thanks for the info... maybe I'll be able to provide more actionable info at a later date.
Have you solved the slowdown? If so, what was the problem?

I'm also experiencing some very slow behavior while using getTokens() on a large map with ~275 objects. In my case it seems the "range" condition slowed things down by a lot, the command took about 2 seconds to execute.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Announcement: MapTool 1.5.2 Released

Post by Full Bleed »

Merudo wrote:
Thu Jul 11, 2019 9:13 pm
Have you solved the slowdown? If so, what was the problem?
I haven't. All I know is that it didn't perform that way in 1.4.0.5.

I was hoping that Wolph would eventually do some testing with his BoT on 1.5.2 and find the issue. In particular, I suspect that his "Crowd" feature would be a good test.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “Announcements”