the Rainbow Networks
+++eXy FFA
Map: nodm13
Players: 2 / 18
The golden pot › RAINBOW NETWORKS › Tech & Support › Spawn....things
Spawn....things
Something wrong with our servers or your system?
Go to page Previous  1, 2, 3  Next
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexTech & Support
View previous topic :: View next topic  
Author Message
chiquita
Alpacas Approved
Alpacas Approved


Joined: Sep 01, 2007
Posts: 1410
Location: psychiatric ward

PostPosted: Mon May 11, 2009 10:14 pm    Post subject: Re: Spawn....things Reply with quote

My 1.16 servers has the players spawn with a teleporter. You can end up in the same place as you spawn first providing you arent on the spawn point.

It's quite funny at times.. someone may use the teleport just as they are about to get hit with a rocket.. then they respawn behind you and shoot you in the arse :D I've even seen players jump into void after another player and rail them.. then use teleport to take them back to safety. IMO it's alot better than servers which have void protection.

Maybe the code has changed since then though. If anyone will know for sure, Falkland will :)
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Tue May 12, 2009 1:40 am    Post subject: Re: Spawn....things Reply with quote

kernel_panic wrote:
Falkland, do you know whether the distance calculated to decide the next spawn point takes into account teleporters?

So, in the next diagram, if a player dies in room A, the next spawn point won't be in room E because of the portal?

Code::
| A | B | C | D | E |
   |               |
   |_ _ portal _ _ | 

Idk , but I think teleport presence should not interfere with the spawn function.
Back to top
View user's profile
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Tue May 12, 2009 8:48 am    Post subject: Re: Spawn....things Reply with quote

chiquita wrote:
...
I've even seen players jump into void after another player and rail them.. then use teleport to take them back to safety. IMO it's alot better than servers which have void protection.

Maybe the code has changed since then though. If anyone will know for sure, Falkland will :)

All I know is that there are 2 maps ( maybe there are also other maps ) having (edit : PERSONAL ) teleport in the void :
- 17instamix
- 17rocketmix

When u fall in the void u pick up the PERSONAL teleport , then press USE_ITEM and u will be again on the platform.


Last edited by Falkland on Tue May 12, 2009 2:43 pm; edited 1 time in total
Back to top
View user's profile
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Tue May 12, 2009 12:16 pm    Post subject: Re: Spawn....things Reply with quote

Quote::
kernel_panic wrote:
"Marked as initial"? What's that? Can the mapper mark a spawn point as such? Clarify, please.

yes, at least i think so. the description i had above was taken from the gtkradiant entities properties.

i guess that the spawns not marked with initial will be ignored when the match first begins unless there are too few initial spawns. but i haven't tested this.

Cool! I'll do some testing when I have time.

Quote::
Idk , but I think teleport presence should not interfere with the spawn function.

Well, I completely disagree. And I think the way the bsp works disagrees too. When it comes to calculate things like the visibility, the way rooms are interconnected matters. There are some tricks the mapper can do to alter the way the bsp is divided to keep optimum performance. One of these is by using some entity whose name I don't remember to block different areas. This thing doesn't work if there are any teleporters connecting the areas you were trying to block. It only makes sense. After all, the teleporter changes the 3D structure of the map and connects different areas with a 'hall' of zero length, putting those rooms next to each other in practical terms.

Also in practical terms, if you don't like people spawn fragging I guess you don't like people spawn fragging no matter what they have to do to get their easy frag. That they reach the freshly spawned player jumping or via a teleporter shouldn't be of any importance.

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
Joki
Übergod
Übergod


Joined: Apr 16, 2008
Posts: 1037
Location: at tiled stove

PostPosted: Tue May 12, 2009 12:53 pm    Post subject: Re: Spawn....things Reply with quote

kernel_panic wrote:

One of these is by using some entity whose name I don't remember to block different areas.

"Hint-Brush", (best used to block horizontal interconnections like doors or L-shaped corridors) and "Portal-Brush" (best used to block vertical open areas, like open ceilings.

kernel_panic wrote:

After all, the teleporter changes the 3D structure of the map and connects different areas with a 'hall' of zero length, putting those rooms next to each other in practical terms.

I'm almost sure, it does not. Unless the teleporter-target has a portal_surface entity, so you can see whats on the "other side" before entering a teleporter (and dont have r_fastsky set to 1).

_________________
Back to top
View user's profile Visit poster's website
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Tue May 12, 2009 2:19 pm    Post subject: Re: Spawn....things Reply with quote

Quote::
"Hint-Brush", (best used to block horizontal interconnections like doors or L-shaped corridors) and "Portal-Brush" (best used to block vertical open areas, like open ceilings.

Unless it's the same thing, I was actually thinking about area portals, but same idea.

Quote::
Quote::

After all, the teleporter changes the 3D structure of the map and connects different areas with a 'hall' of zero length, putting those rooms next to each other in practical terms.

I'm almost sure, it does not. Unless the teleporter-target has a portal_surface entity, so you can see whats on the "other side" before entering a teleporter (and dont have r_fastsky set to 1).

You are right. Apparently clusters are what get merged if you have a teleporter between them. And apparently clusters don't have any effect on vis calculations, but on the generation of the bots file.

So the engine is not on my side on this one :) I still think the teleporters should determine the way distances are calculated...as it's only logic.

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
Joki
Übergod
Übergod


Joined: Apr 16, 2008
Posts: 1037
Location: at tiled stove

PostPosted: Tue May 12, 2009 3:07 pm    Post subject: Re: Spawn....things Reply with quote

Yea, its called "Areaportal" not "Portal-Brush" xD

_________________
Back to top
View user's profile Visit poster's website
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Tue May 12, 2009 3:31 pm    Post subject: Re: Spawn....things Reply with quote

The teleport touch is defined in code/game/g_trigger.c

The main assumption is that the teleport has an origin and a destination : if it has not a destination the function exits with the message "Couldn't find teleporter destination" and the teleport presence does not implies any other action ( the player remains there because the TeleportPlayer function is not called ). There's no other assumption about distance calculation. At least a teleport can be defined as usable by spectators only and that's what happens when a spectator tries to use a port : the spectator is teleported on the other side of the port.

Code::
...
/*
==============================================================================

trigger_teleport

==============================================================================
*/

void trigger_teleporter_touch (gentity_t *self, gentity_t *other, trace_t *trace ) {
	gentity_t	*dest;

	if ( !other->client ) {
		return;
	}
	if ( other->client->ps.pm_type == PM_DEAD ) {
		return;
	}
	// Spectators only?
	if ( ( self->spawnflags & 1 ) && 
		other->client->sess.sessionTeam != TEAM_SPECTATOR ) {
		return;
	}


	dest = 	G_PickTarget( self->target );
	if (!dest) {
		G_Printf ("Couldn't find teleporter destination\n");
		return;
	}

	TeleportPlayer( other, dest->s.origin, dest->s.angles );
}


/*QUAKED trigger_teleport (.5 .5 .5) ? SPECTATOR
Allows client side prediction of teleportation events.
Must point at a target_position, which will be the teleport destination.

If spectator is set, only spectators can use this teleport
Spectator teleporters are not normally placed in the editor, but are created
automatically near doors to allow spectators to move through them
*/
void SP_trigger_teleport( gentity_t *self ) {
	InitTrigger (self);

	// unlike other triggers, we need to send this one to the client
	// unless is a spectator trigger
	if ( self->spawnflags & 1 ) {
		self->r.svFlags |= SVF_NOCLIENT;
	} else {
		self->r.svFlags &= ~SVF_NOCLIENT;
	}

	// make sure the client precaches this sound
	G_SoundIndex("sound/world/jumppad.wav");

	self->s.eType = ET_TELEPORT_TRIGGER;
	self->touch = trigger_teleporter_touch;

	trap_LinkEntity (self);
}
...

The TeleportPlayer function is in the file code/game/g_misc.c

The hold time on the teleport is 160 msec
The player's teleport out speed is 400 ups

Code::
...
/*
=================================================================================

TELEPORTERS

=================================================================================
*/

void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles ) {
	gentity_t	*tent;

	// use temp events at source and destination to prevent the effect
	// from getting dropped by a second player event
	if ( player->client->sess.sessionTeam != TEAM_SPECTATOR ) {
		tent = G_TempEntity( player->client->ps.origin, EV_PLAYER_TELEPORT_OUT );
		tent->s.clientNum = player->s.clientNum;

		tent = G_TempEntity( origin, EV_PLAYER_TELEPORT_IN );
		tent->s.clientNum = player->s.clientNum;
	}

	// unlink to make sure it can't possibly interfere with G_KillBox
	trap_UnlinkEntity (player);

	VectorCopy ( origin, player->client->ps.origin );
	player->client->ps.origin[2] += 1;

	// spit the player out
	AngleVectors( angles, player->client->ps.velocity, NULL, NULL );
	VectorScale( player->client->ps.velocity, 400, player->client->ps.velocity );
	player->client->ps.pm_time = 160;		// hold time
	player->client->ps.pm_flags |= PMF_TIME_KNOCKBACK;

	// toggle the teleport bit so the client knows to not lerp
	player->client->ps.eFlags ^= EF_TELEPORT_BIT;

	// set angles
	SetClientViewAngle( player, angles );

	// kill anything at the destination
	if ( player->client->sess.sessionTeam != TEAM_SPECTATOR ) {
		G_KillBox (player);
	}

	// save results of pmove
	BG_PlayerStateToEntityState( &player->client->ps, &player->s, qtrue );

	// use the precise origin for linking
	VectorCopy( player->client->ps.origin, player->r.currentOrigin );

	if ( player->client->sess.sessionTeam != TEAM_SPECTATOR ) {
		trap_LinkEntity (player);
	}
}
...

Also the action of the portal objects is defined here.

The comments explain how the portal objects are treated :

Quote::

The portal surface nearest this entity will show a view from the targeted misc_portal_camera, or a mirror view if untargeted.
...
The target for a misc_portal_director. You can set either angles or target another entity to determine the direction of view.
"roll" an angle modifier to orient the camera around the target vector
...

So the destination view will be displayed on the portal surface only if it's specified , else it will be displayed the player model itself ( mirror ) ... plus it can be tuned the angle of the destination view.

Code::
...
//===========================================================

void locateCamera( gentity_t *ent ) {
	vec3_t		dir;
	gentity_t	*target;
	gentity_t	*owner;

	owner = G_PickTarget( ent->target );
	if ( !owner ) {
		G_Printf( "Couldn't find target for misc_partal_surface\n" );
		G_FreeEntity( ent );
		return;
	}
	ent->r.ownerNum = owner->s.number;

	// frame holds the rotate speed
	if ( owner->spawnflags & 1 ) {
		ent->s.frame = 25;
	} else if ( owner->spawnflags & 2 ) {
		ent->s.frame = 75;
	}

	// swing camera ?
	if ( owner->spawnflags & 4 ) {
		// set to 0 for no rotation at all
		ent->s.powerups = 0;
	}
	else {
		ent->s.powerups = 1;
	}

	// clientNum holds the rotate offset
	ent->s.clientNum = owner->s.clientNum;

	VectorCopy( owner->s.origin, ent->s.origin2 );

	// see if the portal_camera has a target
	target = G_PickTarget( owner->target );
	if ( target ) {
		VectorSubtract( target->s.origin, owner->s.origin, dir );
		VectorNormalize( dir );
	} else {
		G_SetMovedir( owner->s.angles, dir );
	}

	ent->s.eventParm = DirToByte( dir );
}

/*QUAKED misc_portal_surface (0 0 1) (-8 -8 -8) (8 8 8)
The portal surface nearest this entity will show a view from the targeted misc_portal_camera, or a mirror view if untargeted.
This must be within 64 world units of the surface!
*/
void SP_misc_portal_surface(gentity_t *ent) {
	VectorClear( ent->r.mins );
	VectorClear( ent->r.maxs );
	trap_LinkEntity (ent);

	ent->r.svFlags = SVF_PORTAL;
	ent->s.eType = ET_PORTAL;

	if ( !ent->target ) {
		VectorCopy( ent->s.origin, ent->s.origin2 );
	} else {
		ent->think = locateCamera;
		ent->nextthink = level.time + 100;
	}
}

/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate noswing
The target for a misc_portal_director.  You can set either angles or target another entity to determine the direction of view.
"roll" an angle modifier to orient the camera around the target vector;
*/
void SP_misc_portal_camera(gentity_t *ent) {
	float	roll;

	VectorClear( ent->r.mins );
	VectorClear( ent->r.maxs );
	trap_LinkEntity (ent);

	G_SpawnFloat( "roll", "0", &roll );

	ent->s.clientNum = roll/360.0 * 256;
}
...
Back to top
View user's profile
chiquita
Alpacas Approved
Alpacas Approved


Joined: Sep 01, 2007
Posts: 1410
Location: psychiatric ward

PostPosted: Tue May 12, 2009 4:18 pm    Post subject: Re: Spawn....things Reply with quote

You also spawn after being killed at 400ups.. as most defraggers will know :D
Back to top
View user's profile
Joki
Übergod
Übergod


Joined: Apr 16, 2008
Posts: 1037
Location: at tiled stove

PostPosted: Tue May 12, 2009 6:47 pm    Post subject: Re: Spawn....things Reply with quote

Btw falky, i dont really think that pasting all this code is really helpfull for many readers here. I mean, what would you do, if people start to talk like this all the time... ?

Code::
  [
  uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
  ]
  library LUselessJunk
  {
      // bring in the master library
      importlib("actimp.tlb");
      importlib("actexp.tlb");
 
      // bring in my interfaces
      #include "pshlo.idl"
 
      [
      uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
      ]
      cotype TUselessJunk
   {
   interface IUselessJunk;
   interface IPersistFile;
   };
  };
 
  [
  exe,
  uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
  ]
  module CUselessJunkLib
  {
 
      // some code related header files
      importheader(<windows.h>);
      importheader(<ole2.h>);
      importheader(<except.hxx>);
      importheader("pshlo.h");
      importheader("shlo.hxx");
      importheader("mycls.hxx");
 
      // needed typelibs
      importlib("actimp.tlb");
      importlib("actexp.tlb");
      importlib("thlo.tlb");
 
      [
      uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
      aggregatable
      ]
      coclass CUselessJunk
   {
   cotype TUselessJunk;
   };
  };
 
 
  #include "ipfix.hxx"
 
  extern HANDLE hEvent;
 
  class CUselessJunk : public CUselessJunkBase
  {
  public:
      IPFIX(CLSID_CUselessJunk);
 
      CUselessJunk(IUnknown *pUnk);
      ~CUselessJunk();
 
      HRESULT  __stdcall PrintSz(LPWSTR pwszString);
 
  private:
      static int cObjRef;
  };
 
 
  #include <windows.h>
  #include <ole2.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include "thlo.h"
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "mycls.hxx"
 
  int CUselessJunk::cObjRef = 0;
 
  CUselessJunk::CUselessJunk(IUnknown *pUnk) : CUselessJunkBase(pUnk)
  {
      cObjRef++;
      return;
  }
 
  HRESULT  __stdcall  CUselessJunk::PrintSz(LPWSTR pwszString)
  {
      printf("%ws
", pwszString);
      return(ResultFromScode(S_OK));
  }
 
 
  CUselessJunk::~CUselessJunk(void)
  {
 
  // when the object count goes to zero, stop the server
  cObjRef--;
  if( cObjRef == 0 )
      PulseEvent(hEvent);
 
  return;
  }
 
  #include <windows.h>
  #include <ole2.h>
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "mycls.hxx"
 
  HANDLE hEvent;
 
   int _cdecl main(
  int argc,
  char * argv[]
  ) {
  ULONG ulRef;
  DWORD dwRegistration;
  CUselessJunkCF *pCF = new CUselessJunkCF();
 
  hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
 
  // Initialize the OLE libraries
  CoInitializeEx(NULL, COINIT_MULTITHREADED);
 
  CoRegisterClassObject(CLSID_CUselessJunk, pCF, CLSCTX_LOCAL_SERVER,
      REGCLS_MULTIPLEUSE, &dwRegistration);
 
  // wait on an event to stop
  WaitForSingleObject(hEvent, INFINITE);
 
  // revoke and release the class object
  CoRevokeClassObject(dwRegistration);
  ulRef = pCF->Release();
 
  // Tell OLE we are going away.
  CoUninitialize();
 
  return(0); }
 
  extern CLSID CLSID_CUselessJunk;
  extern UUID LIBID_CUselessJunkLib;
 
  CLSID CLSID_CUselessJunk = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
      0x2573F891,
      0xCFEE,
      0x101A,
      { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
  };
 
  UUID LIBID_CUselessJunkLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
      0x2573F890,
      0xCFEE,
      0x101A,
      { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
  };
 
  #include <windows.h>
  #include <ole2.h>
  #include <stdlib.h>
  #include <string.h>
  #include <stdio.h>
  #include "pshlo.h"
  #include "shlo.hxx"
  #include "clsid.h"
 
  int _cdecl main(
  int argc,
  char * argv[]
  ) {
  HRESULT  hRslt;
  IUselessJunk        *pUselessJunk;
  ULONG  ulCnt;
  IMoniker * pmk;
  WCHAR  wcsT[_MAX_PATH];
  WCHAR  wcsPath[2 * _MAX_PATH];
 
  // get object path
  wcsPath[0] = '\0';
  wcsT[0] = '\0';
  if( argc > 1) {
      mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
      wcsupr(wcsPath);
      }
  else {
      fprintf(stderr, "Object path must be specified\n");
      return(1);
      }
 
  // get print string
  if(argc > 2)
      mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
  else
      wcscpy(wcsT, L"Falkland is da man!!!1"); //^_____^
 
  printf("Linking to object %ws\n", wcsPath);
  printf("Text String %ws\n", wcsT);
 
  // Initialize the OLE libraries
  hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);
 
  if(SUCCEEDED(hRslt)) {
 
 
      hRslt = CreateFileMoniker(wcsPath, &pmk);
      if(SUCCEEDED(hRslt))
   hRslt = BindMoniker(pmk, 0, IID_IUselessJunk, (void **)&pUselessJunk);
 
      if(SUCCEEDED(hRslt)) {
 
   // print a string out
   pUselessJunk->PrintSz(wcsT);
 
   Sleep(2000);
   ulCnt = pUselessJunk->Release();
   }
      else
   printf("Failure to connect, status: %lx", hRslt);
 
      // Tell OLE we are going away.
      CoUninitialize();
      }
 
  return(0);
  }

_________________
Back to top
View user's profile Visit poster's website
Falkland
Übergod
Übergod


Joined: Aug 01, 2008
Posts: 922
Location: Nowhere

PostPosted: Tue May 12, 2009 10:05 pm    Post subject: Re: Spawn....things Reply with quote

But the more or less standard C in which the engine is written is quite readable ... :grin:

I've talked about the spawn function with more than one player before this post :

Player1 (to me) : are you sure of this ?
Player2 (to me) : that's intresting ... where these functions are defined ?
Player3 (to me) : wtf are u trying to say ?
...
...
...

And then ...

me : idk , but I think teleport presence should not interfere with the spawn function.
kernel_panic ( or kernel_panico and by anagram pancio_kernel :O) ) : Well, I completely disagree...

:harr:

btw , what does that code do ? I am not expert in Windows C++ dialect :grin:
Back to top
View user's profile
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Tue May 12, 2009 11:10 pm    Post subject: Re: Spawn....things Reply with quote

Let's get this straight, Lt. Falkland.

I'm not saying that the teleporters do count for the distance calculations, OK? So don't throw more code at us indiscriminately (do it only when you have a good reason :D).

All I'm saying is that if they actually don't enter in the calculation, they definitely should. For the record, I'm also saying that the idtech3 developers, the Rainbow Networks members (all of them) and the whole human population are wrong if they don't share my opinion. See, it all boils down to geometry and theology.

PS. Pancio_kernel! How do you dare?!

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
Joki
Übergod
Übergod


Joined: Apr 16, 2008
Posts: 1037
Location: at tiled stove

PostPosted: Tue May 12, 2009 11:58 pm    Post subject: Re: Spawn....things Reply with quote

Falkland wrote:

btw , what does that code do ? I am not expert in Windows C++ dialect :grin:

Look closer to it and you may find a clue.
Hint: Search for the terms "Alpaca", "Kernelinho" or "Falkland".

_________________
Back to top
View user's profile Visit poster's website
chiquita
Alpacas Approved
Alpacas Approved


Joined: Sep 01, 2007
Posts: 1410
Location: psychiatric ward

PostPosted: Wed May 13, 2009 12:48 am    Post subject: Re: Spawn....things Reply with quote

The only issue I have is I answer the best I can to what I've seen in many years of q3. But Falkland may have already answered it previously amongst the mumbo jumbo.. which I just skip past... cos i'm not that educated enough to understand it :mph:
Back to top
View user's profile
pulchr
Elite Haxor!
Elite Haxor!


Joined: Oct 23, 2007
Posts: 167
Location: sweden

PostPosted: Thu May 21, 2009 10:37 pm    Post subject: Re: Spawn....things Reply with quote

here's another related link - look down at point #29.

_________________
barry white saved my life
Back to top
View user's profile Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum Index -> Tech & Support All times are GMT + 1 Hour
Go to page Previous  1, 2, 3  Next
Page 2 of 3


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Welcome Anonymous


Membership:
Latest: kontol
New Today: 0
New Yesterday: 0
Overall: 355

People Online:
Members: 0
Visitors: 16
Total: 16
Who Is Where:
 Visitors:
01: The golden pot
02: The golden pot
03: Rainbow Media
04: The golden pot
05: Maps
06: Maps
07: Home
08: My Account
09: My Account
10: Shoutblock
11: The golden pot
12: Home
13: The golden pot
14: The golden pot
15: The golden pot
16: Maps

Staff Online:

No staff members are online!

The Rainbow Networks website is hosted by JockeTF and Soder on furver.se.

The Rainbow Networks
Interactive software released under GNU GPL, Code Credits, Privacy Policy
Azul theme and related images designed by Jamin