anchor.diff:    ARoot.Add(TILES_FIELD,main_array);
   end;
   
  +procedure TMapWriterVCMI.StreamTile(AJson: TJSONArray; tile: TMapTile);
  +var
  +  s: string;
  +begin
  +//  [terrain code][terrain index]
  +//[P][path type][path index]
  +//[R][river type][river index]
  +  s := TERRAIN_CODES[tile.TerType]+IntToStr(tile.TerSubType);
  +
  +  if tile.RoadType <> 0 then
  +  begin
  +    s := s + ROAD_CODES[TRoadType(tile.RoadType)]+IntToStr(tile.RoadDir);
  +  end;
  +
  +  if tile.RiverType <> 0 then
  +  begin
  +    s := s + RIVER_CODES[TRiverType(tile.RiverType)]+IntToStr(tile.RiverDir);
  +  end;
  +
  +  AJson.Add(s);
  +end;
  +
   procedure TMapWriterVCMI.StreamTilesLevel(AJson: TJSONArray; AMap: TVCMIMap;
     const Level: Integer);
   var
  
positive.code:   o: TJSONObject;
    //s: string;
    tile: TMapTile;
  begin
    for row := 0 to AMap.Height - 1 do
    begin
      for col := 0 to AMap.Width - 1 do
      begin
        //todo: string encoding
        //o:= FStreamer.ObjectToJSON(AMap.GetTile(Level,Col,Row));
        //gr55Rcb14
        tile := AMap.GetTile(Level,Col,Row);
        //s := Format('%d %d %d %d %d %d %d', [
        //  Integer(tile.TerType), tile.TerSubType,
        //  tile.RiverType,tile.RiverDir,
        //  tile.RoadType, tile.RoadDir,
        //  tile.Flags]);
        o := FStreamer.ObjectToJSON(tile);
        AJson.Add(o);
        //AJson.Add(s);
      end;
    end;
  end;
  
  
negative.code:   TMapWriterVCMI = class(TBaseMapFormatHandler, IMapWriter)
    private
      FStreamer: TVCMIJSONStreamer;
  
      procedure StreamTile(AJson: TJSONArray; tile: TMapTile);
  
      procedure StreamTilesLevel(AJson: TJSONArray; AMap: TVCMIMap; const Level: Integer);
      procedure StreamTiles(ARoot: TJSONObject; AMap: TVCMIMap);
  