Skip to content

Sprites

HerbFargus edited this page May 1, 2016 · 2 revisions

Ripping Sprites:

Seeing as fredit.exe has its issues and no real editor works for .ani files mmatyas created a working package to extract the .tga files from the .ani files from the game. The repository is located here:

https://github.com/mmatyas/ab_aniex

to compile:

git clone https://github.com/mmatyas/ab_aniex.git
cd ab_aniex
mkdir build && cd build && cmake .. && make

and then you run it with ./ab_aniex FILENAME.ANI

and it will extract all the .tga files which you can then use imagemagick to montage them all together.

Automation

Set up Directories:

First get the original .ani files from Atomic Bomberman and place them in a folder somewhere.

then in the same folder run this script:

nano directory.sh


#!/bin/bash

# this script will take all files in the current directory with the .ANI extension, create folders based on the filenames
# with the extensions stripped, and then will move each .ANI file into its matching folder that was just created.

for file in *.ANI; do
dir="${file%%.*}"
if [ -e $dir ];then
mv "$file" "$dir"
else
mkdir -p "$dir"
mv "$file" "$dir"
fi
done
sudo chmod +x directory.sh
./directory.sh

In theory it should create individual folders for each .ani file and place them all in their own folder.

Extract .TGA files

Then we need to extract the .tga files from the .ani files with ab_aniex

then in the same folder run this script:

nano subdirectory.sh


#!/bin/bash

# This will go into each subdirectory and run a command

for f in <pathtoanidirectories>/*;
  do
     [ -d $f ] && cd "$f" && file=$(find . -name '*.ANI') && <pathtoab_aniex>./ab_aniex $file
  done;
sudo chmod +x subdirectory.sh
./subdirectory.sh

Create Montage with ImageMagick

Then we need

then in the same folder run this script:

nano montage.sh

#!/bin/bash

# This will go into each subdirectory and run a command

for f in ~/Desktop/BOMBERMAN_SPRITES/ANI_BACKUP/*;
  do
     [ -d $f ] && cd "$f" && file=$(find . -name '*.ANI') && montage -verbose -label '%f' -font Helvetica -pointsize 10 -background '#000000' -fill 'gray' -auto-orient *.TGA $file.png

  done;
sudo chmod +x montage.sh
./montage.sh

see HERE for more notes on montage for Imagemagick

Final Cleanups

Then we create a folder for all the final sprite sheet montages: mkdir final_sheets

and then we can copy all the sheets we created to the final_sheets folder with

cp `find . -name "*.png"` <newfolder>`
Clone this wiki locally