Effects for 7x7 squares

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Ignatus
Elite
Posts: 490
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Effects for 7x7 squares

Postby Ignatus » Sun Apr 19, 2020 10:35 am

7x7 squares centered at a unit are magical for Civilization games. In Civ2, units are healed 10% faster if a home (allied?) city is within this range, and another 10% if the city has Barracks. In Civ3, foreign unit positioned within a nation's borders in this range from some of the nation's cities is considered placed offensively enough to make ultimative request to its owner to remove all units out of the borders immediately. In Freeciv, some bases in this range from an allied city make military units inside not to cause military unhappiness to their city; also, barbarians may be disbanded if there are no hostile units or cities in the range.

Thus, let's introduce new requirements:
* "NearCityDiplRel", "War/Team/Alliance...", "Local/City/Player/Team/Alliance/World" - a city belonging to a player having this diplrel to a player in the range is within 3-radius square from the target tile; "Local" range means DiplRel to the owner of the tile and "City" to the owner of the target city.
* "NearBuilding", "Barracks etc.", "Player/Team/Alliance..." - The 3-radius square contains a city with this building belonging to a player in the range.
These two effects may make it possible to reproduce Civ2 healing effects.
* "NearUnitDiplRel", "War etc.", "Player etc." - analogical to NearCityDiplRel but towards owners of units around. This may unhardcode "Retire_Pct" effect and eventually transform it into a proper trireme sinking mechanism.

Ignatus
Elite
Posts: 490
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Effects for 7x7 squares

Postby Ignatus » Tue Jan 26, 2021 7:14 am

Alternative solution for buildings is that they have parameters "effect_radius_sq", "effect_dist", "effect_radius_sq2" that, alongside with "Building", "Adjacent", have three separate requirement types that test if a player in given range has such a building within corresponding radius (e.g. Barracks definition will have effect_dist = 3, and the regeneration increment effect will have req "BuildingEffectDist", "Barracks", "Alliance"). We need two effect radii to support regional wonders like on Ways of History game that have one radius of their uniqueness (that we in Freeciv will pass as a negated building req to itself) and another radius of their effect.

Lexxie
Veteran
Posts: 93
Joined: Fri Jun 23, 2017 4:18 pm

Re: Effects for 7x7 squares

Postby Lexxie » Tue Feb 16, 2021 7:33 am

Something like this would be really nice. Especially it's ridiculous with 1 turn left on cease-fire, someone can put a stack of 20 cannons adjacent to your city, and the Senate says no, we don't have casus belli.

Lexxie
Veteran
Posts: 93
Joined: Fri Jun 23, 2017 4:18 pm

Re: Effects for 7x7 squares

Postby Lexxie » Tue Feb 16, 2021 7:33 am

Something like this would be really nice. Especially it's ridiculous with 1 turn left on cease-fire, someone can put a stack of 20 cannons adjacent to your city, and the Senate says no, we don't have casus belli.