NOTE: There are some lighting-related todos and fixmes in\r
ServerMap::emergeBlock. And there always will be. 8)\r
\r
-TODO: Map generator version 2\r
+FEATURE: Map generator version 2\r
- Create surface areas based on central points; a given point's\r
area type is given by the nearest central point\r
- Separate points for heightmap, caves, plants and minerals?\r
where some minerals are found\r
- Create a system that allows a huge amount of different "map\r
generator modules/filters"\r
+ \r
+FEATURE: The map could be generated procedually:\r
+ - This would need the map to be generated in larger pieces\r
+ - How large? How do they connect to each other?\r
+ * Make the stone level with a heightmap\r
+ * Carve out stuff in the stone\r
+ * Dump dirt all around, and simulate it falling off steep\r
+ places\r
+ * Erosion simulation at map generation time\r
+ - Simulate water flows, which would carve out dirt fast and\r
+ then turn stone into gravel and sand and relocate it.\r
+ - How about relocating minerals, too? Coal and gold in\r
+ downstream sand and gravel would be kind of cool\r
+ - This would need a better way of handling minerals, mainly\r
+ to have mineral content as a separate field\r
+ - Simulate rock falling from cliffs when water has removed\r
+ enough solid rock from the bottom\r
\r
TODO: Change AttributeList to split the area into smaller sections so\r
that searching won't be as heavy.\r
-TODO: Change AttributeList to be 2D, as it would be too slow to search\r
- in 3D fields anyway.\r
\r
TODO: Remove HMParams\r
\r
TODO: Flowing water to actually contain flow direction information\r
\r
TODO: Remove duplicate lighting implementation from Map (leave\r
- VoxelManipulator)\r
+ VoxelManipulator, which is faster)\r
\r
Doing now:\r
----------\r
float randmax = 0;
float randfactor = 0;
- if(myrand()%5 == 0)
+ /*if(myrand()%5 == 0)
{
baseheight = 100;
randmax = 50;
baseheight = -3;
randmax = 20;
randfactor = 0.5;
- }
+ }*/
+
+ baseheight = 0;
+ randmax = 15;
+ randfactor = 0.63;
list_baseheight->addPoint(p, Attribute(baseheight));
list_randmax->addPoint(p, Attribute(randmax));
if(version >= 10)
{
- // Get and compress pressure
- SharedBuffer<u8> pressuredata(nodecount);
+ // Get and compress param2
+ SharedBuffer<u8> param2data(nodecount);
for(u32 i=0; i<nodecount; i++)
{
- pressuredata[i] = data[i].pressure;
+ param2data[i] = data[i].param2;
}
- compress(pressuredata, os, version);
+ compress(param2data, os, version);
}
}
// All other versions (newest)
databuf[i+nodecount] = data[i].param;
}
- // Get pressure
+ // Get param2
for(u32 i=0; i<nodecount; i++)
{
- databuf[i+nodecount*2] = data[i].pressure;
+ databuf[i+nodecount*2] = data[i].param2;
}
/*
if(version >= 10)
{
- // Uncompress and set pressure data
+ // Uncompress and set param2 data
std::ostringstream os(std::ios_base::binary);
decompress(is, os, version);
std::string s = os.str();
("MapBlock::deSerialize: invalid format");
for(u32 i=0; i<s.size(); i++)
{
- data[i].pressure = s[i];
+ data[i].param2 = s[i];
}
}
}
{
data[i].param = s[i+nodecount];
}
- // Set pressure
+ // Set param2
for(u32 i=0; i<nodecount; i++)
{
- data[i].pressure = s[i+nodecount*2];
+ data[i].param2 = s[i+nodecount*2];
}
}
}
union
{
u8 param2;
-
- /*
- Pressure for liquids
- */
- u8 pressure;
/*
Direction for torches and other stuff.
*this = n;
}
- MapNode(u8 data=CONTENT_AIR, u8 a_param=0, u8 a_pressure=0)
+ MapNode(u8 data=CONTENT_AIR, u8 a_param=0, u8 a_param2=0)
{
d = data;
param = a_param;
- pressure = a_pressure;
+ param2 = a_param2;
}
bool operator==(const MapNode &other)
{
return (d == other.d
&& param == other.param
- && pressure == other.pressure);
+ && param2 == other.param2);
}
bool light_propagates()
{
dest[0] = d;
dest[1] = param;
- dest[2] = pressure;
+ dest[2] = param2;
}
}
void deSerialize(u8 *source, u8 version)
{
d = source[0];
param = source[1];
- pressure = source[2];
+ param2 = source[2];
}
}
};
#include "main.h"
#include <string>
-// A mapping from tiles to paths of textures
-
-/*const char * g_tile_texture_filenames[TILES_COUNT] =
-{
- NULL,
- "stone.png",
- "water.png",
- "grass.png",
- "tree.png",
- "leaves.png",
- "grass_footsteps.png",
- "mese.png",
- "mud.png",
- "tree_top.png",
- "mud.png_sidegrass",
- "cloud.png",
- "coalstone.png",
- "wood.png",
-};*/
-
/*
These can either be real paths or generated names of preloaded
textures (like "mud.png_sidegrass")
*/
std::string g_tile_texture_paths[TILES_COUNT];
-/*std::string g_tile_texture_path_strings[TILES_COUNT];
-const char * g_tile_texture_paths[TILES_COUNT] = {0};
-
-void init_tile_texture_paths()
-{
- for(s32 i=0; i<TILES_COUNT; i++)
- {
- const char *filename = g_tile_texture_filenames[i];
-
- if(filename != NULL)
- {
- g_tile_texture_path_strings[i] =
- porting::getDataPath(filename);
- g_tile_texture_paths[i] =
- g_tile_texture_path_strings[i].c_str();
- }
- }
-}*/
-
const char * tile_texture_path_get(u32 i)
{
assert(i < TILES_COUNT);
{
c = 'X';
u8 m = m_data[m_area.index(x,y,z)].d;
- u8 pr = m_data[m_area.index(x,y,z)].pressure;
+ u8 pr = m_data[m_area.index(x,y,z)].param2;
if(mode == VOXELPRINT_MATERIAL)
{
if(m <= 9)