Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - General Discussions > Hex coordinate systems PDA View Full Version : Hex coordinate systems LDiCesareFeb 28, 2010, 01:10 PMDoes anyone know which hex coordinate system will be used in civ V? There are at least 2 systems: One uses x/y axis which are horizontal and vertical, the other uses coordinates parallel to the hexagon's preferred directions. So what? Well, developping an algorithm to create a map in one coordinate system would be a lot of wasted work if it happens to be the other system. Yes, one would just have to convert the coordinates once the map is generated, or create a conversion routine, but it's still a pain to have to write one. Already, I'm wondering if there's an easy way to find the vertices from an hexagon. I bet there'll be stuff like North/South - NorthWest/SouthEast - NorthEast/SouthWest directions, or a neighbour() function or something... Not knowing what will be available is a real pain. Of course I'll be even more p** off when Firaxis announces we can't create map scripts, but whatever. Dragonxander PRMar 01, 2010, 05:10 PMI think the coordinate system for the hexes will be similar to the one used with Civ III's map--those use squares, but not horizontal/vertical squares (like Civ IV's), it used diagonal squares. Or it could be that there's some code that treats odd-numbered rows differently from even-numbered rows--you can see why that could be necessary, take a look at my hex paper image: http://forums.civfanatics.com/showpost.php?p=8941176&postcount=16 LDiCesareMar 02, 2010, 01:58 PMI know why the even/odd numbered rows can be necessary. I don't think they'll go with odd/even numbered columns, but it's a possibility too. The 2 axes system is interesting for distance computation (you don't need any "if odd" with that logic), but index bounds are messy so I guess moost programmers would avoid that. I know I went with even/odd numbered rows myself, so I hope they'll go that way too. However, how they represent rivers is anyone's guess (booleans north, northwest, northeast of river like in civ IV). And rivers, being between tiles on the screenshots, are going to be the most painful part of mapscripts to write again I suppose. cephaloMar 02, 2010, 03:22 PMEven/odd rows are the easiest way to do it in my opinion. If you need to find grid cohesiveness for aesthetic reasons, you just offset the odd rows by one half. For pathfinding and all that stuff I'm sure you will have the functions you mentioned, i.e. Neighbor(x,y,NE). I'm very interested to see their river system. One thing I noticed in the screenshots so far is that there are no river junctions! I hope they can give us those so we can have proper river networks. One complication is that on a hex grid with river running between hexes, there are two different kinds of junctions to consider like so. \ / and | | / \ Really, I guess it's even easier than squares in terms of graphics you have to make, but generation and encoding will be sortof tricky. For the direction of flow, I guess you could encode it as the eight compass points. There would be no ambigueity for one to say "River junction flowing Northeast", as that would indicate both the variety of junction and the flow. I would be extremely deflated if they didn't allow us our own mapscripts! I'm hoping that soon we will have to be familiarizing ourselves with these kinds of issues. Gamemaster77Mar 02, 2010, 03:38 PMEDIT: Never mind, my post didn't turn out right