{"__v":30,"_id":"548eb9d5e52d2b0b001b9a28","category":{"__v":5,"_id":"55094050961f17170070abbd","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["550942e2368a5617004146d8","550a3bca42fff40d00ae600c","550a42a342fff40d00ae6022","550a854f635c660d005280b8","554f0dfacbb3510d00a5738a"],"reference":false,"createdAt":"2015-03-18T09:07:28.587Z","from_sync":false,"order":2,"slug":"player-village","title":"Player Village"},"project":"543b9b0065bf840e00b473d5","user":"543b9aa865bf840e00b473d1","version":{"__v":11,"_id":"543b9b0065bf840e00b473d8","project":"543b9b0065bf840e00b473d5","createdAt":"2014-10-13T09:27:28.467Z","releaseDate":"2014-10-13T09:27:28.467Z","categories":["543b9b0065bf840e00b473d9","543b9ef065bf840e00b473e0","54890012f291f61400c02d36","54890902f291f61400c02d3e","54890c43f291f61400c02d44","54890d71c178b40b00aa3086","5508125c0c4d8c19008a5f83","55094050961f17170070abbd","550945111c38c50d006118ad","550a4c2e42fff40d00ae6049","55221c074801a40d00a77610"],"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2014-12-15T10:37:09.781Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"order":0,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"HD art source files and 3D Blender source files for the buildings included for those who purchase the Complete Kit. ([Purchase now](https://www.citybuildingkit.com/#pricing))\"\n}\n[/block]\n\nThe simplest way to replace a functional building would be to start from one of our building prefabs, and just replace the sprites (and adjust the center pivot, if necessary). \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/hdjpWySvmjRd5FErIDZA\",\n        \"building_sprites.png\",\n        \"1920\",\n        \"1055\",\n        \"#73b44d\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nDepending on whether your building is animated or static, choose an appropriate prefab - with or without animation. We have two types of buildings - simple and, less common, with animated parts (The Academy (blue lightning around it) and the Toolhouse (with smoke on top)). Then save the new prefab under a new name.\n\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVZsQo73LC-o%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVZsQo73LC-o%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVZsQo73LC-o%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=VZsQo73LC-o&feature=youtu.be\",\n  \"title\": \"Replace Buildings - Tutorial #3\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico\",\n  \"image\": \"https://i.ytimg.com/vi/VZsQo73LC-o/hqdefault.jpg\"\n}\n[/block]\n\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBDRecy1SDPY%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBDRecy1SDPY%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBDRecy1SDPY%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=BDRecy1SDPY&feature=youtu.be\",\n  \"title\": \"Adding Animated Building - Tutorial #3B\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico\",\n  \"image\": \"https://i.ytimg.com/vi/BDRecy1SDPY/hqdefault.jpg\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Introduction\"\n}\n[/block]\nThe kit supports both animated sprites like Clash of Clans does and 2D images for buildings (either illustrated or exported from 3D models). The following documentation describes a few different standard building types we've pre-programmed for you.\n\nFor 3D gameplay, please see the Developer FAQ for how to convert the kit to a 3D game. However, we recommend the easier option to convert your 3D models to 2D sprites instead for better mobile performance and the least changes necessary.\n\nYou'll receive 11 different examples in the kit including 2 animated demos known as the Dobbit Toolhouse (seen below) and the Academy witch hat.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/9tsDFFzDRMK9IEKJz3XV\",\n        \"fantasy-theme-building-demo-city-builder-kit.jpg\",\n        \"785\",\n        \"360\",\n        \"#69b426\",\n        \"\"\n      ],\n      \"caption\": \"Example art included in the kit\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"35.7 Degree ISO Art Style\"\n}\n[/block]\nWe've modeled the art angle after modern isometric games like Clash of Clans which use a revised 35.7° art style instead of 30° standard design. \n\nIf you're going to design your own buildings, you'll need to export your art at this specific angle. The tiles are not straight isometric, but the same 35.7° angle.\n\nIf you would like to make an old-school style 30° ISO RTS game, then you'll need to replace the terrain too instead of using our sample terrain.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/5eJjAYTKeI2KPTvbI8wd\",\n        \"357.jpg\",\n        \"800\",\n        \"600\",\n        \"#3672c1\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Adding Buildings\"\n}\n[/block]\nFor adding your own buildings, go to NGUI/Open/Atlas Maker and insert the sprites. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/4EHi6p2TcurJjIZb7zdQ\",\n        \"atlasmaker.jpg\",\n        \"800\",\n        \"600\",\n        \"#98432d\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThen replace the pics in Anchor – center / Shop / Buildings / Page0 / BuildingName / Pic. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/LBquumTvqwosCc8L9UAc\",\n        \"buildings-select.jpg\",\n        \"800\",\n        \"600\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAssuming you have more than 12 buildings, you can add more pages to the panel, and modify  TabPages.cs to accommodate 3 or more pages:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/HUlVBxnQey5zYg0lN5Jq\",\n        \"add-pages.jpg\",\n        \"800\",\n        \"600\",\n        \"#84b641\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to Create 2D Buildings from 3D Assets?\"\n}\n[/block]\nLook in the documentation for the 2D Graphics Manual for an introduction converting 3D art into 2D assets. Also look at the documentation section on replacing buildings in the kit. \n\nDoes your 3D asset include animation? Read the animation section for how to your 3D art into 2D assets. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/SATVsEpqRjKxlqvkPoFq\",\n        \"04_02_building_sprite_collection.jpg\",\n        \"1000\",\n        \"562\",\n        \"#993c34\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Building In Progress\"\n}\n[/block]\nThe first building type included is for under construction placeholders. With the Pro and Complete Kit, you'll also get an NPC example during construction. For all kits you'll get the full source code for gem accelerated building. (That button seen in the screenshot below)\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/49DH7pogQLGpo4l1OVMJ\",\n        \"under-construction-mobile-game-building.jpg\",\n        \"720\",\n        \"480\",\n        \"#e78a4c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Resource Generations\"\n}\n[/block]\nA critical compoment of every strategy game is resource generation. This includes gold, cash, wood, coal, mana, elixir. All of the major games include at least two soft currencies such as gold and elixir, in addition to a hard currency such as gems. The hard currency can only be purchased with real-world money, while the soft-currencies can be generated. For example, gold mines or elixir pumps. In our case, we two examples. Gold mines and liquid generators.\n\nYou can add more or customize these two from the example gold and mana types to your own names such as cash and wood. \n\nSpecify in the building.xml file exactly what resource and how much per second they generate. The default is 0.2 per second, per unit. So if the player has 5 gold mines, they'll receive 1 gold per second. All of this is fully-customizable in the buildings.xml file.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/Zeg8ZA5vSdaYND0Lj827\",\n        \"resource-generators.jpg\",\n        \"720\",\n        \"480\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAs the buildings are finished, the production and storage capacity may increase. These elements are processed by BuildingCreator.cs / ConstructionSelector.cs.\n\nRecording the production rate for Mana Generators: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"((Stats)stats).productionRates[1] = float.Parse(buildings [currentSelection] [\\\"ProdPerSec\\\"]);\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\n\nThe storage capacity might be passed to ConstructionSelector, to process when the building is finished:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"((ConstructionSelector)selectedConstruction.GetComponent(\\\"ConstructionSelector\\\")).storageIncrease=\\nint.Parse (buildings [currentSelection] [\\\"StoreCap\\\"]);\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\n\nAll the relevant information concerning production/storage capacity is stored and processed in Stats, at a 1s interval, or updated with user interaction (when the user creates/destroys a building).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/SFAkK5QxRayAYwYbdCTE\",\n        \"resources-building.jpg\",\n        \"800\",\n        \"600\",\n        \"#3977a4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Developer FAQ\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Would it be possible to have 20 different resources that players can trade?\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nWe've given two resource examples, although you could easily add up to 20 by copying and pasting the resource code, giving it a new id and name. 20 is a lot for the UI, so you'll have to design your own menu to show that. Of course since the full source code is provided, you can duplicate the menu too from another part of the project.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Resource Storage\"\n}\n[/block]\nLike major games such as Clash of Clans, Farmville, or Command and Conquer Red Alert you need storage units to house your resources. If you don't have enough, no matter how much you try to earn you cannot exceed the cap.\n\nThe resources are, indeed, generated only by generator objects you specify, and the storage capacity is increased properly with each additional storage building, all of which amounts to the data displayed in the progress bars.\n\nIn the buildings.xml file you can create your own storage buildings, and specify how much and which resource they can store. To double the capacity of their village, a player must build twice as many gold storage buildings.\n\nWe've included two examples, for both of the soft-currencies for the default game engine.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/MuzKAxVJSuqA5LNw5xlh\",\n        \"store-resources.jpg\",\n        \"720\",\n        \"480\",\n        \"#cf0412\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Animated Sprites\"\n}\n[/block]\nIf you have animated 3D buildings, you can convert them to 2D sprites using [Sprite Maker](https://www.youtube.com/watch?v=Q1fRbU-hJPo) and import the 2D sprites as buildings. We have a section of our building documentation dedicated to animation. Please look through it. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/JglueCOSxuOrHZSj9jID\",\n        \"animated-sprites.jpg\",\n        \"720\",\n        \"480\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Other Buildings\"\n}\n[/block]\nThe kit accepts any type of building you can design. No matter how complex. Add your own unique examples, for decoration or for strategic gameplay such as building walls.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/q9wfuKZWQyOCkw3mJfqw\",\n        \"unique-buildigs.jpg\",\n        \"720\",\n        \"480\",\n        \"#2a675c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Defensive\"\n}\n[/block]\nWe've added defensive capability to every building in the kit. As players attack, the buildings have cannons that rotate around - tracking enemy troops - and defending.\n\nProof-of-concept is included for both normal and guided projectiles, damage for everyone, etc.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/Rbz56AfQBy89zJiIKLpj\",\n        \"defensive.jpg\",\n        \"720\",\n        \"439\",\n        \"#7289a6\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Bonus Game Art\"\n}\n[/block]\nThe Complete Kit includes original art sources for both farming games like Farmville and restaurant / bakery games like Restaurant City. ([Purchase the Complete Kit](https://www.citybuildingkit.com/#pricing))\n[block:image]\n{\n  \"images\": [\n    {\n      \"caption\": \"Farming game art from the Complete Kit\",\n      \"image\": [\n        \"https://www.filepicker.io/api/file/juR7UEiS0WL6MPXPvdAu\",\n        \"farming-game2.jpg\",\n        \"720\",\n        \"480\",\n        \"#8aa32f\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"caption\": \"Restaurant game art from the Complete Kit\",\n      \"image\": [\n        \"https://www.filepicker.io/api/file/AP8HWk5gRPyDLS2XH7iE\",\n        \"restaurant-game-art.jpg\",\n        \"720\",\n        \"480\",\n        \"\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nReceive both the restaurant and farming game art with your Complete Kit purchase. ([More information](https://www.citybuildingkit.com/#pricing))\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"FAQ\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Can the player have multiple cities?\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nYes, it's possible with both the Pro and Complete Kits. We didn't design this out of box, but you would simply add a menu and use our save from server and load from server functions to save and load multiple ids. You could also do this with local save and load, depending on whether you want an online version or not.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"For More Details\"\n}\n[/block]\nThis was just a brief summary of the types of buildings. Continue reading the rest of the building documentation pages for more information about adding your own buildings or creating animated buildings.","excerpt":"","slug":"buildings","type":"basic","title":"Summary"}

Summary


[block:callout] { "type": "success", "body": "HD art source files and 3D Blender source files for the buildings included for those who purchase the Complete Kit. ([Purchase now](https://www.citybuildingkit.com/#pricing))" } [/block] The simplest way to replace a functional building would be to start from one of our building prefabs, and just replace the sprites (and adjust the center pivot, if necessary). [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/hdjpWySvmjRd5FErIDZA", "building_sprites.png", "1920", "1055", "#73b44d", "" ] } ] } [/block] Depending on whether your building is animated or static, choose an appropriate prefab - with or without animation. We have two types of buildings - simple and, less common, with animated parts (The Academy (blue lightning around it) and the Toolhouse (with smoke on top)). Then save the new prefab under a new name. [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVZsQo73LC-o%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVZsQo73LC-o%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVZsQo73LC-o%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>", "url": "https://www.youtube.com/watch?v=VZsQo73LC-o&feature=youtu.be", "title": "Replace Buildings - Tutorial #3", "favicon": "https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico", "image": "https://i.ytimg.com/vi/VZsQo73LC-o/hqdefault.jpg" } [/block] [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBDRecy1SDPY%3Ffeature%3Doembed&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBDRecy1SDPY%26feature%3Dyoutu.be&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBDRecy1SDPY%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>", "url": "https://www.youtube.com/watch?v=BDRecy1SDPY&feature=youtu.be", "title": "Adding Animated Building - Tutorial #3B", "favicon": "https://s.ytimg.com/yts/img/favicon-vflz7uhzw.ico", "image": "https://i.ytimg.com/vi/BDRecy1SDPY/hqdefault.jpg" } [/block] [block:api-header] { "type": "basic", "title": "Introduction" } [/block] The kit supports both animated sprites like Clash of Clans does and 2D images for buildings (either illustrated or exported from 3D models). The following documentation describes a few different standard building types we've pre-programmed for you. For 3D gameplay, please see the Developer FAQ for how to convert the kit to a 3D game. However, we recommend the easier option to convert your 3D models to 2D sprites instead for better mobile performance and the least changes necessary. You'll receive 11 different examples in the kit including 2 animated demos known as the Dobbit Toolhouse (seen below) and the Academy witch hat. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/9tsDFFzDRMK9IEKJz3XV", "fantasy-theme-building-demo-city-builder-kit.jpg", "785", "360", "#69b426", "" ], "caption": "Example art included in the kit" } ] } [/block] [block:api-header] { "type": "basic", "title": "35.7 Degree ISO Art Style" } [/block] We've modeled the art angle after modern isometric games like Clash of Clans which use a revised 35.7° art style instead of 30° standard design. If you're going to design your own buildings, you'll need to export your art at this specific angle. The tiles are not straight isometric, but the same 35.7° angle. If you would like to make an old-school style 30° ISO RTS game, then you'll need to replace the terrain too instead of using our sample terrain. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/5eJjAYTKeI2KPTvbI8wd", "357.jpg", "800", "600", "#3672c1", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Adding Buildings" } [/block] For adding your own buildings, go to NGUI/Open/Atlas Maker and insert the sprites. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/4EHi6p2TcurJjIZb7zdQ", "atlasmaker.jpg", "800", "600", "#98432d", "" ] } ] } [/block] Then replace the pics in Anchor – center / Shop / Buildings / Page0 / BuildingName / Pic. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/LBquumTvqwosCc8L9UAc", "buildings-select.jpg", "800", "600", "", "" ] } ] } [/block] Assuming you have more than 12 buildings, you can add more pages to the panel, and modify TabPages.cs to accommodate 3 or more pages: [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/HUlVBxnQey5zYg0lN5Jq", "add-pages.jpg", "800", "600", "#84b641", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "How to Create 2D Buildings from 3D Assets?" } [/block] Look in the documentation for the 2D Graphics Manual for an introduction converting 3D art into 2D assets. Also look at the documentation section on replacing buildings in the kit. Does your 3D asset include animation? Read the animation section for how to your 3D art into 2D assets. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/SATVsEpqRjKxlqvkPoFq", "04_02_building_sprite_collection.jpg", "1000", "562", "#993c34", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Building In Progress" } [/block] The first building type included is for under construction placeholders. With the Pro and Complete Kit, you'll also get an NPC example during construction. For all kits you'll get the full source code for gem accelerated building. (That button seen in the screenshot below) [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/49DH7pogQLGpo4l1OVMJ", "under-construction-mobile-game-building.jpg", "720", "480", "#e78a4c", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Resource Generations" } [/block] A critical compoment of every strategy game is resource generation. This includes gold, cash, wood, coal, mana, elixir. All of the major games include at least two soft currencies such as gold and elixir, in addition to a hard currency such as gems. The hard currency can only be purchased with real-world money, while the soft-currencies can be generated. For example, gold mines or elixir pumps. In our case, we two examples. Gold mines and liquid generators. You can add more or customize these two from the example gold and mana types to your own names such as cash and wood. Specify in the building.xml file exactly what resource and how much per second they generate. The default is 0.2 per second, per unit. So if the player has 5 gold mines, they'll receive 1 gold per second. All of this is fully-customizable in the buildings.xml file. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/Zeg8ZA5vSdaYND0Lj827", "resource-generators.jpg", "720", "480", "", "" ] } ] } [/block] As the buildings are finished, the production and storage capacity may increase. These elements are processed by BuildingCreator.cs / ConstructionSelector.cs. Recording the production rate for Mana Generators: [block:code] { "codes": [ { "code": "((Stats)stats).productionRates[1] = float.Parse(buildings [currentSelection] [\"ProdPerSec\"]);", "language": "cplusplus" } ] } [/block] The storage capacity might be passed to ConstructionSelector, to process when the building is finished: [block:code] { "codes": [ { "code": "((ConstructionSelector)selectedConstruction.GetComponent(\"ConstructionSelector\")).storageIncrease=\nint.Parse (buildings [currentSelection] [\"StoreCap\"]);", "language": "cplusplus" } ] } [/block] All the relevant information concerning production/storage capacity is stored and processed in Stats, at a 1s interval, or updated with user interaction (when the user creates/destroys a building). [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/SFAkK5QxRayAYwYbdCTE", "resources-building.jpg", "800", "600", "#3977a4", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Developer FAQ" } [/block] [block:code] { "codes": [ { "code": "Would it be possible to have 20 different resources that players can trade?", "language": "text" } ] } [/block] We've given two resource examples, although you could easily add up to 20 by copying and pasting the resource code, giving it a new id and name. 20 is a lot for the UI, so you'll have to design your own menu to show that. Of course since the full source code is provided, you can duplicate the menu too from another part of the project. [block:api-header] { "type": "basic", "title": "Resource Storage" } [/block] Like major games such as Clash of Clans, Farmville, or Command and Conquer Red Alert you need storage units to house your resources. If you don't have enough, no matter how much you try to earn you cannot exceed the cap. The resources are, indeed, generated only by generator objects you specify, and the storage capacity is increased properly with each additional storage building, all of which amounts to the data displayed in the progress bars. In the buildings.xml file you can create your own storage buildings, and specify how much and which resource they can store. To double the capacity of their village, a player must build twice as many gold storage buildings. We've included two examples, for both of the soft-currencies for the default game engine. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/MuzKAxVJSuqA5LNw5xlh", "store-resources.jpg", "720", "480", "#cf0412", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Animated Sprites" } [/block] If you have animated 3D buildings, you can convert them to 2D sprites using [Sprite Maker](https://www.youtube.com/watch?v=Q1fRbU-hJPo) and import the 2D sprites as buildings. We have a section of our building documentation dedicated to animation. Please look through it. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/JglueCOSxuOrHZSj9jID", "animated-sprites.jpg", "720", "480", "", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Other Buildings" } [/block] The kit accepts any type of building you can design. No matter how complex. Add your own unique examples, for decoration or for strategic gameplay such as building walls. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/q9wfuKZWQyOCkw3mJfqw", "unique-buildigs.jpg", "720", "480", "#2a675c", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Defensive" } [/block] We've added defensive capability to every building in the kit. As players attack, the buildings have cannons that rotate around - tracking enemy troops - and defending. Proof-of-concept is included for both normal and guided projectiles, damage for everyone, etc. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/Rbz56AfQBy89zJiIKLpj", "defensive.jpg", "720", "439", "#7289a6", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Bonus Game Art" } [/block] The Complete Kit includes original art sources for both farming games like Farmville and restaurant / bakery games like Restaurant City. ([Purchase the Complete Kit](https://www.citybuildingkit.com/#pricing)) [block:image] { "images": [ { "caption": "Farming game art from the Complete Kit", "image": [ "https://www.filepicker.io/api/file/juR7UEiS0WL6MPXPvdAu", "farming-game2.jpg", "720", "480", "#8aa32f", "" ] } ] } [/block] [block:image] { "images": [ { "caption": "Restaurant game art from the Complete Kit", "image": [ "https://www.filepicker.io/api/file/AP8HWk5gRPyDLS2XH7iE", "restaurant-game-art.jpg", "720", "480", "", "" ] } ] } [/block] Receive both the restaurant and farming game art with your Complete Kit purchase. ([More information](https://www.citybuildingkit.com/#pricing)) [block:api-header] { "type": "basic", "title": "FAQ" } [/block] [block:code] { "codes": [ { "code": "Can the player have multiple cities?", "language": "text" } ] } [/block] Yes, it's possible with both the Pro and Complete Kits. We didn't design this out of box, but you would simply add a menu and use our save from server and load from server functions to save and load multiple ids. You could also do this with local save and load, depending on whether you want an online version or not. [block:api-header] { "type": "basic", "title": "For More Details" } [/block] This was just a brief summary of the types of buildings. Continue reading the rest of the building documentation pages for more information about adding your own buildings or creating animated buildings.