Create account / Log in

Hex edge snap to grid and rotation

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Hex edge snap to grid and rotation

Postby Rhett » March 19th, 2014, 10:09 am

I am working on the Wooden Ships & Iron Men module. This is a game of naval warfare around the Napoleonic Age.

All games are unique, and WS&IM special feature is that the counters (ships) are two hexes long. The center of a counter is therefore supposed to be in the middle of a hex edge. There are six such positions in every hex, but an additional complication is that only two of them are legal depending on what direction the ship is pointing.

In the original WS&IM module the designer fixed this problem by making each ship 3 hexes long with an invisible part about half the length of each counter. This 3-hex counter is then centered in the middle of the center hex and gives the illusion of extending two hexes with the center on an edge.

The problem with this solution is that a selected ship still has a selection box around it that is 3 hexes long. This is just a cosmetic problem, but I am thinking of ways of fixing it.


One way is to add a layer trait in the Game Piece Palette with the image of the counter and the correct offset. The image of the Basic Piece trait is then set to No Image. Unfortunately this still produces a selection box that looks bigger than the apparent size of the counter.

Another way is to use an Irregular Grid and define every hex edge to be a region. The hex grid itself then has to be included as part of the underlying background image of the board. But since there is no hex grid there is also no trait for rotating the ship.

I suppose the only way of doing this is to extend a Java class. I notice that the VASL module has a means of placing counters on edges for indicating bypass movement, but likely no command for rotating the counter in that position, so some new code is needed?
Rhett
 
Posts: 39
Joined: March 18th, 2014, 9:32 am

Re: Hex edge snap to grid and rotation

Postby uckelman » March 28th, 2014, 10:09 pm

Thus spake Rhett:
>
> I suppose the only way of doing this is to extend a Java class. I notice
> that the VASL module has a means of placing counters on edges for
> indicating bypass movement, but likely no command for rotating the
> counter in that position, so some new code is needed?

Would a simple solution be to turn off snap-to-grid?
--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Hex edge snap to grid and rotation

Postby Rhett » May 12th, 2014, 1:51 pm

Snap to grid is a great feature which I would rather not be without.

I solved this problem with custom classes, see here.
Rhett
 
Posts: 39
Joined: March 18th, 2014, 9:32 am

Re: Hex edge snap to grid and rotation

Postby dsdhornet » May 14th, 2014, 11:29 pm

Glad you solved it. I haven't messed with custom classes, but maybe I can learn a thing from yours.

Another option (one I had used), was to use a piece with an invisible 1/3rd, then add a non-rectangular trait using the same image (with the invisible 3rd). The non-rectangular changes the selection box to only include the visible portion, so the piece looks and acts like it's only 2 hexes long while still rotating around a point centered in one of the hexes.
dsdhornet
 
Posts: 12
Joined: April 26th, 2014, 5:52 am


Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests

cron