Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12840) delay in pollution patrol (possible causes)
Home

[Freeciv-Dev] (PR#12840) delay in pollution patrol (possible causes)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12840) delay in pollution patrol (possible causes)
From: "Brian Dunstan" <bdunstan149@xxxxxxxxx>
Date: Mon, 18 Apr 2005 22:02:49 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12840 >

I have noticed that, especially towards the end of the
game, when production is high and most squares have
railroads, autosettlers sometimes has a 1 turn delay
before beginning to clean up pollution.  Even when it
does so, it uses only one worker, when two would
probably be better.  I'm attaching a savegame which
has an example of this in motion.

In any case, I think this is happening because, when
worker assignments are being given, it iterates
through the workers, and the first worker that finds
that cleanup job to be its best use of time, reserves
the square.  This is done by setting a bit in
ptile->assigned.

When other workers evaluate what they will do, that
particular polluted square will be reserved, so they
will not consider it.  

The problem is, the worker that made the reservation
may not be able to arrive at the polluted square the
same turn.  The best thing to do would be to find a
worker that can get there the same turn, and use that
worker (or maybe two of them).  

I can't think of any way to fix simply (i.e. without
adding something to the tile struct, for example, to
record who is going there and what their ETA is).  I
do think it should be fixed, since it would greatly
improve the performance of autosettlers, definitely in
the late game and possibly earlier as well.  If a
worker that can get to a tile to irrigate it in 5
turns can be chosen over one that takes 10 turns to
get there, that is an improvement.


-Brian

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Attachment: pollute2.sav.gz
Description: GNU Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12840) delay in pollution patrol (possible causes), Brian Dunstan <=