Hex Range count wrong

I didn’t find this here with a cursory search so…

I’m using a hex map and the range count function is wrong. I’ve tweaked the round up/down settings and using a 0 or 65 size but it’s still wrong. With the default settings the count goes wrong at 3 to 4 hexes. playing a bit I can extend that to 14 or 15 hexes, but it still goes wrong.

keekerdc.com/2011/03/hexagon-gri … lculations.
using a qbert style 3 axis coordinate system

(Just mentally rotate the image 90 Clockwise)

distance = max(x2-x1,y2-y1,z2-z1) max doesn’t care about + or -
using 0101 as top left hence 0,0,0 as top left

0201 to 0709, range is 10 hexes counted visually
These converted to the x,y,z qbert coordinates are
first set 0,1,-1 second set 5,6,-11
5-0, 6-1,-11+1
5,5,-10
max is -10

or reversed
0709 to 0201, range is 10 hexes counted visually
These converted to the x,y,z qbert coordinates are
first set 5,6,-11 second set 0,1,-1
0-5, 1-6,-1+11
-5,-5,+10
max is 10

Other ways redblobgames.com/grids/hexagons/#distances

Hi,
Could you please post an image of an actual example showing the distance reported by Vassal and the distance you think should be reported.
Regards,
Brent.

Range 4 Wrong, showing incorrectly as R3 The real distance From ArcheoTholian to Romulan is Range 4
[attachment=2]r3wrong.png[/attachment]

Here is a Correct Range 11 From Tholian (archeo) to Federation
[attachment=1]r11.png[/attachment]

Here is a an incorrect Range 11 From ArcheoTholian to NeoTholian also Range 11 showing as Range 10
[attachment=0]r11wrong.png[/attachment]

Well, this certainly doesn’t happen in any module I have built. When I recreate the situations you show, I get the ranges reported that you expect to see.

I suspect that the LOS thread in the module you are basing this on has incorrectly specified the range to be calculated using the ‘Pixels per range unit’ method instead of the ‘use Grid calculation’ method.

This explains why you are getting some correct values and some incorrect. Pixels per range will be most correct when the LOS runs down a line of hexes (your example 2 is like this) and will get more wrong the further the LOS gets away from a line of hexes (like your other 2 examples).

Regards,
Brent.

It’s the Star Fleet Battles Cadet module. I built it off the STSTCS as a starting point.

I had tried pixels at zero to use grid and it was wrong as well. Maybe I didn’t reload before testing that. I’ll try it again.

Nope that is still wrong, and it was a complete close and refresh after saving. I am uploading Version003 now so if you want to take a look at it let me know and I’ll hold off on updating it as you look at it.

I have to look into why I can’t see where to add “Definition of Player Sides” anyway and look into actually colouring in the squares of the ships ssd instead of the text base kludge I am using for now.

vassalengine.org/wiki/Module … ing_Manual

The mod I started basing from vassalengine.org/wiki/Module … _Simulator Range is broken in it as well.

If I had the first clue about programming or Java this would probably be easier than it is.

Whale oil beef hooked! he said in a fake Irish accent.

It seems that the Vassal hex range calculation is a variation on the pixels per range calculation and is indeed borked if your hex size is not ‘square’.

In the short term, I can only suggest that you ‘square’ up your hex grid (i.e. change the hex height and use the hex width that vassal automatically sets.

The redblobgames page is brilliant and I can code a fix for this, but It will take a little time to get sorted.

Regards,
Brent.

Thanks.
That seems to have done it.