TL;DR
I built a tool that started as a graphics ripper but evolved into something much more.
Background
About a year ago, I joined this community and decided to try my hand at building a hack. I had a vision, but I quickly realized that the process would be painfully slow due to the need for custom assets. Existing tools like YY-CHR and GraphicsEditor felt too tedious, so I asked myself: Can I programmatically create a GFX file from a PNG image?
Thanks to the wealth of resources on SMWCentral, I found the answer to this question(and about a thousand other questions since), and I wrote a Python script to do just that. Soon, I expanded it to generate Map16 files as well. While using it for my hack, I realized I was still spending too much time for my liking manually placing tiles in Lunar Magic’s Map16 editor. Given that many of my levels were just recreations of environments from other games, I thought: If I can generate GFX and Map16 files, why not generate entire levels too?
Introducing Apollo
Apollo is a tool that takes an image and converts it into all the necessary resources for a SMW level—automating the entire process.
Examples
Over the past month, I’ve been active in the #graphics channel on Discord, looking for opportunities to test Apollo. Most of the following examples—except for Peach's Castle—took about 10 minutes from downloading the image to having the level ready in Lunar Magic. The majority of that time was spent editing the original image and configuring resources.
Peach's Castle took longer because the source image had extensive shading and lacked symmetry, requiring manual edits in Aseprite to fit within six GFX slots. However, once that was done, converting the image to an .mwl file took only a few seconds.
City

Building

Water

Peach's Castle

Additionally, here are some images I pulled from The Spriters Resource this morning and imported into Lunar Magic in a few minutes using Apollo.
Barrel Cannon Canyon

SnakeMan's Level

Hyrule Castle

Mt Woe

See Apollo in Action!
Here’s a video I put together of me recreating level 106 by exporting it from Lunar Magic, and then reimporting it into 107 via Apollo.
Sprites
Apollo handles sprite GFX generation and insertion much like Layer 1 and Layer 2—no problem. But I’ve been pushing this further. My hack relies heavily on custom sprites, and after learning how to code them, I quickly realized I didn’t want to do it repeatedly.
So, I developed an ASM library to work with the resources created by Apollo. With this system, adding new sprites only requires implementing their state behavior—while the library takes care of collision detection, graphics, and state lifecycle.
This works through a set of subroutines implemented using SharedSubroutines. Additionally, it leverages the following patches for fine-tuned sprite control:
- Better Platforms
- Custom Sprite Clipping
- Custom Object Clipping
Note
Apollo does not insert ASM into the ROM. It simply generates a .mwl file and imports it into Lunar Magic using its -ImportLevel CLI command. The shared subroutines and patches mentioned above are simply part of a custom ASM library I wrote for my hack. (I might release it as a patch if there’s interest.) Apollo’s role is to generate sprite GFX and ASM tables representing the sprites, while my library handles everything else.
Example
Here’s a video of me taking the Batadon sprite from SMWCentral and reimplementing a small subset of its behavior via Apollo—covering graphics, collision detection, and movement.
Another Example
Here’s a more complex sprite I’ve been working on. Keep in mind that much of my ASM library is still a work in progress, with plenty of rough edges. This example is mainly to demonstrate how Apollo can take a detailed Aseprite image and convert it into usable resources for coding sprites.
There are a lot more things I could add/share but I’m running out of time. I may update this post later with additional content if the interest is there. Happy to answer any questions you have.
Hope you all have a great C3!
I built a tool that started as a graphics ripper but evolved into something much more.
Background
About a year ago, I joined this community and decided to try my hand at building a hack. I had a vision, but I quickly realized that the process would be painfully slow due to the need for custom assets. Existing tools like YY-CHR and GraphicsEditor felt too tedious, so I asked myself: Can I programmatically create a GFX file from a PNG image?
Thanks to the wealth of resources on SMWCentral, I found the answer to this question(and about a thousand other questions since), and I wrote a Python script to do just that. Soon, I expanded it to generate Map16 files as well. While using it for my hack, I realized I was still spending too much time for my liking manually placing tiles in Lunar Magic’s Map16 editor. Given that many of my levels were just recreations of environments from other games, I thought: If I can generate GFX and Map16 files, why not generate entire levels too?
Introducing Apollo
Apollo is a tool that takes an image and converts it into all the necessary resources for a SMW level—automating the entire process.
Examples
Over the past month, I’ve been active in the #graphics channel on Discord, looking for opportunities to test Apollo. Most of the following examples—except for Peach's Castle—took about 10 minutes from downloading the image to having the level ready in Lunar Magic. The majority of that time was spent editing the original image and configuring resources.
Peach's Castle took longer because the source image had extensive shading and lacked symmetry, requiring manual edits in Aseprite to fit within six GFX slots. However, once that was done, converting the image to an .mwl file took only a few seconds.
City

Building

Water

Peach's Castle

Additionally, here are some images I pulled from The Spriters Resource this morning and imported into Lunar Magic in a few minutes using Apollo.
Barrel Cannon Canyon

SnakeMan's Level

Hyrule Castle

Mt Woe

See Apollo in Action!
Here’s a video I put together of me recreating level 106 by exporting it from Lunar Magic, and then reimporting it into 107 via Apollo.
Sprites
Apollo handles sprite GFX generation and insertion much like Layer 1 and Layer 2—no problem. But I’ve been pushing this further. My hack relies heavily on custom sprites, and after learning how to code them, I quickly realized I didn’t want to do it repeatedly.
So, I developed an ASM library to work with the resources created by Apollo. With this system, adding new sprites only requires implementing their state behavior—while the library takes care of collision detection, graphics, and state lifecycle.
This works through a set of subroutines implemented using SharedSubroutines. Additionally, it leverages the following patches for fine-tuned sprite control:
- Better Platforms
- Custom Sprite Clipping
- Custom Object Clipping
Note
Apollo does not insert ASM into the ROM. It simply generates a .mwl file and imports it into Lunar Magic using its -ImportLevel CLI command. The shared subroutines and patches mentioned above are simply part of a custom ASM library I wrote for my hack. (I might release it as a patch if there’s interest.) Apollo’s role is to generate sprite GFX and ASM tables representing the sprites, while my library handles everything else.
Example
Here’s a video of me taking the Batadon sprite from SMWCentral and reimplementing a small subset of its behavior via Apollo—covering graphics, collision detection, and movement.
Another Example
Here’s a more complex sprite I’ve been working on. Keep in mind that much of my ASM library is still a work in progress, with plenty of rough edges. This example is mainly to demonstrate how Apollo can take a detailed Aseprite image and convert it into usable resources for coding sprites.
There are a lot more things I could add/share but I’m running out of time. I may update this post later with additional content if the interest is there. Happy to answer any questions you have.
Hope you all have a great C3!