Check out the build, (Instruction on that page but mostly tap the numpad keys)
|The rare ideal case - all 8 directions mapped.|
|Debug build in xna. The fuzzy values in the top left|
map how each node best fits each compass direction.
I'm still finding it much easier to tackle issues in XNA then move to Unity. In the bottom image I have all the fuzzy logic values printed on screen. In that particular image, I have to shuffle the mappings a little on the North East to the South as they don't fit neatly, seeing the problem and values all on screen was very helpful in tackling the problem. The heuristics are broadly:
- what directions can these nodes fit? (calculate fuzzy values for all 8 directions)
- where is the best/ideal fit? (pick the best fuzzy value)
- are any nodes not mapped, if so try and slot in. (use a less than perfect fuzzy value to find a spot)
- failed to neatly plot so plan B. (use a secondary plotting and allow the player to toggle between)
I'm starting to appreciate why turn based strategy game mostly adhere to nice uniform grids. Though I've got it largely working quite well there are still a couple of edge cases. Couple of stupid moment these last couple of weeks. The directions where half broken at one point until I realized XNA uses a right handed coordinate system and Unity is left handed. Second one was spending over an hour wondering why icons weren't changing/appearing/vanishing and getting null console messages when I was clearing adding the game object to the script! Then I realized I was adding them in the wrong place...doh. That's going to be a recurring theme, I'm still a little clumsy using Unity.
Updated to Unity 4.3 with no issues. /hurray