#Token # Limit

1 messages · Page 1 of 1 (latest)

warped sedge
#

I've been trying to build out a very large hex map of ~320,000 hexes. Instead of using a massive background image I'm wondering if it would be more feasible to have individual tokens with the different colors, the idea being there'd only be around 30 unique tokens just duplicated thousands of times. Is having hundreds of thousands tokens feasible if they're mostly duplicates? Would it eat just as much memory as the alternatives?

turbid tendon
#

Wow. I can't say that I've ever heard of anyone trying that large a number of tokens!

However, since each token only takes up memory once, the memory footprint would be relatively small. But you're trading low memory usage for cpu performance, since 320k tokens need to have their properly scaled image painted on the background.

To get the best possible performance, size the tokens so that they will be scaled 1:1 with the pixel size of the grid. That way no scaling of individual tokens must be done.

I would suggest creating a smaller sized map and see how well it works. I'd try something like 200x200 (roughly an eighth of what you're attempting) and see how well it performs. Keep in mind that your players may have machines that are more or less powerful as yours.

warped sedge
#

Well I generated out ~60,000 tokens with images that matched the grid size and it's chugging along pretty badly, even zoomed in. Not even counting how long it took to copy all the tokens and place them initially, MapTool was frozen for about 15 minutes.

turbid tendon
#

Ouch. There’s some caching of the images in the rendering of the map, but it still has to loop through 60k tokens to determine whether they’re within the visible area. I can’t think of a simple way around that other than breaking the map up into separate maps that only show a portion of the entire area.

warped sedge
#

Yeah, which mostly I dont' want to do for updating purposes, having to go through X many maps if I make broad changes is a huge pain.

#

I abandoned that approach and actually used the draw functions to draw the terrain on. I have all the hexes stored within an external SQL database that I already set up REST integration with so I did some nonsense and calculated out SVG paths for them. Zooming in and out is somewhat sluggish but the tokens move fine and it only tooks about 5 seconds to pull the data and then create all ~1300 drawings.

#

I already had something setup to generate tokens for the hexes in localized areas to present some data so I'll just keep using that

turbid tendon
#

Hm, cool idea. So each hex is a separate SVG, then those are drawn onto the map to match your hex grid?

warped sedge
#

I set it up so chunks of hexes of the same color are one path, had to break it down because of stack size limitations. Couldn't put all swamps in one path string for example. Got it down to 171 different shapes.

turbid tendon
#

Thanks for the info.