Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Doomkid

Source port that allows "ghost data" / racing a demo?

Recommended Posts

In Mario Kart 64, you can record your previous run and race against your own "ghost". I'm wondering if such a thing is possible in any Doom source ports? I'd love to see my past self running through the map, so I could literally race myself.

 

This would also be a lot of fun, for example two demos from different players could be stacked, and you could race against ZeroMaster and Looper or something (pointless of course, but it would be very enjoyable)

 

Does any such thing exist? I know speedrunners are already constantly racing, but actually seeing someone else's run/a past run of your own in real-time would be swell.

Share this post


Link to post

Doom's enemy AI isn't deterministic (AFAIK), so I don't think you'd be able to do it. If we had positional data for the demos instead of just inputs it could work, but with just inputs bumping into mobs, or not in another run due to where they moved, would desync the recording. And something i've just realised as I type this, even if it is deterministic, if you killed a mob on one run but not on another the colisions would be different.

Maybe it is possible, but I think it might need a different demo format.

Share this post


Link to post

Your response made me realize this makes no sense by default in Doom!

 

I suppose one interesting way to implement this idea would be to have it so just the Doomguy gets played back as a true "ghost" - none of the monsters reacting to him in any way whatsoever, no sectors react to him - just a visible ghost with no collision whatsoever, so he can just pass through doors and lifts and such during playback. But, since demos record input rather than things like player position, there's no doubt it would require a whole new format altogether.. Damn. If there was a format that could simply record a players X, Y and Z positions during play, it would probably be much easier to implement this idea.

 

Thanks a lot for the response, answered my question exactly.

Share this post


Link to post

In a funny coincidence, this actually has been implemented very recently in the brand-new DSDA Doom port.

 

Share this post


Link to post
19 minutes ago, Gez said:

In a funny coincidence, this actually has been implemented very recently in the brand-new DSDA Doom port.

 

Hot damn... Do you know how? (I can't read code well enough to understand from that)

Share this post


Link to post

The ghosts have no gameplay effect, they don't interact wth the world. If you look at the (hilarious) video posted above , you'll see the fluid mass of Doomguys walking through doors, climbing up walls without an elevator, or sinking in the floor, etc., because they don't trigger the door, the elevator or the floor lowering. Likewise, you can spot monsters not waking up immediately when the 500 Doomguys invade their territory -- there's one "real" Doomguy in the flux whose demo has an effect on the world, and for effect he's not the fastest runner in the mix so we get some time to see the crowd doing their stuff before the level ends; but all the others are ghosts.

 

As for the camera viewpoint, it is also immaterial, a "cool demo" feature where you get to look at a demo from outside of the player pawn's eyes.

 

 

I think my favorite part of the video is the slow elevator in Downtown, where the pile of Doomguys get to look like a living Christmas tree.

Share this post


Link to post
Just now, Gez said:

The ghosts have no gameplay effect, they don't interact wth the world. If you look at the (hilarious) video posted above , you'll see the fluid mass of Doomguys walking through doors, climbing up walls without an elevator, or sinking in the floor, etc., because they don't trigger the door, the elevator or the floor lowering. Likewise, you can spot monsters not waking up immediately when the 500 Doomguys invade their territory -- there's one "real" Doomguy in the flux whose demo has an effect on the world, and for effect he's not the fastest runner in the mix so we get some time to see the crowd doing their stuff before the level ends; but all the others are ghosts.

 

As for the camera viewpoint, it is also immaterial, a "cool demo" feature where you get to look at a demo from outside of the player pawn's eyes.

 

 

I think my favorite part of the video is the slow elevator in Downtown, where the pile of Doomguys get to look like a living Christmas tree.

Damn, that's amazing :D

 

I've looked into it, and they seem to have added a .gst file for ghosts, which I guess does take positional data to ignore the rest of the world (so if you just followed the ghost around and didn't open a door it'd just bump into it and then walk through a second later once the door opened).

This port is amazing! I'd seen it before but ignored it because it didn't have a restart level button, and quitting and restarting after 3 seconds because I bumped a wall sucked, so I stuck with Crispy, but if I can get the damn thing to compile I'll definitely be using this! (and it'll mean 1 less port to keep my settings in sync with since I'll drop Crispy)

Share this post


Link to post
1 hour ago, MxCraven said:

Doom's enemy AI isn't deterministic (AFAIK)

Actually, it's 100% deterministic (excluding very rare memory-content-dependent bugs), which is exactly what allows us to have such compact demo files -they only contain player inputs.

 

OTOH, to race your "ghost", your "ghost" would also need to fight "ghost mobs", climb on "ghost elevators", open "ghost doors", have its own "ghost pickups" etc. so in practice you would need two "Dooms" running at the same time but with independent states from each other, and somehow sharing one viewport (yours, the one of the active player) and rendering those two, overlapping states together.


Not impossible, but you'd need a port that has strong state separation/encapsulation to begin with, which excludes most chocolate/linuxdoom/boom etc. derived ports from the get go.

 

That is, if you want to be able to see what your "ghost"'s actions are, what monsters it actually kills in what order, what it picked up, which door it activated etc., and not just pantomime its movements. If that's all you want, then what Gez said will suffice.

Share this post


Link to post

This is possible without requiring a different demo format. If you strip Doom of all the drawing, sounds and tic timing, a demo can take a very short time, like a second or less. Such a port can play this demo in memory really quickly at game startup, just to record the resulting player positions at each tic. Then when you enter the level, you see your past ghost moving according to that demo.

 

Share this post


Link to post
1 hour ago, printz said:

If you strip Doom of all the drawing, sounds and tic timing, a demo can take a very short time, like a second or less.

While that's true for short demos or for longer demos on simpler maps, it's not generally the case. It takes a couple seconds to get through looper's 17:55 in doom 2 for instance (on my computer). If you are dealing with modern maps where there are more enemies and things going on, then it will take quite some time indeed to run through a demo. It gets prohibitively bad at some point, which is why you won't see optimized non-built tases of maps with large quantities of monsters - eventually it takes too long to fast-forward through the demo, even without sound or rendering.

Share this post


Link to post
1 hour ago, kraflab said:

It takes a couple seconds to get through looper's 17:55 in doom 2 for instance (on my computer)

Without any rendering or sound output? I don't think so, you are talking about timedemo. I don't think you understood what printz said.

Share this post


Link to post
21 minutes ago, VGA said:

Without any rendering or sound output? I don't think so, you are talking about timedemo. I don't think you understood what printz said.

Of course not, timedemo still renders the game. If I account for startup time compared with a super short demo, it's ~0.5 seconds for me to run through it.

 

If you take anc's 21 minute rush map 12 demo for instance, that takes about 13 seconds for me. Try it for yourself.

 

Obviously how fast your computer is will determine your time, but my point is that you can't instantly simulate demos in such cases.

Edited by kraflab

Share this post


Link to post

Looper's 17:55 takes 1.6 seconds on my computer with -timedemo, -nodraw, and -nosound (that includes whatever procedures the program has before/after actually running the demo). On the extreme side of things, antares031's 37-minute demo of Antaresian Reliquary MAP31 with its 40k+ monsters took my computer over 19 minutes. Even with a short runtime, producing the ghost data at startup would get impractical for multiple ghosts like the 500 ghosts video posted above.

Share this post


Link to post

Then it would require a new demo "ghost" format. You would run prboom+ with a "-timedemo yourdemo -generateghost yourghost"

and it would generate a ghost demo out of a normal demo.

 

Then you'd do a -warp to a map with a "-ghost yourghost" parameter

Share this post


Link to post

You know what could address these issues, allowing this kind of demo-focused feature to thrive?

 

Share this post


Link to post
20 hours ago, VGA said:

Then it would require a new demo "ghost" format. You would run prboom+ with a "-timedemo yourdemo -generateghost yourghost"

and it would generate a ghost demo out of a normal demo.

 

Then you'd do a -warp to a map with a "-ghost yourghost" parameter

Did you not read the rest of the thread? 😛

Share this post


Link to post
20 hours ago, VGA said:

Then it would require a new demo "ghost" format. You would run prboom+ with a "-timedemo yourdemo -generateghost yourghost"

and it would generate a ghost demo out of a normal demo.

 

Then you'd do a -warp to a map with a "-ghost yourghost" parameter

This is pretty much exactly what DSDA-Doom does. Though it's "-export_ghost" not "generateghost" and "-import_ghost" not "-ghost".

 

And yeah ghost format is different from demo format because it has to store the exact coordinates of the ghosts -- demos can make do with just storing inputs, but ghosts have to be able to go through doors they cannot open, ride lifts they do not trigger, etc. so they'd desync quickly. Instead they go through geometry -- including being able to go below the floor (if in their original reality the floor lowered) or even above the ceiling. Their state is also stored, so it can look like a ghost opened fire except it didn't, because it only did that in its original reality. And a ghost may even be killed, but not by anything in the level -- by something in the ghost's original reality. They cannot be killed by anything in the level, since they don't interact with the level at all, in either direction.

 

So a ghost is just a series of coordinates and states, while a demo is a series of player inputs.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×