Edit: Scroll down to the bottom of this post for the newest version.
Here is an improved version of my old super metroid ghost script:
http://folk.uio.no/sigurdkn/ghost_play.lua
http://folk.uio.no/sigurdkn/ghost_record.lua
Aside from being more robust now, it also supports two new features: The ghosts can be displayed using a proper animated Samus (or anything else, really), and there is a minimap which shows the position of each of the ghosts globally. These features require the gd library for lua, though, so you will have to install that to get this to work. Here is a demonstration of the script:
http://folk.uio.no/sigurdkn/sm_ghost.mkv
This shows Cpadolf's in-game any% non-glitched SM TAS (normal Samus, white cross on minimap), his previous version (blue Samus and cross), and herooftheday's new and old realtime oriented any% runs (green and red respectively).
The settings used to produce this was:
-- Ghost definitions
ghost_dumps = { "ghost_hero1.txt", "ghost_cpadolf1.txt", "ghost_hero2.txt" }
-- Timing options
sync_mode = "ingame" -- Alternative is "real"
display_mode = "ingame" -- Alternative is "real"
offset_mode = "room" -- Alternative is "none"
ghost_hitbox = false
samus_hitbox = false
enemy_hitbox = false
shot_hitbox = false
enemy_hp = false
global_map = true
show_delays = true
show_status = false
-- Graphics options
own_color = "white"
ghost_color = { "red", "blue", "green", "orange" }
enemy_color = "yellow"
shot_color = "purple"
map_pos = { 0xbe, 0, 0x42, 0x1f }
-- These require gd
ghost_gfx = { 1, 2, 3 } -- nil to turn off. Array to specify individually
pose_info = { { "poses_red.png", "poses.map", 0x18, 0x20 }, { "poses_green.png", "poses.map", 0x18, 0x20 }, { "poses_blue.png", "poses.map", 0x18, 0x20} }
minimap = "minimap.png"
As you can see, it is possible to choose which frames to display, and which to sync by. Here I have chosen the most interesting combination in my opinion, which is to sync by ingame frame, and to display only those frames. Additionally, I have chosen "room" offset mode, which resyncs all the ghosts to enter the room at the same time, which makes it easy to compare room strategies.
Please excuse the poor encoding quality in the demonstration video. Especially the crosses on the minimap are much clearer in reality than in the encode.
A few supporting files are involved: The ghost dumps must be generated by ghost_record.lua before they can be used in ghost_play.lua. Simply load ghost_record.lua in snes9x, start the smv you which to dump a ghost from, and exit the emulator when you are done. A file called "ghost.dump" will be generated, which you can rename to something more suitable.
For ghost graphics, you will need two pose definition files, which are harder to generate, so I'll provide an example here:
http://folk.uio.no/sigurdkn/poses.png
http://folk.uio.no/sigurdkn/poses.map
To create the colored ghosts in the example, I simply used a color filter on the above poses.png and used poses.map unchanged. This poses file is slightly incomplete. Some poses are missing, most notably the "exhausted" pose during the mother brain fight. A few map incorrectly, most notably the elevator pose. But it still looks pretty nice.
The minimap I used is this one
http://folk.uio.no/sigurdkn/minimap.png
Please give me feedback on this script if you miss something or can't get it to work. Even without the gd stuff, it should still be an improvement on the old versions with the old crashes Saturn complained about fixed.
Edit: Note: This script assumes that it is safe to draw outside the screen. This is not the case for old versions of snes9x, where this causes the script to crash. I recommend the newest versions for this.
Edit: As LagDotCom pointed out, I had mixed up herooftheday 2 and cpadolf 1. This is fixed in the text above now. The video has not been changed.
Edit: Here is a slightly updated version of the script bundled with some example ghost files and the maps/pose info needed (edit: now also handles resets relatively well):
http://folk.uio.no/sigurdkn/super_metroid_ghost.zip