Page 1 of 1

Respawns...

Posted: Sun Dec 14, 2003 7:19 pm
by The Red Baron
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?

Posted: Mon Dec 15, 2003 12:06 am
by widowmaker
I have noticed this alot also. Did the code get changed to make the respawn more random? I think it might have. Did the respawn code from previous versions get deleted? On all the previous versions there was code to stop the bad respawn from happening.

Posted: Mon Dec 15, 2003 12:08 am
by blast
The server now decides where you spawn. I think the code is just buggy right now.

Posted: Mon Dec 15, 2003 3:50 am
by The Red Baron
very buggy

Posted: Mon Dec 15, 2003 8:55 am
by JeffM
I don't think server side spaws were implemented, because the server dosn't have a full game state yet, it dosn't know where shots are. I will find out tho.

Posted: Mon Dec 15, 2003 3:56 pm
by blast
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

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();
}
It then calls sendAlive() in serverlink.cxx

Code: Select all

void			ServerLink::sendAlive()
{
  send(MsgAlive, 0, NULL);
}
Then back in playing.cxx, in handleServerMessage(...), it recieves the spawn message.

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;
  }
I'll have to look at the server code to see what it does.

Posted: Mon Dec 15, 2003 6:11 pm
by larsl
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.

Posted: Tue Dec 16, 2003 1:47 am
by JeffM
since the server does not fully track shots this would make the spaws very difrent from the old way, but you are asured that everyone spawns the same way.

Posted: Tue Dec 16, 2003 2:23 pm
by widowmaker
Ok, thanks guys! As long as there is a valid reason I am fine with it and that is definately a valid reason.

Posted: Tue Dec 16, 2003 2:52 pm
by SGI
In front of my shots...problem number two, on xmission and on others server using the command -tk I'll be killed "Players who kill teammates die". :(
I hate cheaters

Posted: Tue Dec 16, 2003 4:37 pm
by The Red Baron
Exactly!

on ducati hunt the rabbit. I'm more scared of my teammates then the Rabbit!

IF the tk option is on. you die and lose 2 points, not just 1.

Posted: Wed Dec 17, 2003 4:09 am
by JeffM
someone should get to coding up a proper server state then.

Posted: Fri Dec 26, 2003 4:33 am
by MrApathyCream
Server ops can mitigate the problem a little by adding -sb to their bzfs command lines, which means "spawn on buildings". In this way sometimes tanks spawn on buildings, which should be less dangerous than on the ground. But yes, the currently algorithm is completely random, now.

repawn bug

Posted: Sat Dec 27, 2003 3:32 pm
by sid6.7
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...

Re: repawn bug

Posted: Sat Dec 27, 2003 3:52 pm
by blast
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...
It was a bug in the 1.10.0 server, and was fixed in 1.10.2.

Posted: Sat Dec 27, 2003 6:58 pm
by SGI
The new respawn is ORRIBLE.
Sorry guys

Posted: Sat Dec 27, 2003 9:04 pm
by Chestal
SGI wrote:The new respawn is ORRIBLE.
Sorry guys
Current CVS has a slight improvement on this. I am not sure how good it works in practice. It's probably slightly worse with respect to enemy tanks than the odl spawns and it does not respect shots at all.

Ducati 1.10 servers are running this code.

Posted: Sat Dec 27, 2003 11:00 pm
by DemolitionMan
I see in the task lists on sourceforge that a full client side state is not planed untill 2.0, a full 2 more releases away. Is that really how long it will take before there can be spwans of the the same type that the last release had?

Posted: Sun Dec 28, 2003 1:58 am
by SGI
Before it was far away (in a safe position) and now you respawn totally between the tanks (fighting) or close to a SW (3 times in a row on xmission).
I hate cheaters

Posted: Sun Dec 28, 2003 4:37 am
by |tim|
I was playing with someone on 10.0 and the other teammate spawned right into my base :\

spawns

Posted: Thu Feb 26, 2004 7:56 am
by bloohoo
does the new bzflag version fix the dumb spawn right beside someone thing yet?