Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Buggy Diplomatic State (PR#1146)
Home

[Freeciv-Dev] Re: Buggy Diplomatic State (PR#1146)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Buggy Diplomatic State (PR#1146)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Dec 2001 17:08:10 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Thu, Dec 20, 2001 at 02:19:05PM +0000, Gregory Berkolaiko wrote:
>  --- Jason Short <vze2zq63@xxxxxxxxxxx> wrote: 
> > Gregory Berkolaiko wrote:
> > >
> > >My opinion: delete the lines and see what breaks.
> > >My bet: nothing breaks.
> > >
> > BTW: the patch works for me, too.  However, I am concerned about 
> > removing lines that claim to need to stay :-).
> > 
> > >Can you trace a particular line in CVS somehow?
> > >
> > "cvs annotate savegame.c"
> 
> thanks.  it works but is not documented in man cvs.  damn I hate that!

info cvs

> > This shows that these lines were introduced by Thue on January 4th, 
> > 2001.  The CVS log says:
> > 
> > "Make a small modification to the savegame handling so that loading and
> > saving various parts of a game is conditional. This is usefull for a
> > map editor."
> 
> True.  Further research reveals that on January 4th it was just
> reformatting change.  The lines existed in this form from 1.1 revision
> into which they were transported from gamehand.c ( function game_load()
> ).
> In gamehand.c these lines were made into what they are in revision 1.80
> with message
> =======================
> revision 1.80
> date: 2000/08/03 15:16:44;  author: jjm;  state: Exp;  lines: +18 -5
> Changed way in which AIs are forced into War at save-game load time.  No
> longer call neutralize_ai_player() (calls handle_player_cancel_pact()),
> which caused possible revolutions and called myrand() too early.
> Bug reported by David Pfitzner <dwp@xxxxxxxxxxxxxx>.
> =======================
> Before 1.80 "forcing AI into war" was done in the form of
> neutralize_ai_player() (which is still-existing function btw).
> 
> This neutralize_ai_player was introduced in 
> ----------------------------
> revision 1.73
> date: 2000/06/09 13:26:16;  author: thue;  state: Exp;  lines: +5 -0
> Creates the DS_NO_CONTACT state. Treated like DS_WAR for AI purposes.
> Moves DS_NEUTRAL from players_at_war to players_non_attack, ie you must
> declaire war before you can attack.
> Every time
> -a unit moves
> -a unit is created
> -a city is created
> it is checked if there is made contact. Each turn we also try to make
> contact via the marco polo wonder.
> ----------------------------
> 
> So we can try contacting Thue or just delete the lines.
> 
> 
> 
> I did more testing of the patch.
> Saving, restoring, initialising of the game works fine.  Loading pre-made
> maps works fine.  As a further bonus, you can hack the savegame and put a
> couple of AIs into alliance and they will stay this way!
> 
> I really think these lines got to go...

IMHO to correct time to change the state into war is if the AI make
contact with another nation. Looking at make_contact:

  /* FIXME: Always declairing war for the AI is a kludge until AI
     diplomacy is implemented. */
  pplayer1->diplstates[player2].type
    = pplayer2->diplstates[player1].type
    = pplayer1->ai.control || pplayer2->ai.control ? DS_WAR : DS_NEUTRAL;

So it looks like it is in the code. So I agree that the lines in
game_load() could be removed.

> Quite a lot of research for a subject that unimportant...

It is usally this way. You never know what can of worms you open.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Are you saying that you actually used the Classpath Java AWT classes in 
  addition to the GTK peers and got them to display something?
  Wow.  That's way better than I did and I wrote the code!"
    -- Aaron M. Renn in the classpath mailing list


[Prev in Thread] Current Thread [Next in Thread]