[Freeciv-Dev] Re: Threads!!??
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
What about having the AI players in separate client-like processes ?
We could have something like an ai_civclient process which will
run like any human client, getting all info from the network.
This will simplify the civserver code and also speed-up AI
computations (e.g. micromanaging of cities can be done when it
is others' turn).
/fabio
-----Original Message-----
From: Jordan Crouse [mailto:jordanc@xxxxxxxxxxx]
Sent: Tuesday, February 06, 2001 4:41 PM
To: freeciv development list
Subject: [Freeciv-Dev] Threads!!??
Whilst deep in thought and exploration for AI diplomacy, it has become
apparent that the AI players will need to be informed of events and
diplomacy attempts. I looked at it extensively the other night, and I
couldn't find any preexisting code and/or hooks for this, but I could be
wrong.
If not, then I am looking for comments on a couple of different options
for the AI to receive and process event packets:
A) - Send the messages to the appropriate AI hooks as they come up in
the list, ie:
if (i_am_ai) ai_send_packet(blah); else send_to_network(boah);
This has the disadvantage of delaying the sending of packets to
legitimate players while we crunch the AI.
A2) - A slight variant on the above -- send all network packets first,
and then handle the hooks for all AI
This has the disadvantage of delaying the receiving of incoming packets
while we crunch the AI
B) - Add AI players to their own thread, and set them up with a socket
like the other players, so they can get messages and process them
on their own time. This has the advantage of not slowing down the
server, but it will add many new layers of complexity to the server, and
limit the portability.
Does the infinitely slow response time of a human (at least in computer
terms) cancel out the processing time that we will spend considering
diplomacy and other factors, or is there enough of a timing issue that
threads would be the best way out.
Comments, suggestions, flames and death threats will be accepted,
Jordan
- [Freeciv-Dev] Re: Threads!!??,
Fabio Lopiano (ELN) <=
- [Freeciv-Dev] Re: Threads!!??, Reinier Post, 2001/02/06
- [Freeciv-Dev] Re: Threads!!??, Jordan Crouse, 2001/02/06
- [Freeciv-Dev] Re: Threads!!??, Jed Davis, 2001/02/06
- [Freeciv-Dev] Re: Threads!!??, Raimar Falke, 2001/02/07
- [Freeciv-Dev] Re: Threads!!??, Reinier Post, 2001/02/07
- [Freeciv-Dev] Re: Threads!!??, Jordan Crouse, 2001/02/07
|
|