Generalize Adjacent Water Borders

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Generalize Adjacent Water Borders

Post by GriffonSpade »

Removes the automatic adjacent-to-city border water claim rule from normal border claiming.

Adds new override claim rule, both checks of which must be true:
-Tile is within SQUARE ROOT of RADIUS_SQ_CITY_FORCED range of a CITY.
-Tile failed 'standard' border claims.

--Works the same as standard border claiming rules
--Values larger than the normal RADIUS_SQ_CITY plus SIZE_EFFECT are irrelevent, since border checks for tiles outside the standard claim range are never initiated.
--Values larger than the city's work radius (generally, RADIUS_SQ_CITY_FORCED = 5) are deprecated. Its primary purpose is to allow up to city work radius to be claimed as territory.
--Claim_Ocean effect effectively nullifies this, as it does with the current, adjacent claiming rule.

As an aside, it seems odd that border increases live in the game.ruleset rather than effects.ruleset. Must either be unimportant or a potential source of lag.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Generalize Adjacent Water Borders

Post by Alien Valkyrie »

GriffonSpade wrote:As an aside, it seems odd that border increases live in the game.ruleset rather than effects.ruleset. Must either be unimportant or a potential source of lag.
Since the ruleset is read at the very beginning, splitting things between different files can't cause any lag at turn changes.
Still, though, moving it to effects (Maybe "Border_Radius_Sq_Base" and "Border_Radius_Sq_Size") would allow more customizablity. It would, however, also be a possible source of lag, as recalculating the borders would require evaluating two effects for every city in the world, as well as a possibly source of errors in the implementation. However, what should be moved to effects is base city work and vision radius.
~ AVL
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: Generalize Adjacent Water Borders

Post by GriffonSpade »

Caedo wrote:
GriffonSpade wrote:As an aside, it seems odd that border increases live in the game.ruleset rather than effects.ruleset. Must either be unimportant or a potential source of lag.
Since the ruleset is read at the very beginning, splitting things between different files can't cause any lag at turn changes.
Still, though, moving it to effects (Maybe "Border_Radius_Sq_Base" and "Border_Radius_Sq_Size") would allow more customizablity. It would, however, also be a possible source of lag, as recalculating the borders would require evaluating two effects for every city in the world, as well as a possibly source of errors in the implementation. However, what should be moved to effects is base city work and vision radius.
The stuff in game.ruleset don't actually appear to be effects as such, but simpler constant (within a given game) declarations. As you said, it prevents competing/changing values from having to be assessed.

Edit: Also, as the increments to city work and vision radius ARE in effects, setting the defaults in effects to 0 would essentially do that. Those two work fine as is.
Post Reply