From 3d6e71a7d0d100e4d59464adcf8f0a09e6a20ad8 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 1 Feb 2011 20:28:21 +0200 Subject: end-of-day. --- src/map.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index a62694269..846581305 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1914,7 +1914,8 @@ ServerMap::ServerMap(std::string savedir, HMParams hmp, MapParams mp): // Add only one entry list_baseheight->addPoint(v3s16(0,0,0), Attribute(0)); - list_randmax->addPoint(v3s16(0,0,0), Attribute(30)); + list_randmax->addPoint(v3s16(0,0,0), Attribute(22)); + //list_randmax->addPoint(v3s16(0,0,0), Attribute(0)); list_randfactor->addPoint(v3s16(0,0,0), Attribute(0.45)); // Easy spawn point @@ -2304,6 +2305,22 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, }//timer1 + /* + Randomize some parameters + */ + + // 0-100 + // Usually little, sometimes huge + //u32 stone_obstacle_amount = myrand_range(0, myrand_range(0, 100)); + u32 stone_obstacle_amount = myrand_range(0, 100); + + /* + Loop this part, it will make stuff look older and newer nicely + */ + + for(u32 i_age=0; i_age<2; i_age++) + { // Aging loop + // This is set during the next operation. // Maximum height of the stone surface and obstacles. // This is used to disable dungeon generation from going too high. @@ -2316,11 +2333,14 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, /* Add some random stone obstacles */ - - for(u32 ri=0; ri<15; ri++) + + for(u32 ri=0; rid == CONTENT_GRASS) + n->d = CONTENT_MUD; + } + /* Add mud on ground */ @@ -2779,9 +2815,12 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, // If not mud, do nothing to it MapNode *n = &vmanip.m_data[i]; - if(n->d != CONTENT_MUD) + if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS) continue; + // Make it exactly mud + n->d = CONTENT_MUD; + v3s16 dirs4[4] = { v3s16(0,0,1), // back v3s16(1,0,0), // right @@ -2923,6 +2962,9 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, } }//timer1 + + } // Aging loop + { // 1ms @cs=8 //TimeTaker timer1("plant trees"); @@ -2951,6 +2993,7 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, } }//timer1 + { // 19ms @cs=8 //TimeTaker timer1("grow grass"); -- cgit v1.2.3