BT 3 MSDOS version

Any developer realated stuff
Post Reply
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

BT 3 MSDOS version

Post by drifting »

I have disassembled BT3 for DOS and have been looking at how to fix the bugs mentioned from the thread "Fixing "bad" versions" from the Thief of Fate thread.
Has anyone thought about fixing the dos and amiga versions so that slayers slay, breathers breathe, and bosses put up a fight?
The "breathers breathe" bug is a logic error in the code and would be fairly simple to patch.

The "slayers slay" I believe is in reference to the opponents' attacks not doing special attacks like poisoning, critical hit, wither, etc. From the code, the special attack is passed to the melee attack function but is never used. That can be fairly easily patched as well.

The "bosses putting up a fight" is the big one. The attack code for Tarjan (0x83) calls an empty function in the DOS and Amiga versions. Not having played the Apple or C64 versions I have no idea what kind of attacks Tarjan is supposed to have.
tpth
Posts: 128
Joined: Tue Feb 02, 2010 6:39 am

Post by tpth »

Hey, wow. That's pretty awesome. I'd love to play a bug-free DOS version of BT3! A couple of others that I recall from the distant past:

- The random encounter rate seems insanely high compared to the C64 version.
- Several items don't work - the Horn of Gods (which does nothing) springs to mind, although I seem to remember a couple of others also. I'll see if I can dig up any notes.
- Also the animations were pretty terrible - they had green flashes between each frame, as I remember, and looked awfully jerky.
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

The random encounter rate depends somewhat on the speed of the computer that you're running on. There is a check for a random encounter every time through the dungeon/city main loop. The faster your computer runs, the more times that loop executes. It can be tuned a bit but your results may vary.

The Horn of Gods and the Wand of Fury are two items that I have found that don't work. According to the data they are supposed to do a breath attack but there's no data saying what that attack should be. If I could find out what they were supposed to do I could certainly fix them.

The animations just plain suck. I'm not enough of an artist to fix them. As for the green flash, I haven't been able to replicate that in DOSBox...
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

An update on the encounter rate bug.

One dungeon square flags is a "Higher Chance of Battle" flag. Any time you perform an action on that square there is a 50% chance of a battle occurring.

There are a lot of squares with that flag set. The first level of the Catacombs, for example, has 39 out of 169 squares with the High Battle flag set.

There is something similar in BTI and BTII but the flag is cleared after the first check is made.
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Post by ZeroZero »

in BT1 there is a flag for an "inavoidable random fight", i. e. the monster type and number is not set, it is random, but the fight is inavoidable, it happens 100%.

That flag is cleared after the fight.

Then there are flags for "set fights", i. e. the type and number of opps is set and the fight is inavoidable.

Third sort is fights from event files, which usually also drop a special item or give a certain clue or in any other way are necessary to make progress in the all-over-game.

ALL the flags for specials in dungeon cells are cleared after done. However, they are reset, when you re-enter the dungeon. They are not marked permanently on disk as "done". Only exception is the kill of Mangar.
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

In BT2 that flag causes a 1 in 4 chance for a random fight which is cleared after a battle occurs. In BT1 it is a 100% chance.

In DOS BT3 it's a 50% chance of a fight but it is NEVER cleared. Hence the complaints about the high encounter rate on the DOS version.

I am working on patching the DOS version. With this I can go one of two ways: 1. Reduce the odds of the battle occurring or 2. Clear the battle flag from memory after a battle occurs. If possible I'd like to match the 8-bit behavior.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

drifting wrote:In BT2 that flag causes a 1 in 4 chance for a random fight which is cleared after a battle occurs. In BT1 it is a 100% chance.

In DOS BT3 it's a 50% chance of a fight but it is NEVER cleared. Hence the complaints about the high encounter rate on the DOS version.

I am working on patching the DOS version. With this I can go one of two ways: 1. Reduce the odds of the battle occurring or 2. Clear the battle flag from memory after a battle occurs. If possible I'd like to match the 8-bit behavior.
You know, in BTII on the C64 version there is a section of one of the Dark Domain floors (I think it's level 2) called "The Beastiary" or something where there's an increased chance of each square generating a monster encounter; would that be an example of this flag?
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

Darendor wrote: You know, in BTII on the C64 version there is a section of one of the Dark Domain floors (I think it's level 2) called "The Beastiary" or something where there's an increased chance of each square generating a monster encounter; would that be an example of this flag?
In the DOS version it's called "MONSTER REFORMATORY". Second level of the Dark Domain in the southeast corner. Every square in that room has the high-battle flag set.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I figured as much. Thanks.
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

So I have a patched DOS thief.exe available:

https://github.com/downloads/ChrisAubuc ... thiefp.exe

Fixes:
  • Monsters breathe properly and will also summon help
  • Monsters' special attack now works properly
  • The Divine Intervention spell converts illusions to real monsters as described in the manual
  • The up arrow key does all of the same functions as the 'K' key
  • Fixed a bug where the monster would never get to attack if their attack priority is lower than all of the characters in the party
  • When the party hits a "high chance of battle" square, the "high chance" flag is removed after the battle. This should reduce the encounter rate significantly.
Still todo:
  • Add BT1 and BT2-like casting of spells by the 4 letter abbreviation
  • Add scrolling speed commands for battle
  • Make the dungeon monster rosters more logical. No Roman Gladiators in Berlin for example
  • Match Tarjan's attack with the 8 bit versions. I believe that Tarjan constantly summons Black Slayers but I need to work out the details. Any help from 8-bit land would be appreciated. :D
Last edited by drifting on Mon Feb 06, 2012 6:52 am, edited 2 times in total.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

drifting wrote:So I have a patched DOS thief.exe available:

https://github.com/downloads/ChrisAubuc ... thiefp.exe

Fixes:
  • Monsters breathe properly and will also summon help
  • Monsters' special attack now works properly
  • The Divine Intervention spell converts illusions to real monsters as described in the manual
  • The up arrow key does all of the same functions as the 'K' key
  • Fixed a bug where the monster would never get to attack if their attack priority is lower than all of the characters in the party
  • When the party hits a "high chance of battle" square, the "high chance" flag is removed after the battle. This should reduce the encounter rate significantly.
Still todo:
  • Add BT1 and BT2-like casting of spells by the 4 letter abbreviation
  • Add scrolling speed commands for battle
  • Make the dungeon monster rosters more logical. No Roman Gladiators in Berlin for example
  • Match Tarjan's attack with the 8 bit versions. I believe that Tarjan constantly summons Black Slayers but I need to work out the details. Any help from 8-bit land would be appreciated. :D


I recall during the battle with Tarjan, he would always summon like 8 Black Slayers at the immediate start of the combat round.

Code: Select all

...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
...and a Black Slayer appears!
This would continue until he was dead. Dunno if that helps.


Perhaps the best way to match the DOS version to the 8 bit version would be to play the game through on an emulator (i.e. C64 or Apple II).
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

Uploaded a new patched DOS thief.exe

https://github.com/downloads/ChrisAubuc ... thiefp.exe

Fixes:
  • Horn of Gods and Wand of Fury work properly
  • Limited the maximum AC to -50 to match Apple BT3 behavior
  • Matched saving throw calculation with Apple behavior.
  • Tarjan's attack is now functioning correctly
  • Fixed a bug where the monster group size was set incorrectly when a monster group was created by a summon spell
  • The "make monster hostile" flag is cleared after the check. This now matches Apple behavior.
  • Fixed the "make monster hostile" flag to only affect the party when there is a monster in the party.
  • Some cosmetic fixes in the battle text
  • Print the proper reward string after the "Leave Chest" option.
tpth
Posts: 128
Joined: Tue Feb 02, 2010 6:39 am

Post by tpth »

Wow. Amazing work. It's possibly a bit sad to admit this, but I've been looking forward to this day for, y'know, decades. Bravo.
drifting
Posts: 152
Joined: Wed Dec 07, 2011 10:21 pm

Post by drifting »

I just uploaded a new version.

https://github.com/downloads/ChrisAubuc ... thiefp.exe

Two changes:
  1. Added text casting of spells by 4-letter abbreviation.
  2. Changed mouse casting to use the full spell name instead of the abbreviation.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Were you able to get the Tarjan battle sorted out?
Post Reply