mdtiler tilemapping support

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
User avatar
Sik
Very interested
Posts: 592
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

mdtiler tilemapping support

Post by Sik » Thu Mar 24, 2016 3:33 pm

Before I keep forgetting, I've just updated mdtiler:
https://github.com/sikthehedgehog/mdtoo ... er/mdtiler

What this update adds is a new "map" command that scans a group of tiles, looks for redundancies (i.e. identical tiles, maybe with flipping and/or different palette or priority) and then generates both tiles and tilemap data out of it. Note that I didn't test every possible setting combination yet, and I didn't test the makefile (I use Code::Blocks for development =P), so if something is broken tell me.

How it works: first you specify two filenames, one where the tiles will go and one where the tilemap will go

Code: Select all

output "tiles.blob"
output2 "tilemap.blob"
Then you use the map command to tell mdtiler to look over it (the arguments are the same as for the tiles command):

Code: Select all

map 0 0 64 32
There's not much else to it, look at the README for details. Note however that if you pass mdtiler an 8bpp PNG, you can make use of multiple palettes and even priority and let mdtiler pick this up. How it works is as follows:
  • Every 16 colors is a palette row
  • The first four rows (0~63) are each palette, with low priority
  • The next four rows (64~127) are each palette, with high priority
Tiles start from 0 onwards, so in your code you'll have to add whatever offset is needed to get the correct tile address in VRAM. (or do whatever else you want with it) The title logo in Dragon's Castle is using this feature, so you can take a look at it for an example. (I completely forgot that the mdtiler version on GitHub didn't support this feature until now - sowwy!)
Sik is pronounced as "seek", not as "sick".

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest