bugFreeciv - Bugs: bug #20856, aisettler.c:food_starvation()...

 
 
Show feedback again

bug #20856: aisettler.c:food_starvation() seems to assume hardcoded 2 food/citizen.

Submitted by:  Micke <mss_8734>
Submitted on:  Thu 30 May 2013 02:29:47 PM UTC  
 
Category: aiSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Release: Operating System: None
Planned Release: 2.3.5, 2.4.0, 2.5.0, 2.6.0

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)

Fri 12 Jul 2013 10:14:26 PM UTC, SVN revision 23037:

Use ruleset defined food cost for citizens instead of hardcoded
value 2 when AI checks potential cityspots against starvation.

Patch by Micke

See bug #20856

(Browse SVN revision 23037)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 12 Jul 2013 10:14:21 PM UTC, SVN revision 23036:

Use ruleset defined food cost for citizens instead of hardcoded
value 2 when AI checks potential cityspots against starvation.

Patch by Micke

See bug #20856

(Browse SVN revision 23036)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 12 Jul 2013 10:14:15 PM UTC, SVN revision 23035:

Use ruleset defined food cost for citizens instead of hardcoded
value 2 when AI checks potential cityspots against starvation.

Patch by Micke

See bug #20856

(Browse SVN revision 23035)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 12 Jul 2013 10:14:09 PM UTC, SVN revision 23034:

Use ruleset defined food cost for citizens instead of hardcoded
value 2 when AI checks potential cityspots against starvation.

Patch by Micke

See bug #20856

(Browse SVN revision 23034)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed 10 Jul 2013 12:57:17 AM UTC, comment #5:

- S2_3 version

(file #18227)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 01 Jun 2013 11:24:15 AM UTC, comment #4:

Quite so. I forgot to change < to <=...

(file #18041)

Micke <mss_8734>
Fri 31 May 2013 05:08:03 PM UTC, comment #3:

Shouldn't this be game.info.food_cost+1 ? While the logic will allow growth, I think it represents a behaviour change that would cause the AI to select less favorable cities more often (where inherent food surplus is only 1 rather than 2). I'm not opposed to this behaviour change for 2.5 or 2.6 if others think it a good idea, but think it ought not be changed for 2.3 and 2.4.

Emmet Hikory <persia>
Project Member
Fri 31 May 2013 04:30:39 PM UTC, comment #2:

This basic one ought to work on all versions. I don't think it's worth the trouble of doing more unless one can make the AI send workers out ahead to work on land for future use in a reasonable manner.

(file #18038)

Micke <mss_8734>
Fri 31 May 2013 11:04:37 AM UTC, comment #1:

It seems like that to me too. Will you prepare patches for this?

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu 30 May 2013 02:29:47 PM UTC, original submission:

static bool food_starvation(const struct cityresult *result)
{
/* Avoid starvation: We must have enough food to grow. */
return (result->city_center.tdc->food
+ (result->best_other.tdc ? result->best_other.tdc->food
: 0) < 3);
}

Am I reading this function and its use completely wrong or ought that rely on the ruleset defined food cost for citizen upkeep?

Micke <mss_8734>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #18227:  FoodStarvation-S2_3.patch added by cazfi (1021B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by persia (Posted a comment)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by mss_8734 (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Jul 2013 10:14:48 PM UTCcazfiStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 10 Jul 2013 12:57:17 AM UTCcazfiAttached File-=>Added FoodStarvation-S2_3.patch, #18227
    Fri 05 Jul 2013 05:25:49 AM UTCcazfiStatusNone=>Ready For Test
      Assigned toNone=>cazfi
    Sat 01 Jun 2013 11:24:15 AM UTCmss_8734Attached File-=>Added aisettler_food_starvation.diff, #18041
    Fri 31 May 2013 04:30:39 PM UTCmss_8734Attached File-=>Added aisettler_food_starvation.diff, #18038
    Fri 31 May 2013 11:04:37 AM UTCcazfiPlanned Release=>2.3.5, 2.4.0, 2.5.0, 2.6.0
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup