-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tokens become offset when rotating a larger token on a Hex Column Grid. #108
Comments
That's honestly so strange, that column vs row behaves differntly. I might actually take a look at that. |
Were you able to replicate the strange behavior? |
Hey KayelGee, do you need me to send any files or anything to make it easier for you to debug? |
Hey sorry I'm on vacation so i can't really check for the next 3 weeks.
I'll take a look once I'm back
Tarrith ***@***.***> schrieb am Mi., 3. Apr. 2024, 15:44:
… Hey KayelGee, do you need me to send any files or anything to make it
easier for you to debug?
—
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE5ONVID425HEK6SPE7J2WDY3OXNJAVCNFSM6AAAAABB6NJ4P6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZTGY3TSNBXHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
No problem, enjoy your holiday! :) |
Sorry I can't wrap my head around that. |
Yeah, it's definitely a Hex grid issue, maybe with Foundry itself. So to clarify, the skewering only happens when the Heaxagonal Columns are set to Odd. |
Ah well, I guess I'll either have to the map with the Hex orientated the other way or start using a square grid XD Thanks for trying anyway :) |
Just to add a little more info. This isn't a foundry bug. It has to do with how I offset the elements. To do that I calculate the center of for example a Tile and basically create an offset vector from the center of the token to the center of the Tile. This is later used to place the Tile at the correct position and rotation. In Square grids the center is easy to calculate, because the x,y coordinate is the top left corner and you just need to add half the width and height to that. That works for both Tokens and Tiles. In Hex grids it's a little more complicated to calculate the center, because it depends on the type of hex you're using. The formula isn't actually that complicated it should be basically x,y + half the spacing(see https://www.redblobgames.com/grids/hexagons/#spacing). The token center has to be calculated as a Hex and the Tile center as a square. The rest of the process should be the same. I don't know what I did wrong but I couldn't get the code to behave as I described above. I'd need to add more visualization to see what the problem is. But now that I have written this I might've missed the fact, that Tokens need to have their center calculated as a Hex and Tiles as a Sqaure. |
I found my issue and it's something that's really odd. So the math I used was correct but foundrys default setting is an oddity. I don't understand why they aren't using the actual center for all variants. Maybe this is a bug. I'll have to have another look at this on another day. |
All good, thanks for looking into this. It's only because a lot of wargame hex maps use the grid with the hexes flat on top and I have to admit...it looks so jarring with the hexes rotated :) "but I'm too stupid to figure out how to do it for now."
|
To highlight this I've added two videos showing the issue. The red rectangle shows the mathematical centered bounding box with a centered cross. The white box shows the different variants. offcenter_2.mp4offcenter_3.mp4 |
What does it have to do with flat top hexes? The issue exists in both. |
I've asked in the foundry discord if this is intentional or not. If it's intentional I'll revisit this. The update will be out in the next minutes. You'll have change the control token to a Rectangle variant and redo your attachments. |
Sorry if this is frustrating for you, I can understand that. Ill give the new version a go in about an hour when I get back home :) |
Also I confirmed it, it's not a bug it's an intended change in v12. |
K. Well It was working with the Hex Evens but not the Odds so...I don't know I'm kinda lost. |
When a Controlling Token is attached to a larger Token with its 'Width' increased, the hexagon becomes offset when rotating if the grid is set to Hexagonal Columns.
Hex Columns: Rotation becomes offset.
Hex Rows: Rotation is fine.
The text was updated successfully, but these errors were encountered: