Forum

Last Man Standing

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

Last Man Standing

Postby Senban » Wed Sep 03, 2008 2:20 pm

I really want to add a Last Man Standing game mode to my mod. So far I've got as far as coding it so that the fraglimit sets the number of lives each player has and players stop respawning when they run out of lives. What I don't know how to do is tell when all but one of the players/teams are dead.
Once I know all the players are dead what I want to do is start a new round, respawning all items and players in to the map.
Any ideas/suggestions?
User avatar
Senban
 
Posts: 19
Joined: Sat Apr 14, 2007 8:04 pm

Postby Dr. Shadowborg » Wed Sep 03, 2008 4:07 pm

First check to see how many players there are, next check and see which players are dead. (Compare dead_players against total_players, if equal or 1 off, reset game)
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Re: Last Man Standing

Postby Baker » Fri Sep 05, 2008 2:18 am

Senban wrote:I really want to add a Last Man Standing game mode to my mod. So far I've got as far as coding it so that the fraglimit sets the number of lives each player has and players stop respawning when they run out of lives. What I don't know how to do is tell when all but one of the players/teams are dead.
Once I know all the players are dead what I want to do is start a new round, respawning all items and players in to the map.
Any ideas/suggestions?


You might find this helpful:

Clan Arena (by Mungo) 1.3 source code

Clan Arena is round-based and once all the players are dead, a new round starts. A little different than your idea of players having X lives, but I think the code should be helpful none the less.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Senban » Fri Sep 05, 2008 3:19 pm

Dr. Shadowborg wrote:First check to see how many players there are, next check and see which players are dead. (Compare dead_players against total_players, if equal or 1 off, reset game)

Interesting, I've never come across those values before, is there a complete list of them anywhere? And most importantly can this method be made to work with teamplay?

Baker wrote:You might find this helpful:

Clan Arena (by Mungo) 1.3 source code

Clan Arena is round-based and once all the players are dead, a new round starts. A little different than your idea of players having X lives, but I think the code should be helpful none the less.

Cool I'll have a good look at that. Getting the basic round structure in place seems like being the big hurdle, along with indexing everything that need's to be replaced (cos eventually I'm going to get to coop and need to spawn a full levels worth of fresh monsters each time the players run out of blood.)

This is all a lot harder work than making different kinds of fireballs come out of the monsters.
User avatar
Senban
 
Posts: 19
Joined: Sat Apr 14, 2007 8:04 pm

Postby Dr. Shadowborg » Fri Sep 05, 2008 4:27 pm

Senban wrote:
Dr. Shadowborg wrote:First check to see how many players there are, next check and see which players are dead. (Compare dead_players against total_players, if equal or 1 off, reset game)

Interesting, I've never come across those values before, is there a complete list of them anywhere? And most importantly can this method be made to work with teamplay?


That's because they don't exist in quakec by default. What I mean for you to do is declare in DEFS.QC

float total_players;
float dead_players;

Then in CLIENT.QC under clientconnect() add
total_players = total_players + 1;

In clientdisconnect() add
total_players = total_players - 1;

And finally, whereever you check if a player has expended all lives and dump him into observer mode add something like:

dead_players = dead_players + 1;

If you want this to work in teamplay, you'll have to do something a bit different. (Same principle applies, just slightly more complex)
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby Senban » Fri Sep 05, 2008 5:38 pm

Ahhhh, cool gotcha, makes a lot more sense than having a little daemon constantly searching the map to see if anyone's still alive.
User avatar
Senban
 
Posts: 19
Joined: Sat Apr 14, 2007 8:04 pm

Postby Lardarse » Mon Sep 08, 2008 9:00 am

Senban wrote:Ahhhh, cool gotcha, makes a lot more sense than having a little daemon constantly searching the map to see if anyone's still alive.

Tracking how the total changes is often the fastest way to count things...
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby MeTcHsteekle » Mon Sep 08, 2008 7:27 pm

hmm but dont rule out the demon, that would be cool if a demon was the ref or somthing, or um hmm:D
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Stealth Kill » Tue Sep 09, 2008 12:57 pm

Clanarena is very interesting.
How can play it? If i start a map it spawns me with no weapons. Are there any commands to start game?
Stealth Kill
 
Posts: 83
Joined: Fri Dec 29, 2006 12:34 pm

Postby Wazat » Tue Sep 09, 2008 5:31 pm

Lardarse wrote:
Senban wrote:Ahhhh, cool gotcha, makes a lot more sense than having a little daemon constantly searching the map to see if anyone's still alive.

Tracking how the total changes is often the fastest way to count things...

I should note that a daemon that checks with a find command, say, every 5 seconds is an *extremely* good idea. If you're going to do it by changes alone, then you must make sure you have every single control point and possibility covered. Clients connecting, disconnecting, dying, kill command... *everything*. It may be much better to have a hybrid system that includes the daemon thinking every 5 seconds to audit the results and correct mistakes. If a mistake is made and not corrected, a match may never end even though no players are left alive, and that's very frustrating for players.

Also, make sure that when a player joins, he joins dead and has to wait for the round to restart. If the new player pops right into the match to fight, then whenever a player dies he can just disconnect and reconnect to keep playing and that encourages abuse.

BTW, when you said "daemon" I thought "demon" as in the fiend monster. I imagined an invincible super-powerful fiend that patrols the level by foot and quickly kills any player it finds. Could be something you release into the level right at the get-go, or only if a round goes past a certain time limit to finish off the stragglers. Unleash the army of fiends!

You'd just need some sort of level prowling code, or maybe just let the demon teleport near the location of random players when it can't see a target. The make it able to move extremely fast, jump very fast or climb walls, and kill with only a couple of slashes. Maybe even a spitting ranged attack.

That should take care of some of the players that like to drag these kinds of matches on forever.

*poof* Rawr! "Oh gawd mah camp'n strategy are not werkin!!!"

-Wazat
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby Lardarse » Wed Sep 10, 2008 2:18 am

Wazat wrote:
Lardarse wrote:
Senban wrote:Ahhhh, cool gotcha, makes a lot more sense than having a little daemon constantly searching the map to see if anyone's still alive.

Tracking how the total changes is often the fastest way to count things...

I should note that a daemon that checks with a find command, say, every 5 seconds is an *extremely* good idea. If you're going to do it by changes alone, then you must make sure you have every single control point and possibility covered. Clients connecting, disconnecting, dying, kill command... *everything*. It may be much better to have a hybrid system that includes the daemon thinking every 5 seconds to audit the results and correct mistakes. If a mistake is made and not corrected, a match may never end even though no players are left alive, and that's very frustrating for players.

Very true. The more ways it ccan change, the more likely you are to screw up and miss one...

If you don't want to create an entity for this, then use the think for an existing entity that doens't normally think. info_player_* are good choices.
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Senban » Wed Sep 10, 2008 8:25 am

Wazat wrote:If you're going to do it by changes alone, then you must make sure you have every single control point and possibility covered. Clients connecting, disconnecting, dying, kill command... *everything*.

What happens if a player powers down their computer mid game, or their ISP shut's down or whatever?

Wazat wrote:Also, make sure that when a player joins, he joins dead and has to wait for the round to restart. If the new player pops right into the match to fight, then whenever a player dies he can just disconnect and reconnect to keep playing and that encourages abuse.

Good point.

Wazat wrote:BTW, when you said "daemon" I thought "demon" as in the fiend monster. I imagined an invincible super-powerful fiend that patrols the level by foot and quickly kills any player it finds. Could be something you release into the level right at the get-go, or only if a round goes past a certain time limit to finish off the stragglers. Unleash the army of fiends!

You'd just need some sort of level prowling code, or maybe just let the demon teleport near the location of random players when it can't see a target. The make it able to move extremely fast, jump very fast or climb walls, and kill with only a couple of slashes. Maybe even a spitting ranged attack.

That should take care of some of the players that like to drag these kinds of matches on forever.

*poof* Rawr! "Oh gawd mah camp'n strategy are not werkin!!!"

-Wazat
Maybe later...

Lardarse wrote:Very true. The more ways it can change, the more likely you are to screw up and miss one...

If you don't want to create an entity for this, then use the think for an existing entity that doens't normally think. info_player_* are good choices.
That's got certain effiency to it.
User avatar
Senban
 
Posts: 19
Joined: Sat Apr 14, 2007 8:04 pm

Postby Wazat » Wed Sep 10, 2008 9:32 pm

Senban wrote:What happens if a player powers down their computer mid game, or their ISP shut's down or whatever?

Typically the player will time out and disconnect. This might happen immediately, or it may take a few minutes to happen. I'm not sure how quickly quake determines that it's lost the connection and goes through the motions of a client disconnect, but I seem to remember it being rather quick.

Lardarse wrote:Very true. The more ways it can change, the more likely you are to screw up and miss one...

If you don't want to create an entity for this, then use the think for an existing entity that doens't normally think. info_player_* are good choices.
That's got certain effiency to it.


Just be aware that you only need *one* entity to do the auditing. It's rather inefficient to have info_player_deathmatch do it since the typical map will have many, many dm spawns. info_player_start is a better choice, but by far the best way to do it is to simply have world.qc spawn a new entity on level start and set its think. Then there's no question as to whether it'll get spawned (some dm maps may lack an info_player_start or may have more than one) or how many times per frame it happens because you have full control. I generally prefer to be explicit in these cases, and spawning a new entity really isn't much work.

-Wazat
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby Baker » Wed Sep 10, 2008 9:38 pm

Stealth Kill wrote:Clanarena is very interesting.
How can play it? If i start a map it spawns me with no weapons. Are there any commands to start game?


It's multiplayer only. Bot support would be difficult as there are no items so no waypoints or intuitive bot ai would be easy to achieve.

You start with all weapons and ammo usually it is the blue team vs. the red team until one or the other is dead. You play traditionally best of 9 rounds.

You pretty much have to play it on a server like speaknow.quakeone.com or elsewhere. I'm sure there is Clan Arena in Quake 3 as well, it is one of the few mods that has maintained long term popularity.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest