Reinforcements [survival mutator]

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Reinforcements [survival mutator]

#1

Post by Ænima » Sun Dec 15, 2024 3:03 am

 
  Image  
 
How many times have you died during the first 30 seconds of a Survival match and said, "Whelp, guess I'll just watch for the next 20 minutes"?

Ever connect to a server just barely too late for the warmup countdown so now you have to wait? Well not anymore!



video instead of screenshots:
phpBB [media]



Summary:
This mod allows spectators and dead players to join/respawn once certain conditions are met. Such as killing a certain number of monsters, picking up a key, waiting on a timer, finding all secrets, etc. The number of players who can respawn as well as the conditions required for respawning can be fully customized by the server host.


Image
In this way, players are rewarded for reaching milestones of progress throughout the map. Survival feels less "everything-or-nothing" and more teamwork-focused when your actions in the map directly enable other players to join in.

Spectators no longer have to suffer through 30 minutes of watching one player backtrack through a Chillax map for medkits and ammo. If you're the first spectator in line to join, then you'll be the first one to spawn in.

Players can respawn near teammates, and if there aren't enough players in the server for a respawn wave, the host can choose to spawn AI "helper marines" instead. You can give them orders like "teleport to me", "guard this area", "follow me", and "attack my crosshair target". (See options menu.)

Code: Select all

CVARS FOR SERVER HOSTS:
-----------------------------
reinforcement_requiredkills=	# of kills required to
				respawn players
				[default: 50]
												
reinforcement_size	=	# of players to respawn
				[default: 2, a value of 0
				respawns all players]
								
reinforcement_waves	=	Overrides the required
				kill number and instead
				uses a fixed amount of
				respawn waves based on
				the overall level kill%
				[default: 0]
								
reinforcement_time	=	Respawns players at fixed
				time intervals. Can be
				used in combination with
				killcount/kill%-based
				respawns.
				[default: 0]
								
reinforcement_keys	=	Overrides killcount and
				instead respawns players
				after a key has been
				found.
				[default: 0]		

reinforcement_spawnclosest=	Respawns players near
				another player instead of
				at the start of the map.
				[default: 0]	

reinforcement_robots	=	If there are no dead
				players or spectators to
				spawn, an AI marine will
				be spawned instead.
				[default: 0]

Spoiler: Wanna make a custom map with your own respawn conditions? (Open)

Load/host this mod along with your custom map. The load order shouldn't matter.

Then, you can use a basic script like this in your map:

Code: Select all

#include "zcommon.acs"

script "RespawnWhenImpsKilled" OPEN
{
	delay(10);
	ACS_NamedTerminate("KillWatcher",0); //deactivates the mod's default behavior
	ACS_NamedTerminate("SpawnMessage",0); //deactivates the mod's default behavior
	SetCVar("reinforcement_size", 8); //how many players you want to respawn. set this to 0 to respawn all players

	while (ThingCountName("DoomImp",0) > 0) //replace this with whatever conditions you want
	{
	delay(10);
	}
	printbold(s:"All imps killed! Respawning players..."); //change this message or omit it if you want
	ACS_NamedExecute("RevivePlayers", 0);
}
(If you've never used DoomBuilder's script editor before, simply press F10 while editing your map. Then paste all of this code into that window. Then press F5 to compile the script. Save your map and test it out with bots to make sure it works.)


This mod should be compatible with literally everything, as long as you're playing in Survival mode.




DOWNLOADS:

Testing alpha [v0.1f] (requires Zandronum 3.2 latest build)
Last edited by Ænima on Thu Apr 10, 2025 7:55 am, edited 44 times in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1904
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

Re: Reinforcements for survival (respawn teammates by killing monsters)

#2

Post by Combinebobnt » Thu Dec 19, 2024 8:05 am

How is this compared to https://static.allfearthesentinel.com/w ... nitest.pk3 ?, that has new joiners able to queue immediately since it's played in the coop gamemode.

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements for survival (respawn teammates by killing monsters)

#3

Post by Ænima » Thu Dec 19, 2024 8:18 pm

Combinebobnt wrote:
Thu Dec 19, 2024 8:05 am
How is this compared to https://static.allfearthesentinel.com/w ... nitest.pk3 ?, that has new joiners able to queue immediately since it's played in the coop gamemode.
This is less hacky and supports the Survival gamemode directly. Why use a script for keeping dead players dead and resetting the map when the engine already does that? You also don't get the "__ allies left" display at the bottom of the screen in that mod like with true survival and can't differentiate between dead players and spectators on the scoreboard. Here, you can.

That mod also forced changes to sv_maxplayers on the server, and forced players to spectate, both of which are no longer necessary thanks to SetDeadSpectator, GetJoinQueuePosition, and SkipJoinQueue now being supported by Zandronum.

This mod also prioritizes spectators in the join queue over dead players. I forgot to mention that in the OP. I think "rotating" players like this helps keeps spectators less bored and more engaged.

Overall "I Can't Believe It's Not Survival!" was a great mod and I was glad I could help Laggy out with it. I just figured it was time for a simpler, more modern version so I made this.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1904
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

Re: Reinforcements for survival (respawn teammates by killing monsters)

#4

Post by Combinebobnt » Fri Dec 20, 2024 2:57 pm

Sounds like this will be a welcome, cleaner replacement for notsurvival with the 3.2 function then.

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements for survival (respawn teammates by killing monsters)

#5

Post by Ænima » Fri Dec 20, 2024 5:39 pm

Combinebobnt wrote:
Fri Dec 20, 2024 2:57 pm
Sounds like this will be a welcome, cleaner replacement for notsurvival with the 3.2 function then.
I intend to expand the mod's functionality beyond that as well.

Planned for next version:
  • CVAR reinforcement_spawnclosest: Spawns players on or near another active player, opposite of sv_spawnfarthest
  • CVAR reinforcement_keys: Ignores killcount/timer and instead respawns players after a key has been collected. Since keys are the only tangible milestone of progress in classic Doom maps besides monstercount, I figured key collection would be a good checkpoint, not to mention that most maps dump monsters on you after grabbing a key so having reinforcements here makes sense
  • Better/optional announcer
  • HUD message telling dead/queued players "You will respawn in x more kills/minutes/after a key is found" etc
  • TeamLMS and TeamGame support (survival invasion should in theory already be supported)
  • Maaaybe a CVAR that would spawn helpermarines instead of players if you're playing alone/offline or if there aren't any dead players to spawn. This doesn't seem that important so it's a low priority.
Forgot to mention but there's also sv_maxlives compatibility. Haven't tested it yet but I assume it works because this mod only checks to see if you're dead/spectating-in-queue regardless of lives.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements for survival (respawn teammates by killing monsters)

#6

Post by Ænima » Mon Dec 23, 2024 3:44 am

Updated to v0.1b! Check the first post.

Key changes:
  • +3 new CVARs

    Code: Select all

    reinforcement_keys	=	Overrides killcount and
    				instead respawns players
    				after a key has been
    				found.
    				[default: 0]		
    
    reinforcement_spawnclosest=	Respawns players on/near
    				another player instead of
    				at the start of the map.
    				[default: 0]	
    				
    reinforcement_robots	=	If there are no dead
    				players or spectators to
    				spawn, an AI marine will
    				be spawned instead.
    				[default: 0]
    
  • Added the option to choose between male announcer (Red Alert 1), female announcer (Tiberium Dawn), or none.
  • Made a HUD message telling dead players "You will respawn in x more kills/minutes/after a key is found" etc. Still need to figure out how to also display this message for spectators who are in the join queue but not yet ingame. (Anyone have any suggestions?)
  • Better math for calculating total monster %'s.

Once I clean up my code and get everything bugtested, I'll be releasing the ACS source here so everyone can lose their eyesight looking at my hideous scripts see what's going on under the hood. :razz:
Last edited by Ænima on Fri Dec 27, 2024 9:15 pm, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
thevarian
 
Posts: 50
Joined: Thu Jun 07, 2012 5:28 pm
Location: Vegas
Clan: Hidden Hotdogs
Clan Tag: HH

Re: Reinforcements [survival mutator]

#7

Post by thevarian » Fri Dec 27, 2024 4:58 pm

This is a pretty cool mod. Is it possible to add a customizable reinforcement that can be dependent on a specific enemy being killed or entering a sector as well?

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements [survival mutator]

#8

Post by Ænima » Fri Dec 27, 2024 9:31 pm

thevarian wrote:
Fri Dec 27, 2024 4:58 pm
This is a pretty cool mod. Is it possible to add a customizable reinforcement that can be dependent on a specific enemy being killed or entering a sector as well?
THEVARIAN MAAAAAN where have you been? I was playing SSTMAP26 last night, good times.

And yes, in theory you should be able to trigger the respawn wave with anything. I made "RevivePlayers" its own script so that custom maps can call it.

examples:

Code: Select all

while (ThingCountName("Cyberdemon",0) > 0)
{
delay(10);
}
printbold(s:"All cyberdemons killed! Spawning reinforcements...");
ACS_NamedExecute("RevivePlayers", 0);

Code: Select all

while (ThingCountNameSector("DoomPlayer", 0, 666) < 1)
{
delay(10);
}
printbold(s:"Shrine activated! Players respawned.");
ACS_NamedExecute("RevivePlayers", 0);
I would've made "RevivePlayers" a function instead of a script but there are necessary delay()'s in it.



In other news, I've updated the coop bots. You can now give them orders like "teleport to me", "guard this area", "follow me", and "attack my crosshair target". (See key configuration menu.)
phpBB [media]


I've also improved the waypoint interpolation for player respawn destinations. "reinforcement_spawnclosest" will no longer spawn players directly in your face; instead reinforcements will teleport to where active players were standing 2 seconds ago, as long as it's a valid spot and there's nothing blocking it.

Also improved sv_maxlives compatibility. The "you will respawn when ___" message now only appears after losing your final life, and is disabled in singleplayer.


See first post for download. :cool:
Last edited by Ænima on Wed Jan 22, 2025 5:06 am, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
thevarian
 
Posts: 50
Joined: Thu Jun 07, 2012 5:28 pm
Location: Vegas
Clan: Hidden Hotdogs
Clan Tag: HH

Re: Reinforcements [survival mutator]

#9

Post by thevarian » Sat Dec 28, 2024 6:53 am

Ænima wrote:
Fri Dec 27, 2024 9:31 pm
THEVARIAN MAAAAAN where have you been? I was playing SSTMAP26 last night, good times.
I mostly been loitering in Ivan's Death and Decay Discord playing hardcore mode. I'm taking a break to focus on my own Doom project.
wrote:I made "RevivePlayers" its own script so that custom maps can call it.
Excellent, this will fit my needs.

User avatar
phineas
 
Posts: 28
Joined: Fri Jan 24, 2014 11:13 pm
Location: Hales Corners, WI USA
Contact:

Re: Reinforcements [survival mutator]

#10

Post by phineas » Tue Dec 31, 2024 1:59 am

What would one need to do in designing a map to take advantage of this mod?
Sorry if I sound dumb but I've only ever made one cooperative map and it's not
even done yet (50-55% now?).

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements [survival mutator]

#11

Post by Ænima » Tue Dec 31, 2024 7:58 pm

phineas wrote:
Tue Dec 31, 2024 1:59 am
What would one need to do in designing a map to take advantage of this mod?
Sorry if I sound dumb but I've only ever made one cooperative map and it's not
even done yet (50-55% now?).
Very simple to do. :biggrin:


You can use a basic script like this in your map:

Code: Select all

#include "zcommon.acs"

script "RespawnWhenImpsKilled" OPEN
{
	delay(10);
	ACS_NamedTerminate("KillWatcher",0); //deactivates the mod's default behavior
	ACS_NamedTerminate("SpawnMessage",0); //deactivates the mod's default behavior
	SetCVar("reinforcement_size", 8); //how many players you want to respawn. set this to 0 to respawn all players

	while (ThingCountName("DoomImp",0) > 0) //replace this with whatever conditions you want
	{
	delay(10);
	}
	printbold(s:"All imps killed! Respawning players..."); //change this message or omit it if you want
	ACS_NamedExecute("RevivePlayers", 0);
}
(If you've never used DoomBuilder's script editor before, simply press F10 while editing your map. Then paste all of the code I posted into that window. Then press F5 to compile the script. Save your map and test it out with bots to make sure it works.)
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Destructoid
New User
Posts: 3
Joined: Sun Dec 29, 2024 10:42 am

Re: Reinforcements [survival mutator]

#12

Post by Destructoid » Wed Jan 01, 2025 7:46 pm

Greetings to Ænima. I really liked your mod. I registered here specifically to suggest another challenge for reviving players in future versions. I came across this feature in another Doom port based on the "KEX engine," which was released earlier this year. It's called "Doom + Doom II" from "Nightdive Studios."

There is a "modern coop" option in the coop settings, which works as follows: For example, if two players are playing and one is killed, he cannot respawn until the living player either reaches a safe area where no enemies can see him or clears the current area of enemies, leaving him alone. At that point (after a few seconds), the second player respawns. (Here is an explanation from another user in the discussions thread on the Steam platform: https://steamcommunity.com/app/2280/dis ... 757040857/ ). I’m not sure if it’s possible to implement this in Zandronum using ACS scripts, DECORATE flags, or other methods to detect whether enemies can see the player. If it is, I suggest considering this feature (disabled by default, of course).

"Zandronum (+Reinforcements [survival mutator])" already has an implementation of this mode, partially. For example, Survival mode restarts the map after all players die, and your mod has a CVAR: "reinforcement_spawnclosest" which revives the dead player closer to the active player, and not at the beginning of the map. This mirrors how the behavior is implemented in "modern coop," where two out of the three features are already in place. The last point remains, which I wanted to suggest that you consider for adding in future versions of your mod.

Although the "KEX engine" handles this mode well, it has several drawbacks, such as the inability to play with mods in multiplayer or look up and down. And there are many others, so I was looking for an opportunity to implement the "modern coop" conditions on other engine - Zandronum (the best engine for doom coop). Your mod is nearly perfect for what I was looking for, except for this one missing feature.

Finally, I’d like to note that while this behavior is somewhat similar to requiring a certain number of kills or amount of time, it feels quite different when the remaining player, after losing their last ally in a crowded room (or in a boss fight), retreats or hides to regroup with reinforcements rather than risking death by trying to kill a set number of enemies. I believe that this mode is found in many modern multiplayer shooters, although I don't know for sure.)

If a mod with such functionality for Zandronum already exists and you're aware of it, could you please share a link? During my search, I only found yours. Thank you in advance for your reply.

User avatar
Ænima
Addicted to Zandronum
Posts: 3568
Joined: Tue Jun 05, 2012 6:12 pm

Re: Reinforcements [survival mutator]

#13

Post by Ænima » Fri Jan 03, 2025 6:39 am

Destructoid wrote:
Wed Jan 01, 2025 7:46 pm
Greetings to Ænima. I really liked your mod. I registered here specifically to suggest another challenge for reviving players in future versions. I came across this feature in another Doom port based on the "KEX engine," which was released earlier this year. It's called "Doom + Doom II" from "Nightdive Studios."

There is a "modern coop" option in the coop settings, which works as follows: For example, if two players are playing and one is killed, he cannot respawn until the living player either reaches a safe area where no enemies can see him or clears the current area of enemies, leaving him alone. At that point (after a few seconds), the second player respawns. (Here is an explanation from another user in the discussions thread on the Steam platform: https://steamcommunity.com/app/2280/dis ... 757040857/ ). I’m not sure if it’s possible to implement this in Zandronum using ACS scripts, DECORATE flags, or other methods to detect whether enemies can see the player. If it is, I suggest considering this feature (disabled by default, of course).
It's a neat idea, but it would require even more checks on the player and possibly more hackery. There's no way to definitively determine whether or not a player is in a "safe" area. Doing constant distance checks between every player and every monster is out of the question -- that's a lot of network usage and this mod does not assign unique TID's to players because I want to keep it compatible with all mods and custom maps (most mods assign players ThingID's for one purpose or another). I could try to exclude players who have entered their Pain state within the last 5 seconds, but that would probably rule out too many players, and would require either replacing the DoomPlayer actor in DECORATE (which I won't do for mod compatibility) or using an EVENT script with GAMEEVENT_ACTOR_DAMAGED, which I've never done before and don't know if it works for players. Besides, the host can just turn respawn protection on if they're worried about players getting hurt.

I appreciate the suggestions, though! Thanks for showing interest in the mod. :biggrin:

I'll be updating it semi-regularly for the foreseeable future, so if you have any other ideas or suggestions please feel free to share!

Destructoid wrote:
Wed Jan 01, 2025 7:46 pm
If a mod with such functionality for Zandronum already exists and you're aware of it, could you please share a link? During my search, I only found yours. Thank you in advance for your reply.
Unfortunately, I do not know of any mods that replicate the "modern cooperative" respawning behavior of Nightdive's KEX port for Steam.

I'm fairly certain that this mod is one of the first to directly alter Survival respawn behavior through native functions, considering that SetDeadSpectator() and SkipJoinQueue() are functions unique to Zandronum which were only added a few months ago.

==========================================================
In other news, I've added an options screen to the Main Menu so that players and hosts don't have to fuss about with remembering CVAR names. Anyone with RCON access can change the options in the first and second blocks, or you can use it to test the mod out in singleplayer if you wanna see how everything works or if you just really like playing with coop bots.

Image

I made a fancy console background as well.
Image


Oh, I also made a trailer.


See first post for the newest version, v01e.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Destructoid
New User
Posts: 3
Joined: Sun Dec 29, 2024 10:42 am

Re: Reinforcements [survival mutator]

#14

Post by Destructoid » Fri Jan 03, 2025 8:13 pm

Thank you very much for the detailed response. In the future, I will explore ways to implement the conditions of modern coop in Zandronum on my own. However, the revival conditions in your mod also work well for me (as I mentioned earlier, they are quite similar in behavior to the conditions of "modern coop"), so I’ll continue playing with your mod. However, if you decide to add this behavior in the future, or if new versions of Zandronum (3.2, 3.3, etc.) introduce features that make it easier to implement, please consider adding it. I’ll be keeping an eye on your mod's updates.

Apart from the 'modern coop' feature, I also wanted to ask about a minor behavioral condition that changes when loading your mod. I tried modifying the DECORATE file (specifically, changing "+THRUSPECIES" to "-THRUSPECIES"), but it didn’t work for me.

When loading your mod, players can pass through each other, even if the 'players can block each other normally' option is enabled in the behavior settings of the server creation window. Could you tell me specifically what to change or add whether in the DECORATE file or elsewhere so that this behavior either aligns with the server settings or is explicitly set in the DECORATE file to prevent players from passing through each other?

I'm used to playing with these settings because they make the game more challenging in narrow corridors. For me, it also enhances the sense of other players' presence, as you can physically run into them. That's why I always enable player blocking in my servers. However, this feature doesn't seem to work with your mod. Could you help me resolve this issue?

PkmX
New User
Posts: 5
Joined: Mon Feb 24, 2014 7:53 pm

Re: Reinforcements [survival mutator]

#15

Post by PkmX » Sun Feb 16, 2025 2:00 pm

I play-tested this for a bit and found a few things:

1. It seems like reinforcement_requiredkills has no effect when reinforcement_time is set, although the README says that they can be combined like it did in notsurv.

2. README says that reinforcement_key overrides reinforcement_requiredkills, but I think it should be made additive. The host can always just disable the killcount separately if he only wants to respawn players based on keys.

3. I'd like a system that can "save" reinforcement slots for future use if there aren't eligible players to join when it is awarded. Newly joined or dead players can join immediately in the future if there are saved slots available.

4. Would like to make reinforcement_time to count in seconds instead of minutes.

turner148
Registered just to make one post
Posts: 1
Joined: Wed Mar 27, 2024 12:31 am

Re: Reinforcements [survival mutator]

#16

Post by turner148 » Mon Mar 24, 2025 12:10 am

Tried to use this on an invasion mapset with BYOC cause it's survival stuff doesn't work there.

Sadly either due to a conflict, it does not work with BYOC, which is a shame cause I thought this would be a great alternative to NotSurv since BYOC's stuff badly conflicts with NotSurv.

Mostly cause BYOC and NotSurv make you either go 1 life or inf lives.

Any plans for compatibility?

Post Reply