Respawns...
- The Red Baron
- Sergeant First Class
- Posts: 987
- Joined: Sat Dec 07, 2002 6:21 am
- Contact:
Respawns...
I've noticed (especially on ducati hunt-the-rabbit) That the respawns are really, really, really screwed. I cannot count how many times i've been respawned right in front of a bullet, or infront of the rabbit. Its down right annoying and salvation costing. has the respawn code been messed with or is this a server thing?
Beware! I'm going to clone myself and spread those clones all over the world!
-
- Private First Class
- Posts: 231
- Joined: Sun Mar 09, 2003 2:13 am
- Location: USA
- The Red Baron
- Sergeant First Class
- Posts: 987
- Joined: Sat Dec 07, 2002 6:21 am
- Contact:
I belive this is the code from the client used to grab a new spawn location from the server.
First, the restart command in playing.cxx
It then calls sendAlive() in serverlink.cxx
Then back in playing.cxx, in handleServerMessage(...), it recieves the spawn message.
I'll have to look at the server code to see what it does.
First, the restart command in playing.cxx
Code: Select all
static std::string cmdRestart(const std::string&, const CommandManager::ArgList& args)
{
if (args.size() != 0)
return "usage: restart";
if (myTank != NULL)
if (!gameOver && (myTank->getTeam() != ObserverTeam) && !myTank->isAlive() && !myTank->isExploding())
serverLink->sendAlive();
return std::string();
}
Code: Select all
void ServerLink::sendAlive()
{
send(MsgAlive, 0, NULL);
}
Code: Select all
case MsgAlive: {
PlayerId id;
float pos[3], forward;
msg = nboUnpackUByte(msg, id);
msg = nboUnpackVector(msg, pos);
msg = nboUnpackFloat(msg, forward);
int playerIndex = lookupPlayerIndex(id);
if ((playerIndex >= 0) || (playerIndex == -2)) {
static const float zero[3] = { 0.0f, 0.0f, 0.0f };
Player* tank = getPlayerByIndex(playerIndex);
if (tank == myTank) {
wasRabbit = tank->getTeam() == RabbitTeam;
myTank->restart(pos, forward);
firstLife = false;
mainWindow->warpMouse();
hud->setAltitudeTape(World::getWorld()->allowJumping());
} else if (tank->getPlayerType() == ComputerPlayer) {
for (int r = 0; r < numRobots; r++) {
if (robots[r]->getId() == playerIndex) {
robots[r]->restart(pos,forward);
setRobotTarget(robots[r]);
break;
}
}
}
tank->setStatus(PlayerState::Alive);
tank->move(pos, forward);
tank->setVelocity(zero);
tank->setAngularVelocity(0.0f);
tank->setDeadReckoning();
if (tank==myTank)
playLocalSound(SFX_POP);
else
playWorldSound(SFX_POP, pos[0], pos[1], pos[2], true);
}
break;
}
The spawn code in the server is located at bzfs.cxx:2852. The spawn location calculation was moved to the server to give the server more control over the game and to prevent cheating (some people hacked their client to spawn on top of GM flags etc). The current code does not do a very good job of finding a safe place for the tank, but it can (will) be improved in later server versions without breaking the protocol and without requiring a client upgrade.
-
- Private First Class
- Posts: 231
- Joined: Sun Mar 09, 2003 2:13 am
- Location: USA
- The Red Baron
- Sergeant First Class
- Posts: 987
- Joined: Sat Dec 07, 2002 6:21 am
- Contact:
- MrApathyCream
- Dev Wizard
- Posts: 66
- Joined: Fri Dec 06, 2002 9:16 pm
- Location: Warwick, MD
- Contact:
repawn bug
has anyone noticed the multiple spawn bug?
when your veiwing the radar you can see a person
spawn in 1 spot...then respawn 2-3 times and land
somewhere else...
just noticed this while playing 1.10....the
person it happend too siad it was a bug...
when your veiwing the radar you can see a person
spawn in 1 spot...then respawn 2-3 times and land
somewhere else...
just noticed this while playing 1.10....the
person it happend too siad it was a bug...
Re: repawn bug
It was a bug in the 1.10.0 server, and was fixed in 1.10.2.sid6.7 wrote:has anyone noticed the multiple spawn bug?
when your veiwing the radar you can see a person
spawn in 1 spot...then respawn 2-3 times and land
somewhere else...
just noticed this while playing 1.10....the
person it happend too siad it was a bug...
- DemolitionMan
- Private
- Posts: 3
- Joined: Sat Dec 27, 2003 6:09 am