VOGONS

Common searches


First post, by ptrie

User metadata
Rank Newbie
Rank
Newbie

There have been discussions on this board in the past about the performance of this game [1]. I recently started playing it for the first time, but have been frustrated by the stutter that occurs every few steps when moving around, even with the "optimal" configuration of a 486 33 plus RAM drive. Thanks to the open source UltimaHacks [2], and the toggleable frame limiter in Serpent Isle, I was able to patch The Black Gate with a similar solution.

Serpent Isle has a loop that waits until 6 firings of a 60 Hz timer have passed before updating the game world, giving a maximum of 10 per second. Thankfully The Black Gate also uses a 60 Hz counter, so it wasn't too difficult to add a similar waiting loop. I'm not confident there are no bugs, but so far I'm happy with it.

I've uploaded a video of walking around the starting area in the game to show the new smooth movement that's possible [3]. It was captured with DOSBox with core=dynamic/cycles=max, but I also got good results with a Pentium in PCem. I turn the frame limiter off at the end of the video so you can see how fast the game would be running without the patch. You can compare the game speed with user Cloudschatze's video taken on a 486 33 with a RAM drive [4].

I've attached a patch file which can be applied with the UltimaHacks Applier website [5] that contains just the frame limiter, always enabled. I have a version that is toggleable and contains all the other UltimaHacks patches on my GitHub fork of the project [6].

[1] Measuring Performance in Ultima VII : The Black Gate The ultimate Ultima 7 machine
[2] https://github.com/JohnGlassmyer/UltimaHacks/
[3] https://youtu.be/rRdBOJPj--8
[4] https://youtu.be/K_YRY-nSI7Q
[5] https://johnglassmyer.github.io/UltimaHacks/
[6] https://github.com/ptrie/UltimaHacks/raw/mast … hacks/u7bg.hack

EDIT: Uploaded version 2 of the patch. Hex edit byte 19Ah to change the delay value (e.g. 06 -> 0A).

Attachments

Last edited by ptrie on 2021-04-11, 14:25. Edited 1 time in total.

Reply 3 of 11, by shamino

User metadata
Rank Oldbie
Rank
Oldbie

This is outstanding. I remember having to finish this game on a Cyrix 6x86. Mo'slo made it passable, but I still felt like it was too fast. I had played much of the game on a very slow 386SX, then my 486 was too unstable to play the game at all. Thus still needing to finish it when the 6x86 came along, and not being happy with how fast it was. I was used to the in-game days being long, and suddenly they were zipping by.
This patch would have been perfect, and if I play the game again I'll definitely use it.

Scope creep suggestion - would it be possible to make the frame limiter adjustable to user preference?

Reply 5 of 11, by ptrie

User metadata
Rank Newbie
Rank
Newbie

Thanks for the kind words everyone!

shamino wrote on 2021-04-08, 15:17:

Scope creep suggestion - would it be possible to make the frame limiter adjustable to user preference?

I thought about this too - at 10 Hz , it's possible to run around pretty quickly, and characters can die in battle before you know it - what would it be like at a slower rate? Just now I briefly tried 7.5 Hz, and it's still a good experience, maybe even superior. Going down to 5 Hz, my first impression is that movement is too slow, but some may prefer it.

I'll think about adding an in-game selector, but for now the simplest way to do this is to hex edit the patch - byte 210h is 06. This is how many ticks of the 60 Hz timer need to pass, so change it to 08 for 7.5 Hz and 0C for 5 Hz, etc. Of course the source code is available too for those comfortable with recompiling.

Reply 6 of 11, by newtmonkey

User metadata
Rank Member
Rank
Member

This is great work! U7 is one of most finicky games to play when it comes to speed, so this goes a long way toward resolving that. Thanks so much!

I'd be interested in an in-game selector also, but will hex edit for now to try 7.5 Hz.

Reply 7 of 11, by ptrie

User metadata
Rank Newbie
Rank
Newbie

OK I've added in-game adjustment of the frame limiter, leveraging some of the cheat menu code in the game. I'm really happy with how this turned out, thanks for suggesting it! Pull up the prompt with Alt+8. This time I've only made a version that includes all the UltimaHacks changes, since separating the key input handling would be extra work. You can experiment with different delay settings with this one, and then hex edit your final choice into the original patch if you don't want the other changes.

https://github.com/ptrie/UltimaHacks/raw/mast … hacks/u7bg.hack

Attachments

Reply 8 of 11, by Dagar

User metadata
Rank Newbie
Rank
Newbie

This is excellent! Very much appreciated ptrie.

Works great in DOSBox with your settings above. Also tested it out in PCem v17 using MS-DOS Version 6.22, 486 Award SiS 496/497, Intel Pentium OverDrive/63 and it also works great.
I usually have my PCem DOS config set to use a i486/DX266 but still had hitching even with the frame limit patch so I bumped it up to Intel Pentium OverDrive/63 to fix that.

I like the value of 8 over the default of 6 - what would I hex edit to make that the default?
EDIT: seen your post above about the value to hex edit.....now sorted at 8.

Reply 9 of 11, by newtmonkey

User metadata
Rank Member
Rank
Member

I just tested this on my actual DOS machine (P133) and it works great! I found a setting of 10 to be just right, anything lower seemed a hair too fast to me, though that may be based on my experience playing the game back in the day on a very low spec PC haha.

Reply 11 of 11, by ptrie

User metadata
Rank Newbie
Rank
Newbie

I think the patch can cause a crash or hang if the overlay segment where I put the delay loop is unloaded. I've uploaded a v2 which overwrites some (I hope) unused code in a regular segment instead. I'm still getting used to this 16-bit world!

I also wanted to call attention to NewRisingSun's patch to the game's MT-32 driver ((Yet Another) Ultima 7 & MUNT issue). I noticed using MT-32 sound caused occasional stutters and long load times even on a fast machine with the frame limiter, so I looked into it and was about to post a 3 byte patch, but quickly searched and found that a fix was posted here 10 years ago! Not sure how well known it was, but with these two patches I'm able to get stutter-free gameplay.

Thanks for sharing your preferred delay values - I'm using a slower one in my playthrough now. I think I'll leave the default as it is though to match Serpent Isle.