MantisBT - Zandronum
View Issue Details
0002510Zandronum[All Projects] Suggestionpublic2015-10-30 22:242025-04-11 14:05
Empyre 
DrinkyBird 
normalminoralways
feedbackfixed 
MicrosoftWindowsXP/Vista/7
2.0 
 
0002510: Please implement voodoo dolls in single-player with multiplayer emulation.
In single-player, there are fewer monsters and I don't respawn when I die. In client/server I can neither pause nor save the game. Single-player with multiplayer emulation has the best of both worlds and it is my favorite way to play when I want to play alone, except for one rather big issue, maps that depend on voodoo dolls are broken.
I mentioned this in the forums, and was told that voodoo dolls were never implemented in single-player with multiplayer emulation.
Open the test map in single-player with multiplayer emulation (coop) and use the switch, and then the voodoo doll should open the door. If the door doesn't open, voodoo dolls are broken.
A fix for this would make my day/week/year. It is also limiting my mapping because I feel like I can't use voodoo dolls in my maps since they would be broken, too. The problem is major for me, but I chose minor because I am probably in the minority using this mode.
No tags attached.
zip voodoodolltest.zip (1,916) 2015-10-30 22:24
/tracker/file_download.php?file_id=1673&type=bug
? voodoodolltest_fixed.wad (4,406) 2025-03-20 11:00
/tracker/file_download.php?file_id=3193&type=bug
zip CrashReport.zip (27,091) 2025-03-24 14:32
/tracker/file_download.php?file_id=3199&type=bug
? voodoodolltest_fixed_02.wad (4,626) 2025-03-26 12:21
/tracker/file_download.php?file_id=3200&type=bug
? voodoodolltest_fixed_03b.wad (5,200) 2025-03-30 17:56
/tracker/file_download.php?file_id=3209&type=bug
zip CrashReport_02.zip (26,380) 2025-04-08 11:08
/tracker/file_download.php?file_id=3215&type=bug
zip CrashReport_03.zip (26,311) 2025-04-08 12:13
/tracker/file_download.php?file_id=3216&type=bug
Issue History
2015-10-30 22:24EmpyreNew Issue
2015-10-30 22:24EmpyreFile Added: voodoodolltest.zip
2017-02-06 01:08EmpyreNote Added: 0016765
2018-05-02 15:49EmpyreNote Added: 0019186
2023-12-31 11:04StrikerMan780Note Added: 0022941
2025-03-06 22:15DrinkyBirdAssigned To => DrinkyBird
2025-03-06 22:15DrinkyBirdStatusnew => assigned
2025-03-06 22:16DrinkyBirdTarget Version => 3.2
2025-03-06 23:08DrinkyBirdNote Added: 0024240
2025-03-06 23:08DrinkyBirdStatusassigned => needs review
2025-03-08 17:06DrinkyBirdStatusneeds review => assigned
2025-03-12 01:38DrinkyBirdStatusassigned => needs review
2025-03-16 10:12DrinkyBirdStatusneeds review => needs testing
2025-03-20 11:00unknownnaFile Added: voodoodolltest_fixed.wad
2025-03-20 11:08unknownnaNote Added: 0024262
2025-03-24 11:55DrinkyBirdNote Added: 0024306
2025-03-24 11:55DrinkyBirdStatusneeds testing => resolved
2025-03-24 11:55DrinkyBirdFixed in Version => 3.2
2025-03-24 11:55DrinkyBirdResolutionopen => fixed
2025-03-24 11:59DrinkyBirdNote Edited: 0024306bug_revision_view_page.php?bugnote_id=24306#r14496
2025-03-24 11:59DrinkyBirdStatusresolved => needs testing
2025-03-24 12:02DrinkyBirdNote Edited: 0024306bug_revision_view_page.php?bugnote_id=24306#r14497
2025-03-24 12:04DrinkyBirdNote Edited: 0024306bug_revision_view_page.php?bugnote_id=24306#r14498
2025-03-24 12:06DrinkyBirdNote Edited: 0024306bug_revision_view_page.php?bugnote_id=24306#r14499
2025-03-24 12:22unknownnaNote Added: 0024307
2025-03-24 12:22unknownnaStatusneeds testing => feedback
2025-03-24 13:36DrinkyBirdNote Added: 0024308
2025-03-24 13:37DrinkyBirdNote Edited: 0024308bug_revision_view_page.php?bugnote_id=24308#r14501
2025-03-24 13:54DrinkyBirdNote Edited: 0024308bug_revision_view_page.php?bugnote_id=24308#r14502
2025-03-24 14:07DrinkyBirdNote Added: 0024309
2025-03-24 14:17unknownnaNote Added: 0024310
2025-03-24 14:28DrinkyBirdNote Added: 0024311
2025-03-24 14:32unknownnaNote Added: 0024312
2025-03-24 14:32unknownnaFile Added: CrashReport.zip
2025-03-24 14:34unknownnaNote Edited: 0024312bug_revision_view_page.php?bugnote_id=24312#r14504
2025-03-24 17:10DrinkyBirdNote Added: 0024314
2025-03-24 17:13DrinkyBirdNote Edited: 0024314bug_revision_view_page.php?bugnote_id=24314#r14506
2025-03-24 17:32unknownnaNote Added: 0024315
2025-03-24 17:35unknownnaNote Edited: 0024315bug_revision_view_page.php?bugnote_id=24315#r14508
2025-03-24 17:48unknownnaNote Edited: 0024315bug_revision_view_page.php?bugnote_id=24315#r14509
2025-03-24 19:13DrinkyBirdNote Added: 0024316
2025-03-24 19:16DrinkyBirdNote Edited: 0024316bug_revision_view_page.php?bugnote_id=24316#r14511
2025-03-24 19:16DrinkyBirdNote Edited: 0024316bug_revision_view_page.php?bugnote_id=24316#r14512
2025-03-24 20:01unknownnaNote Added: 0024317
2025-03-26 11:03DrinkyBirdNote Added: 0024359
2025-03-26 12:21unknownnaNote Added: 0024360
2025-03-26 12:21unknownnaFile Added: voodoodolltest_fixed_02.wad
2025-03-29 20:35DrinkyBirdNote Added: 0024363
2025-03-29 22:16unknownnaNote Added: 0024364
2025-03-29 23:48DrinkyBirdNote Added: 0024366
2025-03-30 04:53unknownnaNote Added: 0024369
2025-03-30 15:14DrinkyBirdNote Added: 0024370
2025-03-30 15:28DrinkyBirdNote Edited: 0024370bug_revision_view_page.php?bugnote_id=24370#r14518
2025-03-30 17:56unknownnaNote Added: 0024371
2025-03-30 17:56unknownnaFile Added: voodoodolltest_fixed_03b.wad
2025-04-07 03:38unknownnaNote Edited: 0024371bug_revision_view_page.php?bugnote_id=24371#r14528
2025-04-08 11:02DrinkyBirdNote Added: 0024393
2025-04-08 11:07unknownnaNote Added: 0024394
2025-04-08 11:08unknownnaFile Added: CrashReport_02.zip
2025-04-08 12:05DrinkyBirdNote Added: 0024395
2025-04-08 12:13unknownnaFile Added: CrashReport_03.zip
2025-04-08 12:14unknownnaNote Added: 0024397
2025-04-08 12:43DrinkyBirdNote Added: 0024398
2025-04-08 13:36unknownnaNote Added: 0024399
2025-04-11 13:58DrinkyBirdFixed in Version3.2 =>
2025-04-11 13:58DrinkyBirdTarget Version3.2 =>
2025-04-11 14:05DrinkyBirdNote Added: 0024424

Notes
(0016765)
Empyre   
2017-02-06 01:08   
This is a pet peeve of mine and I worry that this feature request might have been forgotten. Surely I am not the only player who uses single-player with multiplayer emulation. It is awesome except for the lack of voodoo doll support.
(0019186)
Empyre   
2018-05-02 15:49   
Since you are working on a new version (3.1), now is the time for feature requests. I wanted to bring this to your attention, but I don't want to be annoying, so I promise not to bump this again this year.
(0022941)
StrikerMan780   
2023-12-31 11:04   
Currently helping a friend make a mod that requires multiplayer emulation enabled to play properly in SP (as it uses survival's lives system with 1-ups), and not having voodoo dolls working in this mode breaks a majority of megawads.
(0024240)
DrinkyBird   
2025-03-06 23:08   
'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/269 [^]'
(0024262)
unknownna   
2025-03-20 11:08   
The example wad had the player starts reversed so I fixed it.

* The voodoo doll works well, but if you start the game as a netgame or use "map map01" after enabling multiplayer emulation, exiting the map causes your player to lose all weapons in the next map.
* Entering the map as a spectator in multiplayer emulation still doesn't have working voodoo dolls. This also seems to happen online actually. Is this intended? I think maps will break with this behavior.
(0024306)
DrinkyBird   
2025-03-24 11:55   
(edited on: 2025-03-24 12:06)
Quote
The voodoo doll works well, but if you start the game as a netgame or use "map map01" after enabling multiplayer emulation, exiting the map causes your player to lose all weapons in the next map.


I can't seem to reproduce this. nevermind, I can now. Does this also happen online? I guess it's carrying the inventory of the player over from the voodoo doll rather than their real body.

Quote
Entering the map as a spectator in multiplayer emulation still doesn't have working voodoo dolls. This also seems to happen online actually. Is this intended? I think maps will break with this behavior


If sv_coopunassignedvoodoodolls is off, voodoo dolls only spawn when the map starts or a player connects to the server (not joins the game). I guess it should be made so they spawn on join as well.

I did some additional testing assisted by Dark-Assassin and most of the quirks with voodoo dolls are either Doom behaviour or just unrelated to multiplayer emulation specifically. (I marked the ticket as resolved before I saw your response...) Notably Plutonia MAP06 doesn't give weapons - but this doesn't work in vanilla co-op either, and in GZD 1.8.6 it only gives to the highest-idx player.

(0024307)
unknownna   
2025-03-24 12:22   
Quote from DrinkyBird
I can't seem to reproduce this.


I see, could you try the steps below with your latest fix and see if it happens to you? When I enter MAP02 after pressing the exit switch, the player spawns without the pistol. This only happens during multiplayer emulation offline.

1. zandronum -file voodoodolltest_fixed.wad +netgame +map map01
2. Go press the switch to open the door to the exit switch.
3. Press the exit switch and it will spawn you in MAP02 without any weapons.

Quote from DrinkyBird
This is how voodoo dolls are handled in coop, if sv_coopunassignedvoodoodolls is off [...]


Interesting, toggling this on and off doesn't seem to change the behavior with the example wad. No matter what it's set to, the voodoo doll is not spawned if the map is entered with spectators only.
(0024308)
DrinkyBird   
2025-03-24 13:36   
(edited on: 2025-03-24 13:54)
Yeah, I reproduced the inventory bug. Turns out if you enable MP emulation, then map map01, the real player body doesn't spawn with any inventory, but you can still raise and use a pistol. Notice how you can't switch to the fist either. Then when you go to map02 it properly reflects your lack of inventory. Weird.

edit: ok, I think I figured it out. The issue is that the player inventory isn't being copied from the voodoo doll (since the inventory is given to the first voodoo doll when it spawns, then is copied in a chain for each player body that spawns, up until the real one). This is due to this specific if statement, which unsets the player's mo if not in pure singleplayer, causing it to lose track of which body to copy the inventory from.

(0024309)
DrinkyBird   
2025-03-24 14:07   
'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/92624de40cf47ab200d0d2837cd76d8e6a365ff0 [^]' should fix the inventory bug, although I have no idea why that
NETWORK_GetState( ) != NETSTATE_SINGLE
condition was there as it predates the source control history. The player's mobj is set to null at the start of P_SetupLevel (before spawning dolls) so I don't think this should cause other issues.
(0024310)
unknownna   
2025-03-24 14:17   
Hey, I tested the pipeline build and it still seems to be broken, on top of not displaying any ammo, and crashing the client if you try to fire the pistol in the example wad.
(0024311)
DrinkyBird   
2025-03-24 14:28   
That is worrying... I tried with both my local Linux build and the automatic Win64 build and it seems to work fine for me. If I enable multiplayer emulation then map map01, I have all ammo and keep my inventory after exiting into the next map. I am very confused.
(0024312)
unknownna   
2025-03-24 14:32   
(edited on: 2025-03-24 14:34)
Hmm, I always use the Win32 builds when I test, does that make a difference?

I just followed the steps above: zandronum -file voodoodolltest_fixed.wad +netgame +map map01

And it reproduces the crash and missing ammo counter. I also uploaded a crash report if it helps.

I tested the 64 bit build and it also crashes there for me.

(0024314)
DrinkyBird   
2025-03-24 17:10   
(edited on: 2025-03-24 17:13)
Ah, it happens when unassignedvoodoodolls is on. This is because the voodoo doll is spawned as a voodoo doll for the actual player at the relevant index, then gets yanked away to the dummy player, but the real player's mobj still points to the voodoo doll, causing things to break when it takes ownership of the doll's inventory.

The best solution is probably to just to spawn the dolls for the dummy player instead of transferring them from a real player to the dummy player. That way there's no inventory transfer shenanigans since they're entirely separate.

Give'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/bbc2613b718a70bde0db995fd2ced55a55703501 [^]' a try. This includes the previous commit as well, since that fixed the inventory issue when unassigned dolls were off (there, we need to transfer the inventory from a player's doll to their real body.)

(0024315)
unknownna   
2025-03-24 17:32   
(edited on: 2025-03-24 17:48)
I gave the latest fix a try, and while it seems to have fixed the crash and missing ammo counter, the player still only gets the pistol and can't select the fist, and still loses the weapons in the next map in the example wad.
Using "printinv" shows that there's no actual inventory present for the player.

Edit:
Scratch that, I double checked and was possibly testing with the wrong build. Re-downloaded and can confirm it's working.

One big problem, the server crashes immediately if you try start it with the example wad loaded.

(0024316)
DrinkyBird   
2025-03-24 19:13   
(edited on: 2025-03-24 19:16)
Thanks. This amended version should fix that server crash:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/b616cbcd86130661f2ff652dc042a2b8d4ee2e5a [^]'

edit: updated to the right commit

(0024317)
unknownna   
2025-03-24 20:01   
Thanks, that took care of the issues.

I noticed one minor issue that only happens offline in multiplayer emulation when sv_coopunassignedvoodoodolls is 0: There's no respawn protection for the local player when using "map map01".
(0024359)
DrinkyBird   
2025-03-26 11:03   
This should fix the respawn invulnerability:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/44a42932edb45668cb8a887ce34bb90e9d5c8adb [^]'
(0024360)
unknownna   
2025-03-26 12:21   
That seems to have fixed that particular problem, however I noticed that the server no longer gives its inventory to players when the voodoo doll picks them up with "sv_coopunassignedvoodoodolls 1", unlike 3.1.

In the updated example wad, the voodoo doll picks up:

- all keys
- a megasphere
- a backpack
- a SSG
- a radiation suit

On a site note, I was a bit confused myself when testing this, as it turns out you have to enable "alwaysapplydmflags 1" to make the respawn invul appear. Doom Explorer sets this automatically for me when I test through it, but when using the command line it has to be explicitly enabled from the looks of it. I was about to state I discovered a separate problem until I realized this.
(0024363)
DrinkyBird   
2025-03-29 20:35   
Thanks for the updated WAD. I fixed that and a few other edge cases that unveiled, here is the latest commit:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/85190c3b403fd0925c485ac8ebb1618410ae7794 [^]'

This doesn't print the pickup messages or play the pickup sound when an unassigned voodoo doll picks up an item in multiplayer emulation. I'm averse to duplicating the code for that later in AInventory::Touch, and so long as it gives the items at all I think it's good enough for now.
(0024364)
unknownna   
2025-03-29 22:16   
I tested it briefly, and it seems to give the pickups when the voodoo doll picks them up, but it doesn't remember the weapon and key pickups like it's supposed to, if I'm not mistaken. See this commit.

And the server now crashes again if you start one with the example wad.
(0024366)
DrinkyBird   
2025-03-29 23:48   
Should fix both:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/8a522ad257d3dcfdd8f5619409311cb18189b289 [^]'
(0024369)
unknownna   
2025-03-30 04:53   
Using: zandronum -file voodoodolltest_fixed_02.wad +alwaysapplydmflags 1 +netgame +map map01

I found some issues:

* After pushing the switch, getting the items and then entering "sv_coopunassignedvoodoodolls 0; map map01" into the console, it will spawn me in the map again with all the keys and the SSG at a fresh map start. It erroneously keeps the items across the map change.
* Joining the game from a spectator doesn't select the SSG offline with "sv_coopunassignedvoodoodolls 1", unlike online.
* The player doesn't auto-switch to the SSG when picked up by voodoo doll in multiplayer emulation compared to online play and true singleplayer.

Although it's rather unrealistic scenarios, I'm not quite sure if this is the correct behavior yet. I appreciate your continued work however.
(0024370)
DrinkyBird   
2025-03-30 15:14   
(edited on: 2025-03-30 15:28)
It appears the current behaviour (not calling Touch for each real player, but pretending the server did) originates from'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/beb0122a5d4d1d17898c7eecddc40c5eb999c27f. [^]' I could call Touch in multiplayer emulation, which would fix the pickup message and weapon switching etc, but then you won't receive weapons from voodoo dolls if sv_weaponstay is off when sv_coopunassignedvoodoodolls is on. This is a rabbit hole...

At this point it's getting kind of complex to patch every edge case, so if it gives the inventory items at all, I think that'd be good enough for now, and I can chase perfect behaviour some other time (especially since 3.2's release is approaching very soon).

This will fix the items being carried over at least:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/3181505c61f03531cb3399b45f9a7f0548456891 [^]'

(0024371)
unknownna   
2025-03-30 17:56   
(edited on: 2025-04-07 03:38)
I tested it and messed around with it for a bit, and while it fixed the issue with the inventory being carried over to the next map after a "map" map change, I also managed to make it crash with my newer example wad.

This happens if the client for some reason decides to turn into a spectator first, and then joins the game again before telefragging the voodoo doll.

This whole issue is rather problematic indeed, where fixing one thing quickly breaks other things.

1. zandronum -file voodoodolltest_fixed_03b.wad +alwaysapplydmflags 1 +netgame +map map01 +spectate
2. Join the game, press the switch and go into the teleporter to telefrag the voodoo doll. The game will crash.

Edit:
I tested this again, and the crash started to occur after your 3rd fix from the looks of it, so it wasn't caused by your latest changes.

If you're somehow able to squeeze the patch into 3.2 and want to make users happy, it should work ok enough for now. Maybe add a note somewhere telling users not to spectate first when playing with voodoo dolls in multiplayer emulation.

(0024393)
DrinkyBird   
2025-04-08 11:02   
Whoops, I got sidetracked and then kind of forgot about this...

I'm not able to reproduce the crash, with sv_coopunassignedvoodoodolls 1 I just get stuck in the voodoo doll, and with it 0 the voodoo doll won't spawn. Can you send a crash report?

It does feel like ever more specific edge cases though - I wonder how often someone is likely to telefrag a voodoo doll after joining as a spectator (and perhaps only in multiplayer emulation?)
(0024394)
unknownna   
2025-04-08 11:07   
Sure, the crash happens offline in multiplayer emulation. I uploaded the crash report using voodoodolltest_fixed_03b.wad.
(0024395)
DrinkyBird   
2025-04-08 12:05   
Annoyingly, the Heptapod artefacts have expired, so I can't download the symbols anymore, and I can't use a rebuild since Visual Studio requires the original exe be exactly identical to the one used to generate the crash report.

Can you try this commit, and upload a crash report from this? It's the same commit as the previous build, albeit rebased atop the latest changes in the main branch.'https://foss.heptapod.net/zandronum/zandronum-stable/-/pipelines/103472 [^]'
(0024397)
unknownna   
2025-04-08 12:14   
I uploaded a new crash report using the pipeline build from your link.
(0024398)
DrinkyBird   
2025-04-08 12:43   
Very useful, thanks! That crash is with cl_identifytarget 2, as it was trying to get the health of the dummy player, but it doesn't have an individual associated mobj to access. This should fix that:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/b0728ca2c3c1053b72ac6c8e0f90db73a2b12ef3 [^]'
(0024399)
unknownna   
2025-04-08 13:36   
That took care of the crash, nice job! So it seems to work fine now other than the minor discrepancies below:

* The player doesn't auto-switch to the SSG when picked up by voodoo doll in offline multiplayer with "sv_coopunassignedvoodoodolls 1".

* Joining the game from a spectator doesn't auto-select the SSG in offline multiplayer with "sv_coopunassignedvoodoodolls 1".

* No pickup messages or pickup sounds when voodoo doll picks up items in offline multiplayer with "sv_coopunassignedvoodoodolls 1".

* No pickup sounds in offline multiplayer when joining from being a spectator with "sv_coopunassignedvoodoodolls 0", unlike online. (Though this one seems odd, the loudness of the sounds depends on a 2nd client's distance from your own spawnspot.)

Seems like it's just the discrepancy with the unassigned voodoo dolls remaining, and then it's nearly identical between offline and online play. This can be refined further later.
(0024424)
DrinkyBird   
2025-04-11 14:05   
Unfortunately none of those further fixes will probably make it into 3.2, since we are possibly days away from release at this point, and I'd like these to be tested more thoroughly, but I don't think this is crucial enough to delay 3.2 any further.

I'd also like to fix the lack of Touch behaviour in multiplayer emulation, and some other voodoo doll behaviour changes, including some of the tickets spawned from this and some feedback Dark-Assassin mentioned, but those wouldn't be targeted for 3.2 anyway.