Beispiel #1
0
    /*
     * set ecosystem parameters,
     * create resources,
     * create map,
     * add resource to map
     * */
    public void createEcosystem(int mapWidth)
    {
        ecosystem = new Ecosystem();

        ecoCreator = new EcosystemEditor(ecosystem);

        // set basic ecosystem parameters
        EcoCreationHelper.setEcoParams(ecoCreator, 10, 32, 50, true, false, false);

        // create grass
        EcoCreationHelper.addResource(ecoCreator, "energy", 200, 250, 1, .5f, 8f);
        ecoCreator.saveResource();


        EcoCreationHelper.addResource(ecoCreator, "vitamin", 1f, 20, 1, .1f, 1f);
        ecoCreator.saveResource();

        ecoCreator.saveResourceOptions(); // adds all resources to ecosystem resources


        // generate map
        ecoCreator.createMap();
        // TODO: account for asymetric maps
        ecoCreator.mapEditor.generateMap(mapWidth, mapWidth);
        // islands: 300, .8, 50, 30
        // barriers: 300, .8, 100, 30 (creature pop 2000 for barely survive)
        //ecoCreator.mapEditor.addClusteredResource("grass", 1f, 100, 30);
        ecoCreator.mapEditor.addLERPXResource("energy", 1f);
        ecoCreator.mapEditor.addUniformResource("vitamin", .5f);
        ecoCreator.saveEditedMap(); // saves to tentative map
        ecoCreator.saveMap();       // saves to ecosystem map
    }
Beispiel #2
0
    /*
     * set ecosystem parameters,
     * create resources,
     * create map,
     * add resource to map
     * */
    public void createEcosystem(int mapWidth)
    {
        ecosystem = new Ecosystem();

        ecoCreator = new EcosystemEditor(ecosystem);
        // set basic ecosystem parameters
        EcoCreationHelper.setEcoParams(ecoCreator, 10, 4, 50, false, true, false);

        // create resources A, B, and C
        EcoCreationHelper.addResource(ecoCreator, "A", 100, 150, 10, .4f, 1f);
        ecoCreator.saveResource();

        EcoCreationHelper.addResource(ecoCreator, "B", 100, 150, 10, .4f, 1f);
        ecoCreator.saveResource();


        EcoCreationHelper.addResource(ecoCreator, "C", 100, 150, 10, .2f, 0); // not renewed
        ecoCreator.saveResource();

        EcoCreationHelper.addResource(ecoCreator, "D", 100, 150, 10, .2f, 0); // not renewed
        ecoCreator.saveResource();

        ecoCreator.saveResourceOptions(); // adds all resources to ecosystem resources

        // generate map
        ecoCreator.createMap();
        // max size ~ 320 X 320 (100,000 cells)
        // TODO: account for asymetric maps
        ecoCreator.mapEditor.generateMap(mapWidth, mapWidth);
        ecoCreator.mapEditor.addClusteredResource("A", .8f, 100, 30);
        ecoCreator.mapEditor.addClusteredResource("B", .8f, 100, 30);
        // small starting amount of B and C
        ecoCreator.mapEditor.addUniformResource("C", .2f);
        ecoCreator.mapEditor.addUniformResource("D", .2f);
        ecoCreator.saveEditedMap(); // saves to tentative map
        ecoCreator.saveMap();       // saves to ecosystem map
    }