diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbe928f --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +Makefile +CMakeCache.txt +CMakeFiles +cmake_install.cmake +config.py +craft +world +env +log.txt +*.o +*.db +*.exe +*.dll +*.pyc + diff --git a/CMakeCache.txt b/CMakeCache.txt index b3e7d8d..dddc043 100644 --- a/CMakeCache.txt +++ b/CMakeCache.txt @@ -208,6 +208,9 @@ Omicron_BINARY_DIR:STATIC=/home/tux/Dev ++/Omicron //Value Computed by CMake Omicron_SOURCE_DIR:STATIC=/home/tux/Dev ++/Omicron +//pkg-config executable +PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config + //Path to a library. RT_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/librt.so @@ -547,10 +550,36 @@ DOXYGEN_EXECUTABLE-ADVANCED:INTERNAL=1 FIND_PACKAGE_MESSAGE_DETAILS_CURL:INTERNAL=[/usr/lib/x86_64-linux-gnu/libcurl.so][/usr/include/x86_64-linux-gnu][v7.52.1()] //Details about finding OpenGL FIND_PACKAGE_MESSAGE_DETAILS_OpenGL:INTERNAL=[/usr/lib/x86_64-linux-gnu/libGL.so][/usr/include][v()] +//Details about finding PkgConfig +FIND_PACKAGE_MESSAGE_DETAILS_PkgConfig:INTERNAL=[/usr/bin/pkg-config][v0.29()] //Details about finding Threads FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()] //Details about finding X11 FIND_PACKAGE_MESSAGE_DETAILS_X11:INTERNAL=[/usr/lib/x86_64-linux-gnu/libX11.so][/usr/include] +GTK3_CFLAGS:INTERNAL= +GTK3_CFLAGS_I:INTERNAL= +GTK3_CFLAGS_OTHER:INTERNAL= +GTK3_FOUND:INTERNAL= +GTK3_INCLUDEDIR:INTERNAL= +GTK3_LIBDIR:INTERNAL= +GTK3_LIBS:INTERNAL= +GTK3_LIBS_L:INTERNAL= +GTK3_LIBS_OTHER:INTERNAL= +GTK3_LIBS_PATHS:INTERNAL= +GTK3_PREFIX:INTERNAL= +GTK3_STATIC_CFLAGS:INTERNAL= +GTK3_STATIC_CFLAGS_I:INTERNAL= +GTK3_STATIC_CFLAGS_OTHER:INTERNAL= +GTK3_STATIC_LIBDIR:INTERNAL= +GTK3_STATIC_LIBS:INTERNAL= +GTK3_STATIC_LIBS_L:INTERNAL= +GTK3_STATIC_LIBS_OTHER:INTERNAL= +GTK3_STATIC_LIBS_PATHS:INTERNAL= +GTK3_VERSION:INTERNAL= +GTK3_gtk+-3.0_INCLUDEDIR:INTERNAL= +GTK3_gtk+-3.0_LIBDIR:INTERNAL= +GTK3_gtk+-3.0_PREFIX:INTERNAL= +GTK3_gtk+-3.0_VERSION:INTERNAL= //ADVANCED property for variable: MATH_LIBRARY MATH_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: OPENGL_INCLUDE_DIR @@ -561,6 +590,8 @@ OPENGL_gl_LIBRARY-ADVANCED:INTERNAL=1 OPENGL_glu_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: OPENGL_xmesa_INCLUDE_DIR OPENGL_xmesa_INCLUDE_DIR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE +PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1 //ADVANCED property for variable: RT_LIBRARY RT_LIBRARY-ADVANCED:INTERNAL=1 //ADVANCED property for variable: X11_ICE_INCLUDE_PATH diff --git a/CMakeFiles/omicron.dir/C.includecache b/CMakeFiles/omicron.dir/C.includecache index 3845889..2237521 100644 --- a/CMakeFiles/omicron.dir/C.includecache +++ b/CMakeFiles/omicron.dir/C.includecache @@ -451,6 +451,10 @@ config.h /home/tux/Dev ++/Omicron/src/config.h /home/tux/Dev ++/Omicron/src/worldgen/base_terrain.c +stdio.h +- +stdlib.h +- base_terrain.h /home/tux/Dev ++/Omicron/src/worldgen/base_terrain.h noise.h diff --git a/CMakeFiles/omicron.dir/src/cube.c.o b/CMakeFiles/omicron.dir/src/cube.c.o index eefc789..4c94fa1 100644 Binary files a/CMakeFiles/omicron.dir/src/cube.c.o and b/CMakeFiles/omicron.dir/src/cube.c.o differ diff --git a/CMakeFiles/omicron.dir/src/inventory.c.o b/CMakeFiles/omicron.dir/src/inventory.c.o index 95c70a7..9fc6fc9 100644 Binary files a/CMakeFiles/omicron.dir/src/inventory.c.o and b/CMakeFiles/omicron.dir/src/inventory.c.o differ diff --git a/CMakeFiles/omicron.dir/src/item.c.o b/CMakeFiles/omicron.dir/src/item.c.o index 34acf29..a5c2daa 100644 Binary files a/CMakeFiles/omicron.dir/src/item.c.o and b/CMakeFiles/omicron.dir/src/item.c.o differ diff --git a/CMakeFiles/omicron.dir/src/main.c.o b/CMakeFiles/omicron.dir/src/main.c.o index 9325fde..8d72dfb 100644 Binary files a/CMakeFiles/omicron.dir/src/main.c.o and b/CMakeFiles/omicron.dir/src/main.c.o differ diff --git a/CMakeFiles/omicron.dir/src/parser.c.o b/CMakeFiles/omicron.dir/src/parser.c.o index 2dd7aa4..62e5a21 100644 Binary files a/CMakeFiles/omicron.dir/src/parser.c.o and b/CMakeFiles/omicron.dir/src/parser.c.o differ diff --git a/CMakeFiles/omicron.dir/src/rendering.c.o b/CMakeFiles/omicron.dir/src/rendering.c.o index 6dc6dbb..5bf85da 100644 Binary files a/CMakeFiles/omicron.dir/src/rendering.c.o and b/CMakeFiles/omicron.dir/src/rendering.c.o differ diff --git a/CMakeFiles/omicron.dir/src/worldgen/base_terrain.c.o b/CMakeFiles/omicron.dir/src/worldgen/base_terrain.c.o index 1231533..fb73705 100644 Binary files a/CMakeFiles/omicron.dir/src/worldgen/base_terrain.c.o and b/CMakeFiles/omicron.dir/src/worldgen/base_terrain.c.o differ diff --git a/CMakeFiles/omicron.dir/src/worldgen/biome_mesa.c.o b/CMakeFiles/omicron.dir/src/worldgen/biome_mesa.c.o index e01abed..1517b16 100644 Binary files a/CMakeFiles/omicron.dir/src/worldgen/biome_mesa.c.o and b/CMakeFiles/omicron.dir/src/worldgen/biome_mesa.c.o differ diff --git a/CMakeFiles/omicron.dir/src/worldgen/biome_rainforest.c.o b/CMakeFiles/omicron.dir/src/worldgen/biome_rainforest.c.o index a75d078..c8e40fa 100644 Binary files a/CMakeFiles/omicron.dir/src/worldgen/biome_rainforest.c.o and b/CMakeFiles/omicron.dir/src/worldgen/biome_rainforest.c.o differ diff --git a/CMakeFiles/omicron.dir/src/worldgen/biome_temperate.c.o b/CMakeFiles/omicron.dir/src/worldgen/biome_temperate.c.o index 390966d..a9e8106 100644 Binary files a/CMakeFiles/omicron.dir/src/worldgen/biome_temperate.c.o and b/CMakeFiles/omicron.dir/src/worldgen/biome_temperate.c.o differ diff --git a/CMakeFiles/omicron.dir/src/worldgen/world.c.o b/CMakeFiles/omicron.dir/src/worldgen/world.c.o index 68ecf83..ea9f1b1 100644 Binary files a/CMakeFiles/omicron.dir/src/worldgen/world.c.o and b/CMakeFiles/omicron.dir/src/worldgen/world.c.o differ diff --git a/README.md b/README.md index cc50db7..32c38c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -## Omicron by azekill_DIABLO +## Omicron by azekill_DIABLO > pre-release 0.2 + +This game is a voxelly sandbox-game with procedurally generated world! Fork of CraftNG by Twetzel59 which is also a Fork of Michael Fogleman's Minecraft clone for Windows, Mac OS X and Linux. @@ -29,7 +31,7 @@ Linux release : ** ### Running the game Mac and Windows: Click on the executable file, the game should run. -Linux: Open terminal in the directory of the game and type ./omicron` +Linux: Open terminal in the directory of the game and type `./omicron` See below to run from source. @@ -42,15 +44,15 @@ Download and install [CMake](http://www.cmake.org/cmake/resources/software.html) if you don't already have it. You may use [Homebrew](http://brew.sh) to simplify the installation: - brew install cmake + `brew install cmake` #### Linux (Ubuntu) - sudo apt-get install cmake libglew-dev xorg-dev libcurl4-openssl-dev - sudo apt-get build-dep glfw + `sudo apt-get install cmake libglew-dev xorg-dev libcurl4-openssl-dev + sudo apt-get build-dep glfw` - *Under debian (tested under AntiX) it seems you need to run each install - of the first line separately in order to install without errors.* +*Under debian (tested under AntiX) it seems you need to run each install +of the first line separately in order to install without errors.* #### Windows @@ -62,17 +64,17 @@ CURL/lib and CURL/include are in your Program Files directory. Use the following commands in place of the ones described in the next section. - cmake -G "MinGW Makefiles" - mingw32-make + `cmake -G "MinGW Makefiles" + mingw32-make` ### Compile and Run Once you have the dependencies (see above), install the sources and open the terminal in the dowloaded source directory. Run the following commands : - cmake . + `cmake . make - ./omicron + ./craft` ### Multiplayer diff --git a/auth.db b/auth.db deleted file mode 100644 index 3932d7b..0000000 Binary files a/auth.db and /dev/null differ diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..e3aec54 Binary files /dev/null and b/logo.png differ diff --git a/omicron b/omicron index 3e18e66..457eceb 100644 Binary files a/omicron and b/omicron differ diff --git a/src/cube.c b/src/cube.c index 5a616e5..b77700b 100644 --- a/src/cube.c +++ b/src/cube.c @@ -116,10 +116,12 @@ void make_cube( int wbottom = blocks[w][3]; int wfront = blocks[w][4]; int wback = blocks[w][5]; + make_cube_faces( data, ao, light, left, right, top, bottom, front, back, wleft, wright, wtop, wbottom, wfront, wback, + //left, right, top, bottom, front, back, x, y, z, n, noncube_type(w)); } diff --git a/src/cube.h b/src/cube.h index 61738e7..480cd3d 100644 --- a/src/cube.h +++ b/src/cube.h @@ -13,7 +13,7 @@ void make_cube( float *data, float ao[6][4], float light[6][4], int left, int right, int top, int bottom, int front, int back, float x, float y, float z, float n, int w); - + void make_plant( float *data, float ao, float light, float px, float py, float pz, float n, int w, float rotation); diff --git a/src/item.c b/src/item.c index 5cede48..6e7035f 100644 --- a/src/item.c +++ b/src/item.c @@ -6,6 +6,7 @@ const int items[] = { Item_GRASS, Item_SAND, Item_STONEBRICK, + Item_SLAB_LOWER_STONEBRICK, Item_BRICK, Item_WOOD, Item_STONE, @@ -23,7 +24,10 @@ const int items[] = { Item_WATER, Item_CACTUS, Item_PLAYER, - Item_SLAB_LOWER_STONEBRICK, + Item_COAL_ORE, + Item_IRON_ORE, + Item_GOLD_ORE, + Item_RUBIS_ORE, //Flowers Item_TALL_GRASS, @@ -151,8 +155,12 @@ const int blocks[256][6] = { {0, 0, 0, 0, 0, 0}, // 66 {0, 0, 0, 0, 0, 0}, // 67 {2, 2, 2, 2, 2, 2}, // 68 - stonebrick slab - {255, 255, 211, 255, 255, 255}, // 69 - water + {211, 211, 211, 211, 211, 211}, // 69 - water {212, 212, 212, 212, 212, 212}, // 70 - core shell + {64, 64, 64, 64, 64, 64}, // 71 - coal ore + {65, 65, 65, 65, 65, 65}, // 72 - iron ore + {66, 66, 66, 66, 66, 66}, // 73 - gold ore + {67, 67, 67, 67, 67, 67}, // 74 - rubis ore {0, 0, 0, 0, 0, 0} // 71 - empty }; @@ -227,7 +235,7 @@ int is_transparent(int w) { case Item_EMPTY: case Item_GLASS: //case Item_LEAVES: for better performance (8 fps -> 60fps OPTIMIZATION NEEDED!) - case Item_WATER: //Just to stop Xray-ing :D + case Item_WATER: //Just to stop Xray-ing return 1; default: return 0; @@ -239,7 +247,7 @@ int is_destructable(int w) { case Item_EMPTY: case Item_CLOUD: case Item_CORESHELL: - //case Item_WATER + case Item_WATER: return 0; default: return 1; @@ -249,6 +257,16 @@ int is_destructable(int w) { int buildable_to(int w) { switch (w) { case Item_WATER: + case Item_CLOUD: + case Item_TALL_GRASS: + case Item_YELLOW_FLOWER: + case Item_RED_FLOWER: + case Item_PURPLE_FLOWER: + case Item_SUN_FLOWER: + case Item_WHITE_FLOWER: + case Item_BLUE_FLOWER: + case Item_VINE: + case Item_CACTI: return 0; default: return 1; @@ -258,7 +276,6 @@ int buildable_to(int w) { int is_climbable(int w) { switch(w) { case Item_VINE: - //case Item_WATER: return 1; default: return 0; diff --git a/src/item.h b/src/item.h index 7984a35..22633df 100644 --- a/src/item.h +++ b/src/item.h @@ -65,6 +65,10 @@ typedef enum { Item_SLAB_LOWER_STONEBRICK, Item_WATER, Item_CORESHELL, + Item_COAL_ORE, + Item_IRON_ORE, + Item_GOLD_ORE, + Item_RUBIS_ORE, Item_max } Item; diff --git a/src/main.c b/src/main.c index fbfccfd..7ce95e2 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include #include #include +//#include #include "attrib.h" #include "auth.h" #include "chunk.h" @@ -835,6 +836,7 @@ void compute_chunk(WorkerItem *item) { int y = ey - oy; int z = ez - oz; int w = ew; + // TODO: this should be unnecessary if (x < 0 || y < 0 || z < 0) { continue; @@ -847,6 +849,35 @@ void compute_chunk(WorkerItem *item) { if (opaque[XYZ(x, y, z)]) { highest[XZ(x, z)] = MAX(highest[XZ(x, z)], y); } + + /* + if (!is_transparent(w)) { + + if (!opaque[XYZ(x, y + 1, z)]) { + opaque[XYZ(x, y + 1, z)]; + } + + if (!opaque[XYZ(x, y - 1, z)] && (ey > 0)) { + opaque[XYZ(x, y - 1, z)]; + } + + if (!opaque[XYZ(x + 1, y, z)]){ + opaque[XYZ(x + 1, y, z)]; + } + + if (!opaque[XYZ(x - 1, y, z)]){ + opaque[XYZ(x - 1, y, z)]; + } + + if (!opaque[XYZ(x, y, z + 1)]){ + opaque[XYZ(x, y, z + 1)]; + } + + if (!opaque[XYZ(x, y, z - 1)]){ + opaque[XYZ(x, y, z - 1)]; + } + } + */ } END_MAP_FOR_EACH; } } @@ -2011,31 +2042,36 @@ void on_left_click() { State *s = &g->players->state; int hx, hy, hz; int hw = hit_test(0, s->x, s->y, s->z, s->rx, s->ry, &hx, &hy, &hz); - if (hy > 0 && hy < BUILD_HEIGHT_LIMIT && is_destructable(hw) && Inventory_collect(&g->inventory, hw)) { - set_block(hx, hy, hz, 0); - record_block(hx, hy, hz, 0); - if (is_plant(get_block(hx, hy + 1, hz))) { - set_block(hx, hy + 1, hz, 0); - } - } + int mining = 1; + //while (mining = 1) { + if (hy > 0 && hy < BUILD_HEIGHT_LIMIT && is_destructable(hw) && Inventory_collect(&g->inventory, hw)) { + set_block(hx, hy, hz, 0); + record_block(hx, hy, hz, 0); + if (is_plant(get_block(hx, hy + 1, hz))) { + set_block(hx, hy + 1, hz, 0); + } + } + //} } void on_right_click() { State *s = &g->players->state; int hx, hy, hz; int hw = hit_test(1, s->x, s->y, s->z, s->rx, s->ry, &hx, &hy, &hz); + + int nx, ny, nz; + int hwb = hit_test(0, s->x, s->y, s->z, s->rx, s->ry, &nx, &ny, &nz); + if (hy > 0 && hy < BUILD_HEIGHT_LIMIT && is_obstacle(hw) && Inventory_use(&g->inventory, items[g->item_index])) { if (!player_intersects_block(2, s->x, s->y, s->z, hx, hy, hz)) { set_block(hx, hy, hz, items[g->item_index]); record_block(hx, hy, hz, items[g->item_index]); } - } - - if (hy > 0 && hy < BUILD_HEIGHT_LIMIT && !buildable_to(hw) && Inventory_use(&g->inventory, items[g->item_index])) { - if (!player_intersects_block(2, s->x, s->y, s->z, hx, hy, hz)) { - set_block(hx, hy-1, hz, items[g->item_index]); - record_block(hx, hy-1, hz, items[g->item_index]); - } + } else if (ny > 0 && ny < BUILD_HEIGHT_LIMIT && !buildable_to(hwb) && Inventory_use(&g->inventory, items[g->item_index])) { + if (!player_intersects_block(2, s->x, s->y, s->z, hx, hy, hz)) { + set_block(nx, ny, nz, items[g->item_index]); + record_block(hx, hy, hz, items[g->item_index]); + } } } @@ -2731,7 +2767,6 @@ int main(int argc, char **argv) { s->y = highest_block(s->x, s->z) + 2; } - // BEGIN MAIN LOOP // double previous = glfwGetTime(); while (1) { @@ -2763,12 +2798,6 @@ int main(int argc, char **argv) { handle_mouse_input(); - // ######## // - // Add gui? // - // ######## // - - //render_text(&text_attrib, ALIGN_RIGHT, tx, ty, ts, "Omicron", g->width, g->height); - // HANDLE MOVEMENT // handle_movement(dt); @@ -2922,7 +2951,7 @@ int main(int argc, char **argv) { } // SHUTDOWN // - printf("Omicron: Game closing ..."); + printf("\nOmicron: Game closing ... \n"); db_save_state(s->x, s->y, s->z, s->rx, s->ry); db_close(); db_disable(); diff --git a/src/player.h b/src/player.h index 5103d36..0d92af4 100644 --- a/src/player.h +++ b/src/player.h @@ -7,6 +7,7 @@ typedef struct { int id; + int hp; char name[MAX_NAME_LENGTH]; State state; State state1; diff --git a/src/rendering.c b/src/rendering.c index ba1bab6..d2179d6 100644 --- a/src/rendering.c +++ b/src/rendering.c @@ -146,7 +146,7 @@ void draw_player(Attrib *attrib, Player *player) { GLuint gen_crosshair_buffer(int width, int height, int scale) { int x = width / 2; int y = height / 2; - int p = 10 * scale; + int p = 11 * scale; float data[] = { x, y - p, x, y + p, x - p, y, x + p, y diff --git a/src/worldgen/base_terrain.c b/src/worldgen/base_terrain.c index 27676d3..19d9c52 100644 --- a/src/worldgen/base_terrain.c +++ b/src/worldgen/base_terrain.c @@ -1,61 +1,42 @@ +#include +#include #include "base_terrain.h" #include "noise.h" #include "../config.h" #include "../item.h" #include "../util.h" - -const int caveitems[] = { - // items that caves can "dig" trough (Unused) - Item_GRASS, - Item_SAND, - Item_WOOD, - Item_STONE, - Item_DIRT, - Item_SNOW, - Item_LEAVES, - Item_CACTUS, - Item_TALL_GRASS, - Item_YELLOW_FLOWER, - Item_RED_FLOWER, - Item_PURPLE_FLOWER, - Item_SUN_FLOWER, - Item_WHITE_FLOWER, - Item_BLUE_FLOWER, - Item_VINE, - Item_CACTI -}; - - void generateBaseTerrain(int dx, int dz, int x, int z, int start_h, int h, int flag, world_func func, void *arg) { for(int y = start_h; y < h; y++) { - //-- ugly caves - - //float cave1 = simplex3(x, y, z, 8, 1.8, 1.5); - //float cave2 = simplex3(x, y, z, 12, 2.8, 0.5); - //float cave1 = simplex2(x, y + 1, 3, 0.8, 0.5); - //float cave2 = simplex2(x + 1, y, 3, 0.8, 0.5); - - //if(ABS(cave1 - cave2) < 0.1) { - // func(x, y, z, Item_STONE, arg); - //} - - //-- ugly caves - - - // small caves - if ((y < 2 || y > 36) || (simplex3(x * 0.05, y * 0.05, z * 0.05, 16, 0.05, 5) - + simplex3(x * 0.05, y * 0.05, z * 0.05, 16, 0.05, 5) < 1.25)) { - func(x, y, z, Item_STONE, arg); + for (int y = 1; y < 34; y++) { + func(x, y, z, Item_STONE, arg); } - // big caves - // if ((y < 2 || y > h - 5) || (simplex3(x * 0.005, y * 0.05, z * 0.005, 15, 0.1, 5) - // + simplex3(x * 0.005, y * 0.05, z * 0.005, 20, 0.05, 1) < 1.25)) { - // func(x, y, z, Item_STONE, arg); - //} - + // Ores generation system + for (int y = 2; y < 30; y++) { + if (simplex3(x * 0.12, y * 0.12, z * 0.12, 6, 0.5, 2) > 0.74) { + int rand_num = (rand() % 100); + + if (y < 10 && rand_num < 15) { + func(x, y-1, z, Item_RUBIS_ORE * flag, arg); + } else if (y < 20 && rand_num < 30) { + func(x, y, z, Item_GOLD_ORE * flag, arg); + } else if (y < 20 && rand_num < 65) { + func(x, y, z, Item_IRON_ORE * flag, arg); + } else if (y < 30 && rand_num < 85) { + func(x, y, z, Item_COAL_ORE * flag, arg); + } + } + } + + // Caves + for (int y = 1; y < 38; y++) { + if (simplex3( + x * 0.06, y * 0.08, z * 0.06, 8, 0.3, 2) > 0.64) { + func(x, y, z, 0 * flag, arg); + } + } } } diff --git a/src/worldgen/biome_mesa.c b/src/worldgen/biome_mesa.c index b70b174..4d5b9e9 100644 --- a/src/worldgen/biome_mesa.c +++ b/src/worldgen/biome_mesa.c @@ -10,29 +10,34 @@ void generateMesa(int dx, int dz, int x, int z, int start_h, int h, int flag, wo //func(x, 37, z, Item_WATER * flag, arg); //func(x, 36, z, Item_WATER * flag, arg); //} + + // filler to avoid renderer glitch + //func(x, y, z, 0 * flag, arg); + if (y < 66) { - func(x, y, z, Item_DIRT * flag, arg); + func(x, y+1, z, Item_DIRT * flag, arg); } if (y < 65) { - func(x, y, z, 51 * flag, arg); + func(x, y+1, z, 51 * flag, arg); } if (y < 60) { - func(x, y, z, 52 * flag, arg); + func(x, y+1, z, 52 * flag, arg); } if (y < 55) { - func(x, y, z, 53 * flag, arg); + func(x, y+1, z, 53 * flag, arg); } if (y < 50) { - func(x, y, z, 54 * flag, arg); + func(x, y+1, z, 54 * flag, arg); } if (y < 45) { + func(x, y+1, z, Item_SAND * flag, arg); func(x, y, z, Item_SAND * flag, arg); } // I don't even know why it does this but it looks sick if (simplex2(x * 0.005, -z * 0.005, 4, 0.8, 2) > 0.7) { if (h = 67) { - func(x, h-1, z, Item_DIRT * flag, arg); + func(x, h, z, Item_DIRT * flag, arg); } } } diff --git a/src/worldgen/biome_rainforest.c b/src/worldgen/biome_rainforest.c index 40c33d2..86c9232 100644 --- a/src/worldgen/biome_rainforest.c +++ b/src/worldgen/biome_rainforest.c @@ -10,7 +10,7 @@ void generateRainforest(int dx, int dz, int x, int z, int start_h, int h, int fl func(x, h - 1, z, Item_GRASS * flag, arg); // grass - if (simplex2(-x * 0.1, z * 0.1, 4, 0.8, 2) > 0.4) { + if (simplex2(-x * 0.1, z * 0.1, 4, 0.8, 2) > 0.5) { func(x, h, z, 17 * flag, arg); } // flowers diff --git a/src/worldgen/biome_temperate.c b/src/worldgen/biome_temperate.c index 56764f4..1ba3924 100644 --- a/src/worldgen/biome_temperate.c +++ b/src/worldgen/biome_temperate.c @@ -27,6 +27,14 @@ void generateTemperate(int dx, int dz, int x, int z, int start_h, int h, int fla func(x, h, z, w * flag, arg); } } + + // rocks + if (simplex2(x * 0.02, -z * 0.02, 4, 0.8, 2) > 0.75) { + if (h > 72) { + func(x, h-1, z, Item_STONE * flag, arg); + func(x, h, z, Item_STONE * flag, arg); + } + } // trees if (h > 38) { @@ -54,4 +62,31 @@ void generateTemperate(int dx, int dz, int x, int z, int start_h, int h, int fla } } } + + // elder trees + if (h > 38) { + int ok = 1; + if (dx - 4 < 0 || dz - 4 < 0 || + dx + 4 >= CHUNK_SIZE || dz + 4 >= CHUNK_SIZE) + { + ok = 0; + } + + if (ok && simplex2(x, z, 7, 0.6, 2) > 0.85) { + for (int y = h + 4; y < h + 18; y++) { + for (int ox = -4; ox <= 4; ox++) { + for (int oz = -4; oz <= 4; oz++) { + int d = (ox * ox) + (oz * oz) + + (y - (h + 6)) * (y - (h + 6)); + if (d < 18) { + func(x + ox, y, z + oz, 15, arg); + } + } + } + } + for (int y = h; y < h + 10; y++) { + func(x, y, z, 5, arg); + } + } + } } diff --git a/src/worldgen/world.c b/src/worldgen/world.c index 2d8f785..b4b95ce 100644 --- a/src/worldgen/world.c +++ b/src/worldgen/world.c @@ -49,6 +49,7 @@ void create_world(int p, int q, world_func func, void *arg) { generateBaseTerrain(dx, dz, x, z, 0, 32, flag, func, arg); //generateBaseTerrain(dx, dz, x, z, 32, 32 + h, flag, func, arg); + // clouds for (int y = 120; y < 200; y++) { if (simplex3( @@ -57,18 +58,33 @@ void create_world(int p, int q, world_func func, void *arg) { func(x, y, z, 16 * flag, arg); } } - - // Flying dirt patches + + /* Flying dirt patches = bad idea for (int yb = 170; yb < 255; yb++) { if (simplex3( - x * 0.002, yb * 0.004, z * 0.002, 7, 0.5, 2) > 0.72) + x * 0.002, yb * 0.004, z * 0.002, 7, 0.5, 2) > 0.80) { - func(x, yb, z, Item_DIRT * flag, arg); + //if (x > 100 && x < -100 && z > 100 && z < -100) { + func(x, yb, z, Item_DIRT * flag, arg); + //} } - } + }*/ - // Core shell - func(x, 1, z, Item_CORESHELL * flag, arg); + // Unbreakable Core shell + func(x, 0, z, Item_CORESHELL * flag, arg); + if (simplex2( + x * 0.5, z * 0.5, 7, 3, 5) > 0.6) + { + func(x, 1, z, Item_CORESHELL * flag, arg); + } + + + // Buildings + + // Brick Pyramid + //for (int b = 50; b < 100; b++) { + // func(b, b, b, Item_BRICK * flag, arg); + //} } } } diff --git a/textures/texture.png b/textures/texture.png index 92d5b2a..893f7ea 100644 Binary files a/textures/texture.png and b/textures/texture.png differ