Author Topic: [PC98] Mystic Square Modding Toolkit  (Read 15180 times)

Tom

  • *
  • Programmer
    • LunarCast Network
[PC98] Mystic Square Modding Toolkit
« on: January 10, 2019, 05:10:55 AM »
MysticTK (Mystic Square Toolkit)
Project website at http://lunarcast.net


What is this:
This project is a collection of utilities that allow extensive modification of Mystic Square's game archives. Stage enemies, enemy scripts, bullet patterns, backgrounds and dialogue can currently be completely customized.


StageDef.exe:
Decompiles .STD stage definition files in to scripts and tables and compiles resulting file back in to .STD files
Usage:
d <InputFile> <OutputFile> - Decompile STD file to source file
c <InputFile> <OutputFile> - Compile source file to STD file
Uses:
Edit Stage Name, BGM Name and Boss BGM Name
Edit Stage Design and Layout (Rearrange tile sections which are 24x5 rows of tiles composed in MAP files)
Edit Enemy Scripts
Edit Enemy Spawn Table
Edit Bullet Patterns spawned by stage enemies
MapDef.exe
Decompiles .MAP files in to a table of tile indices and compiles indice lists back to .MAP files
Usage:
d <InputFile> <OutputFile> - Decompile MAP file to source file
c <InputFile> <OutputFile> - Compile source file to MAP file
Uses:
Rearrange tiles within a Tile Section (Sections 24x5 tiles (5 rows, 24 across))
MpnDef.exe
Usage:
d <InputFile> <OutputFile> - Decode MPN file to BMP file
c <InputFile> <OutputFile> - Encode BMP file to MPN file
Uses:
Edit the individual tiles used in MAP files and stages
Edit the palette used for the stage (Warning: Affects everything on screen!)
Warning: Use a program that supports Indexed Color to edit the outputted bitmaps (such as GIMP or PS), most programs (such as MSPaint or Paint.NET) mangle the color palette information.
TxDef.exe
Usage:
d <InputFile> <OutputFile> - Decompile TX2 file to source file
c <InputFile> <OutputFile> - Compile source file to TX2 file
Uses:
Edit the dialogue text in game
Edit which portraits appear during dialogue scenes
CDGDef.exe
Usage:
d <InputFile> <OutputFile> <PaletteFile> - Decompile CDG file to source file
c <InputFile> <OutputFile> <FrameWidth> <FrameHeight> - Compile source file to CDG file
Uses:
Edit character portraits and player selection portraits
Edit player spell backgrounds
BFTDef.exe
Decodes .BFT files in to 16 color (4bpp) .BMP files and vice versa
Usage:
d <InputFile> <OutputFile> <PaletteFile> - Decompile BFT file to source file
c <InputFile> <OutputFile> <FrameWidth> <FrameHeight> - Compile source file to BFT file
Uses:
Edit player sprites
Edit stage enemy and boss sprites
Edit shot sheets and items
(Warning: These files may have their own palettes but use MPTN palette ingame)
PIDef.exe
Decodes .PI files in to 16 color (4bpp) .BMP files and vice versa
Usage:
d <InputFile> <OutputFile> [PaletteFile] - Decompile PI file to source file (Custom palette optional)
c <InputFile> <OutputFile> - Compile source file to PI file
Uses:
Edit menu and UI backgrounds
Edit stage loading logo
Edit startup splash screen
(Warning: These files set the palette on menu screens)
BmpConv.exe
Reencodes 16 color (4bpp) .BMP files if they are not recognized by the other tools
Usage:
<InputFile> <OutputFile> - Convert bitmap
Uses:
If a BMP file is not directly recognized by MpnDef this might help


Download (WinXP+): http://file.lunarcast.net/mystictk/latest.zip
Download (Win95/WinNT3.1+/PC98(Win)): http://file.lunarcast.net/mystkcrt/latest.zip

Examples:
Change enemy item drops (StageDef)

Moonlight Palette Swap (MPNDef)


Tom

  • *
  • Programmer
    • LunarCast Network
Re: [PC98] Mystic Square Toolkit
« Reply #1 on: January 19, 2019, 06:09:41 AM »
TxDef tool has been added to Mystic Toolkit, which allows you to edit the dialogue files

Tom

  • *
  • Programmer
    • LunarCast Network
Re: [PC98] Mystic Square Toolkit
« Reply #2 on: February 09, 2019, 11:53:25 PM »
CDGDef tool has been added to Mystic Toolkit, which allows you to edit image files used for dialogue portraits, player spellcard backgrounds and menu character selection portraits

Silent Sinner in Scarlet

  • Chiptune musician in PMD98
  • I will remain silent on that question.
    • My musician profile on CD Baby
Re: [PC98] Mystic Square Toolkit
« Reply #3 on: April 29, 2019, 11:03:24 PM »
There is once crucial tool lacking here: an utility for converting BMP image files into BFT image files (for the individual character and object sprites, in addition for customizing the on-screen gaiji font). Many years ago, I wrote a C program for converting BFT into BMP, but not the other way around. But I cannot locate that utility anymore: it is held hostage in a non-responsive hard drive in my possession. And I don?t currently have US$ 3000 for retrieving data from that HDD  :(

Actually, not all BFT files are single-image sprites, they are more like sprite collections sharing a common 16-color palette.

Fortunately, before this HDD crashed, I was able to use that utility of mine to convert all BFT files from all Tōhō games from TH02 to TH05 into BMP files which I saved to a USB thumbdrive that still survives as of today; the original BFT files are also in my safe possession. If anyone needs them, I can share them here.
« Last Edit: April 29, 2019, 11:18:40 PM by Silent Sinner in Scarlet »

Silent Sinner in Scarlet

  • Chiptune musician in PMD98
  • I will remain silent on that question.
    • My musician profile on CD Baby
Re: [PC98] Mystic Square Toolkit
« Reply #4 on: May 02, 2019, 07:14:18 AM »
Looks like someone already had an utility for opening those BFT files:

https://www.shrinemaiden.org/forum/index.php/topic,20614.msg1320795.html

They called it BFNTCONV. Well, anyway, I am posting here what I could reverse-engineer from BFT (and BB0, BB1, ?) files

Also, this other thread mentioned another utility, YY-CHR, used to apparently edit BFT files. So check which of these two utilities, BFNTCONV or YY-CHR, would be the best one to be included into the Mystic Square Toolkit.
« Last Edit: May 02, 2019, 07:20:19 AM by Silent Sinner in Scarlet »

Tom

  • *
  • Programmer
    • LunarCast Network
Re: [PC98] Mystic Square Toolkit
« Reply #5 on: May 19, 2019, 06:56:35 AM »
Important! An update to Mystic Toolkit has been released (0.1.8b) (http://file.lunarcast.net/mystictk/)
This corrects a serious bug affecting Shift JIS text handling during compilation in TXDEF.EXE, its recommended everyone using the toolset for projects update ASAP. 
To update you will need to compile your files using your current version of MysticTK then decompile using the new version! 
I cannot stress this enough, backup your files/project before upgrading.  This is doubly important for people using automation systems like AutoMSTK (http://file.lunarcast.net/automstk/) to compile entire DAT files at once!

Tom

  • *
  • Programmer
    • LunarCast Network
Re: [PC98] Mystic Square Toolkit
« Reply #6 on: June 07, 2019, 11:06:44 AM »
Mystic Toolkit Update Released http://file.lunarcast.net/mystictk/latest.zip (Normal) http://file.lunarcast.net/mystkcrt/latest.zip (CRT Special Edition)
* Changed MapDef coordinates to hexadecimal instead of decimal (xx,yy -> 0xYX)
* IMPORTANT: A bug in StageDef that led to stage corruption which was patched a long time ago resurfaced (was never really patched in the first place) in TXDef, so I urge you to update and double-check your dialogue files for potentially wrong functions!  (Confirmed to exist in _DM00 at line 16 SetActiveBoss(); should be replaced with FadeToWhite(1);)