Package worldBuilder

Class RPGMTiler

  • All Implemented Interfaces:
    Exporter

    public class RPGMTiler
    extends java.lang.Object
    implements Exporter
    exporter to write world map as tile numbers in RPGMaker levels
    • Constructor Summary

      Constructors 
      Constructor Description
      RPGMTiler​(java.lang.String tileRules, int width, int height)
      create a new output writer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double direction​(int row, int col)
      compass orientation of face
      double dZdX​(int row, int col)
      slope (upwards to the east)
      double dZdY​(int row, int col)
      slope (upwards to the south)
      void erodeMap​(double[][] erode)
      Up-load the net erosion/deposition for every tile
      int export_height()
      return the export height (in tiles)
      int export_width()
      return the export width (in tiles)
      void faunaMap​(double[][] soil, java.lang.String[] names)
      Up-load the fauna type for every tile
      void floraMap​(double[][] flora, java.lang.String[] names)
      Up-load the (integer) flora type for every tile
      void floraQuotas​(double grass, double brush, double trees)
      set the fraction of tiles for each flora class
      void heightMap​(double[][] heights)
      Up-load the altitude of every tile
      void highlandLevels​(int aboveGround)
      set parameters that define the altitude->level mapping
      int neededInfo()
      return list of needed map up-loads
      void position​(double lat, double lon)
      Set the lat/lon of the region being exported
      void preview​(Exporter.WhichMap chosen, java.awt.Color[] colormap)
      generate an export preview, mapping levels to colors
      void rainMap​(double[][] rain)
      Up-load the annual rainfall for every tile
      double slope​(int row, int col)
      aggregate slope
      void soilMap​(double[][] soil, java.lang.String[] names)
      Up-load the soil type for every tile
      void temps​(double meanTemp, double meanSummer, double meanWinter)
      Set seasonal temperature range for region being exported
      void tileSize​(int meters)
      Set the size of a single tile
      java.awt.Color waterColor​(int terrainType)
      water colors for flora previews
      void waterMap​(double[][] depths)
      Up-load the surface-water-depth for every tile
      boolean writeFile​(java.lang.String filename)
      write out an RPGMaker map
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x_points

        public int x_points
        map dimensions (in tiles)
      • y_points

        public int y_points
        map dimensions (in tiles)
      • Tsummer

        public double Tsummer
        seasonal mean temperatures
      • Twinter

        public double Twinter
        seasonal mean temperatures
      • heights

        public double[][] heights
        per point height (Z units)
      • erode

        public double[][] erode
        per point erosion/depostion (Z units)
      • depths

        public double[][] depths
        per point water depth (Z units)
      • soil

        public double[][] soil
        per point soil type
      • levels

        public int[][] levels
        per point terrain level
      • floraTypes

        public int[][] floraTypes
        per point flora type
      • typeMap

        public int[] typeMap
        mapping from levels to TerrainTypes
      • floraNames

        public java.lang.String[] floraNames
        map from ecotope types to names
      • colorTopo

        public java.awt.Color[] colorTopo
        level to preview color map
    • Constructor Detail

      • RPGMTiler

        public RPGMTiler​(java.lang.String tileRules,
                         int width,
                         int height)
        create a new output writer
        Parameters:
        tileRules - ... name of output file
        width - of map (in cells)
        height - of map (in cells)
    • Method Detail

      • neededInfo

        public int neededInfo()
        return list of needed map up-loads
        Specified by:
        neededInfo in interface Exporter
      • export_width

        public int export_width()
        return the export width (in tiles)
        Specified by:
        export_width in interface Exporter
      • export_height

        public int export_height()
        return the export height (in tiles)
        Specified by:
        export_height in interface Exporter
      • floraQuotas

        public void floraQuotas​(double grass,
                                double brush,
                                double trees)
        set the fraction of tiles for each flora class
        Parameters:
        grass - ... fraction of squares eligible for grass
        brush - ... fraction of squares eligible for brush
        trees - ... fraction of squares eligible for trees
      • highlandLevels

        public void highlandLevels​(int aboveGround)
        set parameters that define the altitude->level mapping
        Parameters:
        aboveGround - number of above-GROUND levels
      • writeFile

        public boolean writeFile​(java.lang.String filename)
        write out an RPGMaker map
        Specified by:
        writeFile in interface Exporter
        Parameters:
        filename - of output file
      • preview

        public void preview​(Exporter.WhichMap chosen,
                            java.awt.Color[] colormap)
        generate an export preview, mapping levels to colors
        Specified by:
        preview in interface Exporter
        Parameters:
        chosen - map type (e.g. height, flora)
        colormap - - palette to be used in preview
      • slope

        public double slope​(int row,
                            int col)
        aggregate slope
        Parameters:
        row - (tile) within the export region
        col - (tile) within the export region
        Returns:
        aggregate slope (dZdTILE) of that tile
      • dZdX

        public double dZdX​(int row,
                           int col)
        slope (upwards to the east)
        Parameters:
        row - (tile) within the export region
        col - (tile) within the export region
        Returns:
        slope upwards to the east
      • dZdY

        public double dZdY​(int row,
                           int col)
        slope (upwards to the south)
        Parameters:
        row - (tile) within the export region
        col - (tile) within the export region
        Returns:
        slope upwards to the south
      • direction

        public double direction​(int row,
                                int col)
        compass orientation of face
        Parameters:
        row - (tile) within the export region
        col - (tile) within the export region
        Returns:
        compass orientation (0-359) of face
      • tileSize

        public void tileSize​(int meters)
        Set the size of a single tile
        Specified by:
        tileSize in interface Exporter
        Parameters:
        meters - real-world width of a tile
      • position

        public void position​(double lat,
                             double lon)
        Set the lat/lon of the region being exported
        Specified by:
        position in interface Exporter
        Parameters:
        lat - real world latitude of map center
        lon - real world longitude of map center
      • temps

        public void temps​(double meanTemp,
                          double meanSummer,
                          double meanWinter)
        Set seasonal temperature range for region being exported
        Specified by:
        temps in interface Exporter
        Parameters:
        meanTemp - mean (all year) temperature
        meanSummer - mean (summer) temperature
        meanWinter - mean (winter) temperature
      • heightMap

        public void heightMap​(double[][] heights)
        Up-load the altitude of every tile
        Specified by:
        heightMap in interface Exporter
        Parameters:
        heights - height (in meters) of every point
      • erodeMap

        public void erodeMap​(double[][] erode)
        Up-load the net erosion/deposition for every tile
        Specified by:
        erodeMap in interface Exporter
        Parameters:
        erode - per point height (in meters) of soil lost to erosion negative means sedimentqation
      • rainMap

        public void rainMap​(double[][] rain)
        Up-load the annual rainfall for every tile
        Specified by:
        rainMap in interface Exporter
        Parameters:
        rain - per point depth (in meters) of annual rainfall
      • soilMap

        public void soilMap​(double[][] soil,
                            java.lang.String[] names)
        Up-load the soil type for every tile
        Specified by:
        soilMap in interface Exporter
        Parameters:
        soil - - per point soil type
        names - - per type name strings
      • waterMap

        public void waterMap​(double[][] depths)
        Up-load the surface-water-depth for every tile
        Specified by:
        waterMap in interface Exporter
        Parameters:
        depths - - per point depth of water
      • floraMap

        public void floraMap​(double[][] flora,
                             java.lang.String[] names)
        Up-load the (integer) flora type for every tile
        Specified by:
        floraMap in interface Exporter
        Parameters:
        flora - - per point flora type
        names - - per type name strings
      • faunaMap

        public void faunaMap​(double[][] soil,
                             java.lang.String[] names)
        Up-load the fauna type for every tile
        Specified by:
        faunaMap in interface Exporter
        Parameters:
        fauna - - per point fauna type
      • waterColor

        public java.awt.Color waterColor​(int terrainType)
        water colors for flora previews
        Parameters:
        terrainType -