[Freeciv-Dev] Re: patch 4: ai passive diplomacy + alliances fixes + new
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> wrote:
> A new version of the passive diplomacy patch, also containing a few
> obvious (and as far as I could see, uncontroversial) fixes to diplomacy
> code. Possibly controversial fixes (such as allied help with martial law)
> will be posted as a separate patch when this is in cvs.
>
> I've also included a new version of the new difficulty level patch. The
> number of new levels has been cut to one, since I didn't see all that much
> difference between them. Now there is only 'harder' level in addition to
> the usual three, and it makes the AIs ally up and share their vision. They
> _will_ gang up on you. Great fun. Requires the above AI patch, of course.
>
> Please review and consider for cvs.
>
> Yours,
> Per
>
> PS Latest version of all my usable patches can at any time be found at
> http://www.idi.ntnu.no/~permath/freeciv/
>
<snip>
I'd like to see a version of your ai difficulty patch that does not really on
your diplomacy patch. I also don't know why you still use difficulty levels
3,5,7,8 instead of 1,2,3,4.
switch(level) {
+ case 3 :
cmd=CMD_EASY;
break;
+ case 5 :
cmd=CMD_NORMAL;
break;
+ case 7 :
cmd=CMD_HARD;
break;
+ case 8 :
cmd=CMD_HARDER;
break;
+ }
+
I'd also prefer it if you indented it like the example above.
<snip>
> If (enemy != 0) it looks only for enemy cities
> If (pplayer != NULL) it looks for cities known to pplayer
> **************************************************************************/
> -
> struct city *dist_nearest_city(struct player *pplayer, int x, int y,
> bool everywhere, bool enemy)
> {
> @@ -56,7 +55,7 @@
> int con = map_get_continent(x, y);
>
> players_iterate(pplay) {
> - if(enemy && pplay == pplayer) continue;
> + if ((enemy) && (pplayer) && (!pplayers_at_war(pplayer,pplay))) continue;
>
Explain what is happening here.
> - if (aunit == punit || aunit->owner != punit->owner) continue;
> + if (aunit == punit
> + || !pplayers_allied(unit_owner(punit), unit_owner(aunit))) continue;
So in future, will the AI need to be taught that if you are not allied you
are not necessarily at war with each other?
<snip>
> + if (pcity && pplayers_at_war(pplayer, city_owner(pcity))
> && is_ground_unit(punit)
> && map_get_terrain(punit->x, punit->y) != T_OCEAN) {
We see an empty enemy city and scarf it up.
> SET_BEST(99999);
<snip>
> /*************************************************************************
> -...
> + Use caravans for building wonders, or send caravans to establish
> + trade with a city on the same continent, owned by yourself or an
> + ally.
> **************************************************************************/
> static void ai_manage_caravan(struct player *pplayer, struct unit *punit)
> {
> @@ -1821,7 +1836,9 @@
> else {
> /* A caravan without a home? Kinda strange, but it might happen. */
> pcity=player_find_city_by_id(pplayer, punit->homecity);
> - city_list_iterate(pplayer->cities,pdest)
> + players_iterate(aplayer) {
> + if (pplayers_at_war(pplayer, aplayer)) continue;
Surely you intended a ! here. Why would you establish trade routes with enemy
civs?
<snip>
> - if (pcity && (city_owner(pcity) != owner)
> + if (pcity && (!pplayers_allied(city_owner(pcity), owner))
> && city_got_building(pcity, B_SDI)) return pcity;
Why does the SDI improv matter?
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com
- [Freeciv-Dev] Re: patch 4: ai passive diplomacy + alliances fixes + new difficulty level (PR#1277),
Raahul Kumar <=
|
|