Multiple autopilot clients, without graphics
Multiple autopilot clients, without graphics
Hi there,
I am looking for a way to start multiple autopilot clients without graphics (to reduce cpu consumption) on a single physical machine. Any one knows how to do that?
What I actually want to do is to stress-test the bzflag server, by starting many clients connecting to the same server.
Thanks.
I am looking for a way to start multiple autopilot clients without graphics (to reduce cpu consumption) on a single physical machine. Any one knows how to do that?
What I actually want to do is to stress-test the bzflag server, by starting many clients connecting to the same server.
Thanks.
Well the real issue with BZFlag is not the server, it is with the internet bandwidth. Most servers run below 10% utilization even with 30 or 40 clients connected. Where the bottleneck is is in network bandwidth. The bandwidth required increases exponentially for each player that joins, as all updates must be sent to another client and the updates get larger because there is another client. On my T1 (1.5Mbs) we can handle about 30-35 players before jitter and lag start to increase. Yet the server barely even shows that it is working.
Can it be done programmatically, e.g., starting 50 autopilot clients connecting to a given server using shell script? Put another way, do we have ways for a client to go to autopilot and minimize itself? Otherwise, we have to manually start each client, put it into autopilot mode (press 9) and then minimize it.
Thanks.
Thanks.
That's what I have done, I'll hunt out the patch...JeffM2501 wrote:you'd have to modify the client.
And no, it wasn't hard.
EDIT:
Code: Select all
diff -urN -x '*.o' -x '*.in' bzflag/src/bzflag/LocalPlayer.cxx bzrobot/src/bzflag/LocalPlayer.cxx
--- bzflag/src/bzflag/LocalPlayer.cxx 2005-11-03 16:21:06.000000000 +0000
+++ bzrobot/src/bzflag/LocalPlayer.cxx 2005-12-27 15:08:03.000000000 +0000
@@ -286,10 +286,8 @@
}
setStatus(PlayerState::DeadStatus);
location = Dead;
- if (isAutoPilot()) {
- CMDMGR.run("restart");
+ CMDMGR.run("restart");
}
- }
// can't control explosion motion
newVelocity[2] += BZDBCache::gravity * dt;
@@ -1185,11 +1183,9 @@
{
if (autopilot && !isAutoPilot()) {
setAutoPilot();
- server->sendAutoPilot(true);
}
else if (!autopilot && isAutoPilot()) {
setAutoPilot(false);
- server->sendAutoPilot(false);
}
}
diff -urN -x '*.o' -x '*.in' bzflag/src/bzflag/clientConfig.cxx bzrobot/src/bzflag/clientConfig.cxx
--- bzflag/src/bzflag/clientConfig.cxx 2005-10-21 03:04:51.000000000 +0100
+++ bzrobot/src/bzflag/clientConfig.cxx 2005-12-27 15:08:51.000000000 +0000
@@ -92,7 +92,7 @@
std::string getCurrentConfigFileName(void)
{
- std::string configFile = BZ_CONFIG_FILE_NAME;
+ std::string configFile = "robot.cfg";
std::string name = getConfigDirName(BZ_CONFIG_DIR_VERSION);
name += configFile;
diff -urN -x '*.o' -x '*.in' bzflag/src/bzflag/playing.cxx bzrobot/src/bzflag/playing.cxx
--- bzflag/src/bzflag/playing.cxx 2005-12-05 01:29:39.000000000 +0000
+++ bzrobot/src/bzflag/playing.cxx 2005-12-27 15:05:18.000000000 +0000
@@ -88,6 +88,7 @@
#include "World.h"
#include "WorldBuilder.h"
#include "HUDui.h"
+#include "JoinMenu.h"
//#include "messages.h"
@@ -1729,6 +1730,7 @@
case MsgSuperKill:
printError("Server forced a disconnect");
serverError = true;
+ joinGame();
break;
case MsgAccept:
@@ -1995,7 +1997,7 @@
Player* tank = lookupPlayer(id);
if (!tank) break;
tank->setAutoPilot(autopilot != 0);
- addMessage(tank, autopilot ? "Roger taking controls" : "Roger releasing controls");
+ //addMessage(tank, autopilot ? "Roger taking controls" : "Roger releasing controls");
break;
}
@@ -2074,7 +2076,7 @@
char meaculpa[MessageLen];
memset(meaculpa, 0, MessageLen);
strncpy(meaculpa,
- "sorry, i'm just a silly machine",
+ "sry",
MessageLen);
char *buf = messageMessage;
buf = (char*)nboPackUByte(buf, victimPlayer->getId());
@@ -2304,7 +2306,7 @@
if (myTank->isAutoPilot()) {
char meaculpa[MessageLen];
memset(meaculpa, 0, MessageLen);
- strncpy(meaculpa, "sorry, i'm just a silly machine", MessageLen);
+ strncpy(meaculpa, "sry", MessageLen);
char *buf = messageMessage;
buf = (char*)nboPackUShort(buf, myTank->getTeam());
nboPackString(buf, meaculpa, MessageLen-1);
@@ -4116,6 +4118,7 @@
static void enteringServer(void *buf)
{
+ mainWindow->iconify();
// the server sends back the team the player was joined to
void *tmpbuf = buf;
uint16_t team, type;
@@ -4216,6 +4219,8 @@
BZDB.setBool("displayConsole", true);
entered = true;
+ CMDMGR.run("restart");
+ myTank->activateAutoPilot();
}
static void cleanWorldCache()
@@ -4614,10 +4619,12 @@
// the server is having network problems.
HUDDialogStack::get()->setFailedMessage
("Game is full or over. Try again later.");
+ joinGame();
break;
case ServerLink::SocketError:
HUDDialogStack::get()->setFailedMessage("Error connecting to server.");
+ joinGame();
break;
case ServerLink::CrippledVersion:
diff -urN -x '*.o' -x '*.in' bzflag/src/date/buildDate.cxx bzrobot/src/date/buildDate.cxx
--- bzflag/src/date/buildDate.cxx 2005-10-02 02:09:14.000000000 +0100
+++ bzrobot/src/date/buildDate.cxx 2005-12-27 16:15:24.000000000 +0000
@@ -152,7 +152,7 @@
std::ostringstream appVersionStream;
// TODO add current platform, release, cpu, etc
appVersionStream << getMajorMinorRevVersion() << "." << BZ_BUILD_DATE
- << "-" << BZ_BUILD_TYPE << "-" << BZ_BUILD_OS;
+ << "-TepBot-Client-" << BZ_BUILD_TYPE << "-" << BZ_BUILD_OS;
#ifdef HAVE_SDL
appVersionStream << "-SDL";
#endif
Unpack the source, cd into bzflag-2.0.8, paste the patch as robot.patch, then run
Code: Select all
patch -p1 < robot.patch
Code: Select all
bzrobot -window -directory /usr/share/games/bzflag/data -team auto -g 10x10 robot1@some.server.com:5154