Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

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

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Sun Dec 07, 2008 10:43 pm Post subject: Doctor Coop - Making coop work on maps without coop spawns? |

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 |

MauveBib Joined: 04 Nov 2004 Posts: 602 |

Posted: Mon Dec 08, 2008 2:24 am Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

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 |

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

Posted: Mon Dec 08, 2008 2:28 am Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Mon Dec 08, 2008 2:48 am Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

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 |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Mon Dec 08, 2008 3:24 am Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

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 |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Mon Dec 08, 2008 8:58 am Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Tue Dec 09, 2008 1:57 am Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

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 |

r00k Joined: 13 Nov 2004 Posts: 483 |

Posted: Tue Dec 09, 2008 4:45 am Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Tue Dec 09, 2008 11:21 pm Post subject: Re: Doctor Coop - Making coop work on maps without coop spaw |

Store position of other player upon opposite player's death, check if clear every so many steps, when clear, spawn player. There, perfect

Back to top |

Display posts from previous:

| 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