Giter Club home page Giter Club logo

Comments (12)

kitchen-ace avatar kitchen-ace commented on June 15, 2024

Other demos that desync, non-comprehensive list

https://dsdarchive.com/files/demos/hexen/699/hx4j1617.zip (CHexen)
https://dsdarchive.com/files/demos/hexen/55902/hxf1302.zip (Hexen+ v1.1.5)
https://dsdarchive.com/files/demos/hexen/55856/hxm2140.zip (Hexen+ v1.1.5)
https://dsdarchive.com/files/demos/hexen/55844/hxc2306.zip (Hexen+ v1.1.5)

The last one happens at about 3:20 and so is another good candidate for watching without -timedemo

from chocolate-doom.

turol avatar turol commented on June 15, 2024

Do all of these involve the porkalator? Is this the first use of the porkalator in the demos?
Where did dsda-doom get their Hexen code? Straight from id release or somewhere else?
Did this ever work on chocolate or has it broken recently (can't be that recent if 3.0.1 is broken...)?
Is there some easy hack that can be applied to the source to pause the game shortly before or after the desync so we can attach debugger/add debug code?

from chocolate-doom.

fabiangreffrath avatar fabiangreffrath commented on June 15, 2024

Dsda is based on PrBoom+ and may thus have a more complete emulation of Doom 1.2, upon which Hexen is built.

from chocolate-doom.

kitchen-ace avatar kitchen-ace commented on June 15, 2024

Do all of these involve the porkalator?

No, only the first one does. I'll go through the other demos soon to see if I can identify any commonalities.

2.3.0 was the first stable release to have support for extended demos, I can give that a shot.
*edit: They still desync in 2.3.0, so I guess they never worked properly in Chocolate Hexen.

(It shouldn't matter but I used the windows version of 2.3.0 through wine because I was having trouble getting it to compile on Linux.)

While it's possible that multi-level demos have something to do with the desync, it seems also possible to me that they're the only desyncs I've seen because single-level demos just aren't long enough to run into whatever rare condition is causing the desync.

from chocolate-doom.

kitchen-ace avatar kitchen-ace commented on June 15, 2024

Going through the demos on dsdarchive, most of the ones that desync do so in multi-level runs. However MAP11 always desyncs in Chocolate, essentially from the beginning, even on single map runs. Clearing the savegame directory doesn't seem to matter.

These three single-map demos desync in Chocolate (latest git, 3.0.1, and 2.3.0) but play fine in vanilla and dsda-doom:
https://dsdarchive.com/files/demos/hexen/748/m11f-031.zip
https://dsdarchive.com/files/demos/hexen/749/m11m-033.zip
https://dsdarchive.com/files/demos/hexen/747/m11c-052.zip

Meanwhile this demo I recorded in Chocolate desyncs in vanilla:
hx11test.zip

MAP11 is the secret map of Hub 2, and is somewhat special in that it has a switch that grants access to the secret map of Hub 4 (MAP25). Though to be able to reach MAP11 normally you have to exit from the secret map of the first hub (MAP06), and that map doesn't usually cause desyncs. MAP11 also has a script which teleports ettins in after a while, can only be beaten by killing all living ettins, and will swarm you with chaos serpents if more than 20 ettins are present -- no idea if that's relevant but since it's fairly uncommon I figure I'd mention it.

edit: making a copy of MAP11 with an empty* BEHAVIOR lump and recording on that level still causes desyncs between Chocolate and Vanilla Hexen. (*Hexen needs a valid BEHAVIOUR lump with at least one compiled script, even if it does nothing.)

from chocolate-doom.

mikeday0 avatar mikeday0 commented on June 15, 2024

I haven't checked all the attached demos, but this fixes the Zero Master fullgame run desync on my end:

Diff:
diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c
index c92604d6..54797b49 100644
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -539,11 +539,11 @@ boolean P_LookForPlayers(mobj_t * actor, boolean allaround)
     // an infinite loop can occur if players 0-3 all quit the game. Although
     // technically this is not what Vanilla does, fixing this is highly
     // desirable, and having the game simply lock up is not acceptable.
-    // stop = (actor->lastlook - 1) & 3;
-    // for (;; actor->lastlook = (actor->lastlook + 1) & 3)
+    stop = (actor->lastlook - 1) & 3;
+    for (;; actor->lastlook = (actor->lastlook + 1) & 3)
 
-    stop = (actor->lastlook + maxplayers - 1) % maxplayers;
-    for (;; actor->lastlook = (actor->lastlook + 1) % maxplayers)
+    // stop = (actor->lastlook + maxplayers - 1) % maxplayers;
+    // for (;; actor->lastlook = (actor->lastlook + 1) % maxplayers)
     {
         if (!playeringame[actor->lastlook])
             continue;

from chocolate-doom.

mikeday0 avatar mikeday0 commented on June 15, 2024

I think this is the same issue: #822

from chocolate-doom.

kitchen-ace avatar kitchen-ace commented on June 15, 2024

I haven't checked all the attached demos, but this fixes the Zero Master fullgame run desync on my end

That looks very promising, the MAP11 demos all work now. I'll check the others when I get a chance.

caldera.wad demo in #822 plays properly as well

from chocolate-doom.

kitchen-ace avatar kitchen-ace commented on June 15, 2024

OK that fixes every hexen.wad demo on dsdarchive that desyncs. There is one that causes a segfault but seems likely that that's a different issue. Great spotting @mikeday0

from chocolate-doom.

fragglet avatar fragglet commented on June 15, 2024

Go ahead and roll back please. Though I'm confused as to why that commit causes the desync.

from chocolate-doom.

mikeday0 avatar mikeday0 commented on June 15, 2024

Here's what I think is happening, Upon spawning, each enemy's lastlook is initialized to a random value between 0 and 7 (i.e MAXPLAYERS - 1). There's a chance that the first call of P_LookForPlayers for that monster will return early courtesy of the actor->lastlook == stop condition. Presumably this occurs when (actor->lastlook - 1) & 3 equals 0, or when lastlook equals 1 or 5.

The original fix for the infinite loop has the side effect of altering which enemies are affected by an early actor->lastlook == stop return. Now it happens when (actor->lastlook + MAXPLAYERS - 1) % MAXPLAYERS equals 0, or when lastlook equals 1.

from chocolate-doom.

turol avatar turol commented on June 15, 2024

You could add that analysis as a comment to the fix PR.

from chocolate-doom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.