Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#6283) New path-finding structure: punit->pf
Home

[Freeciv-Dev] Re: (PR#6283) New path-finding structure: punit->pf

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6283) New path-finding structure: punit->pf
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 27 Sep 2003 05:44:34 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 25 Sep 2003, Mike Kaufman wrote:
> > The big "but" with this patch is memory usage. We keep pf maps in memory
> > for all AI units at all times. For a very large game, this can easily
> > double the size of civserver, from 15mb to 30mb on my computer. I think
> > this is acceptable.
>
> yeah, this is a big but. And I'm not so sure that this is acceptable. Is
> there an alternative?

Yes, the alternative is to free the maps after each AI player is done and
recreate them when we start again next turn. This saves memory but costs
more CPU. We just have to decide which is more important.

Recreating each turn also saves us from worrying about stale maps. For
example we might be a non-military unit surrounded by enemies when we make
the map. Since we don't move, we don't recreate it next turn, and we would
think we cannot move even though the enemies might be gone. However, I
think this problem is mostly theoretical and can be sufficiently addressed
by ageing the maps (recreate if too old).

> Would it be sufficiently clean to have a --enable-bigmem switch to use
> faster and/or better (AI-smartness-wise) with a fallback to slower
> routines for machines with smaller memory?

This is possible.

  - Per




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#6283) New path-finding structure: punit->pf, Per I. Mathisen <=