Codebase list dopewars / lintian-fixes/main doc / aiplayer.html
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

aiplayer.html @lintian-fixes/mainraw · history · blame

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
<title>Adding computer-controlled players</title>
<meta charset="utf-8"/>
</head>

<body>
<h1>Adding computer-controlled players</h1>

<p>Multiplayer games of dopewars can be made a little more interesting by
introducing computer-controlled, or AI, players. These players will join
a dopewars server, and to all intents and purposes will behave like normal
human players - they will deal in drugs in an attempt to make a fortune,
they will encounter the cops, you can spy on them, and they will shoot at
you if you give them the chance!</p>

<p>To start a computer-controlled player, all you need is the standard dopewars
binary. Run it as<br />
<tt><b>dopewars -c</b></tt><br />
and it will attempt to connect to the server and port specified in the
<a href="configfile.html">configuration files</a> (or the local host, if none
is specified). Alternatively, you can specify server and port with suitable
<a href="commandline.html">command line options</a>. Since an AI player
takes its game settings from the server it connects to, no other options in
the configuration files will take effect, with the exception of the 
<a href="configfile.html#AITurnPause">AITurnPause</a> option, which sets the
pause in seconds between turns.</p>

<p>Once started and connected to the server, the AI player will choose a
suitable name for itself and start playing. It will continue to play until
its game finishes - i.e. it is killed or runs out of time - at which point
the program will finish and drop you back to the command prompt. The program
will display information to let you know what the AI player is doing within
the game as it goes. Note that the program will pause for five seconds (or
whatever you have set AITurnPause to be) before jetting to a new location -
this is to simulate the time it takes a human player to choose which drugs
to buy and to press all the requisite keys; it also gives other players a
fighting chance of spotting the computer sitting still in any one location
for a few seconds!</p>

<p>If a computer player is attacked by the cops or another player, it will
defend itself if it can, and attempt to run if necessary. During normal
play it will also attempt to "blend in" with the other players by hurling
rather pathetic insults at them... you are free to
<a href="https://github.com/benmwebb/dopewars/blob/develop/src/AIPlayer.c">edit
the code</a> of the AI player to give these insults a little more "punch".</p>

<hr />
<ul>
<li><a href="index.html">Main index</a></li>
</ul>
<p>
  Last update: <b>05-12-2020</b><br />
  Valid <a href="http://validator.w3.org/check/referer">XHTML 1.1</a>
</p>
</body>
</html>