[freeciv-ai] Re: New settler code
[Top] [All Lists]
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
On Fri, 11 Apr 2003, Per I. Mathisen wrote:
> A new patch, and some (rather incoherent) notes.
> 
> PATCH CHANGES
>   - We cache and gain massive increase in speed (thanks to Greg).
Please give me some info on that.  In particular,
1. in aisettler.c
  } else if (cachemap[map_x][map_y].sum == -1 || !is_city_center(i, j)) {
    /* We cannot read city center from cache */
Why "!is_city_center(i, j)" ??
2. Are you sure you initialize your cache in the right place?
I think when you get to contemplate_new_city, your cache is not 
necessarily yours!
Personally, I would store player id and turn number near cachemap and do a 
check in find_best_city_placement.  Ok, you would have more checks, but 
you would ensure that the cachemap is fresh without having to unspaghetti 
the other code.
Another thing, I am not sure why you call citycache a cache, it's very 
confusing.
BTW, the numbers you provided are very impressive!
G.
 
- [freeciv-ai] Re: New settler code, (continued)
- [freeciv-ai] Re: New settler code, Mark Metson, 2003/04/15
 
- [freeciv-ai] Re: New settler code, Ross Wetmore, 2003/04/16
 
- [freeciv-ai] Re: New settler code, Gregory Berkolaiko, 2003/04/16
 - [freeciv-ai] Re: New settler code, Ross Wetmore, 2003/04/16
 
- [freeciv-ai] Re: New settler code, Raimar Falke, 2003/04/17
 
    
- [freeciv-ai] Re: New settler code, Jason Dorje Short, 2003/04/14
 - [freeciv-ai] Re: New settler code, Mike Kaufman, 2003/04/14
 
- [freeciv-ai] Re: New settler code, Raimar Falke, 2003/04/14
 
- [freeciv-ai] Re: New settler code, Per I. Mathisen, 2003/04/14
 
- [freeciv-ai] Re: New settler code, Per I. Mathisen, 2003/04/26
 
- [freeciv-ai] Re: New settler code,
Gregory Berkolaiko <=
 - [freeciv-ai] Re: New settler code, Per I. Mathisen, 2003/04/12
 - [freeciv-ai] Re: New settler code, Gregory Berkolaiko, 2003/04/12
 
 
[freeciv-ai] Re: New settler code, Gregory Berkolaiko, 2003/04/07
 
 | 
 |