Create account / Log in

How best to implement on/off reference numbers on map?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

How best to implement on/off reference numbers on map?

Postby Benkyo » February 20th, 2020, 7:54 am

I have a module with a large map, 180-ish locales that are not, by default, labelled with any identifying numbers. The designer did release an image of the map with reference numbers, and many players use these numbers to reference the locales during play.

So, by default, I don't want those numbers cluttering the map. However, I do want a toggle to make those numbers visible.

My first attempt was an at-start single map-sized mostly transparent piece of all the reference numbers on a bottom layer that starts invisible and can be made visible by a global key command.

This ran into the problem that the "hide pieces" toggle also hides the reference numbers. Given that players might use the "hide pieces" toggle to try and view the reference numbers under other pieces, this isn't ideal.

My current attempt is to make the actual map the one with the reference numbers visible, and to have another at-start piece image of the map without the reference numbers that entirely covers the map. This way the "hide pieces" toggle is all I need to fulfil both functions. The downside is that I have two 8 Mb png images in the module, which seems redundant and possibly a memory hog.

Are there issues with having such a setup? Is there any better way to do this?
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm

Re: How best to implement on/off reference numbers on map?

Postby JoelCFC25 » February 20th, 2020, 1:50 pm

Consider Game Piece Layers perhaps? I have this in my HIS/VQ modules (and maybe Wilderness War too) for the case of wanting to toggle visibility of only units but still see control markers on the map. Once you add this to your map and classify your pieces with Marker traits, you can add a control with associated toolbar buttons to toggle visibility of named layers.

I'm guessing this is Napoleon's Triumph, so the reference map local number "overlay" would be your bottom game piece layer, then blocks above that, then...probably not much else as there aren't really game markers to speak of unless you're adding some.
JoelCFC25
 
Posts: 689
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: How best to implement on/off reference numbers on map?

Postby shilinski » February 20th, 2020, 4:26 pm

I think your initial plan was sound. (I assume you were using map layers and understood how to control them.) Where I think you went astray is you tried using the default “hide pieces” button on the toolbar. Don’t. Disable it and make your own. If you don’t understand this, ask again.
shilinski
 
Posts: 154
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: How best to implement on/off reference numbers on map?

Postby JoelCFC25 » February 20th, 2020, 5:01 pm

The downside is that I have two 8 Mb png images in the module, which seems redundant and possibly a memory hog.

The disk space consumption is likely not worth sweating. The memory consumption depends--what are the pixel dimensions of the map image?

If you go back to the map-sized "piece" that only has labels on it, consider making that SVG instead of PNG, which should have both RAM consumption and file size benefits.
JoelCFC25
 
Posts: 689
Joined: October 12th, 2010, 5:15 pm
Location: Minnetrista, MN

Re: How best to implement on/off reference numbers on map?

Postby Benkyo » February 20th, 2020, 9:11 pm

I like the default hide pieces button for the simple reason that clicking it doesn't count as an action in a log file. It's also the only(?) button that changes its icon when clicked.

The map is 3960 X 3060, so yes, it is the memory use that concerns me, mostly whether or not it affects online synchronization or not.

I suppose giving up the small perks of the default hide pieces button might be the better option, it really depends on whether a 3960 X 3060 8ish Mb png piece is a bad idea.
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm

Re: How best to implement on/off reference numbers on map?

Postby shilinski » February 20th, 2020, 10:04 pm

If it were me and the number of numbered locations were manageable, I’d create the numbers as immovable pieces, and I would put them in a top layer of the main window. I would then add a button to toggle them on and off. This way they would overlay everything on the map without the need to hide anything.
shilinski
 
Posts: 154
Joined: December 22nd, 2007, 8:46 am
Location: Laurel, Maryland

Re: How best to implement on/off reference numbers on map?

Postby Benkyo » February 20th, 2020, 10:21 pm

I didn't think of that. Had my mind stuck on the reference numbers as a map feature. IIRC that would make it impossible to do anything on the map while the reference numbers are displayed though, which is not intuitive and would no doubt lead to bug reports. While I prefer to keep them toggled off for the most part, I imagine there are players who prefer them always on... which leads me back to your first suggestion of giving up on the default hide pieces button. Nothing else would work for those theoretical players who want to move pieces on the map while the reference numbers are visible.
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm

Re: How best to implement on/off reference numbers on map?

Postby Benkyo » February 21st, 2020, 1:06 am

Turns out I was missing something important that solves everything - the Game Piece Layer Control sub-component of Game Piece Layers allows for players to independently activate/deactivate layers without this being logged as actions or affecting your opponent's display. Never noticed that before - thanks JoelCFC25!
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm

Re: How best to implement on/off reference numbers on map?

Postby Benkyo » February 21st, 2020, 1:28 am

One new problem: Is there any way to have a layer (the reference numbers) start as inactive? As one possible way to do this, is there any way to have a Hotkey trigger when a module is loaded?
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm

Re: How best to implement on/off reference numbers on map?

Postby uckelman » February 23rd, 2020, 3:01 pm

Thus spake Benkyo:
>
> The map is 3960 X 3060, so yes, it is the memory use that concerns me,
> mostly whether or not it affects online synchronization or not.

A map that size has about 47MB of image data, which isn't all that much.

Image dimensions don't affect synchronization at all, as image data isn't
sent over the wire in network games.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8380
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: How best to implement on/off reference numbers on map?

Postby Benkyo » February 23rd, 2020, 8:21 pm

Good to know, thanks!

So the best solution appears to be a board with reference numbers, and a piece entirely covering the board without reference numbers. Zoom scaling issues means that a patchy piece just covering the numbers looks messy. An option to switch the piece to a blank layer provides a way to display the reference numbers throughout a PBEM game for players who prefer to do so.
Benkyo
 
Posts: 160
Joined: March 13th, 2013, 11:02 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests