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

StationDoom: reverse engineered source port of PSX Doom for PC (Early progress!)

Recommended Posts

11 hours ago, Redneckerz said:

The very similarly named PsiDoom already exists and is an source port for Amiga. It just has no Wiki entry yet.

 

PsyQDoom could be something? It differentiates enough from PsiDoom and QZDoom in my eyes and its both a reference to PS1 SDK and Psygnosis (Stupid of me that i didn't think of this first up when looking up codenames...)

 

So, as it stands then, we would have two PSX source port projects:

  • DZDoom (DarkZDoom) - A GZDoom based build with all kinds of features from the PSX version added in to work with all the features that GZDoom brings.
  • PsyQDoom (I am just holding this on for now as placeholder) - A port of the PSX Doom code to PC, without additional enhancements like Phoenix Doom does, and which strives for a vanilla port of the PSX framework. (I assume that for more modern stuff like high res/OpenGL support, you could fork this stuff).

Sounds about right, no?

 

Yep that's precisely it. I fully intend to do a Phoenix Doom type job on the PSX codebase when I'm done as well, but the vanilla version must come first.

 

11 hours ago, Redneckerz said:

The very similarly named PsiDoom already exists and is an source port for Amiga. It just has no Wiki entry yet.

 

Thanks for pointing that out, I was not aware!

 

I'm not fond of name confusion myself but I'm not sure it would be much of a problem in this instance given that the author abandoned the project way back in 1997 with no source release that I can see of (so it's truly dead), and also given that it's for a relatively obscure platform. No disrespect to the Amiga and that (I was an avid A600/A1200 user back in the day) but I can't see this phonetic clash being a problem for most people. Just my own thoughts though, if anyone feels really strongly against the name 'PsyDoom' I'm willing to listen. Also open to other suggestions too, this isn't something that needs to be decided immediately...

 

Oh and happy new year everyone! May 2020 be a great year for progress on the PSX DOOM front. Hopefully by this time next year I'll be able to enjoy the fruits of all these efforts and mapping for PSX DOOM with a new engine running on the PC. Back full circle to how I got started in game development in the first place! We'll see how it goes.. :)

Share this post


Link to post

I'm wondering if @Erick194 can figure out a way to record demos on the actual hardware or an emulator and then try them out in your port to see if they sync or not. That way we could potentially record more complex or longer demos, depending on the capabilities of the console.


I like the name PsyDoom and I think it's safe that the confusion with PsiDoom will be minimal, I bet most of us never heard of such a thing before and it has been abandoned for over 22 years.

 

I realized this port runs at ~30fps instead of the uncapped framerate of Phoenix Doom. Was this because of differences in implementation or the way the games work related to their respective consoles?

Share this post


Link to post
16 hours ago, intacowetrust said:

 

Yep that's precisely it. I fully intend to do a Phoenix Doom type job on the PSX codebase when I'm done as well, but the vanilla version must come first.

 

 

Thanks for pointing that out, I was not aware!

 

I'm not fond of name confusion myself but I'm not sure it would be much of a problem in this instance given that the author abandoned the project way back in 1997 with no source release that I can see of (so it's truly dead), and also given that it's for a relatively obscure platform. No disrespect to the Amiga and that (I was an avid A600/A1200 user back in the day) but I can't see this phonetic clash being a problem for most people. Just my own thoughts though, if anyone feels really strongly against the name 'PsyDoom' I'm willing to listen. Also open to other suggestions too, this isn't something that needs to be decided immediately...

 

Oh and happy new year everyone! May 2020 be a great year for progress on the PSX DOOM front. Hopefully by this time next year I'll be able to enjoy the fruits of all these efforts and mapping for PSX DOOM with a new engine running on the PC. Back full circle to how I got started in game development in the first place! We'll see how it goes.. :)

I reckon that the Phoenix Doom type job of it will have a different name aswell :)

 

Well Amiga has had a lot of Doom ports back in the day, the thing is, they aren't on the wiki at all yet :P Besides this, i also recall there was also a PsiDoom for Psion machines, which does not help.

 

Obscurity, well perhaps not! Novacoder did a port of good ole ZDoom 1.2.2 to AGA machines, and also Boom.  Here is a list (But it contains no ZhaDoom and others)

 

Note: PsyDoom is perfectly fine for me, i am just pointing out that there might be multiple projects with similar names :)

 

I would still keep PsyQDoom as a good alternative, mind you!

12 hours ago, CoTeCiO said:

I'm wondering if @Erick194 can figure out a way to record demos on the actual hardware or an emulator and then try them out in your port to see if they sync or not. That way we could potentially record more complex or longer demos, depending on the capabilities of the console.


I like the name PsyDoom and I think it's safe that the confusion with PsiDoom will be minimal, I bet most of us never heard of such a thing before and it has been abandoned for over 22 years.

 

I realized this port runs at ~30fps instead of the uncapped framerate of Phoenix Doom. Was this because of differences in implementation or the way the games work related to their respective consoles?

Just because DoomWorld (And rightly, DoomWiki) have never heard nor documented the various Amiga Doom ports does not mean its not a thing. In fact, all that tells me is an inclination to have stuff like that preserved. :)

 

PSX Doom runs at 30 fps because its a well optimized port.

Share this post


Link to post
Posted (edited)
6 minutes ago, Redneckerz said:

PSX Doom runs at 30 fps because its a well optimized port.

 

Except that, to my knowledge, it's not.

 

It can run at higher frames than other ports that came out around the same time, sure, but it was very inconsistent, with frames dropping pretty often, and the instances where the game could run at its best were pretty rare (typically in small areas with no monsters in sight).

Share this post


Link to post
8 minutes ago, seed said:

 

Except that, to my knowledge, it's not.

 

It can run at higher frames than other ports that came out around the same time, sure, but it was very inconsistent, with frames dropping pretty often, and the instances where the game could run at its best were pretty rare (typically in small areas with no monsters in sight).

Its January 1st. Everyone gets a New Year Mistake at the very least.

 

According to my man John Linneman of Digital Foundry and also as a great explanative piece of how the PSX renderer works and some Aubrey Hodges eastereggstravaganza (Start at 46.39 for the performance part, the PSX piece is at 42.20 and the video starts at that point.):

 

 

''It is not perfect, but compared to every other previous version of Doom including the Jaguar version, PSX Doom runs faster and smoother. The framerate is bumped from 30 up from 20. However it is not always stable. The overall performance is smooth enough though.''

 

So that's basically what you are saying aswell, but John seems rather positively aligned with the performance.

 

Share this post


Link to post

Well, yes, it's the exact same thing I said.

 

PSX Doom was arguably more sophisticated and faster than its predecessors, but it still had its issues, as I've already said - namely inconsistent framerate. It might also be one of the reasons why movement is faster than PC Doom, to make it feel smoother than it actually is.

Share this post


Link to post
Posted (edited)
11 minutes ago, seed said:

Well, yes, it's the exact same thing I said.

 

PSX Doom was arguably more sophisticated and faster than its predecessors, but it still had its issues, as I've already said - namely inconsistent framerate. It might also be one of the reasons why movement is faster than PC Doom, to make it feel smoother than it actually is.

John's conclusion is ever so differently worded and usually more positively minded, but alas, that's correct. - but to be clear, despite not being a cut perfect port in terms of framepacing, it obviously has a host of new features to make up for it - The reason why this is brought over to PC, i reckon. :)

Share this post


Link to post
7 minutes ago, Redneckerz said:

John's conclusion is ever so differently worded and usually more positively minded, but alas, that's correct. - but to be clear, despite not being a cut perfect port in terms of framepacing, it obviously has a host of new features to make up for it - The reason why this is brought over to PC, i reckon. :)

 

Definitely, the colored lightning and more horror oriented atmosphere, sound design, and especially music really gave PSX Doom a whole new identity - a familiar game, but different and refreshing at the same time.

 

And people definitely liked that - it sold very well, and people wouldn't have made TCs, let alone reverse-engineered ports if no one liked it.

Share this post


Link to post
On 12/29/2019 at 5:26 AM, intacowetrust said:

Hey everyone,

 

Check out this brief video demonstration:

 

Happy to answer any questions you might have about this, I can update this post also as new progress/developments are made.


Thanks!

 

 

NICE!

 

Share this post


Link to post

Oh man. There's an MGS hacking Discord server that deals with reverse engineering just about all of the Metal Gear games. You guys should message me and I'll send you guys the Discord server link, and if you guys reverse engineered and made better ports of Twisted Metal 1 and 2 I'd literally die.

 

Going back on topic though this project is awesome, and it reminds me of a project I found on YouTube where they decompiled/disassembled/reverse engineered/ported/etc the original Super Mario Bros. on the NES from it's original 6502 Assembly form to C++. I'm a little sad here with this in the beginning since like it might be a Windows only thing but in the future I hope you guys will consider maybe making it compatible with Mac OS X, Linux, Android, etc.

Share this post


Link to post
36 minutes ago, Lynnie said:

Oh man. There's an MGS hacking Discord server that deals with reverse engineering just about all of the Metal Gear games. You guys should message me and I'll send you guys the Discord server link, and if you guys reverse engineered and made better ports of Twisted Metal 1 and 2 I'd literally die.

 

Interesting - always fun to see old games being picked apart! I'll probably be busy with this for a long time (at least a year I think) so not much time for other projects I'm afraid. After that I'll likely take a break and then move onto some other stuff, maybe back to having some more hobbyist fun with Vulkan: 
 

 

40 minutes ago, Lynnie said:

I'm a little sad here with this in the beginning since like it might be a Windows only thing but in the future I hope you guys will consider maybe making it compatible with Mac OS X, Linux, Android, etc.

 

It's actually running fine on MacOS at the moment for the most part, I hope to support Linux as well when it's all done. Occasionally the build on MacOS will get broken (since I work on Windows most of the time) but it's usually very quick to fix up. Most of the time when I'm travelling I take a MacBook Pro so a side effect of that tends to be portability :)

Share this post


Link to post
Posted (edited)

Just added a new 'noclip' cheat to the game. Was exploring the maps out of bounds a bit when I noticed this in E1M3 - which I thought interesting.

 

Got me thinking, I wonder is the fake 'floating' wall effect just a happy coincidence of how the PSX renderer works? Presumably because it is drawing back to front and not doing the same per column occlusion stuff that the PC version is doing:

 

image.png.017cf20ecbf713eb9e20766d5742386e.png

 

I'm guessing maybe the mappers realized this capability and decided to use it a little in Final DOOM, as discussed/shown in this thread:

 

I also ran into the 'linedef deletion' bug while going out of bounds. If you stray too far outside the map coords, eventually things become corrupted. That'll have to be fixed eventually! Presumably that bug is caused by the lack of bounds checking in some of the blockmap handling code. Maybe I can confirm a fix on that soon...

 

Share this post


Link to post
Posted (edited)
1 hour ago, intacowetrust said:

I also ran into the 'linedef deletion' bug while going out of bounds. If you stray too far outside the map coords, eventually things become corrupted. That'll have to be fixed eventually! Presumably that bug is caused by the lack of bounds checking in some of the blockmap handling code. Maybe I can confirm a fix on that soon...

Yes. It's basically just two lines of code that are missing, as detailed there:

https://doomwiki.org/wiki/Linedef_deletion

Of particular note is the mention that while the bug exists in PSX Doom, it was fixed in PSX Final Doom.

 

Also coincidentally there's a whole thread about the glitch that was just created:

 

Share this post


Link to post
Posted (edited)
1 hour ago, intacowetrust said:

Got me thinking, I wonder is the fake 'floating' wall effect just a happy coincidence of how the PSX renderer works?

I actually doubt that is the linedef deletion bug, to me it looks like what happens in an OpenGL renderer when the sky is not handled 100% correctly and you have a room with a non-sky ceiling higher than a nearby sky sector.

Share this post


Link to post
17 hours ago, andrewj said:

I actually doubt that is the linedef deletion bug, to me it looks like what happens in an OpenGL renderer when the sky is not handled 100% correctly and you have a room with a non-sky ceiling higher than a nearby sky sector.

 

Yeah sorry just to clarify the picture I posted was not showing the linedef deletion bug, just the 'floating wall' trick that is possible in PSX DOOM. It was an unintentional case of that which I spotted, which got me thinking how the whole thing came about...

 

I think it works pretty much as you describe though, and there needs to be sky sectors involved. Here's another (this time deliberate) example from the GEC PSX DOOM Master Levels project, in the PSX version of 'Gotcha':

 

image.png.092d954f23dafc2cd624c51f7a22ed92.png
  

Share this post


Link to post
22 hours ago, Gez said:

Yes. It's basically just two lines of code that are missing, as detailed there:

https://doomwiki.org/wiki/Linedef_deletion

 

Looks like it might be a little more than that actually. I applied the fix in the following commit:

https://github.com/BodbDearg/StationDoom/commit/8e3956eb6c5b24f19ba0ef4ac882372e93809769

 

But still ran into the problem:

image.png.fafb65c2eeddfbd087c8a21336f076f6.png

 

There might be a few more cases in the engine where out of bounds checks are required.

Share this post


Link to post

Could be interesting to do the same reverse-engineering work on Final Doom, and look for the differences, besides the obvious ones related to level progression and the differences in map format.

Share this post


Link to post
7 hours ago, intacowetrust said:

There might be a few more cases in the engine where out of bounds checks are required.

 

Aha... Just a had a thought! Actually it might be inlining that is the issue. I fixed the function but it looks like the compiler might have decided to inline it in a couple of places too. I'll need to reverse those and un-inline in order to fix. Will try that in a while and see if it makes the problem go away.

 

6 hours ago, Gez said:

Could be interesting to do the same reverse-engineering work on Final Doom, and look for the differences, besides the obvious ones related to level progression and the differences in map format.

 

Indeed, I would like to do that eventually too.

Share this post


Link to post
On 1/8/2020 at 5:25 AM, Gez said:

Of particular note is the mention that while the bug exists in PSX Doom, it was fixed in PSX Final Doom.

Lost souls spawning through walls was fixed. Linedef deletion is not fixed to the best of my knowledge, as the bug is still in Doom 64.

Share this post


Link to post

Finally managed to fix the linedef deletion problem! Turns out there were 3 separate (but slightly different) versions of 'P_UnsetThingPosition' that had the same bug.

 

After fixing up each version of the function the problem went away and I was unable to reproduce again. Possible there might still be some more dodgy blockmap code in there (there are still other refs to the blockmap that I not yet reversed) but this seems to solve most of the problems for now.

 

I've marked the 3 points where the fixes were made in the following commit:

https://github.com/BodbDearg/StationDoom/commit/b34c232fd833d5df23d652c6da6353424d62dc23#diff-670a319cfbc1e44e6bf73073a0886427

 

Share this post


Link to post

This work and efforts are an amazing thing to the Doom community. I'll follow them.
Excited to see this running on other platforms!

Share this post


Link to post
On 1/1/2020 at 3:06 PM, Redneckerz said:

PSX Doom runs at 30 fps because its a well optimized port.

What I mean is that this port is running limited at 30 fps while Phoenix Doom runs without limitations, so it easily reach over 60 fps. That's why I'm asking.

Share this post


Link to post
8 hours ago, CoTeCiO said:

What I mean is that this port is running limited at 30 fps while Phoenix Doom runs without limitations, so it easily reach over 60 fps. That's why I'm asking.

 

Actually just to clarify, Phoenix Doom is capped also - albeit at 60Hz. The timebase for game tics in the 3DO version of the game was 60Hz, unlike the 15Hz tics in Jag/PSX and 35Hz tics on PC. I guess maybe there was some more optimism for hitting higher framerates at the start of the project :) Note also that some code in the PSX version runs at 30 Hz - mainly player movement and rendering. (though demos cap the framerate at 15Hz for consistency)

 

Anyhows... I took full advantage of that timebase change in the 3DO version to try and make the game as smooth as possible and run at a steady 60Hz. Future improvements though might involve interpolating to move beyond 60Hz, or even extending the timebase to 120 (or more) Hz by just doubling the time values etc. - the 3DO version doesn't have to worry about demo compatibility so those kinds of changes can be done without breaking anything.

Share this post


Link to post

How about instead of "psyqdoom" the name could be "psyqoom", rolls off the tongue slightly better imo and matches up with the "replace the d with some other letter" trope of some ports like boom and vavoom

Share this post


Link to post
On 1/12/2020 at 12:49 AM, therektafire said:

How about instead of "psyqdoom" the name could be "psyqoom", rolls off the tongue slightly better imo and matches up with the "replace the d with some other letter" trope of some ports like boom and vavoom

 

Thanks for the suggestion!

 

I've been thinking about the naming situation a little more and 'PsyDOOM' seems like it might be the front-runner for the following reasons:

  • It encodes that the project is related to both DOOM and the PlayStation, which was something I was hoping for in a name.
    • The 'PS' serves as an embedded reference of sorts to 'PlayStation'.
    • 'PSY' refers to the PlayStation SDK (PSY-Q)
    • 'PSY' also refers to the legendary studio that is synonymous with the history and development of the PlayStation, Psygnosis (later 'Studio Liverpool'). I think such a name is a nice tribute to that.
  • It's easy to say, not too long, and rolls off the tongue.
  • It sounds pretty cool!
  • It's still different textually to the old 'PsiDoom' port mentioned earlier. I think the potential for confusion should be minimal, especially given that the other project has not been touched in over 22 years.

 

I think I might go with this shortly, unless there are other suggestions which can top it. Want to get this finalized soon before the current name becomes too embedded in people's minds and in search engines :)

 

Share this post


Link to post
1 hour ago, intacowetrust said:

 

Thanks for the suggestion!

 

I've been thinking about the naming situation a little more and 'PsyDOOM' seems like it might be the front-runner for the following reasons:

  • It encodes that the project is related to both DOOM and the PlayStation, which was something I was hoping for in a name.
    • The 'PS' serves as an embedded reference of sorts to 'PlayStation'.
    • 'PSY' refers to the PlayStation SDK (PSY-Q)
    • 'PSY' also refers to the legendary studio that is synonymous with the history and development of the PlayStation, Psygnosis (later 'Studio Liverpool'). I think such a name is a nice tribute to that.
  • It's easy to say, not too long, and rolls off the tongue.
  • It sounds pretty cool!
  • It's still different textually to the old 'PsiDoom' port mentioned earlier. I think the potential for confusion should be minimal, especially given that the other project has not been touched in over 22 years.

 

I think I might go with this shortly, unless there are other suggestions which can top it. Want to get this finalized soon before the current name becomes too embedded in people's minds and in search engines :)

 

You know what, go for it. Even when similar its pretty obvious how vastly different both ports are :)

 

And hey, this brings the PSX renderer to PC, which is always great.

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
×