out = {}
for(var townid in ITowns.towns) {
    out[townid] = {}
    out[townid].units = ITowns.towns[townid].units()
    out[townid].support = ITowns.towns[townid].unitsSupport()
    out[townid].outer = ITowns.towns[townid].unitsOuter()
    out[townid].resources = ITowns.towns[townid].resources()
    out[townid].buildings = ITowns.towns[townid].buildings().getBuildings()
    out[townid].researches = ITowns.towns[townid].researches().attributes
}
var json = JSON.stringify(out)