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

The Doom 64 Source Code Released! (Reverse Engineering)

Recommended Posts

On 9/30/2021 at 11:35 AM, Koko Ricky said:

I have seen two examples of nearest-neighbor rendering on the N64. For whatever reason, the badges in Star Fox 64 (they are awarded for completing missions and appear on the overworld hun) are unfiltered, as are the background buildings in the opening map for Perfect Dark 

Hexen 64 also lets you turn off the filter and witness the pixels in all their... glory?

 

The reason most N64 games used purely filtered graphics is simple: It was the N64's big technical trump card over the PS1, why not use it (even if it doesn't suit your art)?

Share this post


Link to post

now with a more clear head i can see your points better and i apologize to @Edward850 for my comments

 

what i was thinking yesterday was alternative ways of achieving the same effect without the hardware cost but thinking more it might not be as easy to implement an alternative as i though

Share this post


Link to post
9 hours ago, Edward850 said:

@Gibbon If you want options, Doom64 is available on Stadia (stop laughing)

Well now you're just asking me to point and laugh lmao

Share this post


Link to post
21 hours ago, Edward850 said:

Doom64 was only one of maybe two titles tops that was running 1440P@60 FPS on the Xbox One S. I had version nuts.wad playable on the Switch's lowly 1Ghz ARM CPU, while the base game pushed 60FPS effortlessly at 1080P.

Heck we still had an OpenGL 3.2 renderer in it. The game ran on damn near anything far and beyond what it had any right to run on. Bloated it most certainly wasn't.

You quite literally told that to a certain John Linneman didn't you now ;) And it is impressive as heck, too. Certainly caught my attention when you stated this. Its an impressive showing for what in essence are two mildly overclocked Athlon 5150's stapled together with 8 GB DDR3, ESRAM and a Radeon 7790 equivalent GPU.

Color my interest though; What was the other gaming running 1440p60 on Xbox One?

 

19 hours ago, omalefico32x said:

 i still think that the remaster is bloated and could have been optimized better

But the game isn't bloated at all.

18 hours ago, Edward850 said:

 

Like seriously, I can brute force Doom64 to 60FPS out of a software rendered implementation of Vulkan, which is insane. 

Despite using a hefty Threadripper to achieve that, that actually is really impressive considering. CPU-only rendering is so much slower than anything hardware accelerated nowadays, i am impressed with this. If you were to use Microsoft WARP, which is the native software renderer in Windows, i reckon you would get a lot less performance out of it, despite WARP being tuned for performance. Vulkan really helps here.

Share this post


Link to post
9 hours ago, Kinsie said:

Hexen 64 also lets you turn off the filter and witness the pixels in all their... glory?

 

The reason most N64 games used purely filtered graphics is simple: It was the N64's big technical trump card over the PS1, why not use it (even if it doesn't suit your art)?

This is getting tangential, but I would argue that literally no N64 title has assets high resolution enough to warrant filtering. If Doom's scale implies about one meter per 32 pixels, then we're talking about 1.2 pixels per inch, or 14.4 per foot. Texture filtering starts to make sense when the textures are three to four times this density, as seen in Quake 3 Arena, to use an id game as a reference point.

 

However, the N64's hardware has a pathetic 4kb texture cache, limiting the texture size to 32×32 and 64×64 in many cases, so for lots of games you're dealing with about 4 to 8 pixels per foot, sometimes significantly less. This makes for some obscenely ugly results when filtering is applied. 

Share this post


Link to post
5 hours ago, Redneckerz said:

Despite using a hefty Threadripper to achieve that, that actually is really impressive considering.

Note, it was a threadripper, but you'll notice I only gave it 6 cores, and you could manage it on 4 if you turned off the N64 filter. I got diminishing returns past that, probably related to rendering between two CCXs was throttling the memory speeds.

Share this post


Link to post
1 hour ago, Edward850 said:

Note, it was a threadripper, but you'll notice I only gave it 6 cores, and you could manage it on 4 if you turned off the N64 filter. I got diminishing returns past that, probably related to rendering between two CCXs was throttling the memory speeds.

I'd presume my 5900X (which is also a 12-core/24 thread CPU) would fare about as well, then?

Share this post


Link to post
8 hours ago, Dark Pulse said:

I'd presume my 5900X (which is also a 12-core/24 thread CPU) would fare about as well, then?

Seemingly, yes. Getting a build of it however is a fun challenge, compiling it looks like a real nightmare but I found a loose build of it on github.

Share this post


Link to post
22 hours ago, Koko Ricky said:

I would argue that literally no N64 title has assets high resolution enough to warrant filtering. 


I used to believe this, and indeed Doom 64 and other games often do look fantastic without filtering. So I was pretty excited when Quake 64 appeared as DLC for the Quake Rerelease, as I could turn off the filtering. Then I learned the texture scales in Quake 64 are all over the place. Like some of the walls are massively low resolution while the buttons are relatively high resolution. Given the pixel scales are so different, Quake 64 looks disjointed to me without filtering, and the filtering goes a long way to hide that. It makes me wonder what other titles may suffer similar issues.

Share this post


Link to post
On 10/1/2021 at 1:56 AM, KainXavier said:

I would argue that Nightdive’s port is comparable to PsyDoom.  I believe PsyDoom takes a more emulation-centric approach but the end-result is more or less the same.  Both teams had to reverse-engineer the game engine and recreate any quirks specific to the platform it ran on.  One team replaced the renderer with something that uses Vulcan natively.  The other team probably wrote overrides for it so Vulcan winds up being used instead.

 

Just to add to this a little, the Vulkan renderer in PsyDoom is entirely optional and the original PlayStation render path still exists intact - albeit with some tweaks and improvements (Vulkan does not replace it). The original render code is preserved for purists who want the old PlayStation look with all it's strange artifacts and imprecisions or for older computers that cannot support the Vulkan API. It also leaves the door open for platforms that have no Vulkan support but which still have an SDL2 implementation - Vulkan support can be compiled out the PsyDoom binary if required.

 

This original render path uses reverse engineered re-implementations of the Sony PlayStation graphics libraries and an emulation of the PlayStation GPU internally.

 

If one wanted to port D64 to PC using this source release you could in theory take a similar approach and try to mimic the original platform SDKs and underlying hardware. @Erick194 has already done all of the hard work to convert all of the game code to C so it's really that layer which needs to be replaced for a PC port along with additional new platform considerations, like adding keyboard + mouse support, an exit option on the main menu and so on...

 

I'm sure eventually somebody is going to have a shot at producing an open source port of D64 based on this - it's only a matter of time.

Share this post


Link to post
18 hours ago, Immorpher said:


I used to believe this, and indeed Doom 64 and other games often do look fantastic without filtering. So I was pretty excited when Quake 64 appeared as DLC for the Quake Rerelease, as I could turn off the filtering. Then I learned the texture scales in Quake 64 are all over the place. Like some of the walls are massively low resolution while the buttons are relatively high resolution. Given the pixel scales are so different, Quake 64 looks disjointed to me without filtering, and the filtering goes a long way to hide that. It makes me wonder what other titles may suffer similar issues.

I hate the way Quake 64 looks in all honesty. Filtering may make for a more consistent look, but a blurry mess is a blurry mess. It's just shitty and cheap looking to me. However, I was watching a Digital Foundry video on real-time water rendering, and indeed games like Wave Race 64 look good with filtering, but I'd still rather see it in nearest neighbor. I just can't get down with giant smeary texels. 

Share this post


Link to post
6 hours ago, intacowetrust said:

If one wanted to port D64 to PC using this source release you could in theory take a similar approach and try to mimic the original platform SDKs and underlying hardware.

The Mario 64 PC port actually does this using this implementation of the N64's Fast3D renderer: https://github.com/Emill/n64-fast3d-engine

 

This in turn could be used for a Doom 64 port based upon this decompilation.

Share this post


Link to post
On 10/2/2021 at 7:19 PM, Kinsie said:

Hexen 64 also lets you turn off the filter and witness the pixels in all their... glory?

 

The reason most N64 games used purely filtered graphics is simple: It was the N64's big technical trump card over the PS1, why not use it (even if it doesn't suit your art)?

I wouldn't say it's the only trump considering how warpy and unstable PS1 graphics looked.

Share this post


Link to post

Does the release of the source code mean we might get a GZDoom equivalent for Doom 64? It's possible to use Doom 64 resources in UDMF, but I think it needs its own advanced port so modders can work just within it, rather than it being tied to PC Doom code. 

Share this post


Link to post
32 minutes ago, Koko Ricky said:

Does the release of the source code mean we might get a GZDoom equivalent for Doom 64? It's possible to use Doom 64 resources in UDMF, but I think it needs its own advanced port so modders can work just within it, rather than it being tied to PC Doom code. 

DZDoom will basically be that. (Or its current incarnation, the GEC Master Edition for GZDoom.)

Share this post


Link to post
14 hours ago, Dark Pulse said:

DZDoom will basically be that. (Or its current incarnation, the GEC Master Edition for GZDoom.)

We just call it DZDoom because we are naughty. :P

 

Its pretty amazing how accurate that port is, despite using a 5 year old GZDoom build. It implements N64/PSX style rendering and its practically flawless.

 

I mean its pretty amazing where we are at:

  • Doom 64 EX/Remaster for perfect D64 rendering
  • DZDoom for flawless D64/PSX rendering
  • PsyDoom for completely accurate PSX rendering and beyond

Its a good time to be on PC.

Share this post


Link to post
5 hours ago, Redneckerz said:

Its a good time to be on PC.

You can say that when we get a proper PC port of Goldeneye 007 lol

Share this post


Link to post
50 minutes ago, OpenRift said:

You can say that when we get a proper PC port of Goldeneye 007 lol

Is that the XBLA remake? /offtopic

Share this post


Link to post
1 hour ago, Redneckerz said:

Is that the XBLA remake? /offtopic

I mean like a Nightdive-style port of the original N64 version. Yeah, I know the rights are a whole topic unto itself, but I want Goldeneye dammit!

Share this post


Link to post
10 minutes ago, OpenRift said:

I mean like a Nightdive-style port of the original N64 version. Yeah, I know the rights are a whole topic unto itself, but I want Goldeneye dammit!

You're assuming Rare even still has the source code.  Even if it does, Microsoft owns it and probably if it was ever worth doing they would have done it already to the Xbox themselves. /off topic 

Share this post


Link to post
3 hours ago, Gibbon said:

You're assuming Rare even still has the source code.  Even if it does, Microsoft owns it and probably if it was ever worth doing they would have done it already to the Xbox themselves. /off topic 

Rare is known to keep really ancient source material for their games, like art and music, so it's very likely they still have the source code. I don't think Microsoft has the rights to Goldeneye, even if they own Rare. They would have included the game in Rare Replay if that was the case. Goldeneye is, after all, a James Bond game, based on a film by Eon Productions, so neither Nintendo nor Microsoft must have access to them.

 

I guess you could hope for an unofficial PC port more along the lines of Doom 64 EX in that case, where you supply your own ROM for the game data.

Share this post


Link to post
19 hours ago, Gibbon said:

You're assuming Rare even still has the source code.  Even if it does, Microsoft owns it and probably if it was ever worth doing they would have done it already to the Xbox themselves. /off topic 


Microsoft DID try to rerelease it on XBLA for the 360 but couldn’t secure the rights. This port was later leaked and it uses the original source code. 

Edited by Blackpuppy

Share this post


Link to post
On 10/7/2021 at 7:04 AM, Gibbon said:

You're assuming Rare even still has the source code.

Rare still has tons of things dating back to the NES days. Some photos from their "Making of Rare Replay" blog posts:

 

lkWCMrc.jpeg

a9e8CYc.jpeg

Share this post


Link to post

Tool for Doom 64 N64 by [GEC]

 

I have decided to release my tool called "D64TOOL" for people who want to make Doom64 mods on the actual N64 console.
It can convert maps, as well as compress and decompress DOOM64.WAD file without problems.
I hope it will be useful.

 

https://github.com/Erick194/D64TOOL

Edited by Erick194

Share this post


Link to post
On 10/3/2021 at 6:06 PM, Immorpher said:


I used to believe this, and indeed Doom 64 and other games often do look fantastic without filtering. So I was pretty excited when Quake 64 appeared as DLC for the Quake Rerelease, as I could turn off the filtering. Then I learned the texture scales in Quake 64 are all over the place. Like some of the walls are massively low resolution while the buttons are relatively high resolution. Given the pixel scales are so different, Quake 64 looks disjointed to me without filtering, and the filtering goes a long way to hide that. It makes me wonder what other titles may suffer similar issues.

Quake 2 Remaster lets you play Quake 2 64 without the texture filtering and oh boy a lot of the textures are small!

Share this post


Link to post
9 hours ago, Erick194 said:

Tool for Doom 64 N64 by [GEC]

 

I have decided to release my tool called "D64TOOL" for people who want to make Doom64 mods on the actual N64 console.
It can convert maps, as well as compress and decompress DOOM64.WAD file without problems.
I hope it will be useful.

 

https://github.com/Erick194/D64TOOL


Fantastic Erick! I tested it on the Doom 64 XE wad and the file size was reduced by half! This will let us pack a TON of maps on the N64 if we wanted to!

Share this post


Link to post
On 9/15/2023 at 12:13 AM, Erick194 said:

Tool for Doom 64 N64 by [GEC]

 

I have decided to release my tool called "D64TOOL" for people who want to make Doom64 mods on the actual N64 console.
It can convert maps, as well as compress and decompress DOOM64.WAD file without problems.
I hope it will be useful.

 

https://github.com/Erick194/D64TOOL

Did you ever figure out the full recompression algorithm? Last we'd talked about it, you were close, but still off by 1.06% I believe. :)

Share this post


Link to post
3 hours ago, Dark Pulse said:

Did you ever figure out the full recompression algorithm? Last we'd talked about it, you were close, but still off by 1.06% I believe. :)

Well, in this code, there are two versions, one that uses vectors and the other that doesn't. The one using vectors is slower at recompressing data, while the other is faster and compresses the data exactly as the original. Although there is one more function that is still unknown, it doesn't cause any issues when not included.

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

×