Jump to content

Tiles Changes And More


Recommended Posts

  • Developer

In the newest beta, we have made several changes to the tile system, this will go over the changes and how you can update your mods for the new changes.

Tile Changes

The tile limit has been increased from 0-255 to 0-65535, this means we support practically limitless tiles now.

The GROUND table has been deprecated, all tiles should be referenced via the new table WORLD_TILES table, all new tiles from this point onward will not exist in the GROUND table, this means that all currently existing tiles in the GROUND table will have their value stay between 0-255.

Existing mods will be able to function and continue to use the GROUND table, but should migrate to the new table and systems as soon as they can.

Adding Tiles:

Spoiler

We now finally have a tile management system so mods can easily add their own tiles to the game.
Tiles can be added with a single function:


AddTile(tile_name, tile_range, tile_data, ground_tile_def, minimap_tile_def, turf_def)

Adds a new tile.
Returns nothing.
Arguments:

  • tile_name - the name of the tile, this is how you'll refer to your tile in the WORLD_TILES table.
  • tile_range - the string defining the range of possible ids for the tile.
    • the following ranges exist: "LAND", "NOISE", "OCEAN", "IMPASSABLE"
  • tile_data - a table with these possible values:
    • ground_name - optional, a human readable name primarily used for debugging purposes, this can be accessed via the GROUND_NAMES table.
    • old_static_id - optional, the static tile id that this tile had before migrating to this API, if you aren't migrating your tiles from an old API to this one, omit this.
  • ground_tile_def - optional, a table containing the ground definitions for this tile:
    • name - this is the texture for the ground, it will first attempt to load the texture at "levels/texture/<name>.tex", if that fails it will then treat <name> as the whole file path for the texture.
    • atlas - optional, if missing it will load the same path as name, but ending in .xml instead of .tex,  otherwise behaves the same as <name> but with .xml instead of .tex.
    • noise_texture -  this is the noise texture for the ground, it will first attempt to load the texture at "levels/texture/<noise_texture>.tex", if that fails it will then treat <noise_texture> as the whole file path for the texture.
    • runsound - soundpath for the run sound, if omitted will default to "dontstarve/movement/run_dirt"
    • walksound - soundpath for the walk sound, if omitted will default to "dontstarve/movement/walk_dirt"
    • snowsound - soundpath for the snow sound, if omitted will default to "dontstarve/movement/run_snow"
    • mudsound - soundpath for the mud sound, if omitted will default to "dontstarve/movement/run_mud"
    • flashpoint_modifier - the flashpoint modifier for the tile, defaults to 0 if missing
    • colors - the colors of the tile when for blending of the ocean colours, will use DEFAULT_COLOUR(see tilemanager.lua for the exact values of this table) if missing.
    • flooring - if true, inserts this tile into the GROUND_FLOORING table.
    • hard - if true, inserts this tile into the GROUND_HARD table.
    • cannotbedug - if true, inserts this tile into the TERRAFORM_IMMUNE table.
    • other values can also be stored in this table, and can tested for via the GetTileInfo function.
  • minimap_tile_def - optional, a table containing the minimap definitions for this tile:
    • name - this is the texture for the minimap, it will first attempt to load the texture at "levels/texture/<name>.tex", if that fails it will then treat <name> as the whole file path for the texture.
    • atlas - optional, if missing it will load the same path as name, but ending in .xml instead of .tex,  otherwise behaves the same as <name> but with .xml instead of .tex.
    • noise_texture -  this is the noise texture for the minimap, it will first attempt to load the texture at "levels/texture/<noise_texture>.tex", if that fails it will then treat <noise_texture> as the whole file path for the texture.
  • turf_def - optional, a table containing the turf item defintions for this tile
    • name - the postfix for the prefabname of the turf item
    • anim - the name of the animation to play for the turf item, if undefined it will use name instead
    • bank_build - the bank and build containing the animation, if undefined bank_build will use the value "turf"

if ground_tile_def is undefined, the tile will either render as a black void, or if its an ocean tile, will render how the ocean tiles do.
if minimap_tile_def is undefined, the minimap tile will either render as a black void, or if its an ocean minimap tile, will render how the ocean tiles do.
if turf_def is nil, no turf prefab will be created automatically for this tile.

To change the render order for a tile, on either the map or in the world, you can use one of these functions:


ChangeTileRenderOrder(tile_id, target_tile_id, moveafter)
ChangeMiniMapTileRenderOrder(tile_id, target_tile_id, moveafter)

Moves the render order for tile_id to be either before or after target_tile_id.
Returns nothing.
Arguments:

  • tile_id - the tile to change the render order of.
  • target_tile_id - the tile to move either behind or in front of in render order.
  • moveafter - if true the tile is moved after the target tile, otherwise its moved before the target tile.

To set a tile property you can use the following function:


SetTileProperty(tile_id, propertyname, value)

Sets a property for a tile.
Returns nothing.
Arguments:

  • tile_id - the tile to set the property of.
  • propertyname - the string key for the property.
  • value - the value to set the property.

To set a minimap tile property you can use the following function:


SetMiniMapTileProperty(tile_id, propertyname, value)

Sets a property for a minimap tile.
Returns nothing.
Arguments:

  • tile_id - the tile to set the property of.
  • propertyname - the string key for the property.
  • value - the value to set the property.

Everything beyond this point is fairly advanced, if your just adding some tiles in your mod, you probably don't need to read beyond this point.

Map Edge Collisions:

Spoiler

The tile collisions that were previously hardcoded into the engine are now defined in Lua.


Map:AddTileCollisionSet(collision_group, tile_group_for_collisions, tile_group_for_collisions_result, tile_group_to_collide, tile_group_to_collide_result, cut_distance, region_size)

Adds a new collision set to the world.
Returns nothing.
Arguments:

  • collision_group - the collision mask for the physics walls, EG COLLISION.LAND_OCEAN_LIMITS.
  • tile_group_for_collisions - the tile group for determining if any physics borders should exist on this tile.
  • tile_group_for_collisions_result - true or false, when a tile runs through <tile_group_for_collisions>, if it matches this value, try and place collisions on this tile.
  • tile_group_to_collide - the tile group that determines which neighboring tiles are actually "colliding" with this tile.
  • tile_group_to_collide_result - behaves just like <tile_group_for_collisions_result> but with <tile_group_to_collide> instead of <tile_group_for_collisions>, if the result matches the output of the group, it will place physics walls between those two tiles.
  • cut_distance - determines how far away from the edge of the tile the physics wall is placed, 0.0 will place the physics wall right on the edge of the tile, 0.5 will place the collisions on the very middle of the tile, standard game collisions use 0.25.
  • region_size - determines how big each physics region is, smaller physics regions can be rebuilt quicker but have a bigger performance hit during gameplay, larger regions will be rebuilt slower, but have a smaller performance hit during normal gameplay, in the game, the regions between land and water use a value of 64, and the edge of the world collisions use 128.

Falloff Textures:

Spoiler

The singular falloff texture that used to be hardcoded in the engine, has been replaced with a customizable system controlled from Lua.


AddFalloffTexture(falloff_id, falloff_def)

Adds a new falloff texture
Returns nothing.
Arguments:

  • falloff_id - the falloff id for this texture, this texture isn't saved anywhere, so it just needs to be unique, all falloff ids are stored in the table FALLOFF_IDS
  • falloff_def- optional, a table containing the ground definitions for this tile:
    • name - this is the texture for the falloff, it will first attempt to load the texture at "levels/texture/<name>.tex", if that fails it will then treat <name> as the whole file path for the texture.
    • atlas - optional, if missing it will load the same path as name, but ending in .xml instead of .tex,  otherwise behaves the same as <name> but with .xml instead of .tex.
    • noise_texture -  this is the noise texture for the ground, it will first attempt to load the texture at "levels/texture/<noise_texture>.tex", if that fails it will then treat <noise_texture> as the whole file path for the texture.
    • should_have_falloff - tile group, determines if a tile should have this falloff texture on its edge.
    • should_have_falloff_result - true or false, when a tile runs through <should_have_falloff>, if it matches this value, try and place the falloff texture on this tile.
    • neighbor_needs_falloff - tile group, determines based on neighbors which tile edges get the falloff texture.
    • neighbor_needs_falloff_result - behaves just like <should_have_falloff_result> but with <neighbor_needs_falloff> instead of <should_have_falloff>, if the result matches the output of the group, will place the falloff texture between those two tiles.

To change the render order of a falloff texture


ChangeFalloffRenderOrder(falloff_id, falloff_id_id, moveafter)

Moves the render order for falloff_id to be either before or after target_falloff_id.
Returns nothing.
Arguments:

  • falloff_id - the falloff texture to change the render order of.
  • target_falloff_id - the falloff texture to change either behind or in front of in render order.
  • moveafter - if true the falloff texture is moved after the target falloff texture, otherwise its moved before the target falloff texture.

To set a falloff texture property you can use the following function:


SetFalloffProperty(falloff_id, propertyname, value)

Sets a property for a falloff texture.
Returns nothing.
Arguments:

  • falloff_id - the falloff texture to set the property of.
  • propertyname - the string key for the property.
  • value - the value to set the property.

 

Tile Groups:

Spoiler

Testing for tile type (EG: Is this a land tile? Is this an ocean tile?) is now done in a new class, TileGroupManager

TileGroupManager is split into two parts, testing done in Lua, and testing done in the engine.
Lua currently has five tile type tests


TileGroupManager:IsLandTile(tile)
TileGroupManager:IsOceanTile(tile)
TileGroupManager:IsImpassableTile(tile)
TileGroupManager:IsInvalidTile(tile)
TileGroupManager:IsNoiseTile(tile)

IsLandTile and IsOceanTile are pretty self explanatory.
IsImpassableTile will include WORLD_TILES.IMPASSABLE, along with any tile that adds itself to the impassable tile group.
IsInvalidTile includes everything in the IsImpassableTile check, but also includes WORLD_TILES.INVALID.
IsNoiseTile is primarily used for world gen, several tiles are defined as noise tiles for world generation, more on those later.

The engine now supports a concept of a tile group, which is a set of tiles that are all one thing, for instance all land.

To create a tile group you can do the following:


 TileGroupManager:AddTileGroup(parent_tile_group)

This creates a new tile group.
Returns a new tile group ID.
Arguments:

  • parent_tile_group - optional, if supplied, it will inherit from the parent tile group.

All created tile groups should be stored in the table: TileGroups.

Tile groups have several functions that can include and exclude tiles in the tile group.


TileGroupManager:SetValidTileRange(tile_group, lower_bound, upper_bound)

Sets the valid range of tile IDs for a group, this will cause any tile id in the range to return true when queried.
Returns nothing.
Arguments:

  • tile_group - the tile group to set the range for.
  • lower_bound - the lower edge of the range, if the tile id is equal to lower_bound its also inside the tile id range.
  • upper_bound - the upper edge of the range, if the tile id is equal to upper_bound its also inside the tile id range.

TileGroupManager:AddValidTile(tile_group, tile_id)

Adds a specific valid tile to a group.
Returns nothing.
Arguments:

  • tile_group - the tile group to add the valid tile for.
  • tile_id - the tile to add to the valid tile list.

TileGroupManager:RemoveValidTile(tile_group, tile_id)

Removes a specific valid tile from a group.
Returns nothing.
Arguments:

  • tile_group - the tile group to remove the valid tile for.
  • tile_id - the tile to remove from the valid tile list.

TileGroupManager:AddInvalidTile(tile_group, tile_id)

Marks a specific tile as invalid, this will forcibly exclude a tile from a group even if that tile is in the valid range or valid tile list.
Returns nothing.
Arguments:

  • tile_group - the tile group to add the invalid tile for.
  • tile_id - the tile to add to the invalid tile list.

TileGroupManager:RemoveInvalidTile(tile_group, tile_id)

Removes a specific invalid tile from a group.
Returns nothing.
Arguments:

  • tile_group - the tile group to remove the invalid tile for.
  • tile_id - the tile to remove from the invalid tile list.

The engine has several tile groups it must be informed of to properly setup the world:


TileGroupManager:SetIsLandTileGroup(tile_group)

Sets the tile group that contains all land tiles.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all land tiles.

TileGroupManager:SetIsOceanTileGroup(tile_group)

Sets the tile group that contains all ocean tiles.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all ocean tiles.

TileGroupManager:SetIsTransparentOceanTileGroup(tile_group)

Sets the tile group that contains all transparent ocean tiles, transparent ocean tiles get the special rendering that makes them, well transparent, any ocean tile not in this list will be rendered like a land tile.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all transparent ocean tiles.

TileGroupManager:SetIsImpassableTileGroup(tile_group)

Sets the tile group that contains all impassable tiles.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all impassable tiles.

TileGroupManager:SetIsInvalidTileGroup(tile_group)

Sets the tile group that contains all invalid tiles.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all invalid tiles.

TileGroupManager:SetIsNoiseTileGroup(tile_group)

Sets the tile group that contains all noise tiles.
Returns nothing.
Arguments:

  • tile_group - the tile group that contains all noise tiles.

The engine must also be informed of 3 specific tiles


TileGroupManager:SetInvalidTile(tile)
TileGroupManager:SetDefaultImpassableTile(tile)
TileGroupManager:SetFakeGroundTile(tile)

Sets the tile for associated type.
Returns nothing.
Arguments:

  • tile - the tile for the default type.

Worldgen:

Spoiler

All tile type references have been moved out of the engine, and are completely controlled from Lua now.
The amount of changes are too many to list, but lots of world gen function calls now have extra arguments that contain the tiles that were previously hard coded.

The biggest change is moving noise tiles outside the engine, and into Lua, the code for translating noise tiles into real tiles can be found at the file noisetilefunctions.lua, any tile that is inside the Noise Tile Group, will be run through this code path, you can implement your noise tiles by adding to the table returned from that file with your tile id.

Deprecated Functions:

Spoiler

Map:RebuildLayer has been deprecated due to layer rebuilding happening automatically when Map:SetTile  is used now, calling this function now does nothing.

Map:SetUndergroundRenderLayer has been deprecated due to the custom falloff texture support, calling this function now does nothing.

Map:SetImpassableType is now deprecated, call TileGroupManager:SetDefaultImpassableTile(tile) if you want to set the impassable type, calling this function now does nothing.

Map:SetPhysicsWallDistance has been deprecated, since each tile collision set can have its own cut distance, calling this function now does nothing.

Map:SetTransparentOcean has been deprecated, Map:DoOceanRender(true/false) can be used to enable transparent ocean rendering now.

Final Notes:

There were a lot of changes in this update, too many to list, if you're curious about what some new function that was added in this update does that wasn't listed here, or if anything was unclear, feel free to ask in the comments.

Happy Modding!

  • Like 7
  • Thanks 2
  • Happy Hazard 1
  • Health 2
  • Big Ups 3
  • GL Happy 3
Link to comment
Share on other sites

LESGOOOOOOOOOOOO :love_heart::love_heart::love_heart: @Notecja and I really needed these for some of our upcoming turfs but our mod tile space was already totally surrounded, this makes my day Zark

  • Like 3
  • Health 2
  • Big Ups 1
Link to comment
Share on other sites

So many juicy things! I'm expecting the official caves will benefit from the new falloff textures too.

To clarify, these textures are in the old Don't Starve (since caves update I believe).

Spoiler

walls.thumb.png.90f393d3f39b09d56cb847e6d7530eb6.png

The non-ruins ones have separate files too!

Spoiler

wall_cave_01.png.7efcda10e6798952695b576fe8bfe18a.pngwall_dirt_01.png.c88ad6f9dd5209802754434f8ce7ccf0.pngwall_fungus_01.png.d3b2a8003f333a53b816b3a9daba9024.pngwall_marsh_01.png.31652e2f37a5249c524cf76046a75468.pngwall_mud_01.png.c1269a20d791088d398fec22c2c4ef7a.pngwall_rock_01.png.eaabc8f0c2008764f8e30b8f5197162c.pngwall_sinkhole_01.png.ab2e6c487ed7dfb84cd020eda16b5f02.png

For comparison, this is the default falloff:

Spoiler

falloff.png.fe8ff5548c391ce9e254afdac4c480a3.png

Edited by Mobbstar
added images
  • Like 1
  • Sanity 1
  • Spool 1
  • Big Ups 1
Link to comment
Share on other sites

Me and my friend have an issue and I think this is a greate place to mention it, this topic feels relevant. I don't exactly know much about the technical side of things so Im gonna explain it simpler, so apologies for that.

Basically my friends trying to replicate a world generation simular to hamlet, where theres no dst like ocean and instead theres pre return of them style water animation for the void. But if i understand it correctly from his explanation you can't add a biome made out of rot style water and make it flow into the void like the hamlet lillypond biome (if you leave the void just blank like in caves you can but if you add something like the pre rot uninteractable waves you can't. Basically I think you can add the old waves at the very edge of the map with flowing ocean)

Would there be a solution to this in any time soon please?

Link to comment
Share on other sites

Thank you @zarklord_klei,the new tile API is great and convenient,but I have problem with using tiles(added in my mod) in rooms(you know,the AddRoom API).

According the new AddTile API,the name of my tile is WORLD_TILES.GALE_JUNGLE_DEEP,and I want to use it in my own room,so I just replace "GROUND.GALE_JUNGLE_DEEP" with "WORLD_TILES.GALE_JUNGLE_DEEP" in AddRoom function.After world generation,my room do spawned,but the tiles there are normal forest and grass tiles, not mine tile.

I can't figure out why,would there be a solution to this ?

Many thanks,and...... this is my code:

AddTile(
    "GALE_JUNGLE_DEEP",
    "NOISE",
    {
        ground_name = "Gale Jungle Deep",
    },
    {
        name = "jungle_deep",
        noise_texture = "Ground_noise_jungle_deep",
        runsound = "dontstarve/movement/run_marsh",
        walksound = "dontstarve/movement/walk_marsh",
        snowsound = "dontstarve/movement/run_ice",
        mudsound = "dontstarve/movement/run_mud",
        colors = GROUND_OCEAN_COLOR,    --my defined color
    },
    {
        name="map_edge",
        noise_texture = "mini_noise_jungle_deep",
    }
)
 
 
 
AddRoom("duri_forest_bg_room", {
    colour={r=0,g=1,b=0,a=1},
    value = WORLD_TILES.GALE_JUNGLE_DEEP,
    contents =  {
        countprefabs = {
            livingtree = 1,
        },
 
        distributepercent = 0.5,
        distributeprefabs = {
            trees = {weight = 2, prefabs = {"deciduoustree", "evergreen_sparse"}},
            gale_forest_pillar_tree = 0.5,
            flower = 1.2,
            catcoonden = 0.1,
            beehive = 0.1,
            fireflies = 0.5,
            grass = 0.6,
            sapling= 0.8,
            twiggytree = 0.8,
            ground_twigs = 0.06,                                            
            molehill= 0.3,
            berrybush= 0.5,
            berrybush2= 0.5,
            berrybush_juicy = 0.25,
            red_mushroom = 0.3,
            green_mushroom = 0.2,
            rocks = 0.14,
            carrot_planted = 0.5,                                      
        },
    },
})
 
AddTask("duri_forest",{
    locks=LOCKS.NONE,
    keys_given=KEYS.NONE,
    room_choices={
        duri_forest_bg_room = 5,
    },
    room_bg = WORLD_TILES.GALE_JUNGLE_DEEP,
    background_room="Clearing",
    colour={r=0,g=1,b=0,a=1},
})
 
AddTaskSetPreInit("default", function(tasksetdata)
    if type(tasksetdata)=="table" and type(tasksetdata.tasks)=="table" then
        local tab= {
            "duri_forest",
        }
        for _,v in pairs(tab) do
            table.insert(tasksetdata.tasks, v)
        end
    end
end)

 

Edited by Collecter
Link to comment
Share on other sites

On 6/16/2022 at 7:03 PM, Mert_TR said:

Me and my friend have an issue and I think this is a greate place to mention it, this topic feels relevant. I don't exactly know much about the technical side of things so Im gonna explain it simpler, so apologies for that.

Basically my friends trying to replicate a world generation simular to hamlet, where theres no dst like ocean and instead theres pre return of them style water animation for the void. But if i understand it correctly from his explanation you can't add a biome made out of rot style water and make it flow into the void like the hamlet lillypond biome (if you leave the void just blank like in caves you can but if you add something like the pre rot uninteractable waves you can't. Basically I think you can add the old waves at the very edge of the map with flowing ocean)

Would there be a solution to this in any time soon please?

From what I understand the beta has solved this. try Map:AlwaysDrawWaves(true) instead of disabling the ocean rendering. Note: the waterfalls on non transparent ocean is a bug and will be fixed soon, also this picture may look a bit wonky because the falloff texture was lowered similarly to the caves.

unknown (3).png

Edited by HalfEnder776
Link to comment
Share on other sites

21 hours ago, HalfEnder776 said:

From what I understand the beta has solved this. try Map:AlwaysDrawWaves(true) instead of disabling the ocean rendering. Note: the waterfalls on non transparent ocean is a bug and will be fixed soon, also this picture may look a bit wonky because the falloff texture was lowered similarly to the caves.

unknown (3).png

This was already working the problem is I think you cant add a waterfall that makes the water turfs flow into the waves like in hamlet or like in edges of the dst map

Link to comment
Share on other sites

11 hours ago, Mert_TR said:

Did this changes added with the new update?

The issue was that in order for the waves to appear you would have to be near a rot ocean tile, the only way to make them render everywhere was to disable the ocean rendering via Map:SetTransparentOcean. As of the beta Map:SetTransparentOcean was replaced with Map:DoOceanRender(true/false) and it no longer changed if waves can render everywhere or not. Now thats handled by Map:AlwaysDrawWaves(true) so you can have both waves rendering everywhere and ocean rendering.

Link to comment
Share on other sites

On 6/24/2022 at 10:42 PM, Collecter said:

Thank you @zarklord_klei,the new tile API is great and convenient,but I have problem with using tiles(added in my mod) in rooms(you know,the AddRoom API).

According the new AddTile API,the name of my tile is WORLD_TILES.GALE_JUNGLE_DEEP,and I want to use it in my own room,so I just replace "GROUND.GALE_JUNGLE_DEEP" with "WORLD_TILES.GALE_JUNGLE_DEEP" in AddRoom function.After world generation,my room do spawned,but the tiles there are normal forest and grass tiles, not mine tile.

I can't figure out why,would there be a solution to this ?

Many thanks,and...... this is my code:

AddTile(
    "GALE_JUNGLE_DEEP",
    "NOISE",
    {
        ground_name = "Gale Jungle Deep",
    },
    {
        name = "jungle_deep",
        noise_texture = "Ground_noise_jungle_deep",
        runsound = "dontstarve/movement/run_marsh",
        walksound = "dontstarve/movement/walk_marsh",
        snowsound = "dontstarve/movement/run_ice",
        mudsound = "dontstarve/movement/run_mud",
        colors = GROUND_OCEAN_COLOR,    --my defined color
    },
    {
        name="map_edge",
        noise_texture = "mini_noise_jungle_deep",
    }
)
 
 
 
AddRoom("duri_forest_bg_room", {
    colour={r=0,g=1,b=0,a=1},
    value = WORLD_TILES.GALE_JUNGLE_DEEP,
    contents =  {
        countprefabs = {
            livingtree = 1,
        },
 
        distributepercent = 0.5,
        distributeprefabs = {
            trees = {weight = 2, prefabs = {"deciduoustree", "evergreen_sparse"}},
            gale_forest_pillar_tree = 0.5,
            flower = 1.2,
            catcoonden = 0.1,
            beehive = 0.1,
            fireflies = 0.5,
            grass = 0.6,
            sapling= 0.8,
            twiggytree = 0.8,
            ground_twigs = 0.06,                                            
            molehill= 0.3,
            berrybush= 0.5,
            berrybush2= 0.5,
            berrybush_juicy = 0.25,
            red_mushroom = 0.3,
            green_mushroom = 0.2,
            rocks = 0.14,
            carrot_planted = 0.5,                                      
        },
    },
})
 
AddTask("duri_forest",{
    locks=LOCKS.NONE,
    keys_given=KEYS.NONE,
    room_choices={
        duri_forest_bg_room = 5,
    },
    room_bg = WORLD_TILES.GALE_JUNGLE_DEEP,
    background_room="Clearing",
    colour={r=0,g=1,b=0,a=1},
})
 
AddTaskSetPreInit("default", function(tasksetdata)
    if type(tasksetdata)=="table" and type(tasksetdata.tasks)=="table" then
        local tab= {
            "duri_forest",
        }
        for _,v in pairs(tab) do
            table.insert(tasksetdata.tasks, v)
        end
    end
end)

 

Thats because you set it as a "NOISE" tile, "NOISE" tiles only exist during worldgen, they then get transformed into other tiles via the functions in the new noisetilefunctions.lua. What you saw there was the result of the default function:

local function GetTileForGroundNoise(noise)
    if noise < 0.25 then
        return WORLD_TILES.IMPASSABLE
    elseif noise < 0.26 then
        return WORLD_TILES.ROAD
    elseif noise < 0.35 then
        return WORLD_TILES.ROCKY
    elseif noise < 0.4 then
        return WORLD_TILES.DIRT
    elseif noise < 0.5 then
        return WORLD_TILES.GRASS
    elseif noise < 0.75 then
        return WORLD_TILES.FOREST
    end

    return WORLD_TILES.MARSH
end

I suggest you change that to a "LAND" tile, no idea why you picked "NOISE":

AddTile(
    "GALE_JUNGLE_DEEP",
    "LAND", <--------- change to "LAND"
    {
        ground_name = "Gale Jungle Deep",
    },
    {
        name = "jungle_deep",
        noise_texture = "Ground_noise_jungle_deep",
        runsound = "dontstarve/movement/run_marsh",
        walksound = "dontstarve/movement/walk_marsh",
        snowsound = "dontstarve/movement/run_ice",
        mudsound = "dontstarve/movement/run_mud",
        colors = GROUND_OCEAN_COLOR,    --my defined color
    },
    {
        name="map_edge",
        noise_texture = "mini_noise_jungle_deep",
    }
)
Link to comment
Share on other sites

On 7/2/2022 at 2:51 AM, HalfEnder776 said:

Thats because you set it as a "NOISE" tile, "NOISE" tiles only exist during worldgen, they then get transformed into other tiles via the functions in the new noisetilefunctions.lua. What you saw there was the result of the default function:

local function GetTileForGroundNoise(noise)
    if noise < 0.25 then
        return WORLD_TILES.IMPASSABLE
    elseif noise < 0.26 then
        return WORLD_TILES.ROAD
    elseif noise < 0.35 then
        return WORLD_TILES.ROCKY
    elseif noise < 0.4 then
        return WORLD_TILES.DIRT
    elseif noise < 0.5 then
        return WORLD_TILES.GRASS
    elseif noise < 0.75 then
        return WORLD_TILES.FOREST
    end

    return WORLD_TILES.MARSH
end

I suggest you change that to a "LAND" tile, no idea why you picked "NOISE":

AddTile(
    "GALE_JUNGLE_DEEP",
    "LAND", <--------- change to "LAND"
    {
        ground_name = "Gale Jungle Deep",
    },
    {
        name = "jungle_deep",
        noise_texture = "Ground_noise_jungle_deep",
        runsound = "dontstarve/movement/run_marsh",
        walksound = "dontstarve/movement/walk_marsh",
        snowsound = "dontstarve/movement/run_ice",
        mudsound = "dontstarve/movement/run_mud",
        colors = GROUND_OCEAN_COLOR,    --my defined color
    },
    {
        name="map_edge",
        noise_texture = "mini_noise_jungle_deep",
    }
)

Thank you,my forest tile work fine now

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...