Baron of Hell
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Misc. > Everything Else > Heretic II Problems
 
Author
All times are GMT. The time now is 19:46. Post New Thread    Post A Reply
Quasar
Moderator


Posts: 4615
Registered: 08-00


Heretic II. Cool game. Shame the source was never released, though, because it is rapidly accumulating problems when running on modern systems.

To spare anybody else interested in it from searching the web in vain for hours trying to find a solution to one of them, I will document it here.

If you start up the program in OpenGL mode on pretty much anything newer than a Voodoo or a Rage Pro, it will crash. The crash is a common idTech 2 issue and results from Carmack's incessant use of sprintf() on fixed-size buffers - it tries to read in the OpenGL extensions string at startup just to show it to the user, but on modern cards this string is way longer than they anticipated.

To fix this, open ref_gl.dll in a hex editor of your choice and find the string "GL_EXTENSIONS: %s". Change the %s to "xx" or any two other characters not including a %. This will disable sprintf from accessing the too-large string passed to it.

Unfortunately the music also won't loop in Windows 7, which is a ANOTHER bug in the MCI API on that platform. I don't have a solution for this one yet.

Old Post 02-01-12 04:29 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
GooberMan
Scripting Nut


Posts: 1097
Registered: 02-01


How feasible would it be to Strife it? It's a Q2 engine game IIRC, can't be too big a difference between engine and DLL communications.

/me prepares to eat own words.

Old Post 02-01-12 06:46 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
printz
CRAZY DUMB ZEALOT


Posts: 6847
Registered: 06-06



Quasar said:
The crash is a common idTech 2 issue and results from Carmack's incessant use of sprintf() on fixed-size buffers - it tries to read in the OpenGL extensions string at startup just to show it to the user, but on modern cards this string is way longer than they anticipated.
That's real dumb.


To fix this, open ref_gl.dll in a hex editor of your choice and find the string "GL_EXTENSIONS: %s". Change the %s to "xx" or any two other characters not including a %. This will disable sprintf from accessing the too-large string passed to it.
Thank you. I hope it will work. Even though I'm not much of a Heretic 2 fan, I'm pissed that I can only get to play Heretic 1.

Old Post 02-01-12 08:56 #
printz is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Doom Dude
Senior Member


Posts: 1171
Registered: 12-00


nevermind

Last edited by Doom Dude on 02-02-12 at 14:01

Old Post 02-01-12 11:58 #
Doom Dude is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



GooberMan said:
How feasible would it be to Strife it? It's a Q2 engine game IIRC, can't be too big a difference between engine and DLL communications.

/me prepares to eat own words.


If I were more knowledgeable of the idTech 2 architecture, the project would be of similar complexity to Chocolate Strife.

This is because the Quake 2 source for the core engine is available, and I've also been told that the Heretic II game DLL source code is supposedly available *somewhere* (I have never found it so far though), and with those two together, putting the missing puzzle pieces together in IDA Pro would be simple.

So then you'd take some advanced Quake 2 source port and do some Chinese Copypasta, as I like to call it. Voila, Heretic II source port.

There are a couple of things that would get lost in the mix, however. The Creative EAX code in the sound engine is patented and copyrighted and would need to be dropped. The Smacker library used for videos is also highly proprietary and a successful attempt at reversing it would probably result in a lawsuit.

The best that could be done for the videos would be to de-mux them and then re-encode them into some open-spec format, right on the end-user's machine.

Last edited by Quasar on 02-01-12 at 18:41

Old Post 02-01-12 18:35 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Snarboo
Forum Staple


Posts: 2073
Registered: 09-04



Quasar said:
The best that could be done for the videos would be to de-mux them and then re-encode them into some open-spec format, right on the end-user's machine.
The way I "fixed" this was by ripping the music right off the disk, then running it outside of the game in a separate media player. It's an inelegant solution, but it works.

I didn't run into too many issues while playing through Heretic II a few months ago on Windows 7, but I was probably using the Direct3D renderer.

Old Post 02-01-12 20:09 #
Snarboo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Enjay
ASK ME ABOUT FOOTBALL / STEAM / DEAD CELEBRITIES / THE BLAIR WITCH PROJECT


Posts: 5595
Registered: 12-00


Good to see some love for Heretic II. I thought it was a pretty decent game but it seems to get a bit of a hard time from some people.

Old Post 02-01-12 21:00 #
Enjay is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



Snarboo said:
The way I "fixed" this was by ripping the music right off the disk, then running it outside of the game in a separate media player. It's an inelegant solution, but it works.

I didn't run into too many issues while playing through Heretic II a few months ago on Windows 7, but I was probably using the Direct3D renderer.


There's a Direct3D renderer?

I have some ideas that I haven't ruled out on the music yet; it might be possible to fool with the DLL imports or strings, depending on how Quake 2 invokes the MCI API to do CD music, to change the function or its parameters that results in the broken looping on Windows 7.

I bet if I could get xttl interested in that particular problem, it'd be fixed within a day's time ;)

Old Post 02-01-12 22:24 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Snarboo
Forum Staple


Posts: 2073
Registered: 09-04



Quasar said:
There's a Direct3D renderer?
I could have sworn there was, but I might be misremembering. I was able to play through the game using hardware acceleration without issue. Perhaps it was added in a patch?

Edit:
I should note that I'm using an ATI card, in case that has anything to do with it. :p

Edit 2:

Enjay said:
Good to see some love for Heretic II. I thought it was a pretty decent game but it seems to get a bit of a hard time from some people.
My biggest issue with the game was how the story resolved itself. I thought it was incredibly insulting that the big bad got off Scott free.

Old Post 02-01-12 22:50 #
Snarboo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
GooberMan
Scripting Nut


Posts: 1097
Registered: 02-01


Well, technically there's a Direct3D renderer if you're running on Vista or Windows 7. All OpenGL calls are translated to Direct3D calls there with the default drivers. Might be the same for manufacturer drivers too.


Quasar said:
I've also been told that the Heretic II game DLL source code is supposedly available *somewhere*


Apparently it's in the Tool Kit. I haven't installed/extracted to confirm though.

Old Post 02-02-12 01:13 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



Snarboo said:
I could have sworn there was, but I might be misremembering. I was able to play through the game using hardware acceleration without issue. Perhaps it was added in a patch?

Edit:
I should note that I'm using an ATI card, in case that has anything to do with it. :p

Edit 2:
My biggest issue with the game was how the story resolved itself. I thought it was incredibly insulting that the big bad got off Scott free.


There's an "expansion" floating around called Ogle's Quest, and while it's unofficial, I think it does a very good job of turning that goofy ending on its head. There are some play throughs of it on Youtube if you're interested.

Old Post 02-02-12 03:15 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
printz
CRAZY DUMB ZEALOT


Posts: 6847
Registered: 06-06



Quasar said:

There's an "expansion" floating around called Ogle's Quest, and while it's unofficial, I think it does a very good job of turning that goofy ending on its head. There are some play throughs of it on Youtube if you're interested.

Wow, Heretic 2 can be modded? Awesome, maybe this way I can forget about the Doom 3 shit and try something requiring less art.

Or maybe not.

Old Post 02-02-12 09:04 #
printz is online now Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
kristus
Megablast!


Posts: 9683
Registered: 07-00


Didn't ATI and Nvidia add exceptions for the Quake 2 engine games in their drivers? I can play Vanilla Quake 2 just fine without any changes with the latest ATI drivers.

EDIT: Just tested Heretic 2 as well. Works just fine. I remember when the games using the Q2 engine crashed. But that was a few years ago now.

Last edited by kristus on 02-02-12 at 12:22

Old Post 02-02-12 10:16 #
kristus is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



kristus said:
Didn't ATI and Nvidia add exceptions for the Quake 2 engine games in their drivers? I can play Vanilla Quake 2 just fine without any changes with the latest ATI drivers.

EDIT: Just tested Heretic 2 as well. Works just fine. I remember when the games using the Q2 engine crashed. But that was a few years ago now.


ATi Radeon 4850 is not immune. Otherwise I wouldn't have been posting this thread :P

Old Post 02-02-12 12:36 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
kristus
Megablast!


Posts: 9683
Registered: 07-00


Don't they update the drivers for the 4k series?

Old Post 02-02-12 12:58 #
kristus is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Aliotroph?
postCount++


Posts: 1809
Registered: 03-02


Pretty sure it worked fine on my 4750 a couple years ago. Or was that my 8800 before that died? Hmm, I forget now. Either way, I've never had any problems with it on any of my hardware so far.

Last time I played it we were also running T-Mod, which is a clever bit of hackery that adds source-port-like features mostly in the form of extended multiplayer support. It's hard to find now, but poking in the (horrible) docs, I don't think it made any changes to prevent graphics-related crashes.

I feel the need to say I don't even like Heretic II very much. It's just a boring shooter.

Old Post 02-02-12 16:48 #
Aliotroph? is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
kristus
Megablast!


Posts: 9683
Registered: 07-00



Aliotroph? said:
I feel the need to say I don't even like Heretic II very much. It's just a boring shooter.

Me neither, I never played very far into it.

Old Post 02-02-12 17:49 #
kristus is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Snarboo
Forum Staple


Posts: 2073
Registered: 09-04



Quasar said:
There's an "expansion" floating around called Ogle's Quest, and while it's unofficial, I think it does a very good job of turning that goofy ending on its head. There are some play throughs of it on Youtube if you're interested.
Thanks! I'll have to look into that. :)

Old Post 02-02-12 17:54 #
Snarboo is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Blzut3
Junior Member


Posts: 210
Registered: 06-04



Quasar said:
The Smacker library used for videos is also highly proprietary and a successful attempt at reversing it would probably result in a lawsuit.

The best that could be done for the videos would be to de-mux them and then re-encode them into some open-spec format, right on the end-user's machine.


The Linux version uses mpeg videos. (As I cover in my conversion guide.) I guess you could always make a port of that version and avoid this issue.

Old Post 02-02-12 18:00 #
Blzut3 is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 4615
Registered: 08-00



Aliotroph? said:
Pretty sure it worked fine on my 4750 a couple years ago. Or was that my 8800 before that died? Hmm, I forget now. Either way, I've never had any problems with it on any of my hardware so far.


I WILL take this moment to note that the problem in question is inconsistent because it involves memory corruption. It's possible that, when run on different machines, or even during different runs on the same machine, that the game won't crash every time, or possibly ever, due to this issue.

And it definitely will NOT crash if your video card driver is detecting the application doing the request and moderating the length of its GL extensions string.

Anyway, why do people feel the need to comment about a posting on a crash fix for a crash they're not having in a way that suggests nobody should be having that problem? I notice this happens all the time, everywhere.

(I am not suggesting that you are doing this in particular by using the word "you" below, but it's an impression I get in general)

Just because you aren't doesn't mean there are not a lot of people who have this issue. I had this issue, and so did other people. I never suggested it happens everywhere and you know what, if it doesn't, you should be happy for yourself. That's how I see it.

Old Post 02-02-12 18:10 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
GooberMan
Scripting Nut


Posts: 1097
Registered: 02-01



Blzut3 said:
The Linux version uses mpeg videos.

Interestingly, that sheds light on how you could do a Windows port and avoid any legal issues. If a Smacker codec is installed - say, with an ffmpeg distribution - then all you need to do is configure the input pin in DirectShow with an ffmpeg decoder and let someone else assume the legal liability for you.

Of course, that only works for as long as it takes RAD to harass ffmpeg about their implementation. And it's useless for platform portability. No idea how you'd tackle an in-port implementation for Linux or OSX.

Old Post 02-02-12 22:45 #
GooberMan is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 19:46. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Misc. > Everything Else > Heretic II Problems

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Forums Directory