Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request -- Ocean tiles should not be claimable by cities #4353

Closed
ryanmusante opened this issue May 7, 2018 · 14 comments
Closed

Request -- Ocean tiles should not be claimable by cities #4353

ryanmusante opened this issue May 7, 2018 · 14 comments

Comments

@ryanmusante
Copy link

ryanmusante commented May 7, 2018

1. Mod version (i.e Date - 4/23):
4/30

2. Mod list (if using Vox Populi only, leave blank):
Infixo's UI Mods

3. Error description:
Ocean tiles should not be claimed by cities. If units require compass for traversing ocean tiles, why can a city claim an ocean tile for work (extremely low yields)?

Problems with cities having ocean tiles:

  1. Extremely low yields
  2. Blocks early/mid-game travel for civs uncovering fog of war
  3. Blocks mid game travel for establish sea trade routes
  4. Creates deadlocks for ships at sea leading to wars otherwise unnecessary
  5. Prevents artificial dead spots in between owned territories
  6. Comparable to moden day Maritime Law/Admiralty Law, civs do not have so much of the ocean claimed as owned territory

FIX: Global - Coastal Waters Only Mod:

UPDATE CustomModOptions SET Value=1 WHERE Name="EVENT_CITY_BORDERS";
along with GlobalCoastalWatersOnly.lua

4. Steps to reproduce (optional):


Supporting information:
Please note that you can attach .zip files by dragging-and-dropping them. If possible, zip up all supporting data and post that way.

@ryanmusante ryanmusante changed the title Ocean tiles should by default not be claimed Ocean tiles should not be claimable by cities May 7, 2018
@ilteroi
Copy link
Collaborator

ilteroi commented May 7, 2018

so your're proposing to include this mod or to replace it?

in general lua hooks aren't great for performance.

@ryanmusante
Copy link
Author

I'm proposing to include the mod. According to latest version from 2016:

Cities may only acquire water plots if they are adjacent to land or contain a workable feature (atolls, et al) or visible resource (fish, whales, et al)

@Iamblichos
Copy link
Collaborator

If it's to be included, let's do the work in C++ and not Lua. @ilteroi is right, Lua hooks are a poor way to make a feature work.

@ryanmusante
Copy link
Author

ryanmusante commented May 7, 2018

Indeed, cpp is the way to go, I agree. Beow is the lua script:

print("This is the 'Global - Coastal Waters Only' mod script")
--
-- This function is called whenever a city is considering a tile for acquisition.
-- It is called after the standard checks (does anybody else own this tile, etc)
--
function OnCityCanAcquirePlot(iPlayer, iCity, iPlotX, iPlotY)
  -- print(string.format("OnCityCanAcquirePlot(%d, %d - (%d, %d))", iPlayer, iCity, iPlotX, iPlotY))
  local pPlot = Map.GetPlot(iPlotX, iPlotY)
  if (pPlot:IsWater() and not pPlot:IsAdjacentToLand()) then
    -- Non-coastal water, check for features (atolls, natural wonders etc) or visible resources
	if (pPlot:GetFeatureType() == -1 and pPlot:GetResourceType(Players[iPlayer]:GetTeam()) == -1) then
	  -- print("  ... plot may NOT be acquired")
	  return false
	end
  end
  -- By default we can acquire the plot
  return true
end
GameEvents.CityCanAcquirePlot.Add(OnCityCanAcquirePlot)
GameEvents.CityCanBuyPlot.Add(OnCityCanAcquirePlot)

@ilteroi
Copy link
Collaborator

ilteroi commented May 7, 2018

well, that piece of code raises a few questions:

  • there is also "shallow water" which is not adjacent to land. i would include that in the definition of coastal.
  • there is no check for player tech? i was assuming that after a player can cross ocean the restriction would be lifted.

@Iamblichos
Copy link
Collaborator

Needs to be isCoastalLand

@tu-79
Copy link

tu-79 commented May 8, 2018

So ocean is no longer claimable ever? Or just before Compass?

@ilteroi
Copy link
Collaborator

ilteroi commented May 8, 2018

before compass. or whatever the relevant tech is ...

@bigcat88
Copy link

What about Polynesia? They can claim ocean from start or like others from request tech?

@TechpriestEnginseer
Copy link
Collaborator

Wasn't it that you could traverse your own ocean's tiles or was that just a version later too late? That's my inquiry.

@ilteroi
Copy link
Collaborator

ilteroi commented May 11, 2018

polynesia is fine. can buy/claim from the start.

the other question i don't understand

@TechpriestEnginseer
Copy link
Collaborator

TechpriestEnginseer commented May 11, 2018

Ships can travel ocean tiles that are owned by their cities pre-Compass.

I also feel like there should be an exception for one-tile city islands to be able to claim ocean pre-Compass...

@ilteroi
Copy link
Collaborator

ilteroi commented May 12, 2018

  1. i think that's obsolete with the may-traverse-ocean-but-cannot-end-turn-there rule.
  2. how would you settle those one-tile islands?

@ryanmusante ryanmusante changed the title Ocean tiles should not be claimable by cities Request -- Ocean tiles should not be claimable by cities Sep 19, 2018
@ryanmusante
Copy link
Author

#6555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants