Jump to content

Bug in the newly added AbandonedBoat layout


clearlove
  • Fixed

I believe the codes of AbandonedBoat in the map/layouts.lua should be changed as below:

["AbandonedBoat1"] = StaticLayout.Get("map/static_layouts/abandonedboat",
  {
    start_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED,
    fill_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED,
    areas = 
    {
      -- item_area1 = {math.random() >= .5 and "spoiled_fish_small" or "spoiled_fish"},
      item_area1 = function() return math.random() >= .5 and {"spoiled_fish_small"} or {"spoiled_fish"} end,
      -- item_area2 = {math.random() >= .5 and "twigs" or "cutgrass"},
      item_area2 = function() return math.random() >= .5 and {"twigs"} or {"cutgrass"} end,
      mast_area = {"mast_broken"},
      fishing_item_area = {"chum"},
      seastack_area = function() return math.random() < 0.9 and {"seastack"} or nil end
    },
  }),

["AbandonedBoat2"] = StaticLayout.Get("map/static_layouts/abandonedboat",
  {
    start_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED,
    fill_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED,
    areas = 
    {
      -- item_area1 = {math.random() >= .5 and "oar" or "oar_driftwood"},
      item_area1 = function() return math.random() >= .5 and {"oar"} or {"oar_driftwood"} end,
      -- item_area2 = {math.random() >= .5 and "twigs" or "cutgrass"},
      item_area2 = function() return math.random() >= .5 and {"twigs"} or {"cutgrass"} end,
      mast_area = {},
      -- fishing_item_area = {math.random() >= .5 and "oceanfishinglure_hermit_snow" or "oceanfishinglure_hermit_heavy"},
      fishing_item_area = function() return math.random() >= .5 and {"oceanfishinglure_hermit_snow"} or {"oceanfishinglure_hermit_heavy"} end,
      seastack_area = function() return math.random() < 0.9 and {"seastack"} or nil end
    },
  }),

 

Why I think such modification is needed: 

  1. Current codes will cause the generated world different from the one in V605310 with the same seed. I modified the codes as above and produced a nearly identical world as V605310.
  2. Another reason that I believe it is a bug is that all other layouts in this file wrap the expression in a function.
  3. I am not sure whether this bug will cause any side effects. I hypothesize this may reduce the randomness of the generated boats, but I am not sure.

Steps to Reproduce

1. You can directly review the code snippet. 

2. You may also compare the worlds generated in V605310 and the current version with the same SEED (I use 1172289482 as the SEED). Without the modification, the two worlds look different while the worlds are quite similar with the modification.

  • Like 2
  • Thanks 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


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

×
  • Create New...