Hello Unity fans, and welcome back to my hex map game development series. Now that we have a decent user interface going to place our woodcutter and stonemason cabins on the map, I think it’s about time we produced some food for our inhabitants, so that our town can start growing. This video will focus a bit less on the technical aspects since we’ve already covered a lot of that while developing the functionality for our woodcutters and stonemasons. However, I will briefly show how we expand on the existing functionality to quite easily add in a completely new resource, a different floor plan in terms of the farm’s layout and get our farmer harvesting in no time.
Part0 (Introduction): • [Unity3D Hex Map Game Dev] 0: Introduction...
Part1 (Hexes to Water): • [Unity3D Hex Map Game Dev] 1: Hexes to Water
Part2 (Features and Textures): • [Unity3D Hex Map Game Dev] 2: Features, Te...
Part3 (Units, Visibility): • [Unity3D Hex Map Game Dev] 3: Units, Pathf...
Part4 (Random Maps): • [Unity3D Hex Map Game Dev] 4: Creating Ran...
Part5 (Post Processing): • [Unity3D Hex Map Game Dev] 5: Post Process...
Part6 (Resource Gathering): • [Unity3D Hex Map Game Dev] 6: Automated Re...
Part7 (Spinning Selector): • [Unity3D Hex Map Game Dev] 7: Spinning Obj...
Part8 (Preparing for Resources): • [Unity3D Hex Map Game Dev] 8: Preparing fo...
Part9(How Much Wood?): • [Unity3D Hex Map Game Dev] 9: How Much Woo...
Part10(Dynamic Trees): • [Unity3D Hex Map Game Dev] 10: Dynamic Trees
Part11(Meet The Meeples): • [Unity3D Hex Map Game Dev] 11: Meet The Me...
Part12(Harvesting Wood): • [Unity3D Hex Map Game Dev] 12: Harvesting ...
Part13(Harvesting Stone): • [Unity3D Hex Map Game Dev] 13: Harvesting ...
Part14(Walking Around Wallls): • [Unity3D Hex Map Game Dev] 14: Stop Walkin...
Part15(Multiple Unit Types): • [Unity3D Hex Map Game Dev] 15: Preparing f...
Part16(Manipulate Terrain): • [Unity3D Hex Map Game Dev] 16: Manipulate ...
Part17(ResourceBuilding Upgrades): • [Unity3D Hex Map Game Dev] 17: Resource Bu...
Part18(Camera Fly-through): • [Unity3D Hex Map Game Dev] 18: Camera Fly ...
Part19(Animated UI): • [Unity3D Hex Map Game Dev] 19: Animated Us...
The floor plans of our cabins have been fairly small up to now, with one ring of hexes around the centre catering for our outbuildings and enough walking space to ensure nobody gets stuck. For our farm, we need to go a bit bigger. This is mainly because the farm’s resources are not already part of the map, and we need extra space to cater for these. Still, we don’t want our farms to completely clog up the map in terms of unit movement, so we need to design it keeping this in mind. I played around with a few configurations on a plot consisting of two rings of hexes around the centre hex, and ultimately found something I liked. Like the other cabins, I wanted to have two upgrade locations for the farm, so I followed the same design there. The outbuildings are situated towards the back of their hexes, so that units can still pass between the house and the outbuildings. But rather than just walking out into the world on the opposite side of the upgrade buildings, for the farm I have another hex there that can contain some random farm buildings – a chicken coup and a well at this stage. If we now place two hexes of farmland either side of each outbuilding plot, we have 6 plots containing farm resources, which feels like enough to work with. We also have 3 gateways to and from our farm, and there are 3 more hexes around the edge where units can also pass freely. All in all, I feel this gives enough substance for the farm while not taking up excessive amounts of land, so let’s get some proper graphics onto the floor plan.
We use the same Prefab Linker we’ve used for the other cabins in order to let the map generator know which prefabs to use to construct a farm. We could also design a few slightly different-looking farms and let one be chosen at random each time. We still have a main cabin part, and two upgrade parts as before, so nothing much changes here. The farm’s models are just a bit bigger now. We build these three parts up separately. It can be difficult to align everything, so I use temporary hexes that show where the real hexes would be, then align everything to these, before hiding them again. You have to make sure all the rotations and positions are correct so that it creates a complete farm when stitched together, and not something like this Picasso farm.
We also use a similar user interface icon as before, and slightly adjust the on click events, position and animations that show and hide the icons. We use the same functionality we’ve developed for the other cabins, adjusted to cater for two rings around the centre instead of one. So, if you try to place your farm over existing resources, rivers, lakes or land that is too uneven, the problematic hexes are pointed out in the UI.
When we’ve found an acceptable location, we can click to place the farm. Since it will be producing its own resources, we don’t have the situation like for the woodcutters and stonemasons where we rotate it to face the nearest resource. We just add a random rotation to it for now, so they’re not all rotated the same way. With the buildings in place we can now procedurally add some full-grown corn to the farm.
Информация по комментариям в разработке