Forum

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

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

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

Postby Baker » Sun Dec 07, 2008 10:43 pm

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?
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby MauveBib » Mon Dec 08, 2008 2:24 am

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.


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!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby MeTcHsteekle » Mon Dec 08, 2008 2:28 am

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
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby Downsider » Mon Dec 08, 2008 2:48 am

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.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby Baker » Mon Dec 08, 2008 3:24 am

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.


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?
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Mon Dec 08, 2008 8:58 am

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..)
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby Downsider » Tue Dec 09, 2008 1:57 am

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
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby r00k » Tue Dec 09, 2008 4:45 am

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: Select all
   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: Select all
   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.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Re: Doctor Coop - Making coop work on maps without coop spaw

Postby Downsider » Tue Dec 09, 2008 11:21 pm

Store position of other player upon opposite player's death, check if clear every so many steps, when clear, spawn player. There, perfect :)
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest