Naval issues

Knasp

Warlord
Joined
Sep 10, 2011
Messages
266
Played a game today where I focused on naval part of the game, and I noticed some possible bugs and issues:
  • Fishing doesn't work until you research Celestial navigation tech. I believe it should be moved to Sailing tech, otherwise Fishing boats and Fish market are useless. I.e. no Fish or Crabs were aquired by the City at all, until Celestial navigation.
  • My Galley units lost 1 or both their ships, and still managed to stay alive. The units could resupply with new Galleys if they were moved into the City, but the replacement Galleys they aquired were placed in their Camp. I'm not sure how the resupply mechanic works, because the Galley was only moved into "Frontline" once I had a positive income again. I didn't check the naval logistics in the beginning, so maybe that had something to do with it. See screenshots below:
Spoiler Screens :
Here's a Galley unit without any ships:
Here's a Galley unit with an extra Galley "In Camp":

Here's the same unit next turn, extra Galley still "In Camp":



Didn't save log files exactly after this unfortunately, but attaching lua.log and autosaves. (Game crashed on turn 124)
 

Attachments

  • Naval_issues_crash_at_turn_124.7z
    6.2 MB · Views: 144
We need a better name for Naval "buffer-reserve"...

I may need to change a rounding method somewhere, so that an unit near 0 health still has at least 1 unit of equipment... On the other hand, it could represent ship(s) still floating but damaged beyond repairs.

About Fishing, it should work on plots in the close area from the city before Celestial Navigation, but you won't see Fishing Boats, just a bit of water resources collected. The Lighthouse is triggering the Fishing Boats (and you get a lot more water resources then), some techs/buildings raise the range of the workable plots. That's a mechanism that need some polish and a lot more UI feedback, on the techs, buildings and maybe City tooltips.
 
We need a better name for Naval "buffer-reserve"...

I may need to change a rounding method somewhere, so that an unit near 0 health still has at least 1 unit of equipment... On the other hand, it could represent ship(s) still floating but damaged beyond repairs.

About Fishing, it should work on plots in the close area from the city before Celestial Navigation, but you won't see Fishing Boats, just a bit of water resources collected. The Lighthouse is triggering the Fishing Boats (and you get a lot more water resources then), some techs/buildings raise the range of the workable plots. That's a mechanism that need some polish and a lot more UI feedback, on the techs, buildings and maybe City tooltips.
In the screenshots above, you can see that there's a Fish resource 2 tiles away from Athens. As far as I could tell, I recieved no fish and no food from any water tile. And I looked specifically in the City details to make sure I wasn't missing something.

I'm pretty sure I recieved Fish just by finishing the tech, as I never built a lighthouse. Celestial Navigation tech brings the ability to harvest Fish/Crabs as well as allowing all land units to disembark, so I thought that maybe one of those made fishing possible. Of course, you know best how the code operates. In any case, I think you should be able to fish further away than your culture extends. Maybe 6 tiles range from City center, with Sailing?
 
It's not something I've coded recently, so I had to look at the code...

It was done quickly (and hardcoded) at the time to allow harvesting resources without culture on water.

For the range at which you get resource it's from 0 (before Sailing) to 11 (late game) see (in GCO_CityScript.lua)

Code:
function GetSeaRange(self)
    if not self:IsCoastal() then return 0 end -- to do: harbor
    local range = 0
    local pTech = Players[self:GetOwner()]:GetTechs()
    if pTech then
        if pTech:HasTech(GameInfo.Technologies["TECH_SAILING"].Index)                 then range = range + 1    end
        if pTech:HasTech(GameInfo.Technologies["TECH_CELESTIAL_NAVIGATION"].Index)     then range = range + 1    end
        if pTech:HasTech(GameInfo.Technologies["TECH_SHIPBUILDING"].Index)             then range = range + 1    end
        if pTech:HasTech(GameInfo.Technologies["TECH_CARTOGRAPHY"].Index)             then range = range + 1    end
        if pTech:HasTech(GameInfo.Technologies["TECH_SQUARE_RIGGING"].Index)         then range = range + 1    end
    end
    local buildings = self:GetBuildings()
    if buildings then
        if buildings:HasBuilding(GameInfo.Buildings["BUILDING_CITY_SHIPYARD"].Index) then range = range + 1 end
        if buildings:HasBuilding(GameInfo.Buildings["BUILDING_LIGHTHOUSE"].Index) then range = range + 1 end
        if buildings:HasBuilding(GameInfo.Buildings["BUILDING_SHIPYARD"].Index) then range = range + 1 end
        if buildings:HasBuilding(GameInfo.Buildings["BUILDING_SEAPORT"].Index) then range = range + 3 end
    end
    return range
end

The Lighthouse triggers the Fishing boats, which multiply the collected resources.

The range is a path range, and you won't go through Ocean to get a resource before Cartography.

And yes, that to do... I really need to do it.

And de-hardcode everything (setting the values in XML, adding info in the UI based on those, ...)

While I'm at it, resource in owned plots (the one you can get to place Harbors) are exploited only by the city owning the plot, while the other resources can be exploited by multiple cities at once.
 
Top Bottom