Some work-in-progress stuff and many comment updates
authorPerttu Ahola <celeron55@gmail.com>
Sun, 22 May 2011 20:55:02 +0000 (23:55 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 22 May 2011 20:55:02 +0000 (23:55 +0300)
src/environment.cpp
src/environment.h
src/main.cpp
src/mapnode.cpp
src/mapnode.h

index f233eaf7ff072ddab7ef88c824b51c2103147497..3ebfef0c539e185826788e6063efd9314193b39a 100644 (file)
@@ -739,7 +739,7 @@ void ServerEnvironment::step(float dtime)
                                        if(1)
                                        {
                                                MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0));
-                                               if(content_features(n_top.d).walkable == false &&
+                                               if(content_features(n_top.d).air_equivalent &&
                                                                n_top.getLight(LIGHTBANK_DAY) >= 13)
                                                {
                                                        n.d = CONTENT_GRASS;
@@ -796,10 +796,10 @@ void ServerEnvironment::step(float dtime)
                                // Convert mud under proper lighting to grass
                                if(n.d == CONTENT_MUD)
                                {
-                                       if(myrand()%4 == 0)
+                                       if(myrand()%10 == 0)
                                        {
                                                MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0));
-                                               if(content_features(n_top.d).walkable == false &&
+                                               if(content_features(n_top.d).air_equivalent &&
                                                                n_top.getLightBlend(getDayNightRatio()) >= 13)
                                                {
                                                        n.d = CONTENT_GRASS;
index e32b15dbb6f73c607fee5ac0f442a52f121fd539..8993b8e87c07ce2bc129206ed9144edb74312ec2 100644 (file)
@@ -112,6 +112,19 @@ public:
 private:
 };
 
+/*
+       Active block modifier interface
+*/
+
+class ActiveBlockModifier
+{
+public:
+       ActiveBlockModifier(){};
+       virtual ~ActiveBlockModifier(){};
+       //TODO
+       //virtual void 
+};
+
 /*
        The server-side environment.
 
index c3b0757320c7061cea3de1f368b58ea6919d551e..457fa06936baeebc5dbec701e03f4c3c84f354a8 100644 (file)
@@ -85,6 +85,10 @@ SUGG: Server-side objects could be moved based on nodes to enable very
       lightweight operation and simple AI\r
        - Not practical; client would still need to show smooth movement.\r
 \r
+SUGG: Make a system for pregenerating quick information for mapblocks, so\r
+         that the client can show them as cubes before they are actually sent\r
+         or even generated.\r
+\r
 Gaming ideas:\r
 -------------\r
 \r
@@ -211,6 +215,9 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
 FIXME: The new optimized map sending doesn't sometimes send enough blocks\r
        from big caves and such\r
 \r
+Environment:\r
+------------\r
+\r
 TODO: A list of "active blocks" in which stuff happens.\r
        + Add a never-resetted game timer to the server\r
        + Add a timestamp value to blocks\r
@@ -289,18 +296,20 @@ Mapgen v2:
 \r
 Misc. stuff:\r
 ------------\r
-* Make an "environment metafile" to store at least time of day\r
-* Move digging property stuff from material.{h,cpp} to mapnode.cpp...\r
-  - Or maybe move content_features to material.{h,cpp}?\r
-* Maybe:\r
-  Make a system for pregenerating quick information for mapblocks, so\r
-  that the client can show them as cubes before they are actually sent\r
-  or even generated.\r
+* Move digging property stuff from material.{h,cpp} to mapnode.cpp\r
+  - ...Or maybe move content_features to material.{h,cpp}?\r
 \r
 Making it more portable:\r
 ------------------------\r
-* Some MSVC: std::sto* are defined without a namespace and collide\r
-  with the ones in utility.h\r
\r
+Stuff to do before release:\r
+---------------------------\r
+- Player default privileges and default password\r
+- Chat privilege\r
+- Some simple block-based dynamic stuff in the world (finish the\r
+  ActiveBlockModifier stuff)\r
+- Protocol version field\r
+- Consider getting some textures from cisoun's texture pack\r
 \r
 ======================================================================\r
 \r
index 00ebef84026faa5e9a72ae6477b1f5058b7cb3a5..c8e4e8449f1cae1b5ccdc25288a4bcebcfaebf28 100644 (file)
@@ -252,6 +252,7 @@ void init_mapnode()
        f->pointable = false;
        f->diggable = false;
        f->buildable_to = true;
+       f->air_equivalent = true;
        
        i = CONTENT_WATER;
        f = &g_content_features[i];
@@ -303,6 +304,7 @@ void init_mapnode()
        f->solidness = 0; // drawn separately, makes no faces
        f->walkable = false;
        f->wall_mounted = true;
+       f->air_equivalent = true;
        f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
        
        i = CONTENT_SIGN_WALL;
@@ -314,6 +316,7 @@ void init_mapnode()
        f->solidness = 0; // drawn separately, makes no faces
        f->walkable = false;
        f->wall_mounted = true;
+       f->air_equivalent = true;
        f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
        if(f->initial_metadata == NULL)
                f->initial_metadata = new SignNodeMetadata("Some sign");
index 5a17702309bb0799c53dde2345d106102c52c1b7..09fe02ba1d37acaf2a4d6bfe6371274efaa2af17 100644 (file)
@@ -151,13 +151,20 @@ struct ContentFeatures
        // This is used for collision detection.
        // Also for general solidness queries.
        bool walkable;
+       // Player can point to these
        bool pointable;
+       // Player can dig these
        bool diggable;
+       // Player can build on these
        bool buildable_to;
+       // Whether the node has no liquid, source liquid or flowing liquid
        enum LiquidType liquid_type;
-       // If true, param2 is set to direction when placed
+       // If true, param2 is set to direction when placed. Used for torches.
        // NOTE: the direction format is quite inefficient and should be changed
        bool wall_mounted;
+       // If true, node is equivalent to air. Torches are, air is. Water is not.
+       // Is used for example to check whether a mud block can have grass on.
+       bool air_equivalent;
        
        // Inventory item string as which the node appears in inventory when dug.
        // Mineral overrides this.
@@ -183,6 +190,7 @@ struct ContentFeatures
                buildable_to = false;
                liquid_type = LIQUID_NONE;
                wall_mounted = false;
+               air_equivalent = false;
                dug_item = "";
                initial_metadata = NULL;
        }