Chappell's Bard's Tale Character Editor

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:

Downloads

The Current version is 1.6

Useful Links

Chappell’s Bard’s Tale Character Editor Version 1.6

Usage: btce [-c] [-d] [-e] [-f] [-h] [-i] [-n] [-p] [-r] TPWfile

-c
CSV dump.
-d
Short dump.
-e
Edit (default).
-f
Fill Garth’s Equipment Shoppe.
-h
Help.
-i
Initialize Garth’s Equipment Shoppe.
-n
Create a new character.
-p
Print Character (stdout).
-r
Rename character.
-v
Print version information.

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)

Screen Shots

While they are not that much to look at for a text program, here are a few screen shots.

The Bard's Tale Characters

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.

The Bard's Tale Character Statistics

FileCharacteracterRaceClassLvlXPGoldBattlesStrIQDexConstLckHit Pts.Spell Pts.ConjMagSorcWizHideCritSngsAtckCond
1001.TPWBRIAN THE FISTHumanPaladin22030001291410630000000000Alive
1002.TPWEL CIDDwarfWarrior22030001291410628000000000Alive
1003.TPWMARKUSElfBard6241640221391512645000000060Alive
1004.TPWSIR GRADYHobbitRogue2512704910176624000000000Alive
1005.TPWMERLINGnomeConjurer220300010177912162010000000Alive
1006.TPWOMARElfMagician2203000111611811201401000000Alive
1011.TPWTARAElfWizard131498346240847983181818181834625977770000Alive
1012.TPWSPIKEElfBard232391577638396118181818172610000000230Alive
1013.TPWDAWNDwarfHunter2220724016936973181816181824100000025500Alive
1014.TPWBUFFYHumanWarrior22203811527369391816171715223000000005Alive
1015.TPWGILESHalf-ElfBard101580151516141221000000010Alive
1016.TPWWILLOWElfWizard1314661703616980181818181828831677770000Alive
1017.TPWXANDERGnomeMonk22231188609611818141318103000000005Alive
1021.TPWMARIAHumanWarrior33431729726657310721818181818395000000007Alive
1022.TPWALEXANDERHumanRogue72131001451315161311540000036000Alive
1023.TPWMAXWELLHumanPaladin33424579723154510681818181818309000000007Alive
1024.TPWELIZABETHHumanBard334317347489541107318181818182740000000300Alive
1025.TPWISABELElfWizard1434481551214591075181818181831333377770000Alive
1026.TPWMICHAELElfWizard1434481552805361064181818181828024477770000Alive
1027.TPWKYLEHumanHunter334221648161808928181818181835200000025500Alive
1031.TPWTIKA WAYLANHobbitBard34232046111314131545000000020Alive
1032.TPWRAISTLINGnomeConjurer342324981924614131076282120000000Alive
1033.TPWGOLDMOONElfMagician342320461415131312231702000000Alive
1034.TPWTANISHalf-ElfMonk34232046161017131332000000000Alive
1035.TPWFLINT FIREFORGDwarfHunter342320461810141710550000002700Alive
1036.TPWSTURM BRIGHTBLHumanPaladin34232046181113151245000000000Alive
3250.TPWERICHalf-OrcWarrior22210678014376812681816181818291000000005Alive
3251.TPWCHARLESHumanPaladin23220557222853012691718141514176000000005Alive
3252.TPWSTEVEHalf-ElfMonk21220541019603012661818181818154000000005Alive
3253.TPWMIKEGnomeWizard131306628532161268181818181827526577770000Alive
3254.TPWMARKHalf-ElfBard232205572180920126918181818182410000000170Alive
3255.TPWDELIAElfSorceror134215483170921269181818181832127177770000Alive

From My Blog

(Some of the content has been edited.)

Sun Feb 19, 2017

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

Mon Feb 20, 2017

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.

Fri Feb 24, 2017

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.

Sat Feb 25, 2017

I fixed a few bugs I had in BTCE version 1.2 and released 1.3.

Wed Jan 16, 2019

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.



Saturday, 13 April 2024   Michael J. Chappell   Contact me at: mcsuper5@freeshell.org Made with Emacs