Zandronum Chat @ irc.zandronum.com
#zandronum
Get the latest version: 2.1.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002594Zandronum[All Projects] Suggestionpublic2016-01-25 00:012017-04-28 18:36
ReporterHypnotoad 
Assigned ToTorr Samaho 
PrioritynormalSeverityfeatureReproducibilityN/A
Statusneeds testingResolutionopen 
PlatformOSOS Version
Product Version 
Target Version3.0Fixed in Version 
Summary0002594: ACS spectator/join control
DescriptionWhen I make game modes, I'd like to be able to dynamically remove and re-add players to the game during the session, however this is difficult to do. One option I try is to make a custom spectator class, however I cannot stop these 'spectators' from triggering line actions with use, even if I put +NOTRIGGER on their class.

If I were able to turn players into spectators and back from acs, this would be very useful. Dusk mentioned that this might be possible by extending the 'dead spectator' stuff, exposing it to ACS.
Attached Files? file icon voodoo.wad [^] (6,589 bytes) 2017-04-18 19:56
? file icon DeadSpectatorTest.wad [^] (4,312 bytes) 2017-04-24 14:34

- Relationships

-  Notes
User avatar (0014195)
Dusk (developer)
2016-01-25 00:04

What I had in mind was to expose our "dead spectator" handling to ACS. By "extending" I rather mean that we should rename it. The "dead" term is simply because of the only current use case of this engine feature. It's currently under wraps and mods could certainly use it IMO.

(Yes this would also mean that mods could resurrect players in LMS. I see no problem in this.)
User avatar (0014831)
Torr Samaho (administrator)
2016-05-07 09:00

I agree that we should expose the "dead spectator" handling to ACS. One possibility would be to add an additional argument to ForceToSpectate that allows to specify whether the player should be turned into a true spectator or a dead spectator. Furthermore, we'd need an additional function SpawnSpectator that turns a spectator (doesn't matter if "true" or "dead") into a player and spawns a new body.

Opinions?
User avatar (0014832)
Edward-san (developer)
2016-05-07 10:16

For the name of the function which spawns a player from a spectator I'd say 'SpawnPlayerFromSpectator' or 'ForceSpectatorJoin'..
User avatar (0014837)
Hypnotoad (reporter)
2016-05-08 20:47

ForceToJoin, or just ForceJoin, would be best in my opinion since it's a clear corollary to 'ForceToSpectate'.
User avatar (0015533)
Torr Samaho (administrator)
2016-08-28 19:56

We discussed this in our dev meeting and decided that we'll add a function that allows to set the "dead spectator" status of a player, i.e. it can turn a player into a dead spectator and a dead spectator back into a player. Mods shouldn't be messing with true spectators, so we won't add functionality that forces a true spectator to join.

We'll just need a good name for that function, possibly getting rid of the intuitive notion of "dead spectators". Opinions?
User avatar (0015536)
Ivan (reporter)
2016-08-29 09:30

How about "RaisePlayer" for dead spec to player and "KillPlayer" for player to dead spec?
User avatar (0015539)
Hypnotoad (reporter)
2016-08-29 13:54

But this would make it difficult to, for instance, have spectators in survival join midway through. I suppose the mod could just be run in coop mode and have players automatically become "dead spectators" on joining unless certain conditions are met, though that would be fairly messy. Would it be possible to perhaps add a GAMEMODE lump flag which makes all players join as "dead spectators", so the mod can decide what to do from there?

As for the name, maybe you can consider joined/dead spectators a new class of spectator, and call them 'observers' - then the function could be called 'SetObserver(bool)'.
User avatar (0015540)
Dusk (developer)
2016-08-29 15:06

Quote
How about "RaisePlayer" for dead spec to player and "KillPlayer" for player to dead spec?

That's going to just get mixed up with in-game death and revival.

Quote
But this would make it difficult to, for instance, have spectators in survival join midway through. I suppose the mod could just be run in coop mode and have players automatically become "dead spectators" on joining unless certain conditions are met, though that would be fairly messy. Would it be possible to perhaps add a GAMEMODE lump flag which makes all players join as "dead spectators", so the mod can decide what to do from there?

I think that if the player is in the join queue, he's eligible for joining, and ACS should be able to make him join the game.

Quote
As for the name, maybe you can consider joined/dead spectators a new class of spectator, and call them 'observers' - then the function could be called 'SetObserver(bool)'.

Observer is only a synonym for spectator, so the name doesn't work either.
User avatar (0015541)
Torr Samaho (administrator)
2016-08-29 17:57

Quote from Dusk
I think that if the player is in the join queue, he's eligible for joining, and ACS should be able to make him join the game.

For this to work reasonably, we also have to make information about the join queue available via ACS. That's no problem, we'll just need at least one additional ACS function.
User avatar (0015542)
Hypnotoad (reporter)
2016-08-29 20:08

Quote
Observer is only a synonym for spectator, so the name doesn't work either.


What about these: AwaitingPlayer, ProspectivePlayer, QueuedPlayer
User avatar (0015543)
Torr Samaho (administrator)
2016-08-30 06:01

Another thought: Instead of allowing mods to mess with players in the join queue, we could instead (allow the mod to) allow true spectators to join as dead spectator in case joining as player is currently forbidden by the gamemode.
User avatar (0015545)
Hypnotoad (reporter)
2016-08-30 17:12

That also sounds reasonable to me.
User avatar (0017142)
Torr Samaho (administrator)
2017-04-15 17:49

Ok, I added the ACS command SetDeadSpectator (int playernumber, int deadspectator). This command can turn alive players into dead spectators (deadspectator == 1) and revive dead spectators (deadspectator == 0). To use it, add
-130:SetDeadSpectator(2),

to zspecial.acs.
User avatar (0017143)
Hypnotoad (reporter)
2017-04-16 03:11

Awesome, but how come deadspectator is an int rather than a bool?
User avatar (0017144)
Torr Samaho (administrator)
2017-04-16 06:58

Declaring it as at int now leaves the possibility open to allow values other than 0 and 1 later on, if we should see the need for it, without breaking backwards compatibility.
User avatar (0017195)
Hypnotoad (reporter)
2017-04-18 17:18

By the way it would be helpful if the function was added to zspecial.acs.
User avatar (0017197)
Hypnotoad (reporter)
2017-04-18 18:43
edited on: 2017-04-18 19:16

I was testing this in teamlms and was occasionally getting voodoo dolls when setting spectator, can't reproduce any more but I think it has something to do with the short amount of time you have invulnerability (by default dmflags) when you spawn.

edit: seems to happen consistently now, setdeadspectator on a player during a teamgame on Enter causes a flashing voodoo doll to spawn

User avatar (0017200)
Hypnotoad (reporter)
2017-04-18 19:18

Quote
Instead of allowing mods to mess with players in the join queue, we could instead (allow the mod to) allow true spectators to join as dead spectator in case joining as player is currently forbidden by the gamemode.


Will this be implemented by the way?
User avatar (0017201)
Torr Samaho (administrator)
2017-04-18 19:22

Quote from Hypnotoad
seems to happen consistently now, setdeadspectator on a player during a teamgame on Enter causes a flashing voodoo doll to spawn

Can you create a minimal example wad that allows to reproduce this easily?

Quote from Hypnotoad

Will this be implemented by the way?

I'm not sure yet whether I'll have enough time to finish this before we release 3.0. Fixing the 3.0 regressions definitely has priority.
User avatar (0017202)
Hypnotoad (reporter)
2017-04-18 19:28
edited on: 2017-04-18 21:39

Quote
Can you create a minimal example wad that allows to reproduce this easily?


I'll see what I can do

Quote
I'm not sure yet whether I'll have enough time to finish this before we release 3.0. Fixing the 3.0 regressions definitely has priority.


Alternatively, a simple GAMEMODE flag that disables the round from ending if everyone is a dead spectator, and a function that allows you to manually end the round (and pick the winning team)?

Also, I noticed GAMEMODE has a DEADSPECTATORS flag, can I ask what setting this flag does?

edit: I just tried adding the deadspectators flag to cooperative and it causes a fatal error when you do this and then do SetDeadSpectator (PlayerNumber(), 1) in an enter script.

edit 2: adding USEMAXLIVES to GAMEMODE for cooperative fixes the crash, but it now produces voodoo dolls in multiplayer, and in singleplayer turns you into a bizarre static doomguy whose sprite still shows, with gravity still applying, but cant shoot, interact or jump

User avatar (0017204)
Hypnotoad (reporter)
2017-04-18 19:58

I've uploaded voodoo.wad to this ticket. To test, simply load the wad, change game mode to teamlms, add a few bots and let it last for several. You should see a few instances of voodoo dolls.

The script just sets a player to dead spectator on enter, with 50/50 chance (to prevent everyone from being dead spectator and therefore ending the round immediately).
User avatar (0017268)
Torr Samaho (administrator)
2017-04-23 10:47

Quote from Hypnotoad

Alternatively, a simple GAMEMODE flag that disables the round from ending if everyone is a dead spectator, and a function that allows you to manually end the round (and pick the winning team)?

That's not so easy to implement, since it would require changes to all the game modes.

Quote from Hypnotoad

Also, I noticed GAMEMODE has a DEADSPECTATORS flag, can I ask what setting this flag does?

It's an internal flag that declares that dead spectators exist in the game mode. It wasn't meant to be used without the MAPRESETS flag in a game mode that has map resets, e.g. survival or lms.

Quote from Hypnotoad
I've uploaded voodoo.wad to this ticket. To test, simply load the wad, change game mode to teamlms, add a few bots and let it last for several. You should see a few instances of voodoo dolls.

Does this only happen offline? So far, I couldn't reproduce it online.
User avatar (0017269)
Torr Samaho (administrator)
2017-04-23 11:17

Can you check if this fixes the problem?
User avatar (0017277)
Hypnotoad (reporter)
2017-04-23 14:25

Quote
That's not so easy to implement, since it would require changes to all the game modes.


Well the problem is that as it is now the feature isn't very usable, at least on competitive game modes. If I'm making any kind of new mod where I want control over who is in and isn't in the game, it's highly likely that there will at least be one or two temporary moments where everyone will be set to dead spectator, for instance in the beginning of the game where I need to choose who will be in and who won't be, or if I need to swap one player (the only live one) in a team for another. If the game suddenly ends every time everyone is temporarily set to spect, you start to run into huge problems.

I suppose this might be bypassed by hacking a team game mode into cooperative with acs, but the function still appears to be broken with cooperative currently.

Quote
It's an internal flag that declares that dead spectators exist in the game mode. It wasn't meant to be used without the MAPRESETS flag in a game mode that has map resets, e.g. survival or lms.


To clarify, is it possible at all, with the right combination of GAMEMODE flags, to have deadspectators work in coop? Because right now I'm either getting a fatal error or the strange bugs as described earlier depending on what flags are used.

Quote
Can you check if this fixes the problem?


This appears to fix the problem with voodoo dolls in teamlms. However, it doens't fix the issues with cooperative.
User avatar (0017280)
Torr Samaho (administrator)
2017-04-23 15:05

Quote from Hypnotoad
To clarify, is it possible at all, with the right combination of GAMEMODE flags, to have deadspectators work in coop? Because right now I'm either getting a fatal error or the strange bugs as described earlier depending on what flags are used.

The code was never intended to be used in such a way, to it may not be possible without further changes under the hood. Did you try adding DEADSPECTATORS and MAPRESETS to coop?
User avatar (0017282)
Torr Samaho (administrator)
2017-04-23 16:38
edited on: 2017-04-23 16:42

Quote from Hypnotoad
I just tried adding the deadspectators flag to cooperative and it causes a fatal error when you do this and then do SetDeadSpectator (PlayerNumber(), 1) in an enter script.

This should hopefully be fixed now.

EDIT: Here is a test build with the fix.

User avatar (0017294)
Hypnotoad (reporter)
2017-04-23 20:04

Quote
EDIT: Here is a test build with the fix.


This seems to have largely fixed the issues, however I still get the strange behaviour in single player I described before if the USEMAXLIVES flag is added to coop, and it seems to produce a single voodoo doll when you switch to multiplayer emulation from single player and spectate, under those circumstances, but then no more after.
User avatar (0017308)
Fused (reporter)
2017-04-24 14:37
edited on: 2017-04-24 15:07

I noticed when playing around a bit that turning a player into a dead spectator calls a RESPAWN type script. Is that intended? I added an example wad.

Also, it would be nice to have an option to keep scripts from stopping when turning someone into a dead spectator. I know there's a compat flag for it, but having an option with the function itself would prove better than having to change all my code to support the compat flag.

EDIT: I request this because I want to create a "login" screen when someone enters. The only problem I have with this is that basically.
I did notice something weird. When I set the dead spectator as activator, it's not the activator. However when that RESPAWN script is called, it appears it does turn the player as the activator. I tested this through a print message that prints the activator.

User avatar (0017326)
Torr Samaho (administrator)
2017-04-25 19:59

Quote from Hypnotoad

This seems to have largely fixed the issues, however I still get the strange behaviour in single player I described before if the USEMAXLIVES flag is added to coop, and it seems to produce a single voodoo doll when you switch to multiplayer emulation from single player and spectate, under those circumstances, but then no more after.

Please test if this fixes the issue.

Quote from Fused

I noticed when playing around a bit that turning a player into a dead spectator calls a RESPAWN type script. Is that intended? I added an example wad.

Isn't this also the case when a dead player is turned into a dead spectator by the internal game modes when the player has no lives left? So far the new function just mimics what the existing game modes do. We can still discuss though whether this needs to be adjusted.

Quote from Fused

Also, it would be nice to have an option to keep scripts from stopping when turning someone into a dead spectator. I know there's a compat flag for it, but having an option with the function itself would prove better than having to change all my code to support the compat flag.

Spectators (true and dead) are supposed to be not part of the game. Thus, they have all scripts stopped. The reason why we have the compat flag is to stay compatible with existing mods that relied on the legacy behavior. I see your point though. Perhaps we need to keep scripts of dead specators, but not of true ones.
User avatar (0017348)
Hypnotoad (reporter)
2017-04-26 18:28

Quote
Please test if this fixes the issue.


That appears to have fixed it, nice.

Still hoping there can be some way to disable automatic round ends if all your players happen to be dead spect, but I suppose I can find some hacky/ugly solutions to this using acs for now if absolutely necessary (I hope).
User avatar (0017362)
Cutman (reporter)
2017-04-27 13:43

I'm having the voodoo issue too but it looks like it's going to be fixed.

Another (minor) issue: Bots do not like being resurrected by SetDeadSpectator. They will stand there and do nothing, even if attacked.
User avatar (0017368)
Fused (reporter)
2017-04-27 18:24
edited on: 2017-04-27 18:24

Quote

Isn't this also the case when a dead player is turned into a dead spectator by the internal game modes when the player has no lives left? So far the new function just mimics what the existing game modes do. We can still discuss though whether this needs to be adjusted.


After usinghttp://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^] it appears the RESPAWN script triggers in survival aswell, when turning into a dead spectator by the engine when out of lives.

This actually does not happen in the latest release, which ishttp://zandronum.com/forum/viewtopic.php?f=55&t=8266&sid=acb76a0bbad1ea9c821b7d24a3683df0 [^]

So this is actually something that must've come with this update.

Quote

Spectators (true and dead) are supposed to be not part of the game. Thus, they have all scripts stopped. The reason why we have the compat flag is to stay compatible with existing mods that relied on the legacy behavior. I see your point though. Perhaps we need to keep scripts of dead specators, but not of true ones.

Yeah I know the system has this behaviour intended. It would be great if you could make that an option. It would save a lot of script jumping, if that even allows everything still.

User avatar (0017373)
Torr Samaho (administrator)
2017-04-27 19:42

Quote from Hypnotoad

Still hoping there can be some way to disable automatic round ends if all your players happen to be dead spect, but I suppose I can find some hacky/ugly solutions to this using acs for now if absolutely necessary (I hope).

Right now, I don't see a reasonable way of adding a feature that allows a mod to stop a round reset of one of the built-in gamemodes, but won't get in the way later on if we ever get around to externalize the game modes. Did you already check if it's possible to handle the necessary reviving in death scripts so that the round end condition is not fulfilled unless you want it to be? If not, can't you take full control by just using coop, dm, teamplay or teamgame as base, instead of lms, survival etc.?

Quote from Cutman

Another (minor) issue: Bots do not like being resurrected by SetDeadSpectator. They will stand there and do nothing, even if attacked.

Does this happen offline and/or online? Does it also happen in the build I posted above in #17326? If so, can you post a minimal example wad?

Quote from Fused

After usinghttp://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^] it appears the RESPAWN script triggers in survival aswell, when turning into a dead spectator by the engine when out of lives.

This actually does not happen in the latest release, which ishttp://zandronum.com/forum/viewtopic.php?f=55&t=8266&sid=acb76a0bbad1ea9c821b7d24a3683df0
[^]
FYI, online and offline behavior were inconsistent (online was correct),http://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^] fixes that. Were RESPAWN script triggerd in survival online before? If not, can you make a 2.1.2 compatible minimal example wad? The online behavior should not differ from 2.1.2.
User avatar (0017387)
Hypnotoad (reporter)
2017-04-28 18:36

I tried to post this last night but couldn't because I kept getting the following message: "Invalid form security token. This could be caused by a session timeout, or accidentally submitting the form twice.":

Quote
Did you already check if it's possible to handle the necessary reviving in death scripts so that the round end condition is not fulfilled unless you want it to be?


Can you elaborate on this? Not sure what you mean.

Quote

 If not, can't you take full control by just using coop, dm, teamplay or teamgame as base, instead of lms, survival etc.?


Probably, I just need to account for people joining mid way through. Does teamgame/teamplay actually not end the current session if an entire team's players (or both teams') are dead spectators? That's probably helpful if so.

Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: Hypnotoad Korshun djskaarj WaTaKiD AlienOverlord Meesor Marcaek unknownna
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2016-01-25 00:01 Hypnotoad New Issue
2016-01-25 00:04 Dusk Note Added: 0014195
2016-05-07 09:00 Torr Samaho Note Added: 0014831
2016-05-07 09:00 Torr Samaho Assigned To => Torr Samaho
2016-05-07 09:00 Torr Samaho Status new => feedback
2016-05-07 10:16 Edward-san Note Added: 0014832
2016-05-08 20:47 Hypnotoad Note Added: 0014837
2016-05-08 20:47 Hypnotoad Status feedback => assigned
2016-08-28 19:56 Torr Samaho Note Added: 0015533
2016-08-29 09:30 Ivan Note Added: 0015536
2016-08-29 13:54 Hypnotoad Note Added: 0015539
2016-08-29 15:06 Dusk Note Added: 0015540
2016-08-29 17:57 Torr Samaho Note Added: 0015541
2016-08-29 20:08 Hypnotoad Note Added: 0015542
2016-08-30 06:01 Torr Samaho Note Added: 0015543
2016-08-30 17:12 Hypnotoad Note Added: 0015545
2017-04-02 20:41 Torr Samaho Target Version => 3.0
2017-04-15 17:49 Torr Samaho Note Added: 0017142
2017-04-15 17:49 Torr Samaho Status assigned => needs testing
2017-04-16 03:11 Hypnotoad Note Added: 0017143
2017-04-16 06:58 Torr Samaho Note Added: 0017144
2017-04-18 17:18 Hypnotoad Note Added: 0017195
2017-04-18 18:43 Hypnotoad Note Added: 0017197
2017-04-18 19:16 Hypnotoad Note Edited: 0017197 View Revisions
2017-04-18 19:18 Hypnotoad Note Added: 0017200
2017-04-18 19:22 Torr Samaho Note Added: 0017201
2017-04-18 19:28 Hypnotoad Note Added: 0017202
2017-04-18 19:29 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 19:56 Hypnotoad File Added: voodoo.wad
2017-04-18 19:58 Hypnotoad Note Added: 0017204
2017-04-18 20:48 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 20:50 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 21:36 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 21:39 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-23 10:47 Torr Samaho Note Added: 0017268
2017-04-23 11:17 Torr Samaho Note Added: 0017269
2017-04-23 14:25 Hypnotoad Note Added: 0017277
2017-04-23 15:05 Torr Samaho Note Added: 0017280
2017-04-23 16:38 Torr Samaho Note Added: 0017282
2017-04-23 16:42 Torr Samaho Note Edited: 0017282 View Revisions
2017-04-23 20:04 Hypnotoad Note Added: 0017294
2017-04-24 14:34 Fused File Added: DeadSpectatorTest.wad
2017-04-24 14:37 Fused Note Added: 0017308
2017-04-24 15:07 Fused Note Edited: 0017308 View Revisions
2017-04-25 19:59 Torr Samaho Note Added: 0017326
2017-04-26 18:28 Hypnotoad Note Added: 0017348
2017-04-27 13:43 Cutman Note Added: 0017362
2017-04-27 18:24 Fused Note Added: 0017368
2017-04-27 18:24 Fused Note Edited: 0017368 View Revisions
2017-04-27 19:42 Torr Samaho Note Added: 0017373
2017-04-28 18:36 Hypnotoad Note Added: 0017387






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker