// 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
}//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.
/*
Add some random stone obstacles
*/
-
- for(u32 ri=0; ri<15; ri++)
+
+ for(u32 ri=0; ri<stone_obstacle_amount/3; ri++)
+ //for(u32 ri=0; ri<7; ri++)
+ //if(0)
{
// Randomize max height so usually stuff will be quite low
- s16 maxheight_randomized = myrand_range(0, 30);
+ //s16 maxheight_randomized = myrand_range(0, 25);
+ s16 maxheight_randomized = myrand_range(0, stone_obstacle_amount/3);
// The size of these could actually be m_chunksize*MAP_BLOCKSIZE*2
v3s16 ob_size(
s16 max_tunnel_diameter = 5;
u16 tunnel_routepoints = 15;
- bool bruise_surface = (jj < dungeons_count / 3);
+ u32 bruise_surface_maxindex =
+ dungeons_count / 10 * stone_surface_max_y / 10;
+ bruise_surface_maxindex =
+ rangelim(bruise_surface_maxindex, 0, dungeons_count/2);
+ bool bruise_surface = (jj < bruise_surface_maxindex);
if(bruise_surface)
{
// Find ground level
s16 surface_y = find_ground_level(vmanip, p2d);
+ /*
+ If topmost node is grass, change it to mud.
+ It might be if it was flown to there from a neighboring
+ chunk and then converted.
+ */
+ {
+ u32 i = vmanip.m_area.index(v3s16(p2d.X, surface_y, p2d.Y));
+ MapNode *n = &vmanip.m_data[i];
+ if(n->d == CONTENT_GRASS)
+ n->d = CONTENT_MUD;
+ }
+
/*
Add mud on ground
*/
// 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
}
}//timer1
+
+ } // Aging loop
+
{
// 1ms @cs=8
//TimeTaker timer1("plant trees");
}
}//timer1
+
{
// 19ms @cs=8
//TimeTaker timer1("grow grass");
continue;
}
+#if 0
+ /*
+ NOTE: We can't know the ground level this way with the
+ new generator.
+ */
if(haxmode)
{
/*
continue;
}
}
+#endif
/*
Check if map has this block
// Don't add a node if this is not a free space
MapNode n2 = m_env.getMap().getNode(p_over);
if(content_buildable_to(n2.d) == false)
+ {
+ // Client probably has wrong data.
+ // Set block not sent, so that client will get
+ // a valid one.
+ dstream<<"Client "<<peer_id<<" tried to place"
+ <<" node in invalid position; setting"
+ <<" MapBlock not sent."<<std::endl;
+ RemoteClient *client = getClient(peer_id);
+ v3s16 blockpos = getNodeBlockPos(p_over);
+ client->SetBlockNotSent(blockpos);
return;
+ }
}
catch(InvalidPositionException &e)
{
*/
player->setPosition(intToFloat(v3s16(
0,
- 50,
+ 64,
0
)));
#if 1
player->setPosition(intToFloat(v3s16(
0,
- 50,
+ 64,
0
)));
#endif