Create account / Log in

Hex Range count wrong

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Hex Range count wrong

Postby sfbaddict » August 5th, 2015, 1:42 am

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.

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

Image
The orientation of the axes is relatively arbitrary. The diagrams above could be easily flipped vertically, so that y increases downward and x increases up and to the right. This would create a (0,0,0) tile in the upper left instead of the lower left.
(Just mentally rotate the image 90 Clockwise)
Image

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 http://www.redblobgames.com/grids/hexagons/#distances
sfbaddict
 
Posts: 42
Joined: August 1st, 2015, 2:29 am

Re: Hex Range count wrong

Postby Brent Easton » August 6th, 2015, 2:57 am

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.
User avatar
Brent Easton
 
Posts: 3090
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Hex Range count wrong

Postby sfbaddict » August 6th, 2015, 8:02 am

Range 4 Wrong, showing incorrectly as R3 The real distance From ArcheoTholian to Romulan is Range 4
r3wrong.png
r3wrong.png (19.69 KiB) Viewed 3440 times


Here is a Correct Range 11 From Tholian (archeo) to Federation
r11.png
r11.png (29.7 KiB) Viewed 3440 times



Here is a an incorrect Range 11 From ArcheoTholian to NeoTholian also Range 11 showing as Range 10
r11wrong.png
r11wrong.png (29.6 KiB) Viewed 3440 times
sfbaddict
 
Posts: 42
Joined: August 1st, 2015, 2:29 am

Re: Hex Range count wrong

Postby Brent Easton » August 7th, 2015, 3:03 am

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.
Attachments
eb2.png
eb2.png (10.66 KiB) Viewed 3429 times
User avatar
Brent Easton
 
Posts: 3090
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Hex Range count wrong

Postby sfbaddict » August 7th, 2015, 8:18 am

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.
sfbaddict
 
Posts: 42
Joined: August 1st, 2015, 2:29 am

Re: Hex Range count wrong

Postby sfbaddict » August 7th, 2015, 8:35 am

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.

http://www.vassalengine.org/wiki/Module ... ing_Manual

The mod I started basing from http://www.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.
sfbaddict
 
Posts: 42
Joined: August 1st, 2015, 2:29 am

Re: Hex Range count wrong

Postby Brent Easton » August 8th, 2015, 3:52 am

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.
User avatar
Brent Easton
 
Posts: 3090
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Hex Range count wrong

Postby sfbaddict » August 8th, 2015, 1:53 pm

Thanks.
That seems to have done it.
sfbaddict
 
Posts: 42
Joined: August 1st, 2015, 2:29 am


Return to Module Design

Who is online

Users browsing this forum: Google [Bot] and 3 guests