MantisBT - Zandronum
View Issue Details
0001814Zandronum[All Projects] Suggestionpublic2014-06-04 05:132018-09-30 21:45
JKist3 
 
normalminorhave not tried
closedfixed 
3.0-beta 
3.03.0 
0001814: sv_forcerespawn improvement/upgrade
There should be an option to force player respawns after a certain time. Currently this is just a boolean variable: if off players can remain dead forever, and if on players are immediately spawned back into the map.

Often you want the dead player not to be immediately forced back into the game (example: abusing this feature by spamming bfg constantly over forced respawn points, or in general just being able to gather your breathe before re-entering the game); however, you don't want them to have the ability to remain dead forever either (example: duel game with a time limit). Making this variable have a configurable time to it would be a great improvement.
No tags attached.
has duplicate 0002239closed  Timed Force Respawn 
Issue History
2014-06-04 05:13JKist3New Issue
2014-06-07 18:43WatermelonAssigned To => Watermelon
2014-06-07 18:43WatermelonStatusnew => assigned
2014-06-07 20:00WatermelonAssigned ToWatermelon =>
2014-06-07 20:00WatermelonStatusassigned => feedback
2014-06-07 20:41WatermelonAssigned To => Watermelon
2014-06-07 20:41WatermelonStatusfeedback => assigned
2014-06-07 20:42WatermelonNote Added: 0008878
2014-06-07 20:42WatermelonStatusassigned => needs review
2014-06-07 22:54DuskNote Added: 0008889
2014-06-08 00:28WatermelonStatusneeds review => assigned
2014-06-08 10:33Torr SamahoNote Added: 0008908
2014-06-08 10:34Torr SamahoStatusassigned => feedback
2014-06-08 18:14WatermelonNote Added: 0008930
2014-06-08 18:14WatermelonStatusfeedback => assigned
2014-10-09 00:04WatermelonNote Added: 0010397
2014-10-09 00:04WatermelonAssigned ToWatermelon =>
2014-10-09 00:04WatermelonStatusassigned => new
2015-05-19 01:22DuskRelationship addedhas duplicate 0002239
2015-12-15 00:29Ru5tK1ngNote Added: 0013992
2016-09-16 03:56Ru5tK1ngNote Added: 0015643
2016-09-16 03:56Ru5tK1ngStatusnew => needs review
2016-09-19 03:24Ru5tK1ngNote Edited: 0015643bug_revision_view_page.php?bugnote_id=15643#r9517
2017-05-07 10:14Torr SamahoNote Added: 0017565
2017-05-07 10:14Torr SamahoStatusneeds review => feedback
2017-05-08 18:30Ru5tK1ngNote Added: 0017608
2017-05-13 10:04Torr SamahoNote Added: 0017632
2017-05-13 10:04Torr SamahoStatusfeedback => needs testing
2017-05-13 10:04Torr SamahoTarget Version => 3.0
2017-05-13 10:04Torr SamahoNote Edited: 0017632
2017-05-13 10:05Torr SamahoNote Edited: 0017632bug_revision_view_page.php?bugnote_id=17632#r10588
2017-05-13 10:05Torr SamahoNote Revision Dropped: 17632: 0010586
2017-05-13 10:05Torr SamahoNote Revision Dropped: 17632: 0010587
2017-05-17 02:42CombinebobntNote Added: 0017702
2017-05-17 03:11Ru5tK1ngNote Added: 0017703
2017-05-17 03:11Ru5tK1ngStatusneeds testing => resolved
2017-05-17 03:11Ru5tK1ngResolutionopen => fixed
2017-05-17 03:11Ru5tK1ngProduct Version => 3.0-beta
2017-05-17 03:11Ru5tK1ngFixed in Version => 3.0
2018-09-30 21:45Blzut3Statusresolved => closed

Notes
(0008878)
Watermelon   
2014-06-07 20:42   
'https://bitbucket.org/ChrisKOmg/zandronum/commits/6e3894bcff6623d84d699d5c8ad166e2948abaaa [^]'

Can someone please evaluate if this was the right thing? So far it's working just right on my end, but maybe someone can investigate the reason bSpawnTelefragged was used.


This also makes the ZACOMPATFLAG useless if this is approved, and can be taken out.
(0008889)
Dusk   
2014-06-07 22:54   
On face value it looks like it allows instant respawn if the player was spawn telefragged and your patch does not preserve this behavior.

The Printf() line for the out-of-bounds where it resets itself back to TICRATE/2 IMO. No other CVar that I know of prints it like this. And what do if it becomes gargantually huge? :P

Also, lines 771-774 could be collapsed to one with use of the ternary operator IMO. And the padding style is also off.
(0008908)
Torr Samaho   
2014-06-08 10:33   
In addition to what Dusk already said (drop the Printf), I think we should keep compat_instantrespawn for compatibility purposes.

Then, the change in AActor::Die can be simplified to changing

            if ( dmflags & DF_FORCE_RESPAWN )
                player->respawn_time += TICRATE/2;

to

            if ( dmflags & DF_FORCE_RESPAWN )
                player->respawn_time += sv_forcerespawntics - TICRATE;

This simplification combined with changing the default of sv_forcerespawntics to TICRATE*3/2 also fixes the problem that your patch changes the old default behavior: Your patch reduced the default value in case DF_FORCE_RESPAWN is true from TICRATE*3/2 to TICRATE/2 and increased it from TICRATE to TICRATE*3/2 in case DF_FORCE_RESPAWN is false.
(0008930)
Watermelon   
2014-06-08 18:14   
I changed the printf, it's gone


When I change the function to have this:

// [RH] Force a delay between death and respawn
        if ((( zacompatflags & ZACOMPATF_INSTANTRESPAWN ) == false ) ||
            ( player->bSpawnTelefragged ))
        {
            player->respawn_time = level.time + TICRATE;

            // [BC] Don't respawn quite so fast on forced respawn. It sounds weird when your
            // scream isn't completed.
            // [CK] If desired, we can use our own custom respawn time with force respawn
            if ( dmflags & DF_FORCE_RESPAWN )
                player->respawn_time += sv_forcerespawntics - TICRATE;
        }


Now I can't achieve the ticket authors request of being able to spawn whenever, yet force respawning. It makes me wait until sv_forcerespawntics, where I believe he wants it.

I'll try to figure this out and see what solution I can come up with. I have an idea.
(0010397)
Watermelon   
2014-10-09 00:04   
Will check into this after completing some other tickets
(0013992)
Ru5tK1ng   
2015-12-15 00:29   
Currently there is a wad floating around unofficially that duplicates this forced spawn timer behavior. However, it relies on the use of console command to spawn the player and since console command will eventually be removed, the wad will be useless in the future. If native support isn't possible at this time, then perhaps some sort of ACS function could be introduced so that a scripting solution can still be utilized.
(0015643)
Ru5tK1ng   
2016-09-16 03:56   
(edited on: 2016-09-19 03:24)
So I decided to take a shot at this:

'https://bitbucket.org/Torr_Samaho/zandronum/pull-requests/143/added-sv_forcerespawntime-to-control-force/diff [^]'

(0017565)
Torr Samaho   
2017-05-07 10:14   
I left two comments in the pull request. Please have a look.
(0017608)
Ru5tK1ng   
2017-05-08 18:30   
Updated pullrequest based off your comments.
(0017632)
Torr Samaho   
2017-05-13 10:04   
(edited on: 2017-05-13 10:05)
Thanks for the changes! I added your updated patch.

(0017702)
Combinebobnt   
2017-05-17 02:42   
tested in build whatever rust gave me

everything seemed to work fine. I couldnt break it with negative numbers or anything retarded, all defaulted to 0. No decimals accepted but I don't think that matters much.
(0017703)
Ru5tK1ng   
2017-05-17 03:11   
Thanks for testing.