Unity3D Hex Map Game Dev 1 Hexes to Water











>> YOUR LINK HERE: ___ http://youtube.com/watch?v=2ktop35T2rI

Hello Unity fans. It’s time for Part 1 of my series of videos in which I’m reviewing, and also adding on to, Catlike Coding’s hex map tutorial. If you haven’t seen Part 0, the introduction, in which I’m basically just a big fan-boy of this professional, excellent tutorial series by Jasper Flick, I’ll link to it in the description, or you can follow the link in the top right, right now. I’ll also put a link to Catlike Coding’s website in the description. In Part 0 I introduce, surprise-surprise, the series of tutorials and lay out a very high level summary of the topics covered, with footage of how it all looks when implemented. • Part0 (Introduction):    • [Unity3D Hex Map Game Dev] 0: Introdu...   • Catlike Coding's Website: https://catlikecoding.com/unity/tutor... • ---*----* My Playlists *----*--- • Unity Journey Of Discovery (Tutorials):    • Unity Journey of Discovery: Hello Wor...   • The Main Course (Maths and Science Concepts Explained Visually:    • Sun, Earth and Moon: Introduction and...   • Eco-Pool Natural Swimming Pool (Build and Progress):    • Green/Eco/Natural Pool, Part 1: Plann...   • 4K Treats (Ultra HD content):    • Marine Life Photos Part 1 4K UHD   • Finger Snacks (Shorter, Unclassified Videos):    • Ribbon Eel (Rhinomuraena Quaesita) Sw...   • *----*----*----*----*----*----*----* • In the next four parts I’ll be diving in a bit deeper into each group of topics. Today we start with the basics of creating and colouring the hexes procedurally as part of a single mesh. We will be adding some variability in the form of elevation and random irregularity. We will then create larger maps using one mesh per chunk and stringing meshes together. Oh, I remember how frustrated I was years ago when I could only allocate enough memory for about 3 times the screen resolution in Turbo Pascal… Not anymore! Next, we’ll add properly behaving rivers and roads, and finally a water level. Let’s get going. • The triangulation of the hexes works as follows: Meshes are constructed from polygons, more specifically triangles. Each of the triangles comprising the mesh needs to be specified, in our case procedurally. To accomplish this, a hex is divided into 6 triangles, and the three coordinates of each triangle are used to construct the part of the mesh that renders the specific triangle. Colours are also added for each point in the triangle, and the renderer interpolates between these three colours to render the triangle. To start off with, all three points of each triangle have the same colour, which means the triangle would have that same uniform colour. This leads to sharp edges between hexes where the colours meet, which we want to improve on. Additionally, we want to be able to have varying elevations for our hexes, so that everything isn’t on the same level. We cannot just jump straight up and down between hexes. And finally, we don’t want these sharp, regular hex cells – we want some irregularity to try and get a more natural look to the world. We can cater for all of these improvements by employing one basic change to our mesh triangulation. We split the hex up into an inner hex and an outer rim. The outer rim, which now has to be broken down further into triangles, is then used to raise elevation and to connect to neighbouring hexes, blending the two together gradually. Irregularity is applied to break the sharp lines, although the coordinates of the inner hex is kept on the same height to provide a flat surface. These flat surfaces can be used to display most of the game objects, for example units or buildings. • Of course, a lot of information needs to be stored about these hexes to allow us to work with them. We need to be able to identify which hex the mouse cursor is over, and obtain the neighbours in all six directions for any hex, taking into account special cases. For example, hexes at the edge of the map do not have neighbours in certain directions. While the irregularities added to coordinates need to be random in one sense, they need to also be repeatable for any single coordinate on the map, since interaction between coordinates with indeterminate randomness will lead to gaps and discontinuities, which will not look good. The triangulation quickly becomes a lot more complex than the visual example I showed earlier. You can see here how terraces are catered for and that the edges of the inner hexes are broken down into more than one segment each, to increase the amount of irregularity than can be applied.

#############################









New on site
Content Report
Youtor.org / YTube video Downloader © 2025

created by www.youtor.org