patchFreeciv - Patches: patch #3692, Reduce SHIELD_WEIGHTING

 
 
Show feedback again

patch #3692: Reduce SHIELD_WEIGHTING

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Mon 11 Feb 2013 02:05:17 AM UTC  
 
Category: aiPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Sat 20 Apr 2013 09:34:24 PM UTC, SVN revision 22738:

Tweaked AI weights to values that seem to result in slightly
better autosettler decisions in typical rulesets.

See patch #3692

(Browse SVN revision 22738)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 18 Apr 2013 08:36:11 AM UTC, comment #4:

Here is the patch I've been using a couple of months now. I've tested mainly with the modified ruleset I use for any serious freeciv games I play, but at least in brief autogame testing also default settings + classic ruleset seems to be slightly benefit.

> There's slim hope to get that part kludged (while we wait for
> more extensive rewrite to future versions) by increasing
> TRADE_WEIGHTING so that Plains gets roads (1/1/0 -> 1/1/1)
> rather than is turned to Forest (1/1/0 -> 1/2/0).


This seems to work to some extend at least. Often Plains (1/1/0) get roads (1/1/1) and are then irrigated (2/1/1).

(file #17756)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 13 Feb 2013 12:39:21 AM UTC, comment #3:

Another problem is that it doesn't understand connecting irrigation. Plains not next to existing water is considered for mining to Forest only as irrigation is impossible. It does the mining, as it brings benefit (1/1/0 -> 1/2/0). Even if irrigation then later gets extended to neighbour tile, Forest will never be irrigated back to Plains as explained in previous comment. There's slim hope to get that part kludged (while we wait for more extensice rewrite to future versions) by increasing TRADE_WEIGHTING so that Plains gets roads (1/1/0 -> 1/1/1) rather than is turned to Forest (1/1/0 -> 1/2/0).

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 13 Feb 2013 12:21:33 AM UTC, comment #2:

Workers ending with forest everywhere is actually unavoidable with our rulesets and the fact that AI considers only one step forward. Converting forest to plains, without then irrigating it or building a road, only reduces tile output 1/2/0 -> 1/1/0. Irrigation of Jungles or Swamps would lead to 2/0/0 Grassland while Mining leads to 1/2/0 Forest.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 11 Feb 2013 02:48:10 AM UTC, comment #1:

Simply reducing SHIELD_WEIGHTING to get correcte relative weight to FOOD and TRADE means that average tile improvement value goes down. This in turn means that default AI does not value Workers/Settlers as much as before -> doesn't build, doesn't research tech enabling them.

So, my next attempt
FOOD: 19 -> 21
SHIELD: 17 -> 15
TRADE: 13 -> 14
POLLUTION: 12 -> 13

AI buglet noticed:
- As value of the improver unit is taken from single tile, and further possible actions ignored, settler consuming one food is considered zero value when it could only improve tiles to produce +1 food (no matter how many)

Autosettler buglet:
- It prefers to have at least one of each of food/shield/trade in every tile. Comment says this is to take advantage of _INC effects. Comment is wrong in that _INC effects are already included in the calculation (+1 food with _INC effect is +2 food).

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 11 Feb 2013 02:05:17 AM UTC, original submission:

It might be specific to the rules I play with so that changing this would break the more important supplied rulesets, but in the serious (as opposed to quick tests) games I've played lately, AI autosettlers (and city worker placement?) seem to value production far too much. AI cities are generally left rather small as instead of producing food in the fields, all the tiles are transformed to forests.

Autosettler production want value is SHIELD_WEIGHTING in server/advisors/citytools.h. Maybe unfortunately it controls more than autosettlers in the default AI code. From the architecture perspective it belongs to autosettlers, and if changing it breaks parts of actual AI code, that should be fixed in the AI code and not to try to kludge autosettlers code to use values suitable for current AI code. So I'm simply changing value from 17 to 13 for my testing. It would be good if other people tested similar change with other rulesets so we get data to decide if the change should be made to freeciv.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #17756:  AIPriorities.patch added by cazfi (833B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 Apr 2013 09:34:39 PM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Thu 18 Apr 2013 08:36:11 AM UTCcazfiStatusIn Progress=>Ready For Test
    Thu 18 Apr 2013 08:36:10 AM UTCcazfiAttached File-=>Added AIPriorities.patch, #17756
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup