Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#4107) Client crash on start.
Home

[Freeciv-Dev] Re: (PR#4107) Client crash on start.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxx, ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4107) Client crash on start.
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Fri, 2 May 2003 09:58:37 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Fri, 2 May 2003, Gregory Berkolaiko wrote:
> On Fri, 2 May 2003, Per I. Mathisen wrote:
> There is. AI will move units with danger uninitialized so the defenders
> will leave the cities.

Ick. My intuition told me it couldn't be that easy. However, I still went
ahead and committed that change (commented it out, not removed it) before
I got your response - but at least that way cvs will not core.

> So, for now, we need a function init_ai_player in
> aihand.c which calls assess_danger and other initializing stuff.

We can just move the assess_danger_player() stuff into
ai_data_turn_init(), IMHO. That function is already called at the right
time, and it is the right place for that kind of stupid data crunching.

> > Why is a function (or set of functions) in common/ when they send packets
> > to the client? These should either be generalised or moved to server/. One
> > way to generalising them, and presumably save some network traffic, would
> > be to instead mark units as "dirty" when they need updating on the client,
> > and then actually only do the send_unit_infos later.
>
> I agree but not sure how to implement it.

bool punit->dirty ?

> I agree AI should do everything at the same time, but I disagree on
> timing. I think AI has a right to adjust it's production when it sees
> human units coming next to their cities. The only way to do it is to do
> it before end-turn. So everything else should be done then too.

But shouldn't the AI see those units coming a long time before they end up
next to its cities? We could also add an emergency reallocate function at
the end which doesn't need much data: "An enemy at the gates -- make best
defender!!".

I think the crucial question is: Do we want the AI lag/actions accumulated
at turn end, or sliced up during the beginning of turn? IMHO it is much
nicer if we can see the AIs moving while we do the turn, instead of having
to wait for the AIs to finish moving once we press 'end turn'. But I may
be wrong.

On Fri, 2 May 2003, Gregory Berkolaiko wrote:
> On Fri, 2 May 2003, Raimar Falke wrote:
> > I would rather add a new parameter "bool send_packets" for
> > generic_city_refresh.
>
> But then you have monstrosity like line 74 of common/city.h

Right.

> BTW, the info is now sent only when units are "dirty" so no network
> saving is possible (short of delta).

You may be sending info on the same unit several times. In particular when
you observe the AI and it runs through its calculations which calls
generic_city_refresh() multiple times.

  - Per




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