icecoldduke Posted March 7, 2021 (edited) Hey, I wanted to show the next round of my effort to try and re-create the original Heretic 2 source code. This time I won't take it down unless Raven or someone from Activision asks(just send me a nice DM, I'll take it down immediately :) ). Source Effort 1.0: ref_gl.dll from Quake 2 has been modified to load Heretic 2 data. Source Effort 2.0: Quake2.dll. I have got Heretic 2 running without any closed source bits; I modified the Quake 2 GPL release, to become the "quake2.dll" in Heretic 2. The code changes I made to create the new "quake2.dll" foundation aren't made hap hazzardly; I have mapped enough functions in quake2.dll and was able to use hex rays to help me make the needed code modifications to get this far. I have got the foundation on its feet, just a few big things are left: 1) 3rd person camera has to be re-created. 2) Player pmove needs to be re-written based on the hex rays output of the original Quake2.dll. 3) Client effects need to be hooked up the network replication. 4) Minor things like obituary notifications and such. The intro to the game (ssdocks) "runs" the camera positions and orientations are off since all of that code is in original quake2.dll, and of course you can't move since I need to port over pmove. PMove I think should be alright to port, but the c compiler made a lot of optimizations to their camera system that makes it really hard to follow. I'm reaching out to see if anyone would be able to re-create the third person camera for Heretic 2? Github: https://github.com/jmarshall23/Heretic2/tree/Engine-DLL Edited March 8, 2021 by icecoldduke 20 Share this post Link to post
omx32x Posted March 8, 2021 wait heretic 2 doesnt have its source code public available? kinda weird even considering how few copies it sold did it get lost? or destroyed? or they just never released it? 0 Share this post Link to post
icecoldduke Posted March 8, 2021 2 minutes ago, omalefico32x said: wait heretic 2 doesnt have its source code public available? kinda weird even considering how few copies it sold did it get lost? or destroyed? or they just never released it? As far as we know its just never been released. However since its never got a proper steam release, its suspected the original source code was lost. 1 Share this post Link to post
Murdoch Posted March 8, 2021 (edited) Good luck man, that's a bold task. I do not think there's ever been a bigger difference in intent from the final game and the engine it used than Heretic II and Quake II - at the least not from the time period. 1 Share this post Link to post
icecoldduke Posted March 8, 2021 1 minute ago, Murdoch said: Good luck man, that's a bold task. I do not think there's ever been a bigger difference in intent from the final game and the engine it used than Heretic II and Quake II. Luckily a good portion of the changes the core tech team at Raven did for Heretic 2, were actually in the released DLL's, which we have source code for. I've already completely reverse engineered the ref_gl.dll and the code in my depot already supports m8 and flex model formats, and render correctly. The part I was concerned about initially was Raven completely re-wrote the physics system in Heretic 2, but luckily all of those bits are in the released game dll and player.dll, with some minor exceptions like SV_TraceBoundingForm, which is just a modified SV_Trace, that essentially does the same thing but fills in some bits like stepheight and such. So I think the last reminaing big tasks are pmove and the camera stuff. Then obviously getting the client effects replication working so particle effects work, and then its just filling in the rest of the functions and some code deltas, then this is done aside from multiplayer. The other big change Raven did for Heretic 2 was the client side prediction, which was all inside the Quake2.dll. I don't plan on taking those changes over, they are very complex, multiplayer isn't even on my radar, but its possible those changes aren't needed in 2021, since the original game was designed to run on a 56k modem. 0 Share this post Link to post
Murdoch Posted March 8, 2021 14 minutes ago, icecoldduke said: The other big change Raven did for Heretic 2 was the client side prediction, which was all inside the Quake2.dll. I don't plan on taking those changes over, they are very complex, multiplayer isn't even on my radar, but its possible those changes aren't needed in 2021, since the original game was designed to run on a 56k modem. Somehow i doubt anyone is desperate to see the multiplayer resurrected so i think you can be forgiven for not doing anything there. 1 Share this post Link to post
icecoldduke Posted March 9, 2021 I got the third person camera working. 7 Share this post Link to post
icecoldduke Posted March 9, 2021 Fixed lightmap support and widescreen support. Next step reverse engineering Heretic 2's pmove code so the player can move. 4 Share this post Link to post
seed Posted March 9, 2021 Yee, another icecoldduke project 🦊. You don't seem to be running out of ideas for sure. But don't misunderstand, I'm praising it, a Heretic 2 port would be very nice since this game enjoys total obscurity now thanks to no commercial release. 0 Share this post Link to post
omx32x Posted March 9, 2021 seens like the game is also abandonware from my quick search i did maybe if this gets flashed out it can even serve as a bases to a possible rerelease like strife but lets not jump the gun here keep up the good work dude 0 Share this post Link to post
Doom_Dude Posted March 9, 2021 This is pretty interesting. I can't imagine how much work it would take to do this and I really would love to know if Raven really lost the code or they're just sitting on it. They completely abandoned their roots with making fantasy based games and are in some kind of Call of Duty funk. Several + years ago I made some bladematch levels when my friends and I were playing Heretic 2. We basically played everything you could find, no matter what game mode it was made for. We were using Talon's T-Mod and he had a lot of cool stuff in there. At one point I was going to make a SP episode where you play as a guy from a Insect Extermination Guild. lol. 0 Share this post Link to post
omx32x Posted March 9, 2021 12 minutes ago, Doom_Dude said: This is pretty interesting. I can't imagine how much work it would take to do this and I really would love to know if Raven really lost the code or they're just sitting on it. They completely abandoned their roots with making fantasy based games and are in some kind of Call of Duty funk. Several + years ago I made some bladematch levels when my friends and I were playing Heretic 2. We basically played everything you could find, no matter what game mode it was made for. We were using Talon's T-Mod and he had a lot of cool stuff in there. At one point I was going to make a SP episode where you play as a guy from a Insect Extermination Guild. lol. i think the fact that they just make cod these days is activision faulty funny thing is it seens like they are the most hated cod developer on the fanbase shame they are a shadow of their former glory 0 Share this post Link to post
ETTiNGRiNDER Posted March 10, 2021 Good luck, I hope the project goes better this time. 0 Share this post Link to post
icecoldduke Posted March 11, 2021 I ported over the Quake 3 pmove code and thanks to Paril on the Quake Mapping Discord, he supplied some fixes for the collision code in Quake 2. So the player can move around. I also started the replication for the client entities, the portal VFX now renders. On 3/9/2021 at 6:05 PM, ETTiNGRiNDER said: Good luck, I hope the project goes better this time. What's nice this time around is I have full source to everything, its just a pain filling in the missing bits, especially when you can't trust the quality of the collision detection code(again thanks Paril for helping out with that). 2 Share this post Link to post
omx32x Posted March 11, 2021 damn dude you work fast must be a hell of a coder 0 Share this post Link to post
icecoldduke Posted March 14, 2021 (edited) Some bigger updates(most technical). I got more VFX replication working(evident by the lens flares working). I have combined everything into a single executable(before Heretic 2 was spread across multiple DLL's); i needed to do this so I can eventually remove Raven's memory manager in the code. Also got 64bit on its feet, while it loads in, the flex models aren't rendering correctly in 64bit for some reason. 2 Share this post Link to post
icecoldduke Posted March 16, 2021 (edited) x64 now runs, as evident in this screenshot and I'm at the point were I can remove the 32bit platform, and also got the hud completely working. Edited March 16, 2021 by icecoldduke 0 Share this post Link to post
Dark Pulse Posted March 16, 2021 Can't wait for that HUD scaling option. Imagining that in 4k is not gonna be fun. Even games later than that can have that problem. Look at Unreal II, for example... Good luck reading your status! 0 Share this post Link to post
icecoldduke Posted April 4, 2021 First update video: I fixed a lot of things since the last post: one of the more evident bits in there is swimming now works, game plays significantly better, gameplay mechanics are now working a lot better, check out the video and let me know your thoughts. 4 Share this post Link to post
MLGari Posted April 5, 2021 NOW THAT'S WHAT I CALL FUCKING COOL AND AWESOME 0 Share this post Link to post
Murdoch Posted April 5, 2021 17 hours ago, icecoldduke said: let me know your thoughts. My thoughts are going something like "JESUS THIS GUY IS A CODING NINJA". 1 Share this post Link to post
bladerunner Posted April 11, 2021 Great news! Hopefully "it will also read/write/load savegames so it works this time around I am just a mapper not a programmer and envy you guys. But I was wondering why no ever tried doing this with a modified Quake2 such as "KMQuake2". It already has all these features below incorporated into it and provides the source code for it as well. 5/06/20 KMQuake2 0.20 Besides lots of bug fixes, this update will also include the following changes from the development branch: Added support for triple-monitor surround modes via custom resolutions. Added Windows DPI scaling detection from Yamagi Quake2. Added 3840x1600 and 4096x2160 video modes. Added support for 160Hz and 240Hz refresh rates. Added cel shading. Shadow volumes will now be drawn even if the model isn't in view. Added font upscaling (with optional blending by Skuller from Q2Pro) for old 128x128 fonts. Added adjustable horizontal offset to third-person mode. Added support for quake2:// URLs. Added UDP fallback from HTTP downloads and support for Q2Pro-style HTTP URLs. Now reads/writes savegames, config files, demos, etc. to the user profile Saved Games folder, and auto-downloaded files are now written to to the user profile Downloads folder. This eliminates the need to run the game in Administrator mode when file permissions issues are present. Now compresses .sav and .sv2 savegame files into .savz files. Added basegame3 cvar to load data from up to 3 other other mods. Works in conjunction with basegame and basegame2, which must be set first. Screenshots now go up to 9999. Instead of contacting me to get access to private pre-release builds, I've set up a Bitbucket repo with nightly test builds of this latest update. The full source code is also viewable. Please email me with any bugs you may find. https://bitbucket.org/Knightmare66/kmquake2_stable/downloads/ ------------------------------ Key Features ------------------------------ - Eliminates the limit of 256 each on models, sounds, and images- no more index: overflow errors! - No more SZ_Getspace: overflow errors - Supports up to 8000 entities per map, up to 2000 in view at once - Supports maps with large coordinate ranges, maximum of +/-16384 - Supports maps compiled with large chop values, up to 1024 - Supports server-side player speed control for class-based mods, etc. - Supports server-side control of entity transparency - Supports server-side control of looped sound attenuation - Includes default Lazarus DLL with ACE bots, CTF and 3Team CTF support - Uses modified Quake2maX particle effects - Improved menus and console (uses some code from Quake2maX) - Streamlined, more memory-efficent adaptation of decal system from Quake2maX - TGA, PNG, and JPG texture, skin, and pic autoloading - Autoscaling of hi-res replacement textures - Support for MD3 models - *.pak and pk3 support - Ogg Vorbis soundtrack support - RoQ support - Alpha test surface support for easy rendering of textures with holes/cut-outs - Trans33 and Trans66 flag combining for textures with alpha-channel controlled transparency - Supports rendering transparent surfaces with lightmaps - Supports moving and animated transparent surfaces - Integrated support for Lazarus footstep sounds 0 Share this post Link to post
bladerunner Posted April 11, 2021 (edited) Maybe icecoldduke can incorporate what he needs from KMQuake2. Like Multiplayer, savegames, etc...It might be worth it to look at the code he has for it. KMQuake2 website: http://www.markshan.com/knightmare/ 0 Share this post Link to post
icecoldduke Posted April 12, 2021 22 hours ago, bladerunner said: Maybe icecoldduke can incorporate what he needs from KMQuake2. Like Multiplayer, savegames, etc...It might be worth it to look at the code he has for it. KMQuake2 website: http://www.markshan.com/knightmare/ Thanks for that, I'll definitely take a look. I probably won't take anything graphics related though; I plan on ditching OpenGL and switching over to Vulkan or D3D12 at some point and see if I can add real time lighting via raytracing as well as a opt in feature. 2 Share this post Link to post
bladerunner Posted April 15, 2021 (edited) Hey icecoldduke is there anyway you can fix the Heretic2 toolkit HereticEd so we can build maps with Windows 10? The batch only works on WindowsXP/Vista. Probably why no one has been making many maps for Heretic II. 0 Share this post Link to post
ArgonianLord Posted April 22, 2021 (edited) Seeing the progress on this has really rekindled some hope in this game getting properly playable on modern systems again, I cannot wait until this is complete! Before I forget though, there's one graphical error in the original Heretic 2 that I feel as though it'd be nice to make you aware of if you do not know about it yourself, and it is an issue involving Corvus in the cutscenes of the game and his "injured body textures". To describe the error, in the 1.06 patch (Raven's official patch for Heretic 2) a graphical bug will show up later in the game when Corvus has been infected with the plague and has his skin textures change to the pale-white color to reflect his affliction. So how does the graphical bug manifest?, well most of the time when you enter cutscenes while injured in any way Corvus will have parts of his body textures revert to his "healthy pre-infected" skin textures in the first episode of the game. I have no idea if there's any easy fix for this or if you know how to fix it yourself, but it is a problem not many seem to bring up and as such I figured it was best to bring it up to you when you're working on recreating the game's sourcecode and such. I'm sorry if my description of this old graphical bug is confusing, I'm pretty bad at formulating myself on these sorts of things. And as such I also figured I'd post a picture of the problem so you see exactly how it looks like. https://imgur.com/xvpozYr 0 Share this post Link to post
bladerunner Posted April 25, 2021 How is the Heretic 2 - Source code recreation part 2 progressing icecoldduke... 0 Share this post Link to post
bladerunner Posted May 2, 2021 Nothing has been entered in his repository for Heretic 2 - Source code recreation part 2 in two months. Did he give up on it? https://github.com/jmarshall23/Heretic2 0 Share this post Link to post
deus-ex Posted May 2, 2021 No, currently he's active in different repositories of his, namely Doom3 and Quake4BSE, as you can gather from the contributions timeline in his overview page (screenshot). Clicking on a green item in the timeline reveals its related activity. 1 Share this post Link to post