MantisBT - Zandronum
View Issue Details
0002551Zandronum[All Projects] Bugpublic2015-12-13 18:302016-12-18 22:44
Zalewa 
Zalewa 
normalmajoralways
closedinvalid 
 
 
0002551: Multiplayer: Infinite Cacodemon spawns in Pinnacle of Darkness.
Video:'https://youtu.be/6oPtFfSgL6A [^]'
WAD:'https://www.doomworld.com/idgames/levels/doom2/Ports/p-r/pinnacle [^]'
0. Use build 3.0-alpha-r151004-2012
1. Start multiplayer cooperative server with pinnacle.pk3.
2. Join this server.
3. Go to the spawning place as shown in the video.
4. Wake up monsters and behold.
5. Repeat in single player.
Zandronum build: 3.0-alpha-r151004-2012
No tags attached.
Issue History
2015-12-13 18:30ZalewaNew Issue
2015-12-13 21:04DuskNote Added: 0013989
2015-12-13 21:04DuskNote Edited: 0013989bug_revision_view_page.php?bugnote_id=13989#r8325
2015-12-13 21:22DuskNote Edited: 0013989bug_revision_view_page.php?bugnote_id=13989#r8326
2016-12-18 22:44ZalewaNote Added: 0016535
2016-12-18 22:44ZalewaStatusnew => closed
2016-12-18 22:44ZalewaAssigned To => Zalewa
2016-12-18 22:44ZalewaResolutionopen => invalid
2016-12-18 22:44ZalewaNote Edited: 0016535bug_revision_view_page.php?bugnote_id=16535#r9989

Notes
(0013989)
Dusk   
2015-12-13 21:04   
(edited on: 2015-12-13 21:22)
This map lags way too much to be debugged. I'm going to need a minimal testcase unless someone else deals with this one.
EDIT: Scratch that, I get reasonable performance by using software and disabling 3d floors and portals.

(0016535)
Zalewa   
2016-12-18 22:44   
I'm very sorry for reporting this. I just got to the bottom of the problem and the issue is not with the port but with ACS scripting in the WAD itself.

If you take a look at the script below you'll notice an `if (GameType() != GAME_SINGLE_PLAYER)` check. This check ensures that the problem occurs only in multiplayer. Inside the check there are multiplications that simply calculate the wrong values. Both ints are essentially divided/multiplied by 65541. If you delete the `if` check the problem also occurs in single player and in newest version of GZDoom.

script 34 (void) {

    if (ActivatorTid() == s_playerTid && !s_yellowKeyStart)
    {
        int maxSpawnCount = 2;
        s_yellowKeyStart = 1;
        Thing_Spawn(147, T_CYBERDEMON, 160, s_cyberNewTid);
        //s_bossTid50 = s_cyberNewTid;
        //ACS_Execute(50, 0, 148, 149, -1);

        int start = 0;
        int count = 0;
        int spawnInterval = 50;

        switch(GameSkill())
        {
            case 0:
            case 1:
            case 2:
                spawnInterval = 40;
                break;
            case 3:
            case 4:
                spawnInterval = 30;
                break;
        }

        if (GameType() != GAME_SINGLE_PLAYER)
        {
            spawnInterval = spawnInterval / 1.5;
            maxSpawnCount = maxSpawnCount * 1.5;
        }

        int spawnAlt = 0; //skill easy, don't spawn the alternate (harder) monster

        if (GameSkill() > 1)
            spawnAlt = 1;

        while(count <= maxSpawnCount)
        {
            if (Timer() - start > spawnInterval*35 || start == 0)
            {
                count++;
                start = Timer();
                SpawnSpot("Cacodemon", 148, s_cacoNewTid, 160);

                if (spawnAlt == 1)
                {
                    SpawnSpot("PainElemental", 149, s_cacoNewTid, 160);
                    SpawnSpot("Cacodemon", 148, s_cacoNewTid, 160);
                    spawnAlt = 0;
                }
                else
                {
                    SpawnSpot("Cacodemon", 149, s_cacoNewTid, 160);
                    SpawnSpot("Cacodemon", 148, s_cacoNewTid, 160);
                    if (GameSkill() > 1)
                        spawnAlt++;
                }

                Thing_Hate(s_cacoNewTid, 0, 0);
            }

            Delay(35);
        }
    }
}



I'll email the author of the WAD about this.