PvP Troubleshooting

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

👍

Reminder - Keep Daily Backups!

When working on a strategy game with a kit as big as the Complete Kit - always keep a working daily backup! Save yourself the trouble of rolling-back changes if problems occur and losing work.

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.

Have you customized the kit?

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/

Then update the Server Address where you updated your License code in the two screenshots below.

Testing with Our Servers?

Update the license used for both Game scene GameManager > SaveLoadWWW and Map01 scene GameManager > SaveLoadBattle. 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)

800

If your license isn't set with our server software, you'll get this error. Click on image to view larger

Make sure you've update your License Code

981

Game > GameManager > SaveLoadWWW. Click on image to view larger

979

Map01 > Game Manager > SaveLoadBattle. Click on image to view larger

Using with your own server

Follow the Installation Instructions in the Online Server Sync section of the documentation for how to setup PvP with your own server.

Does Unity hang when a random map downloads?

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.

800

Click on image to view larger

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 http://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.

Can't deploy any troops because map is empty

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.

800

Click on image to view larger

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, you'll see the list under ###Buildings### is blank here:

###StartofMapid###
x2Ag3j0159bi
###EndofMapid###
###StartofFile###
###Buildings###
###Grass###
4,0,-768,-90
3,1,-384,270
###Construction###
###BuildingIndex###
10
0.00,0
0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0
###Stats###
2410,7,3,28670.52,8169.019,591,64750,18250,605,0.2,0.2,True,False,True,True
03/02/2015 23:03:36
###EndofFile###

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.

Can't deploy troops anywhere next to unit deployment menu?

There is a blind spot around the menu, we reduced it in the latest version. The problem was that while clicking on buttons, the squares underneath got selected for unit deployment. This blind spot is used to keep the user from accidentally selecting a spot under the menu when deploying.

I don't have any sample maps!

With the server demo scripts included with the Complete Kit, we've provided demo maps. Download the original copy you purchased and look for the server scripts. You'll see a maps folder with demo player maps and campaign maps inside like demoplayer5.txt

Here is an example of one:

###StartofFile###
###PosStruct###
Weapon,ArcherTower,136,2,-128,-724
Weapon,ArcherTower,137,2,1024,90.5
Building,Vault,138,3,-1024,0
Building,Vault,139,3,0,724
Building,Summon,140,3,0,0
###GridStruct###
WoodFence,WoodFenceNE,93,22,16
WoodFence,WoodFenceNE,94,22,17
WoodFence,WoodFenceNE,95,22,18
WoodFence,WoodFenceNE,96,22,19
WoodFence,WoodFenceNE,97,22,20
WoodFence,WoodFenceNE,98,22,21
WoodFence,WoodFenceNE,99,22,22
WoodFence,WoodFenceNE,100,22,23
WoodFence,WoodFenceNE,101,22,15
WoodFence,WoodFenceNE,102,22,14
WoodFence,WoodFenceNE,103,22,13
WoodFence,WoodFenceNW,104,21,12
WoodFence,WoodFenceNW,105,20,12
WoodFence,WoodFenceNW,106,19,12
WoodFence,WoodFenceNW,107,18,12
WoodFence,WoodFenceNW,108,17,12
WoodFence,WoodFenceNW,109,16,12
WoodFence,WoodFenceNW,110,15,12
WoodFence,WoodFenceNW,111,14,12
WoodFence,WoodFenceNW,112,13,12
WoodFence,WoodFenceNW,113,12,12
WoodFence,WoodCornerW,114,22,12
WoodFence,WoodCornerN,115,22,24
WoodFence,WoodFenceNW,116,21,24
WoodFence,WoodFenceNW,117,20,24
WoodFence,WoodFenceNW,118,19,24
WoodFence,WoodFenceNW,119,18,24
WoodFence,WoodFenceNW,120,17,24
WoodFence,WoodFenceNW,121,16,24
WoodFence,WoodFenceNW,122,15,24
WoodFence,WoodFenceNW,123,14,24
WoodFence,WoodFenceNW,124,13,24
WoodFence,WoodFenceNW,125,12,24
WoodFence,WoodCornerE,126,11,24
WoodFence,WoodCornerS,127,11,12
WoodFence,WoodFenceNE,128,11,13
WoodFence,WoodFenceNE,129,11,14
WoodFence,WoodFenceNE,130,11,23
WoodFence,WoodFenceNE,131,11,22
WoodFence,WoodCornerN,132,11,15
WoodFence,WoodCornerW,133,11,21
WoodFence,WoodEndSE,134,10,21
WoodFence,WoodEndSE,135,10,15
###Construction###
###Removables###
TreeC,0,0,2,10
TreeC,1,0,2,13
TreeD,2,0,2,26
TreeC,3,0,4,12
ClamC,4,0,4,13
TreeA,5,0,4,23
TreeB,6,0,4,26
TreeC,7,0,4,32
TreeC,8,0,5,8
ClamA,9,0,5,16
TreeB,10,0,5,26
TreeA,11,0,5,28
TreeC,12,0,6,2
TreeB,13,0,6,23
TreeB,14,0,6,33
TreeA,15,0,7,7
ClamB,16,0,7,10
ClamB,17,0,7,18
TreeC,19,0,8,30
TreeD,20,0,9,5
TreeC,22,0,9,28
TreeC,23,0,9,30
ClamC,24,0,10,2
ClamA,25,0,10,10
TreeB,28,0,11,4
ClamC,31,0,12,10
TreeD,32,0,12,11
ClamC,35,0,12,25
TreeB,36,0,12,28
TreeA,38,0,13,33
TreeD,39,0,14,8
ClamB,41,0,14,28
TreeC,42,0,15,4
TreeC,43,0,15,7
ClamB,45,0,15,28
ClamA,46,0,16,4
ClamC,48,0,16,31
ClamC,49,0,16,32
ClamC,51,0,17,25
ClamB,52,0,17,28
ClamA,53,0,17,29
TreeB,54,0,17,30
ClamC,55,0,18,3
ClamC,57,0,18,25
TreeB,58,0,18,26
TreeA,59,0,20,29
TreeA,60,0,21,10
TreeC,63,0,21,28
TreeC,64,0,21,29
ClamC,65,0,22,11
TreeC,66,0,23,5
ClamA,67,0,23,28
ClamC,68,0,24,3
TreeA,69,0,24,16
ClamA,70,0,24,20
TreeD,71,0,25,9
TreeA,72,0,25,19
TreeB,73,0,25,23
TreeA,74,0,26,33
TreeB,75,0,27,19
TreeD,76,0,28,3
ClamB,77,0,28,7
ClamA,78,0,28,14
ClamB,79,0,28,23
TreeB,80,0,28,25
ClamA,81,0,28,29
TreeB,82,0,29,9
TreeB,83,0,29,16
TreeB,84,0,29,24
ClamC,85,0,30,5
ClamC,86,0,30,6
TreeC,87,0,30,23
TreeB,88,0,30,25
TreeA,89,0,30,31
TreeB,90,0,32,9
TreeA,91,0,32,13
TreeC,92,0,33,12
###RemovableTimers###
###Numerics###
140,135,137
0.00,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
###Stats###
140,683,1,0,0,100,93700,96700,2,505000,500000,5,True,True,True,True,True
11/10/2016 9:47:10 PM
###EndofFile###

❗️

Have a unique error?

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.

To 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.