Aseprite tilemap layer unique tile counter

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Aseprite tilemap layer unique tile counter

Post by NovaSquirrel »

I made this script a month ago to help with my SNES game. While I have some intuition for whether something might fit in a 256 tile limit, I have no idea how to tell whether or not something would fit in a 1024 tile (or more, with multiple layers) limit. So I fixed it by making a script that looks at the tilemap layers on the current sprite's current frame, and calculates how many unique 8x8 tiles there are, keeping flips in mind. That way I can just check it as I draw.
tile counter.png

I previously made another script that lets you quickly switch between different palettes on the same image, because I like to draw tile sets as PNG files, sometimes it makes a lot of sense to have tiles with multiple palettes represented in the same PNG. This is a lot like changing the palette around in a VRAM viewer to choose which of the tiles should look correct. I know you can just have a long PNG palette with multiple SNES palettes in there but I feel like that could get messy.
fast palette switch 2.gif

Link here: https://github.com/NovaSquirrel/AsepriteScripts
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Aseprite tilemap layer unique tile counter

Post by rainwarrior »

Woah I did not realize Aseprite had Lua capabilities now! Neat!
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Aseprite tilemap layer unique tile counter

Post by NovaSquirrel »

I added another script that flattens the image temporarily and then counts the unique tiles on the image as a whole. This means it works for both tilemaps and regular layers (without me having to have any code to handle tilemaps specifically 8-) ) and it's good for things like game backgrounds.
aseprite flat unique counter.png
Post Reply