Inside3D!
     

Doctor Coop - Making coop work on maps without coop spawns?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sun Dec 07, 2008 10:43 pm    Post subject: Doctor Coop - Making coop work on maps without coop spawns? Reply with quote

A couple of years ago, I can remember walking around maps with a QuakeC function to show my position to build entity files for maps that didn't have coop spawn points.

Is there a good universal QuakeC way to make a map support any number of players on coop without telefragging anyone?

Is it possible for QuakeC (even with an extension) to tell if some area of space is unoccupied and that a player could spawn there, like have QuakeC check to the side and the left of the spawn point to see if someone could spawn there?

I know one mod (Clan ArenaX) that at least at one point would do a "push" effect on a player at spawn to move him out of the way in case another player needs to spawn.

Just curious?

Or maybe have the player in a "teleporter queue" until the player standing there moves ... and maybe make the player standing there take 20 temporary damage points per second if he is at a spawn point so he can't hold up the game?
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Mon Dec 08, 2008 2:24 am    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

Baker wrote:

Is it possible for QuakeC (even with an extension) to tell if some area of space is unoccupied and that a player could spawn there, like have QuakeC check to the side and the left of the spawn point to see if someone could spawn there?


Perfectly possible, with or without an extension, but not reliable. You'd spawn a test entity with a player bbox and try a droptofloor and walkmove (or tracebox if available in that engine). The unreliability comes from not knowing the layout of maps; it's quite possible you could spawn in a valid location that you'd not be able to move out of. I spent ages fine tuning the spawning location code for my RTS mods, but they still occasionally turn up standing on each others' heads or in places they can't get out of.


Quote:

Or maybe have the player in a "teleporter queue" until the player standing there moves ... and maybe make the player standing there take 20 temporary damage points per second if he is at a spawn point so he can't hold up the game?


Certainly a plasuible idea, though the player entity would have to go somewhere in the interventing time, say a box outside the level or something. Having multiples in the queue wouldn't be a problem as you'd have no telefrag in the queue, as they wouldnt be moving while queued.

Frankly, probably the simplest idea is to allow spawning at item locations. On 99% of maps all item locations will be safe places to spawn, and there should be enough to ensure no telefrags.
_________________
Apathy Now!
Back to top
View user's profile Send private message
MeTcHsteekle



Joined: 15 May 2008
Posts: 397
Location: its a secret

PostPosted: Mon Dec 08, 2008 2:28 am    Post subject: Reply with quote

you could try what Gunter does on FvF, you spawn in increments of maybe 5 seconds, and when u do spawn you have invulnerability for around five seconds
_________________
bah
Back to top
View user's profile Send private message AIM Address
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Mon Dec 08, 2008 2:48 am    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

I've got it =D

Have them spawn near his partner, test random areas for spawnability in a certain radius of said partner. Do a traceline to make sure they're not behind any walls.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon Dec 08, 2008 3:24 am    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

MauveBib wrote:
I spent ages fine tuning the spawning location code for my RTS mods, but they still occasionally turn up standing on each others' heads or in places they can't get out of.


Yeah, heh.


Quote:

Frankly, probably the simplest idea is to allow spawning at item locations. On 99% of maps all item locations will be safe places to spawn, and there should be enough to ensure no telefrags.


Yeah, that's what RuneQuake does.

Downsider wrote:
I've got it =D

Have them spawn near his partner, test random areas for spawnability in a certain radius of said partner. Do a traceline to make sure they're not behind any walls.


I've got it x2 maybe probably?

What if players aren't corporeal and can walkthrough each other if any part of them is in contact with the info_player_start entity box?
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Mon Dec 08, 2008 8:58 am    Post subject: Reply with quote

Try spawning the player (as self).
Use walkmove(0,0)

Test its return values.

This will tell you if they are properly spawned there or if they're stuck in something.

Quirks: It'll trigger touch functions, so make sure you clear out the player's classname first, just in case, and restore after, or your player will be able to pick up ammo boxes that they're not even spawned upon.

This is after all what zombies do to see if they can get back up.


Might want to do a traceline too, just in case.
Delaying spawns works too, and encourages people to actually move (instead of going afk while the loading screen is up in slow loading engines..)
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Tue Dec 09, 2008 1:57 am    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

Baker wrote:

What if players aren't corporeal and can walkthrough each other if any part of them is in contact with the info_player_start entity box?


BRILLIANT
Back to top
View user's profile Send private message
r00k



Joined: 13 Nov 2004
Posts: 483

PostPosted: Tue Dec 09, 2008 4:45 am    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

Baker wrote:
A couple of years ago, I can remember walking around maps with a QuakeC function to show my position to build entity files for maps that didn't have coop spawn points.


In Qrack (for example) you can type SPOT in console and it will output your origin and angles.

Baker wrote:

I know one mod (Clan ArenaX) that at least at one point would do a "push" effect on a player at spawn to move him out of the way in case another player needs to spawn.


Here's the modified code for that (in T_Damage), as players do not have takedamage TRUE until after the round starts...

Code:

   if ((!targ.takedamage) && (targ.classname == "player"))//This is here for pre-game spawn's tdeath_touch to push the player out of the way...
   {
      dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
      dir = normalize(dir);
      
      targ.velocity = (targ.velocity + ((dir * damage) * 8));
      return;
   }



But that portion of code became partially obsolete, since when I initially spawn a player I force them to step forward in PutClientInServer
Code:

   makevectors (self.v_angle);
   spawn_tdeath (self.origin, self);//create telefrag trigger
   spawn_tfog (self.origin + v_forward*20);
   self.velocity = v_forward * 320;//step forward after spawn please.   


But after 5 years since I really have looked at that part of the code it makes me wonder if I should create that spawn_tDeath AFTER the step, else tdeath trigger will be left behind him, so the next player comming thru in time+0.2 seconds would touch the 1st player's tdeath trigger, thus the second player would be telefragged not the 1st :O

Anyways, a bottom line DYNAMIC team spawn would be kinda cool.
Maybe like Spike suggested to use a movewalk in a series of attempts, forward, back, left, or right of the INITIAL spawn point then if valid step in that direction.
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Tue Dec 09, 2008 11:21 pm    Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw Reply with quote

Store position of other player upon opposite player's death, check if clear every so many steps, when clear, spawn player. There, perfect Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
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


Powered by phpBB © 2004 phpBB Group