{"__v":19,"_id":"55082e75c79a211900a8de1b","category":{"__v":8,"_id":"543b9ef065bf840e00b473e0","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["543b9f11b1479b1400c42f58","548a78adb77bb70b00ac8c10","55082e75c79a211900a8de1b","55083e4e31eeba2d00d66a2d","550bfa9022ccb01700a79466","550c312a5fdefb19003d1201","554f015d1bc7d20d00458588","554f03de1bc7d20d0045858c"],"reference":false,"createdAt":"2014-10-13T09:44:16.284Z","from_sync":false,"order":4,"slug":"pvp-battles","title":"PvP Battles"},"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":"2015-03-17T13:39:01.325Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"order":5,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To prevent problems, always make a daily backup of every script you're editing - so that if a problem occurs, you can revert to the most recent save.\",\n  \"title\": \"Keep Daily Backups!\"\n}\n[/block]\nIf you begin to have problems with PvP, we recommend you download an original copy of the kit, add your license code, and then try a battle. The unedited kit will return you a demo village you can attack, showing that the problem isn't your connection or network.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Have you customized the kit?\"\n}\n[/block]\nWe recommend you use your own server as the map files from the default kit may no longer be compatible with your customized buildings. Maps may appear empty, or the battle may instantly complete reporting 0 gold/mana gained, and units lost.\n\nUpload the PvP Server Sync scripts to your web host. You can download these scripts from our download center and upload to your website like http://yoursite.com/pvp/ or https://mybucket.s3.amazonaws.com/pvp/\n\nThen update the Server Address where you updated your License code in the two screenshots below.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Testing with Our Servers?\"\n}\n[/block]\nUpdate the license used for both Save Load WWW and Save Load Battle. Instructions are located below in the next section. (For the Pro Kit, you'll find the URLs hardcoded in the SaveLoadWWW.cs and SaveLoadBattle.cs files - the screenshots below are from the Complete Kit which has an easier way to update the license using Unity)\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/APaJvV9GT0VIv4xfEFDs\",\n        \"license.jpg\",\n        \"800\",\n        \"600\",\n        \"\",\n        \"\"\n      ],\n      \"caption\": \"If your license isn't set with our server software, you'll get this error.\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Update the License Code\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/VdRK99PWS9Gn2YIVFd18\",\n        \"license1.jpg\",\n        \"981\",\n        \"666\",\n        \"#76ae3a\",\n        \"\"\n      ],\n      \"caption\": \"Game > GameManager > SaveLoadWWW\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/kwl2jcchSZK6jqBEkg2e\",\n        \"license2.jpg\",\n        \"979\",\n        \"665\",\n        \"#75af3a\",\n        \"\"\n      ],\n      \"caption\": \"Map01 > Game Manager > SaveLoadBattle\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Using with your own server\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Does Unity hang when a random map downloads?\"\n}\n[/block]\n**Are you using our server software demo links still?**\n\nIf it doesn't load a map from our server demo, download the original development kit again, install, and run the Game.unity scene. Open competitions and a demo map should load. If it doesn't work, then there's something causing the problem on your development machine. Firewall or connection issue? Try on your mobile device over the cellular network if possible to compare.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/JzE0CBU0TUiHyLVdnfTy\",\n        \"map.jpg\",\n        \"800\",\n        \"381\",\n        \"#71ac34\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n**Did you change the demo links from our PvP server software to your own?**\n\nIf you're using the demo server software scripts included with the Complete Kit: In our testing records, Unity will hang if your server blocks requests, alters the output of the files or has some other issue unique to your server. To troubleshoot, revert to the original https://www.citybuildingkit.com/ server software links included when you first downloaded the kit. Try to play the scene and open competitions. If it loads the enemy map, then the problem is with your server.\n\n**Was it working before on your server?**\n\nIf yes -- When looking through our testing records, we have a test with Unity hanging completely and unrecoverable, if, for instance, we changed the name of the save file from USERID**_results.txt** to USERID**_attack.txt**. Although the files save correctly on the server, the demo server software scripts provided with the Complete Kit should also be updated or else the scripts won't find the file to retrieve when requested by Unity. If the server can not find a file you expect to have a certain extension/part of filename, everything hangs, and it's not just the game, the entire unity editor too.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Can't deploy any troops because map is empty\"\n}\n[/block]\nIn our testing, the most common cause for troops that cannot be deployed if a map contains no buildings. Technically, there's nothing for the troops to destroy. Check the maps.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/FtVJ3NrTy6Lmnt3aXLbI\",\n        \"empty-map.jpg\",\n        \"800\",\n        \"341\",\n        \"#79ab08\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nFirst, check if you have any empty maps on your server. If you're using our server scripts, look in the administration page and check for any files that have no data under the **###Buildings###** section. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"###StartofMapid###\\nx2Ag3j0159bi\\n###EndofMapid###\\n###StartofFile###\\n###Buildings###\\n###Grass###\\n4,0,-768,-90\\n3,1,-384,270\\n###Construction###\\n###BuildingIndex###\\n10\\n0.00,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n###Stats###\\n2410,7,3,28670.52,8169.019,591,64750,18250,605,0.2,0.2,True,False,True,True\\n03/02/2015 23:03:36\\n###EndofFile###\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nIf all of your maps have buildings listed in **###Buildings###**, then there's a problem with your server or the link you used in the PvP. Download the original kit file again with our demo links to compare the difference. In the worst case if you can't figure out what's different, revert the specific script to the original copy. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"I don't have any sample maps!\"\n}\n[/block]\nWith the server demo scripts included with the Complete Kit, we've provided 5 demo maps. Download the original copy you purchased and look for the server scripts. You'll see a folder called \"maps\" with 5 demo player maps inside like **demoplayer1.txt**\n\n**Here is an example of one:** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"###StartofMapid###\\ndemoplayer\\n###EndofMapid###\\n\\n###StartofFile###\\n###Buildings###\\nBarrel,1,-384,270\\nChessboard,2,-1280,-360\\nClassroom,3,-1280,180\\nForge,4,-256,-360\\nGenerator,5,-768,-720\\nGlobe,6,0,540\\nSummon,8,384,270\\nVault,7,0,0\\n###Grass###\\n4,0,-768,-90\\n3,1,-384,270\\n3,2,-1280,-360\\n3,3,-1280,180\\n3,4,-256,-360\\n3,5,-768,-720\\n3,6,0,540\\n3,7,0,0\\n3,8,384,270\\n3,9,384,-270\\n2,10,640,0\\n###Construction###\\nAcademy,0,15,11,0,-768,-90\\nWorkshop,9,1,0,0,384,-270\\nToolhouse,10,1,0,0,640,0\\n###BuildingIndex###\\n10\\n0.00,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n0,0,0,0,0,0,0,0,0,0,0,0\\n###Stats###\\n2410,7,3,28670.52,8169.019,591,64750,18250,605,0.2,0.2,True,False,True,True\\n03/02/2015 23:03:36\\n###EndofFile###\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Have a unique error?\",\n  \"body\": \"The catch-all fix for most errors we've come across is to download the original kit again and replace the scripts you've edited one-by-one to troubleshoot where the exact problem is.\\n\\nTo prevent future problems, always keep a backup of every script - daily backups preferably - so that if a problem occurs, you can revert to the most recent save.\"\n}\n[/block]","excerpt":"Common problems you may come across, and how to fix them.","slug":"pvp-troubleshooting","type":"basic","title":"PvP Troubleshooting"}

PvP Troubleshooting

Common problems you may come across, and how to fix them.

[block:callout] { "type": "info", "body": "To prevent problems, always make a daily backup of every script you're editing - so that if a problem occurs, you can revert to the most recent save.", "title": "Keep Daily Backups!" } [/block] If you begin to have problems with PvP, we recommend you download an original copy of the kit, add your license code, and then try a battle. The unedited kit will return you a demo village you can attack, showing that the problem isn't your connection or network. [block:api-header] { "type": "basic", "title": "Have you customized the kit?" } [/block] We recommend you use your own server as the map files from the default kit may no longer be compatible with your customized buildings. Maps may appear empty, or the battle may instantly complete reporting 0 gold/mana gained, and units lost. Upload the PvP Server Sync scripts to your web host. You can download these scripts from our download center and upload to your website like http://yoursite.com/pvp/ or https://mybucket.s3.amazonaws.com/pvp/ Then update the Server Address where you updated your License code in the two screenshots below. [block:api-header] { "type": "basic", "title": "Testing with Our Servers?" } [/block] Update the license used for both Save Load WWW and Save Load Battle. Instructions are located below in the next section. (For the Pro Kit, you'll find the URLs hardcoded in the SaveLoadWWW.cs and SaveLoadBattle.cs files - the screenshots below are from the Complete Kit which has an easier way to update the license using Unity) [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/APaJvV9GT0VIv4xfEFDs", "license.jpg", "800", "600", "", "" ], "caption": "If your license isn't set with our server software, you'll get this error." } ] } [/block] [block:api-header] { "type": "basic", "title": "Update the License Code" } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/VdRK99PWS9Gn2YIVFd18", "license1.jpg", "981", "666", "#76ae3a", "" ], "caption": "Game > GameManager > SaveLoadWWW" } ] } [/block] [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/kwl2jcchSZK6jqBEkg2e", "license2.jpg", "979", "665", "#75af3a", "" ], "caption": "Map01 > Game Manager > SaveLoadBattle" } ] } [/block] [block:api-header] { "type": "basic", "title": "Using with your own server" } [/block] [block:api-header] { "type": "basic", "title": "Does Unity hang when a random map downloads?" } [/block] **Are you using our server software demo links still?** If it doesn't load a map from our server demo, download the original development kit again, install, and run the Game.unity scene. Open competitions and a demo map should load. If it doesn't work, then there's something causing the problem on your development machine. Firewall or connection issue? Try on your mobile device over the cellular network if possible to compare. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/JzE0CBU0TUiHyLVdnfTy", "map.jpg", "800", "381", "#71ac34", "" ] } ] } [/block] **Did you change the demo links from our PvP server software to your own?** If you're using the demo server software scripts included with the Complete Kit: In our testing records, Unity will hang if your server blocks requests, alters the output of the files or has some other issue unique to your server. To troubleshoot, revert to the original https://www.citybuildingkit.com/ server software links included when you first downloaded the kit. Try to play the scene and open competitions. If it loads the enemy map, then the problem is with your server. **Was it working before on your server?** If yes -- When looking through our testing records, we have a test with Unity hanging completely and unrecoverable, if, for instance, we changed the name of the save file from USERID**_results.txt** to USERID**_attack.txt**. Although the files save correctly on the server, the demo server software scripts provided with the Complete Kit should also be updated or else the scripts won't find the file to retrieve when requested by Unity. If the server can not find a file you expect to have a certain extension/part of filename, everything hangs, and it's not just the game, the entire unity editor too. [block:api-header] { "type": "basic", "title": "Can't deploy any troops because map is empty" } [/block] In our testing, the most common cause for troops that cannot be deployed if a map contains no buildings. Technically, there's nothing for the troops to destroy. Check the maps. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/FtVJ3NrTy6Lmnt3aXLbI", "empty-map.jpg", "800", "341", "#79ab08", "" ] } ] } [/block] First, check if you have any empty maps on your server. If you're using our server scripts, look in the administration page and check for any files that have no data under the **###Buildings###** section. For example: [block:code] { "codes": [ { "code": "###StartofMapid###\nx2Ag3j0159bi\n###EndofMapid###\n###StartofFile###\n###Buildings###\n###Grass###\n4,0,-768,-90\n3,1,-384,270\n###Construction###\n###BuildingIndex###\n10\n0.00,0\n0,0,0,0,0,0,0,0,0,0,0,0\n0,0,0,0,0,0,0,0,0,0,0,0\n0,0,0,0,0,0,0,0,0,0,0,0\n###Stats###\n2410,7,3,28670.52,8169.019,591,64750,18250,605,0.2,0.2,True,False,True,True\n03/02/2015 23:03:36\n###EndofFile###", "language": "text" } ] } [/block] If all of your maps have buildings listed in **###Buildings###**, then there's a problem with your server or the link you used in the PvP. Download the original kit file again with our demo links to compare the difference. In the worst case if you can't figure out what's different, revert the specific script to the original copy. [block:api-header] { "type": "basic", "title": "I don't have any sample maps!" } [/block] With the server demo scripts included with the Complete Kit, we've provided 5 demo maps. Download the original copy you purchased and look for the server scripts. You'll see a folder called "maps" with 5 demo player maps inside like **demoplayer1.txt** **Here is an example of one:** [block:code] { "codes": [ { "code": "###StartofMapid###\ndemoplayer\n###EndofMapid###\n\n###StartofFile###\n###Buildings###\nBarrel,1,-384,270\nChessboard,2,-1280,-360\nClassroom,3,-1280,180\nForge,4,-256,-360\nGenerator,5,-768,-720\nGlobe,6,0,540\nSummon,8,384,270\nVault,7,0,0\n###Grass###\n4,0,-768,-90\n3,1,-384,270\n3,2,-1280,-360\n3,3,-1280,180\n3,4,-256,-360\n3,5,-768,-720\n3,6,0,540\n3,7,0,0\n3,8,384,270\n3,9,384,-270\n2,10,640,0\n###Construction###\nAcademy,0,15,11,0,-768,-90\nWorkshop,9,1,0,0,384,-270\nToolhouse,10,1,0,0,640,0\n###BuildingIndex###\n10\n0.00,0\n0,0,0,0,0,0,0,0,0,0,0,0\n0,0,0,0,0,0,0,0,0,0,0,0\n0,0,0,0,0,0,0,0,0,0,0,0\n###Stats###\n2410,7,3,28670.52,8169.019,591,64750,18250,605,0.2,0.2,True,False,True,True\n03/02/2015 23:03:36\n###EndofFile###", "language": "text" } ] } [/block] [block:callout] { "type": "danger", "title": "Have a unique error?", "body": "The catch-all fix for most errors we've come across is to download the original kit again and replace the scripts you've edited one-by-one to troubleshoot where the exact problem is.\n\nTo prevent future problems, always keep a backup of every script - daily backups preferably - so that if a problem occurs, you can revert to the most recent save." } [/block]