X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.cpp;h=fb1b2d8fd9a80d00f4c6d0f59a41279d144a1425;hb=bc66bb2d409f13554bdcec7386766af82a343cad;hp=2c9e9cf750d647fb272e107cccfb63c6f39fdc49;hpb=a302ae3e08c6ddc171c78e1e2b59cf5148860e90;p=dragonfireclient.git diff --git a/src/main.cpp b/src/main.cpp index 2c9e9cf75..fb1b2d8fd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,9 @@ NOTE: VBO cannot be turned on for fast-changing stuff because there NOTE: iostream.imbue(std::locale("C")) is very slow NOTE: Global locale is now set at initialization +Random suggeestions: +-------------------- + SUGG: Fix address to be ipv6 compatible NOTE: When a new sector is generated, it may change the ground level @@ -116,11 +119,6 @@ Gaming ideas: Build system / running: ----------------------- -FIXME: Some network errors on Windows that cause local game to not work - - See siggjen's emails. - - Is this the famous "windows 7 problem"? - - Apparently there might be other errors too - Networking and serialization: ----------------------------- @@ -160,6 +158,11 @@ TODO: Make fetching sector's blocks more efficient when rendering TODO: Flowing water animation +* Combine meshes to bigger ones in ClientMap and set them EHM_STATIC + +SUGG: Draw cubes in inventory directly with 3D drawing commands, so that + animating them is easier. + Configuration: -------------- @@ -182,7 +185,7 @@ TODO: Remove IrrlichtWrapper TODO: When player dies, throw items on map -TODO: Make an option to the server to disable building and digging near +SUGG: Make an option to the server to disable building and digging near the starting position TODO: Copy the text of the last picked sign to inventory in creative @@ -191,10 +194,13 @@ TODO: Copy the text of the last picked sign to inventory in creative TODO: Check what goes wrong with caching map to disk (Kray) - Nothing? -TODO: When server sees that client is removing an inexistent block in - an existent position, resend the MapBlock. +FIXME: Server sometimes goes into some infinite PeerNotFoundException loop -FIXME: Server went into some infinite PeerNotFoundException loop +* Fix the problem with the server constantly saving one or a few + blocks? List the first saved block, maybe it explains. + - It is probably caused by oscillating water +* Make a small history check to transformLiquids to detect and log + continuous oscillations, in such detail that they can be fixed. Objects: -------- @@ -221,6 +227,15 @@ Block object server side: - When a statically stored active object comes near a player, recreate the active object +* Continue making the scripting system: + * Make updateNodeMesh for a less verbose mesh update on add/removenode + * Switch to using a safe way for the self and env pointers + * Make some global environment hooks, like node placed and general + on_step() +* Add a global Lua spawn handler and such +* Get rid of MapBlockObjects +* Other players could be sent to clients as LuaCAOs + Map: ---- @@ -230,9 +245,6 @@ TODO: Mineral and ground material properties TODO: Flowing water to actually contain flow direction information -TODO: Remove duplicate lighting implementation from Map (leave - VoxelManipulator, which is faster) - FEATURE: Create a system that allows a huge amount of different "map generator modules/filters" @@ -247,42 +259,10 @@ FEATURE: Erosion simulation at map generation time - Simulate rock falling from cliffs when water has removed enough solid rock from the bottom -Doing now (most important at the top): --------------------------------------- -# maybe done -* not done - -=== Next -* Somehow generate trees - -=== Fixmes -* Check the fixmes in the list above -* Make server find the spawning place from the real map data, not from - the heightmap - - But the changing borders of chunk have to be avoided, because - there is time to generate only one chunk. +Mapgen v2 (not doing): +* only_from_disk might not work anymore - check and fix it. * Make the generator to run in background and not blocking block placement and transfer -* only_from_disk might not work anymore - check and fix it. - -=== Making it more portable -* Some MSVC: std::sto* are defined without a namespace and collide - with the ones in utility.h - -=== Features -* Continue making the scripting system: - * Make updateNodeMesh for a less verbose mesh update on add/removenode - * Switch to using a safe way for the self and env pointers - * Make some global environment hooks, like node placed and general - on_step() -* Map should make the appropriate MapEditEvents -* Add a global Lua spawn handler and such -* Get rid of MapBlockObjects -* Other players could be sent to clients as LuaCAOs -* Add mud underground -* Make an "environment metafile" to store at least time of day -* Move digging property stuff from material.{h,cpp} to mapnode.cpp... - - Or maybe move content_features to material.{h,cpp}? * Add some kind of erosion and other stuff that now is possible * Make client to fetch stuff asynchronously - Needs method SyncProcessData @@ -292,16 +272,45 @@ Doing now (most important at the top): and stuff yet and the ground is fairly flat, the mud will flow to the other chunk making nasty straight walls when the other chunk is generated. Fix it. -* Fix the problem with the server constantly saving one or a few - blocks? List the first saved block, maybe it explains. - - It is probably caused by oscillating water -* Make a small history check to transformLiquids to detect and log - continuous oscillations, in such detail that they can be fixed. -* Combine meshes to bigger ones in ClientMap and set them EHM_STATIC + +Mapgen v4 (not doing): +* only_from_disk might not work anymore - check and fix it. +* Make the generator to run in background and not blocking block + placement and transfer +* Make chunks to be tiled vertically too +* MAKE IT FASTER + +Mapgen v3 (not doing): +* Generate trees better + - Add a "trees_added" flag to sector, or something +* How 'bout making turbulence controlled so that for a given 2d position + it can be completely turned off, and is usually so. This way generation + can be sped up a lot. +* Add a way to generate a block partly, so that trees are not added, like + the chunks in v2 +* Add mud "discretely", not by guessing from the noise + +Mapgen v4: +* This will be the final way. +* Generate blocks in the same way as chunks, by copying a VoxelManipulator + from the map that is one block larger in all directions. + +Misc. stuff: +------------ +* Make an "environment metafile" to store at least time of day +* Move digging property stuff from material.{h,cpp} to mapnode.cpp... + - Or maybe move content_features to material.{h,cpp}? * Maybe: Make a system for pregenerating quick information for mapblocks, so that the client can show them as cubes before they are actually sent or even generated. +* Optimize VoxelManipulator lighting implementation by using indices + in place of coordinates? + +Making it more portable: +------------------------ +* Some MSVC: std::sto* are defined without a namespace and collide + with the ones in utility.h ====================================================================== @@ -496,7 +505,7 @@ Inventory local_inventory; u16 g_selected_item = 0; bool g_show_map_plot = false; -bool g_refresh_map_plot = true; +bool g_refresh_map_plot = false; /* Debug streams @@ -1267,7 +1276,7 @@ void draw_hotbar(video::IVideoDriver *driver, gui::IGUIFont *font, } video::ITexture *g_map_plot_texture = NULL; -float g_map_plot_texture_scale = 2; +float g_map_plot_texture_scale = 4; void updateMapPlotTexture(v2f centerpos, video::IVideoDriver* driver, Client *client) @@ -1306,28 +1315,67 @@ void updateMapPlotTexture(v2f centerpos, video::IVideoDriver* driver, c.set(255, 160, 160, 160); else if(h < WATER_LEVEL - 0.5) // Water c.set(255, 50, 50, 255); - else if(h < WATER_LEVEL + 2) // Sand - c.set(255, 237, 201, 175); -#if 1 - else if(h < WATER_LEVEL + 10) // Green - c.set(255, 50, 150, 50); - else if(h < WATER_LEVEL + 20) // Greenish yellow - c.set(255, 110, 185, 50); - else if(h < WATER_LEVEL + 50) // Yellow - c.set(255, 220, 220, 50); - else if(h < WATER_LEVEL + 100) // White - c.set(255, 180, 180, 180); +#if 0 + else if(get_have_sand_ground(client->getMapSeed(), pf) + || (h < WATER_LEVEL + 2 + && get_have_sand_coast(client->getMapSeed(), pf))) + { + h -= WATER_LEVEL; + h /= 50.0; + h = 1.0 - exp(-h); + + video::SColor c1(255,237,201,175); + //video::SColor c2(255,20,20,20); + video::SColor c2(255,150,0,0); + c = c2.getInterpolated(c1, h); + } else - c.set(255, 255, 255, 255); + { + h -= WATER_LEVEL; + h /= 50.0; + h = 1.0 - exp(-h); + + video::SColor c1(255,110,185,90); + //video::SColor c2(255,20,20,20); + video::SColor c2(255,150,0,0); + c = c2.getInterpolated(c1, h); + } #endif - /*else if(h < WATER_LEVEL + d1) +#if 1 +#if 0 + else if(get_have_sand_ground(client->getMapSeed(), pf)) { h -= WATER_LEVEL; - u32 a = (u32)(h / d1 * 255); - if(a > 255) - a = 255; - c.set(255, 0, a, 0); - }*/ + h /= 20.0; + h = 1.0 - exp(-h); + + video::SColor c1(255,237,201,175); + //video::SColor c2(255,20,20,20); + video::SColor c2(255,150,0,0); + c = c2.getInterpolated(c1, h); + } +#endif + // Sand + else if(h < WATER_LEVEL + 2 + && get_have_sand_coast(client->getMapSeed(), pf)) + c.set(255, 237, 201, 175); +#if 1 + else if(h < WATER_LEVEL + 10) + c.set(255, 50, 150, 50); // Green + else if(h < WATER_LEVEL + 20) + c.set(255, 110, 185, 50); // Yellowish green + else if(h < WATER_LEVEL + 40) + c.set(255, 180, 210, 50); // Greenish yellow + else if(h < WATER_LEVEL + 60) + c.set(255, 220, 220, 50); // Yellow + else if(h < WATER_LEVEL + 80) + c.set(255, 200, 200, 110); // Yellowish white + else if(h < WATER_LEVEL + 100) + c.set(255, 190, 190, 190); // Grey + else + c.set(255, 255, 255, 255); // White +#endif +#endif #if 0 else { @@ -1345,6 +1393,22 @@ void updateMapPlotTexture(v2f centerpos, video::IVideoDriver* driver, a = 255-a; c.set(255, a, a, a);*/ } +#endif +#if 1 + if(h >= WATER_LEVEL - 0.5 + && get_have_sand_ground(client->getMapSeed(), pf)) + { + video::SColor c1(255,237,201,175); + c = c.getInterpolated(c1, 0.5); + } +#endif +#if 1 + double tf = get_turbulence_factor_2d(client->getMapSeed(), pf); + if(tf > 0.001) + { + video::SColor c1(255,255,0,0); + c = c.getInterpolated(c1, 1.0-(0.5*tf)); + } #endif img->setPixel(x, y, c); } @@ -2906,7 +2970,7 @@ int main(int argc, char *argv[]) driver->setFog( bgcolor, video::EFT_FOG_LINEAR, - range*0.6, + range*0.4, range*1.0, 0.01, false, // pixel fog