Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

API Efficiency: Long Path vs Several Paths

I assume the answer is one long path, but which runs more efficiently in-game: A lot of short path objects that happen to be contiguous A single long path object that follows the same path, but may draw over the same place twice sometimes. I'll be writing a script (probably?) this weekend that involves drawing a lot of paths to the screen, but I've never interacted with them before, so I was hoping there was some established knowledge about performance.  For what it's worth, in my script, I aim to redraw the same path several times, with (usually) mild updates each time.
1562210540
The Aaron
Roll20 Production Team
API Scripter
Anecdotally, one long path is better.&nbsp;&nbsp; If you look into the specification for SVG lines, you can actually do some pretty great things that are not available via the drawing tools, specifically creating a single path object with multiple non-contiguous lines.&nbsp; Look at:&nbsp; <a href="https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands" rel="nofollow">https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands</a> If you want to see this in action, check out my Walls script:&nbsp; <a href="https://app.roll20.net/forum/post/1337473/script-walls-svg-path-importer-for-dynamic-lighting-revisited" rel="nofollow">https://app.roll20.net/forum/post/1337473/script-walls-svg-path-importer-for-dynamic-lighting-revisited</a> &nbsp;
Perfect, thanks!