Ticket #42333

fix interverted naming : AI_HARD vs AI_CHEATING

Eröffnet am: 2021-05-20 21:09 Letztes Update: 2021-06-07 21:09

Auswertung:
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
3

Details

Currently AI_LEVEL_HARD is cheating on rates , which is visible by user in nation reports (when AI_LEVEL_CHEATING was not). (All others 'cheats' for AI are not visible to the user)

This is not what a player can expect, as the help says :

  case AI_LEVEL_CHEATING:
    /* TRANS: describing an AI skill level */
    astr_add_line(&help,
                  _("\nThis skill level has the same features as 'Hard', "
                    "but may enjoy additional ruleset-defined bonuses."));
    break;
(As a player, i played at normal level fist, then hard, and only tried cheating lately , and i expected it to be even strong than hard, not the opposite.)

This trivial patch applies on all branches S2_6,S3_0, S3_1, master.

I checked the code in S3_0 , and this patch has no effect other than just naming things correctly, in a way players can understand.

Ticket-Verlauf (3/15 Historien)

2021-05-20 21:09 Aktualisiert von: alain_bkr
  • New Ticket "fix interverted naing : AI_HARD vs AI_CHEATING" created
2021-05-20 21:09 Aktualisiert von: alain_bkr
  • Summary Updated
2021-05-20 21:26 Aktualisiert von: cazfi
Kommentar

Reply To alain_bkr

_("\nThis skill level has the same features as 'Hard', " "but may enjoy additional ruleset-defined bonuses."));

It has *ruleset* defined bonuses, in most rulesets including unlimited rates (that Hard has as a hardcoded bonus). civ2civ3 might be an exception as people are reporting that unlimited rates are actually hurting AIs performance.

2021-05-20 21:34 Aktualisiert von: alain_bkr
Kommentar

I did a second patch, S3_0 only .

  • does the same trivial fix
  • add comments on each line
  • rewrite the switch (level) and let on case pass throug to the next, to ease reading of what each level add.
       /* real AIs */
       case AI_LEVEL_NOVICE:
       case AI_LEVEL_HANDICAPPED:
         BV_SET(handicap, H_DANGER);        /* paranoia : Believes its cities are always under threat. */
         BV_SET(handicap, H_PRODCHGPEN);    /* may suffer prod penalty when changing city's production
                                             *    which is not the case generally for sake of code simplicity
                                             *    and reasonable efficiency of AI */
         /* continue below */
       case AI_LEVEL_EASY:
         BV_SET(handicap, H_NOPLANES);      /* does not build planes */
         BV_SET(handicap, H_LIMITEDHUTS);   /* reduced bonus from huts */
         BV_SET(handicap, H_DEFENSIVE);     /* Prefers defensive buildings and avoids close diplomatic relations. */
    
    

I can make a similar comment patch for each branch if someone thinks it is valuable.

2021-05-20 21:46 Aktualisiert von: alain_bkr
Kommentar

Reply To cazfi

Reply To alain_bkr

_("\nThis skill level has the same features as 'Hard', " "but may enjoy additional ruleset-defined bonuses."));

It has *ruleset* defined bonuses, in most rulesets including unlimited rates (that Hard has as a hardcoded bonus). civ2civ3 might be an exception as people are reporting that unlimited rates are actually hurting AIs performance.

No matter what the ruleset adds or removes.

  • currently AI_LEVEL_HARD visibly does not follow the rules == it is either broken or cheating
  • cheating level is handicaped with H_RATE which is a handicap, not a bonus (inverted handicap) compared to HARD. This is opposite to what is explained in the help message.

=> just name things correctly with a trivial patch :-)

I ended by making the 'S3_0_add_comments...patch' , because I spent a lot of time to be sure of what H_XYZ 'inverted' does compared to what is written in the help message.

(Edited, 2021-05-20 21:47 Aktualisiert von: alain_bkr)
2021-05-20 21:52 Aktualisiert von: cazfi
Kommentar

Reply To alain_bkr

Reply To cazfi

Reply To alain_bkr

_("\nThis skill level has the same features as 'Hard', " "but may enjoy additional ruleset-defined bonuses."));

It has *ruleset* defined bonuses, in most rulesets including unlimited rates (that Hard has as a hardcoded bonus). civ2civ3 might be an exception as people are reporting that unlimited rates are actually hurting AIs performance.

* cheating level is handicaped with H_RATE which is a handicap, not a bonus (inverted handicap) compared to HARD. This is opposite to what is explained in the help message.

Lack of H_RATE is a bonus compared to rules, and *Cheating gets equivalent bonus through the rulesets*, but with better control (e.g. in civ2civ3 it's better for the overall AI perfromance *not* to have that freedom (to shoot oneself in the foot, in that ruleset))

(Edited, 2021-05-20 21:58 Aktualisiert von: cazfi)
2021-05-20 22:05 Aktualisiert von: alain_bkr
Kommentar

Reply To cazfi

Lack of H_RATE is a bonus compared to rules, and *Cheating gets equivalent bonus through the rulesets*, but with better control (e.g. in civ2civ3 it's better for the overall AI perfromance *not* to have that freedom (to shoot oneself in the foot, in that ruleset))

yes lack of H_rate is a bonus

currently in master, ai/difficulty.c , line 125

   case AI_LEVEL_CHEATING:
     BV_SET(handicap, H_RATES);
     break;
   case AI_LEVEL_HARD:
     /* No handicaps */
     break;

* HARD has the bonus, and players thinks it is a bug, because tax can be 100% under monarchy and this is forbidden by the rules (no matter if it is efficient or not.)

This behavior would not be reported as a bug for CHEATING, because the player is aware that AI is...cheating.

Edited : in other words , HARD should have BV_SET(handicap, H_RATES); because the help text never informs the player that AI will cheat (and this one is visible by the player)

(Edited, 2021-05-20 22:13 Aktualisiert von: alain_bkr)
2021-05-20 22:15 Aktualisiert von: cazfi
Kommentar

So, all what you actually want to do is to add H_RATES for hard, so that it would not have that cheat?

2021-05-20 22:22 Aktualisiert von: cazfi
Kommentar

Reply To alain_bkr

This behavior would not be reported as a bug for CHEATING, because the player is aware that AI is...cheating.

Minor note that current behavior matches what is documented, e.g. '/help hard' tells it.

2021-05-21 20:44 Aktualisiert von: alain_bkr
Kommentar

I understand why we are discussing so much for a seemingly so simple thing :-)


Your point of view is from inside freeciv-server shell , where no player goes.

The inside server doc seems to automagically generate content, and thus is always correct. But i only went there recently, after many years of occasional play/wait-next-version/retry.


My point of view is a player one, using the GUI :

In the first screen, i can choose ai_level, and they are sorted by strenght. (also no help is available in gtk* first screen, and anyway players never read the doc until it is too late)

As 'cheating' is mentioned, so i don't expect previous levels to cheat (in a visible way). The expected behavior is that CHEATING cheats more than HARD ( be it good or bad is not the question).

In a ticket for something else, i noticed btw that HARD did not respect tax rate, and really thought it was a bug. As a player I don't like when a game is "obviously" buggy, and #42309 will make this very visible


As a newcomer developer, i don't want to waste more of your time.

I propose you to :

  • not change anything for 2.6 (that personally i would end-of-life)
  • for 3_0, S3_1, master take the opportunity of a major version change to 'fix' this :
    • Either just add BV_SET(handicap, H_RATES) to ai_LEVEL_HARD, , the simple patch just work.
    • or fix and add comments in ai/difficulty.c (i make the patches for each branch) because it is impossible when reading the code to understand that
          case AI_LEVEL_HARD:
           BV_SET(handicap, H_RATES);
          break;
      
      means:
         case AI_LEVEL_HARD:
           BV_SET(handicap, H_RATES);         /* follow government rules wrt %gold / %sci / %lux   */
      
           /* below are listed 'inverted' handicaps */
           /* BV_SET(handicap, H_TARGETS);        without this AI CAN target unknow stuff */
           /* BV_SET(handicap, H_HUTS);           without this AI KNOWS the location of huts in unexplored territory */
           /* BV_SET(handicap, H_REVOLUTION);     without this AI AVOIDS anarchy during revolution */
           /* BV_SET(handicap, H_PRODCHGPEN);     without this AI CAN change city production without penalty */
      
           /* AI always know map and see through fog  (v3.x) */
           /* BV_SET(handicap, H_FOG);            without this AI CAN see through fog of war */
           /* BV_SET(handicap, H_MAP);            without this AI KNOWS the complete map, including unexplored territory */
           break;
      
      
2021-05-21 21:13 Aktualisiert von: cazfi
  • Lösung Update from Keine to Accepted
  • Meilenstein Update from (Keine) to 3.1.0 (closed)
Kommentar

Attached a patch to add H_RATES for Hard and Experimental.

- Hardcoded properties of Hard and Cheating are the same, the only difference are ruleset provided cheating for Cheating level - Experimental is like Hard + H_EXPERIMENTAL

Not targeting to stable branches.

2021-06-07 21:09 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Accepted to Gefixt

Bearbeiten

Please login to add comment to this ticket » Anmelden