Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] (PR#6402) AI focus woes.
Home

[Freeciv-Dev] (PR#6402) AI focus woes.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6402) AI focus woes.
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 5 Oct 2003 04:47:47 -0700
Reply-to: rt@xxxxxxxxxxxxxx

When a sentried unit wakes up in the server, the client gets an info 
packet and focuses on that unit.

Sometimes, set_unit_focus would slightly alter the state of the unit and 
send a corresponding packet to the server.

All is fine unless the unit is AI controlled.  When it is in a boat, it is 
sentried, then it wakes up (the packet is sent to client, client react 
with another packet), moves ashore, does it's nasty business there etc 
etc.  When the AI is finished, server starts sniffing for packets, gets 
the now stale packet from client (unit is no longer on the boat, where it 
lost its sentriness, but to the server it looks as if the unit wants to 
move back to the boat!), tries to react on it.  In the best case the unit 
has no movepoints and you get a corresponding message.  I guess sometimes 
the server will actually move the unit back.

There are two ways to fix it:

1. the packet should not be sent back from the client.  it only happens 
because punit->ai.control is TRUE, why I don't know [1].

2. the client observing AI should not focus on unsentried units [2].  It
is highly annoying, I switch off all the auto-center options to observe
one particular part of the map and the client still jumps back and forth
when some units decide to go ashore.

I prefer fix#2 but I guess both of them at the same time would be even 
better.

References:
[1] http://www.freeciv.org/lxr/source/client/control.c#L108
[2] http://www.freeciv.org/lxr/source/client/packhand.c#L940


G.





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