bugFreeciv - Bugs: bug #16308, Great Wall doesn't protect allied...

 
 
Show feedback again

bug #16308: Great Wall doesn't protect allied units in owner's cities

Submitted by:  George Koehler <kernigh>
Submitted on:  Tue 27 Jul 2010 01:10:36 AM UTC  
 
Category: rulesetsSeverity: 3 - Normal
Priority: 5 - NormalStatus: Confirmed
Assigned to: NoneOpen/Closed: Open
Release: 2.2.1+ r17591Operating System: *BSD
Planned Release: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 30 Jun 2012 10:45:30 AM UTC, comment #7:

I've raised comment 5 separately as bug #19874.
I haven't raised tickets for other wishes expressed here.
Let's keep this for the specific problem of how effects affect allies.
(I still have no good idea how to solve it.)

Jacob Nevins <jtn>
Project Administrator
Sat 14 Aug 2010 11:01:51 PM UTC, comment #6:

Sorry me, previous post was mine, I forgot to login.

-Deleted Account- <tirolalira>
Sat 14 Aug 2010 11:00:17 PM UTC, comment #5:

Thank you George. Then I guess the best option for now is to use the Great Wall effect of default ruleset.

I have noticed another possible bug similar to this one. When I use the requeriment "Special", "River", "Adjacent" in my rulesets, it seems to return always false, even when the city is placed near or over a river.

This code from effects.ruleset never works (it is supposed to give aqueduct bonus in cities near rivers):

I do not open a new topic in case I'm doing something wrong and there is no bug.

Anonymous
Fri 13 Aug 2010 03:41:16 AM UTC, comment #4:

> Would it be possible to give this defense bonus to every unit placed inside your national borders?


No. S2_2 has some requirement types that check tiles (like "Special", "Terrain", "TerrainClass", "Base", "TerrainAlter", "CityTile"), but none of these can check national borders.

> or to every unit in some of the tiles owned by your cities (workable tiles)?


No. "CityTile" of S2_2 can only check for city centers ("center"), not for workable tiles.

> or to every unit in same continent than the Great walls?


Yes, try this:

A comment at common/requirements.c:703 claims, ' At present, "Continent" effects can affect only cities and units in cities.' So there is no way to give bonus to units who are on continent but not in cities!

From common/combat.c:442, "Defend_Bonus" only knows three facts:

  • the player of the defending unit.
  • the defending city.
  • the type of the attacking unit.

If there is no city, then the check has no information about the location of the unit. This is why "Continent" requires a city. "Continent", like "Player", checks the player. Because of this bug, "Defend_Bonus" checks the player of the defending unit (not the defending city).

The result is a Great Wall that checks the continent of the defending city (not the defending unit) and the player of the defending unit (not the defending city).

George Koehler <kernigh>
Thu 12 Aug 2010 10:21:55 PM UTC, comment #3:

A question related to this bug:
I'm working on a Ruleset where I want the Great Wall to give an additional defense bonus instead of replacing the Walls.

With current Ruleset capabilies: Would it be possible to give this defense bonus to every unit placed inside your national borders? or to every unit in some of the tiles owned by your cities (workable tiles)? or to every unit in same continent than the Great walls?

-Deleted Account- <tirolalira>
Thu 12 Aug 2010 08:50:48 AM UTC, comment #2:

See also bug #16080.

pepeto <pepeto>
Project Member
Sun 08 Aug 2010 10:59:05 AM UTC, comment #1:

I confirm this is buggy. However, I am out of idea about how we could fix that.

pepeto <pepeto>
Project Member
Tue 27 Jul 2010 01:10:36 AM UTC, original submission:

Let player C have the Great Wall. Help text says, "Works as a City Wall in all your cities." I would expect the Great Wall to protect all units in cities, where the cities belong to player C. The bug is that the Great Wall protects all units in cities, where the units belong to player C. (I have r17591 of S2_2, which has the fix from bug #16080 that actually requires units to be in cities.)

If player C has alliance with player K, then Great Wall protects whom? Units of K in cities of C, or units of C in cities of K? I attach x-great-wall-test.sav.bz2 which shows exactly this problem. (I made this game with the editing-mode.)

Load x-great-wall-test.sav.bz2 and take player S (Scottish), who is attacking player C (Chinese) and player K (Korean). Cities marked [C] have three Chinese defenders; cities marked [K] have three Korean defenders. All units are green Archers.

  • Guangzhou [C] and Shanghai [K] are Chinese cities.
  • Wanggomsong [C] and Jolbon [K] are Korean cities with no walls.
  • Ungjin [C] and Wandu [K] are Korean cities with City Walls.

Kill all defenders, but never conquer cities. (They might be homecities of other defenders.) Shanghai [K] and Jolbon[K] are easy to kill; the four other cities are difficult to kill.

  • Guangzhou [C] is a Chinese city with Chinese defenders. Difficult to kill. Chinese Great Wall protects defenders. No bug.
  • Shanghai [K] is a Chinese city with Korean defenders. Easy to kill! Chinese Great Wall fails to protect Korean defenders in a Chinese city! This is bug.
  • Wanggomsong [C] is a Korean city with Chinese defenders. Difficult to kill! Chinese Great Wall protects Chinese units in a Korean city! This is bug.
  • Jolbon [K] is a Korean city with Korean defenders. Easy to kill. No bug.
  • Ungjin [C] and Wandu [K] have City Walls. Difficult to kill. No bug.

Chinese Great Wall prevents loss of population in Shanghai [K], but not in Wanggomsong [C]. This is correct.

I thought that Chinese Great Wall and Korean City Walls might combine to add protection to Ungjin [C], but this seems not to happen.

These are the current rules in effects.c:

This says to protect all Chinese units in any city (if the attacker is land or helicopter unit). I would change this to say to protect any unit in all Chinese cities, if I knew a way.

George Koehler <kernigh>

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #9590:  x-great-wall-test.sav.bz2 added by kernigh (10kB - application/octet-stream - play as Scottish; attack Chinese and Korean cities)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jtn (Posted a comment)
  • -unavailable- added by tirolalira (Posted a comment)
  • -unavailable- added by pepeto (Posted a comment)
  • -unavailable- added by kernigh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Jun 2012 10:45:30 AM UTCjtnSummaryGreat Wall protects wrong units=>Great Wall doesn't protect allied units in owner's cities
    Sun 08 Aug 2010 10:59:05 AM UTCpepetoStatusNone=>Confirmed
    Tue 27 Jul 2010 01:10:36 AM UTCkernighAttached File-=>Added x-great-wall-test.sav.bz2, #9590
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup