On reddit and twitch I've seen some confusion about fishing (especially in winter), so I thought I'd investigate.
The wiki states the following:
- Fishing at dawn (04:00-06:00) and dusk (18:00-20:00) increases the chance of catching fish
- Fishing between November and February decreases the chance of catching fish
- Fishing with a spear is harder
- Fishing with live bait is easier
- Fishing with fishing tackle requires higher levels of Fishing skill
The wiki is actually accurate about this, but I wanted to give additional details that are available in the lua code. ISFishingAction.lua has all the relevant information.
First off, you can set the Sandbox Settings to adjust how easy it is to "attract" fish to catch:
o.attractNumber = 100; if SandboxVars.NatureAbundance == 1 then -- very poor o.attractNumber = 140; elseif SandboxVars.NatureAbundance == 2 then -- poor o.attractNumber = 120; elseif SandboxVars.NatureAbundance == 4 then -- abundant o.attractNumber = 80; elseif SandboxVars.NatureAbundance == 5 then -- very abundant o.attractNumber = 60; end
For the purposes of this post, let's just assume you are using default settings, so your attract number is 100 and we more easily talk in percentages.
The attractFish() method gives all the information we need:
-- Depend on what lure you used : -- Living lure is easier but can escape and always removed after getting something -- Plastic lure are for good fisherman, almost never disapear but harder to get something function ISFishingAction:attractFish() local attractNumber = ZombRand(self.attractNumber); -- a bit more chance during dawn and dusk local currentHour = math.floor(math.floor(GameTime:getInstance():getTimeOfDay() * 3600) / 3600); if (currentHour >= 4 and currentHour <= 6) or (currentHour >= 18 and currentHour <= 20) then attractNumber = attractNumber - 10; end if self.usingSpear then -- less chance to catch something with a spear attractNumber = attractNumber + 10; end -- harder chance of getting fish during winter if (getGameTime():getMonth() + 1) >= 11 or (getGameTime():getMonth() + 1) <= 2 then attractNumber = attractNumber + 20; end -- start with plastic lure if self.plasticLure and attractNumber <= (10 + (self.fishingLvl * 2.5)) then return true; elseif not self.plasticLure and attractNumber <= (20 + (self.fishingLvl * 1.5)) then return true; end -- return true; return false; end
So, with the default self.attractNumber of 100, we generate a random number (1-100) and call it attractNumber. If it is low enough, we have attracted fish, and that number is modified in the following ways:
- Fishing at dawn and dusk increases the chance of catching fish by 10%
- Fishing between November and February decreases the chance of catching fish by 20%
- Fishing with a spear is harder by 10%
- Fishing with live bait is easier than fishing tackle by 10% at Level 0
10 + (self.fishingLvl * 2.5) vs 20 + (selffishingLvl * 1.5)
10 + (10 * 2.5) = 20 + (10 * 1.5) = 35
Wait, doesn't Fishing Abundance affect your chance of catching fish?
if fishLeft == 0 then self.character:SetVariable("FishingFinished","true"); -- needed to remove from queue / start next. ISBaseTimedAction.perform(self); return; end end local caughtFish = false; if self:attractFish() then -- caught something !
self:drawTextCentre(getText("IGUI_FishingUI_FishAbundance") .. self.zoneProgress .. "%", self.width/2, barY, 1,1,1,1, UIFont.Small);
if zoneClicked then local currentFish = tonumber(zoneClicked:getName()); local totalFish = tonumber(zoneClicked:getOriginalName()); if not currentFish or not totalFish or currentFish <= 0 or totalFish <= 0 then self.zoneProgress = 0; else self.zoneProgress = math.floor((currentFish / totalFish) * 100); end end
local fishLeft = tonumber(updateZone:getName()); if getGametimeTimestamp() - updateZone:getLastActionTimestamp() > 20000 then fishLeft = math.max(ZombRand(10,25) + self.fishingZoneIncrease, 0); updateZone:setName(tostring(fishLeft)); updateZone:setOriginalName(tostring(fishLeft)); end if fishLeft == 0 then self.character:SetVariable("FishingFinished","true"); -- needed to remove from queue / start next. ISBaseTimedAction.perform(self); return; end
if self:attractFish() then -- caught something ! local fish = self:getFish(); if updateZone then local fishLeft = tonumber(updateZone:getName()); updateZone:setName(tostring(fishLeft - 1)); updateZone:setLastActionTimestamp(getGametimeTimestamp()); if isClient() then updateZone:sendToServer() end end caughtFish = true;
if not updateZone then -- register a new fishing zone local nbrOfFish = math.max(ZombRand(10,25) + self.fishingZoneIncrease, 0); local x,y,z = self.tile:getSquare():getX(), self.tile:getSquare():getY(), self.tile:getSquare():getZ() local updateZone = getWorld():registerZone(tostring(nbrOfFish), "Fishing", x - 20, y - 20, z, 40, 40); updateZone:setOriginalName(tostring(nbrOfFish)); updateZone:setLastActionTimestamp(getGametimeTimestamp()); if isClient() then updateZone:sendToServer() end end
So, what is the deal with what I called "units"?
@LuaMethod(name="getGametimeTimestamp", global=true) public static long getGametimeTimestamp() { return GameTime.instance.getCalender().getTimeInMillis() / 1000L; }
