Respawns...

NOTE: this is an informal bug post place ONLY. Real bugs should be posted on GitHub
Post Reply
User avatar
The Red Baron
Sergeant First Class
Sergeant First Class
Posts: 987
Joined: Sat Dec 07, 2002 6:21 am
Contact:

Respawns...

Post 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?
Beware! I'm going to clone myself and spread those clones all over the world!
widowmaker
Private First Class
Private First Class
Posts: 231
Joined: Sun Mar 09, 2003 2:13 am
Location: USA

Post 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.
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

The server now decides where you spawn. I think the code is just buggy right now.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
The Red Baron
Sergeant First Class
Sergeant First Class
Posts: 987
Joined: Sat Dec 07, 2002 6:21 am
Contact:

Post by The Red Baron »

very buggy
Beware! I'm going to clone myself and spread those clones all over the world!
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post 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.
ImageJeffM
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post 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.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
larsl
Dev Monkey
Dev Monkey
Posts: 50
Joined: Tue May 20, 2003 2:35 pm
Location: Stockholm
Contact:

Post 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.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post 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.
ImageJeffM
widowmaker
Private First Class
Private First Class
Posts: 231
Joined: Sun Mar 09, 2003 2:13 am
Location: USA

Post 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.
User avatar
SGI
Private First Class
Private First Class
Posts: 513
Joined: Mon Dec 09, 2002 7:24 pm
Location: Motown, MI, USA

Post 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
User avatar
The Red Baron
Sergeant First Class
Sergeant First Class
Posts: 987
Joined: Sat Dec 07, 2002 6:21 am
Contact:

Post 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.
Beware! I'm going to clone myself and spread those clones all over the world!
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

someone should get to coding up a proper server state then.
ImageJeffM
User avatar
MrApathyCream
Dev Wizard
Dev Wizard
Posts: 66
Joined: Fri Dec 06, 2002 9:16 pm
Location: Warwick, MD
Contact:

Post 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.
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

repawn bug

Post 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...
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: repawn bug

Post 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.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
SGI
Private First Class
Private First Class
Posts: 513
Joined: Mon Dec 09, 2002 7:24 pm
Location: Motown, MI, USA

Post by SGI »

The new respawn is ORRIBLE.
Sorry guys
User avatar
Chestal
Dev Guru
Dev Guru
Posts: 171
Joined: Fri Dec 06, 2002 11:56 pm
Location: Siegen, Germany
Contact:

Post 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.
User avatar
DemolitionMan
Private
Private
Posts: 3
Joined: Sat Dec 27, 2003 6:09 am

Post 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?
User avatar
SGI
Private First Class
Private First Class
Posts: 513
Joined: Mon Dec 09, 2002 7:24 pm
Location: Motown, MI, USA

Post 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
User avatar
|tim|
Private First Class
Private First Class
Posts: 71
Joined: Sun Sep 28, 2003 4:45 am
Location: Bakersfield, California
Contact:

Post by |tim| »

I was playing with someone on 10.0 and the other teammate spawned right into my base :\
Image

~Bring the Pain!~
bloohoo
Private
Private
Posts: 3
Joined: Thu Feb 26, 2004 7:45 am

spawns

Post by bloohoo »

does the new bzflag version fix the dumb spawn right beside someone thing yet?
Post Reply