[Freeciv-Dev] Re: More on client AIs.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
In <3A5C0E9C.D1F44A70@xxxxxxxxxxxxxxx>, on 01/10/01
at 01:26 AM, "Bobby D. Bryant" <bdbryant@xxxxxxxxxxxxxxx> said:
:Here is a synthesis of the current state of my ideas on client AIs
Most of what you ask for already exists, and I have running code to prove
it, but I only have time enough right now to give you one specific
example, as follows:
:Also, the whole system will need a way to tell the AI agent "Make a move
:now." This could be done by having the AI poll the game state until it
:sees an appropriate flag set, or else by some more elegant mechanism.
:For hybrid systems, the helper scripts could behave the same way, i.e.
:once per turn they would all wake up and do whatever tasks have been
:delegated to them.
At the start of each turn, the server sends PACKET_NEW_YEAR, which (on the
client side) causes handle_new_year() in packhand.c to call new_year() in
gui_main.c. So, all I had to do was to add my turn based logic to
new_year(). Likewise, at the end of my turn based code, all I had to do
was to call user_ended_turn(), which notifies the existing common client
code to send PACKET_TURN_DONE to the server.
Best,
-- Chuck Crayne
-----------------------------------------------------------
ccrayne@xxxxxxxxxxx
-----------------------------------------------------------
|
|