Questions on VBL Slowdown

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

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. :)
User avatar
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Questions on VBL Slowdown

Post by J.P. »

I imported a cavern map into Maptool and carefuly traced the VBL around the rocky curves of the natural paths. This created an overwhemlming amount of start and stop points for the VBL and my computer slowed down to a crawl with lengthy wait times in between each token movement. I knew it wouldn't work so I went back, deleted all of the VBL and started filling in the areas with solid shapes. It seems to work much better for me but now I am wondering how the VBL works. Is each start and stop point calculated and redrawn as the tokens move across the map? And if so, does it count the points of overlapping shapes or do they merge to reduce the amount of processing? Do hollow shapes require more processing power because they are being calculated and redrawn on both sides of the lines?

I'm really just trying to get a better idea of how this works so I don't run into any serious lag when running a server so tips and advice are always welcomed.
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by JamzTheMan »

Question, how many tokens did you have on the map?
How many have darkvision?
How many light sources do you have?

If you only have ONE token and you set it to day light, how does it perform? In my experience, complicated VBL alone isn't usually a problem. But adding lights add an exponential cost on resources. I've done some crazy cavern type vbl with only the PC's having a few lights (usually darkvision) and got away with it.

To answer your question, all VBL is 'added' together into a java object called Area. Basically a big complicated polygon. Light sources are added together into an area as well (so bunch of circles added to form another polygon). All token sights are are added together as well. These "Areas" are then 'intersected' to form a final polygon/Area for display.

The "intersection" is done by core java (math behind the scenes) but as you can imagine, yes, the more 'points' a polygon has, the more complicated the computation is.

If you have that original map, I'd love to have a copy of it. I will throw it in my bin of maps I use for bench testing new vbl/light changes. :)
-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
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Questions on VBL Slowdown

Post by Full Bleed »

J.P. wrote:I imported a cavern map into Maptool and carefuly traced the VBL around the rocky curves of the natural paths. This created an overwhemlming amount of start and stop points for the VBL and my computer slowed down to a crawl with lengthy wait times in between each token movement. I knew it wouldn't work so I went back, deleted all of the VBL and started filling in the areas with solid shapes. It seems to work much better for me but now I am wondering how the VBL works. Is each start and stop point calculated and redrawn as the tokens move across the map? And if so, does it count the points of overlapping shapes or do they merge to reduce the amount of processing? Do hollow shapes require more processing power because they are being calculated and redrawn on both sides of the lines?

I'm really just trying to get a better idea of how this works so I don't run into any serious lag when running a server so tips and advice are always welcomed.
As Jamz noted, it's the interaction of a lot things that can cause poor performance.

I've actually never had a problem with VBL. I suspect it's because I follow a standard of best practices and don't use a lot of non-token light sources:

1) Lower the vision distance of your map from the default 1000 to something more realistic... like 120.
2) Frame every map with a hollow rectangle so that vision is never calculated outside the map.
3) Use solid blocks when possible.
4) When using the polyline tool make sure the ends are "flush" with other lines or merged with other solid shapes. You don't want any "cracks" in the VBL. If I have an "ugly" connection of two poly lines I will often drop a square over the joint to smooth out the side that vision will be calculated against. Try to reduce the number of surfaces that you need (so use as few polylines as possible and use longer lines instead of lots of little lines.)
5) Think of all the VBL as one SHAPE. And think of the visible areas being calculated against that SHAPE as a second SHAPE. The less complicated those shapes are the easier it will be to calculate.
6) If you can build VBL using the CTRL key to snap the lines and shapes--do it. Rough out the map this way and you'll have very uncomplicated VBL. Go ahead and add detail work if the map demands it afterwards.

Complicated VBL will usually take 10 times longer to create and require 10 times the processing power to use. And, frankly, it's really not necessary the vast majority of the time.

If you want to share your campaign map I'd be happy to show you how I'd VBL it.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Re: Questions on VBL Slowdown

Post by J.P. »

Sorry Jamz, I no longer have a copy of the map with the VBL I originally put on it. To answer some of the questions, I had 1 token on the map with a 20 ft. light circular light sources. No darkvision and I wasn't connected to any other computers as I was still in the design phase of my next adventure.

I would link a copy of the map directly to this page using my Photobucket account that I have had for years but it appears that Photobucket is now charging a subscription fee to share images on 3rd party sites. I will be looking for another image hosting site but in the meantime, here is a link to the image online: https://www.bing.com/images/search?view ... ajaxhist=0

I have made the suggested adjustments to my current campaign and will try to remember to do that for future projects. Thanks for that. :)
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by Full Bleed »

Here is a pretty quick vbl application.

It should give you some ideas.

If you don't think the sight lines are restricted enough you can always extend closer to the wall edges or add more polylines, but I don't usually go overboard unless it's really going to matter for the encounters.
Attachments
VBL test.cmpgn
(917.95 KiB) Downloaded 44 times
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Re: Questions on VBL Slowdown

Post by J.P. »

Full Bleed wrote:Here is a pretty quick vbl application.

It should give you some ideas.

If you don't think the sight lines are restricted enough you can always extend closer to the wall edges or add more polylines, but I don't usually go overboard unless it's really going to matter for the encounters.
Thanks for doing that. I pretty much did the same kind of blocking on my map and that works but your VBL is more accurate than mine with a number of the polygons closer to the edges of the rocks.

Encouunters this time around really don't matter much. There are a couple of zombies hiding in the corners, maybe 20 of them across the entire map but nothign major. They are there mostly to give my new players a chance to get used to how combat works before they move onto bigger things.
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by JamzTheMan »

Thanks. I took that map, ran it through photoshop to create a mask, imported that mask and original map into MapTool, used 'generate vbl' on the mask to get detailed vbl to see what the worst case scenario. With same setup, I was getting 1-2 second lag (which isn't completely terrible given the level of detailed vbl)

But ya, you want something between this and Full Bleed's VBL (closer to FB's of course).

I'll keep this in the bank to test future enhancements...
insane level vbl
insane-vbl.jpg
insane-vbl.jpg (103.67 KiB) Viewed 1526 times
-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
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Questions on VBL Slowdown

Post by Full Bleed »

J.P. wrote:Thanks for doing that. I pretty much did the same kind of blocking on my map and that works but your VBL is more accurate than mine with a number of the polygons closer to the edges of the rocks.
I mainly just wanted to show some options for closing off sight lines with the polyline tool that wouldn't get too out of hand and keep the performance up. Block in the blocks that are 100% out of sight using rectangular VBL and the CTRL button. Then go back in and add some smaller blocks and some strategic polylines and you can make a very usable dungeon quickly.
Encouunters this time around really don't matter much. There are a couple of zombies hiding in the corners, maybe 20 of them across the entire map but nothign major. They are there mostly to give my new players a chance to get used to how combat works before they move onto bigger things.
Understood. And I wasn't sure what the scale was... but I messed around with the map a little more, and I think it works much better with each visible square being 10 ft. Will give the place more scope, provide more places to hide, and slow the exploration considerably. It'll be a creepier dungeon crawl.

Here is a scaled version of the map for 10' visible squares in case you want to use it. You would set the map to 5' per square and 20 pixels per square and it will import perfectly. Kinda low rez but that image wasn't very large and it's workable for a simple oldskool map like this: https://www.dropbox.com/s/g9n3csdnwk9ou ... i.jpg?dl=0
Last edited by Full Bleed on Thu Sep 21, 2017 2:17 am, edited 1 time in total.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: Questions on VBL Slowdown

Post by Full Bleed »

JamzTheMan wrote:Thanks. I took that map, ran it through photoshop to create a mask, imported that mask and original map into MapTool, used 'generate vbl' on the mask to get detailed vbl to see what the worst case scenario. With same setup, I was getting 1-2 second lag (which isn't completely terrible given the level of detailed vbl)
That's pretty cool. What about using some kind of "simplify" shape routine on complex VBL like that? Kind of like what's done with the circle shape.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Re: Questions on VBL Slowdown

Post by J.P. »

JamzTheMan wrote:Thanks. I took that map, ran it through photoshop to create a mask, imported that mask and original map into MapTool, used 'generate vbl' on the mask to get detailed vbl to see what the worst case scenario. With same setup, I was getting 1-2 second lag (which isn't completely terrible given the level of detailed vbl)

But ya, you want something between this and Full Bleed's VBL (closer to FB's of course).

I'll keep this in the bank to test future enhancements...
insane level vbl
insane-vbl.jpg
That is very nice. I don't use Photoshop but I have InkScape, Gimp and Paint.net on my computer. I keep all three around because I find that each one has its strengths and weaknesses. It has been years since I tried using MapTool because our group stopped playing but now we are getting back into it and I'm having to knock the rust and dust off of everything. One adventure where we played before was set on an island and I had populated most of the isltand with overlapping tree tokens (objects) there must have been over 100 of them with the quick C&P. Our group connecte wirelessly over my lousy 3 Mbps Windstream internet service using our dual core, 2GB Ram, integrated graphic card laptops and there was a tiny bit of lag, maybe the 1 - 2 seconds you mentioned with the "insane" detail on the cavern map.

When I first drew the VBL for the cavern map, I started the line and double clicked as I went around the map. It took me a while - I don't know the exact time but as I was zoommed in, I got to the point of "How much longer is this thing?!" When I finished, it looked like all of the lines were connected but there was obviously something wrong somewhere because my 3.9Ghz, 6-core, 16GB Ram, Nividia 750 graphics card computer was taking 5+ seconds to recaulate each movement of the one token with the 20 ft. light source. And that was before I added any other tokens to the map. :shock: I am chalking this one up to user error.
Full Bleed wrote: Understood. And I wasn't sure what the scale was... but I messed around with the map a little more, and I think it works much better with each visible square being 10 ft. Will give the place more scope, provide more places to hide, and slow the exploration considerably. It'll be a creepier dungeon crawl.

Here is a scaled version of the map for 10' visible squares in case you want to use it. You would set the map to 5' per square and 20 pixels per square and it will import perfectly. Kinda low rez but that image wasn't very large and it's workable for a simple oldskool map like this: https://www.dropbox.com/s/g9n3csdnwk9ou ... i.jpg?dl=0
Yeah, I went with the 10' scale. I looked at 5' but didn't like how many "single file" sections that created and the rooms were just way too small. It's funny you mentioned an old school dungeon crawl because that is what I was going for. Three of my players are old school and they like the exploration aspect of RPGs. 2 of my players are brand new having never played any RPGs before but they made it clear at the last session that they needed some maps to help picture the setting. All six of us are learning the ropes of Savage Worlds so between that, relearning MapTool, working on my adventure ideas and dealing with real world headaches - I've had a pretty full plate but it is all coming together now and I think I am on track for this Sunday's session.
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by JamzTheMan »

Full Bleed wrote:
JamzTheMan wrote:Thanks. I took that map, ran it through photoshop to create a mask, imported that mask and original map into MapTool, used 'generate vbl' on the mask to get detailed vbl to see what the worst case scenario. With same setup, I was getting 1-2 second lag (which isn't completely terrible given the level of detailed vbl)
That's pretty cool. What about using some kind of "simplify" shape routine on complex VBL like that? Kind of like what's done with the circle shape.
Ya, I was looking at some other algorithms that turned the shape into a "polygon" of varying degrees of complexity...
-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
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Re: Questions on VBL Slowdown

Post by J.P. »

We had our gaming session last night and everything was going smoothly at first but then the group started having problems with this map.

The setup involved 2 laptops connected wirelessly over a LAN. I ran one as the server while the playes shared the second laptop on their end of the table. When I first switched over to the cavern map, everything was fine but after about an hour of moving through it, something went wrong on their end. I could move the tokens normally but they couldn't. When the token was selected to move, it would remain in the same place. Right clicking and dragging the map around on their laptop in a fast circular motion wasn't an issue at all. It moved easily so whatever the cause, it was linked directly to their token movement.

I thought it might have been because they had identical tokens left on previous maps and deleted them. Then I closed Maptool and restarted the server but the problem persisted. We finihsed the session with the players telling me where they wanted to move and I would move the tokens for them. As I done so, they could see the token movement on their screen with minimal delay.

The vision range was set to 120. The map was set to night and each member of the group had a light source that covered a 5 space radius. I did not have UPnP checked because I didn't know if I would need it or not and everything was working fine in the beginning.

Since you guys have a lot more experience with Maptool than I do, I'm hoping you can tell me what was going on and how I might prevent it from happening again.
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by Full Bleed »

J.P. wrote:Since you guys have a lot more experience with Maptool than I do, I'm hoping you can tell me what was going on and how I might prevent it from happening again.
When running the server, did you have "Use Individual FoW" checked?

If so, that's probably the problem. Too many people run into issue with that. I would disable it.

Use "Individual Views".... just don't use the "Individual Fow". It builds up FoW data on the tokens and then things can grind to a halt.

There is a way to clear a token's FoW, but if you're forced to do that to get the performance back I don't see the point of using it.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
J.P.
Kobold
Posts: 20
Joined: Sun Dec 18, 2016 1:18 pm

Re: Questions on VBL Slowdown

Post by J.P. »

I went back and double checked my server settings. The only three boxes I have checked are: "Players Can Reveal Vision", "Auto Reveal on Movement" and "Use Individual Views".
Does that smell normal to you?!

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

Re: Questions on VBL Slowdown

Post by Full Bleed »

J.P. wrote:I went back and double checked my server settings. The only three boxes I have checked are: "Players Can Reveal Vision", "Auto Reveal on Movement" and "Use Individual Views".
Not sure what would have caused the slowdown then... unless the client's memory setting were really low. Can you share the Help>Gather Debug Information from the client setup?

It is worth mentioning that I don't use "Players Can Reveal Vision" or "Auto Reveal on Movement" in my games though. I only reveal vision manually with CTRL-I... so maybe the number of reveals has something to do with the performance as well. Jamz will probably be able to sniff this out...
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 “MapTool”