I’ve been messing around with The Bard’s Tale again and wanted to put a page up on my site for my character editor.
While there are other editors out there, I wanted to be able to view all my characters’ attributes, and do things like cure my characters in a script, etc.
Under DOS copying the BARD.EXE, IN and BAT files to the Bard’s Tale directory should be sufficient.
I have successfully compiled this project under DOS, OS X, Linux, Solaris and FreeBSD. The zip file was created using PKZIP, and you should use
$ unzip -L btce1_6.zip
to restore file names to lowercase for case sensitive systems. Compile with:
$ make -f makefile.gcc install
after verifying the directories are appropriate for your system.
The ZIP file should have binaries, btce (for OS X 10.11.6), and btce.exe for DOS systems. I expect that the OS X binary will work under different versions; however I don’t have the resources to verify this.
The DOS version was compiled with MIX Power C. I had installed MAKE on the system as well. I'm not well versed in makefiles, but never used the PRJ files for Power C. The makefile is fairly simple, and you can build the executable without make if necessary. I did not test under alternate DOS compilers. MIX files are object files for this compiler.
You should change to the directory where you have The Bale’s Tale installed. The program does not search for your character disk, or install directory. However, full path names for the characters (TPW files) can be passed to the program as arguments.
ITEMFILE is currently declared as a macro in shoppe.h as "ITEMS" which is created in the current directory. Linux filesystems are generally case sensitive; DOSBox is not. I’m not sure how DOSBox will behave if it comes across "ITEMS" and "items" or other variations in the same directory, which can happen if working under Linux or other systems with case sensitive filesystems. (I belive it is possible to make OS X case sensitive as well, but I believe that caused some issues, and is not the default.)
I just updated the BTCE to version 1.4 on January 12, 2019. Updates include:
Updated the BTCE to version 1.5 on January 21, 2019.
Changes in BTCE version 1.6 on January 25, 2019 include:
The Current version is 1.6
Usage: btce [-c] [-d] [-e] [-f] [-h] [-i] [-n] [-p] [-r] TPWfile
Option flags can begin with - or /, and can be upper or lowercase. The main menu will accept lines starting with [’[;:!#(@] as comments. This will allow commenting input files. (Only the main menu)
This program is released “as is”, with no warranty. Use at your own risk. You may distribute this program freely provided:
©2020 Michael J. Chappell (September 3, 2020)
While they are not that much to look at for a text program, here are a few screen shots.
I synced the data from DOSBox between three of my computers. Some of the character's have obviously been edited.
I put together a few scripts to covert the CSV data into HTML.
File | Characteracter | Race | Class | Lvl | XP | Gold | Battles | Str | IQ | Dex | Const | Lck | Hit Pts. | Spell Pts. | Conj | Mag | Sorc | Wiz | Hide | Crit | Sngs | Atck | Cond |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1001.TPW | BRIAN THE FIST | Human | Paladin | 2 | 2030 | 0 | 0 | 12 | 9 | 14 | 10 | 6 | 30 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1002.TPW | EL CID | Dwarf | Warrior | 2 | 2030 | 0 | 0 | 12 | 9 | 14 | 10 | 6 | 28 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1003.TPW | MARKUS | Elf | Bard | 6 | 24164 | 0 | 22 | 13 | 9 | 15 | 12 | 6 | 45 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 | Alive |
1004.TPW | SIR GRADY | Hobbit | Rogue | 2 | 5127 | 0 | 4 | 9 | 10 | 17 | 6 | 6 | 24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1005.TPW | MERLIN | Gnome | Conjurer | 2 | 2030 | 0 | 0 | 10 | 17 | 7 | 9 | 12 | 16 | 20 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1006.TPW | OMAR | Elf | Magician | 2 | 2030 | 0 | 0 | 11 | 16 | 11 | 8 | 11 | 20 | 14 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1011.TPW | TARA | Elf | Wizard | 13 | 1498346 | 240847 | 983 | 18 | 18 | 18 | 18 | 18 | 346 | 259 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
1012.TPW | SPIKE | Elf | Bard | 23 | 2391577 | 6383 | 961 | 18 | 18 | 18 | 18 | 17 | 261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0 | Alive |
1013.TPW | DAWN | Dwarf | Hunter | 22 | 2072401 | 6936 | 973 | 18 | 18 | 16 | 18 | 18 | 241 | 0 | 0 | 0 | 0 | 0 | 0 | 255 | 0 | 0 | Alive |
1014.TPW | BUFFY | Human | Warrior | 22 | 2038115 | 2736 | 939 | 18 | 16 | 17 | 17 | 15 | 223 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | Alive |
1015.TPW | GILES | Half-Elf | Bard | 1 | 0 | 158 | 0 | 15 | 15 | 16 | 14 | 12 | 21 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | Alive |
1016.TPW | WILLOW | Elf | Wizard | 13 | 1466170 | 3616 | 980 | 18 | 18 | 18 | 18 | 18 | 288 | 316 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
1017.TPW | XANDER | Gnome | Monk | 22 | 2311886 | 0 | 961 | 18 | 18 | 14 | 13 | 18 | 103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | Alive |
1021.TPW | MARIA | Human | Warrior | 33 | 4317297 | 266573 | 1072 | 18 | 18 | 18 | 18 | 18 | 395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | Alive |
1022.TPW | ALEXANDER | Human | Rogue | 7 | 21310 | 0 | 145 | 13 | 15 | 16 | 13 | 11 | 54 | 0 | 0 | 0 | 0 | 0 | 36 | 0 | 0 | 0 | Alive |
1023.TPW | MAXWELL | Human | Paladin | 33 | 4245797 | 231545 | 1068 | 18 | 18 | 18 | 18 | 18 | 309 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | Alive |
1024.TPW | ELIZABETH | Human | Bard | 33 | 4317347 | 489541 | 1073 | 18 | 18 | 18 | 18 | 18 | 274 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0 | Alive |
1025.TPW | ISABEL | Elf | Wizard | 14 | 3448155 | 121459 | 1075 | 18 | 18 | 18 | 18 | 18 | 313 | 333 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
1026.TPW | MICHAEL | Elf | Wizard | 14 | 3448155 | 280536 | 1064 | 18 | 18 | 18 | 18 | 18 | 280 | 244 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
1027.TPW | KYLE | Human | Hunter | 33 | 4221648 | 161808 | 928 | 18 | 18 | 18 | 18 | 18 | 352 | 0 | 0 | 0 | 0 | 0 | 0 | 255 | 0 | 0 | Alive |
1031.TPW | TIKA WAYLAN | Hobbit | Bard | 3 | 4232 | 0 | 46 | 11 | 13 | 14 | 13 | 15 | 45 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | Alive |
1032.TPW | RAISTLIN | Gnome | Conjurer | 3 | 4232 | 498192 | 46 | 14 | 13 | 10 | 7 | 6 | 28 | 21 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1033.TPW | GOLDMOON | Elf | Magician | 3 | 4232 | 0 | 46 | 14 | 15 | 13 | 13 | 12 | 23 | 17 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1034.TPW | TANIS | Half-Elf | Monk | 3 | 4232 | 0 | 46 | 16 | 10 | 17 | 13 | 13 | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
1035.TPW | FLINT FIREFORG | Dwarf | Hunter | 3 | 4232 | 0 | 46 | 18 | 10 | 14 | 17 | 10 | 55 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0 | 0 | Alive |
1036.TPW | STURM BRIGHTBL | Human | Paladin | 3 | 4232 | 0 | 46 | 18 | 11 | 13 | 15 | 12 | 45 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Alive |
3250.TPW | ERIC | Half-Orc | Warrior | 22 | 2106780 | 143768 | 1268 | 18 | 16 | 18 | 18 | 18 | 291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | Alive |
3251.TPW | CHARLES | Human | Paladin | 23 | 2205572 | 228530 | 1269 | 17 | 18 | 14 | 15 | 14 | 176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | Alive |
3252.TPW | STEVE | Half-Elf | Monk | 21 | 2205410 | 196030 | 1266 | 18 | 18 | 18 | 18 | 18 | 154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | Alive |
3253.TPW | MIKE | Gnome | Wizard | 13 | 1306628 | 53216 | 1268 | 18 | 18 | 18 | 18 | 18 | 275 | 265 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
3254.TPW | MARK | Half-Elf | Bard | 23 | 2205572 | 180920 | 1269 | 18 | 18 | 18 | 18 | 18 | 241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0 | Alive |
3255.TPW | DELIA | Elf | Sorceror | 13 | 421548 | 317092 | 1269 | 18 | 18 | 18 | 18 | 18 | 321 | 271 | 7 | 7 | 7 | 7 | 0 | 0 | 0 | 0 | Alive |
(Some of the content has been edited.)
I started playing around with The Bard’s Tale a little. I spent about two weeks working on a character editor in FreeDos using MIX’s Power C.
I’d forgotten much about editing text in a DOS environment. VIM was broken, and E did not have undo. I ended up relying on a few editors in Windows 3.1 for a small amount of the editing.
Power C’s Project files leave something to be desired, so I downloaded some BSD tools for DOS including make.
The program will probably compile with any ANSI C compiler; but, it was written for a 16 bit compiler. So, char is 1 byte, int is 2 bytes and long is 4 bytes.
I don't believe prototypes were standard yet when the compiler was released. It looked like the compiler did not warn if it thought a function returned an int value when your function returned a long value. Which leads to some really fun bug tracking. I found it by using 65535 as a test value and found it was returning (-1). Coding the function before it is called resolves the issue; otherwise it will silently cast the int to a long.
I learned to program using top down design, before GUIs were ubiquitous, and prefer to use stdin and stdout, so the end result isn't terribly pretty. However, it will accept an input stream. Since the menu system is simple, I added the ability for the editor to accept comments, instead of a command.
I wrote a few batch files for curing the team and traversing all the TPW files in a directory and ran into a few problems. Apparently the FOR construct is not supported in FreeeDOS, and either pipes are broken or MORE is broken and does not accept piped input.
My piping requirements were minimal and redirecting to a temporary file was adequate. I needed to use DRDOS to work around the missing FOR construct though. If you have DRDOS, MSDOS or IBMDOS you can avoid the call to the shell. (I was not running DRDOS as my shell.)
I got the imformation for the file format from The Adventurers’ Guild, which was largely adequate. The spell levels are stored beginning at byte 81: sorcerer, conjurer, magician, wizard.
The source code is available at http://mcsuper5.freeshell.org/dl/dos/btce/btce1_1.zip
In the DOS version of Bard’s Tale the TPW files are used for both parties and characters. The last byte of the 17 byte header indicates if the file is for a party or character.
Parties are simply 6 16 byte fields with null terminated strings for the names of the party members.
The character data is a little more complicated, and some of the skipped bytes might be used for something. I did some range checking, but don’t know the maximum values for all of the fields. I tried watching string input to avoid any buffer overruns. I might try to clean the code up in the future. FreeDOS might be okay for games, but it is not the greatest for setting up a development environment.
In DOS apparently BardsTale will list all files ending in TPW; however, you can only select files of the format: "%d.TPW", where %d is in the range 0 to 32767.
The heuristic is simple enough, but wasn’t used in other versions.
I fixed a few bugs I had in BTCE version 1.2 and released 1.3.
I have been working on updating my Bard's Tale Character Editor to compile under GCC. It is a lot more complicated than I thought.
I had to change int to INT16, long to INT32. Enum is type int, under GCC, INT16 is short. So, enums are problematic.
I have dumps working correctly; however, edit segfaults.