Post by 0x8bitdev on Apr 17, 2023 12:40:39 GMT
A little addition to the dynamic maps info:
Getting a tile property with dynamic maps:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From the available functionality of dynamic maps follows a more flexible way to obtain a tile properties for multi-directional maps.
For example, when both tiles and tile properties consist of 2x2* blocks, you can use:
mpd_get_tile_property( mpd_get_tile( x, y, TURE/FALSE ) ) **
This will work faster than mpd_get_property( x, y ), due to its greater versatility.
But if you have a simple map consisting of 2x2 blocks or 4x4 tiles with unique properties per tile (when different tiles do not share the same property),
then the built-in tile property data can be ignored and replaced with block/tile indices.
In this case, getting the properties of a tile is reduced to a single call to mpd_get_tile( x, y, TRUE/FALSE ), which is even faster.
---
* It is more complicated with 4x4 tiles, because they require additional data about the 2x2 blocks of which they are composed.
And this data is in ROM. In this case it is easier to use the existing function mpd_get_property( x, y ).
** Since mpd_get/set_tile_property(...) and mpd_get/set_tile(...) are macros or inline functions, and if you have many identical calls to them in your code, it may be better to wrap these calls with function(s).
I haven't tested this yet?
For dynamic maps, you can use RLE compression. But you may get a negative compression exception when exporting.
Because completely unique maps without repeating tiles cannot be compressed using RLE.
And at the moment, all maps either have to be compressed, or RLE compression cannot be used.
I will make ignoring of incompressible maps to make the operation more transparent for user.
Three frames per tile...
I realize that in this case my approach is wrong.
A) Drawing these tiles to screen every 5 ticks is taxing
B) I am wasting tile space by having three frames of animation.
The real method here would be palette cycling.
You are right. Why complicate things when you can make them simpler?..
With MAPeD I can get as far as inserting the 6 colour tile...would you ever consider incorporating this palette shifting functionality?
Or is this better suited being manually coded?
In either case I'm very excited about this prospect but I'm not sure how to proceed with offsetting and injecting colours into specific indexes and insights would be a big help. I don't know of any examples of this behavior off hand.
It's quite simple task and you can make it manually.
Try to use the HuC's set_color(...)/get_color(...) functions. Using them, you can get and change all the 512 colors in the palette.
But you should do it right after vsync() to avoid glitches on the screen.
Sorry, but I have a feeling that you have already written the game and only animated tiles are left as a finishing touch. Or am I wrong?..
Getting a tile property with dynamic maps:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From the available functionality of dynamic maps follows a more flexible way to obtain a tile properties for multi-directional maps.
For example, when both tiles and tile properties consist of 2x2* blocks, you can use:
mpd_get_tile_property( mpd_get_tile( x, y, TURE/FALSE ) ) **
This will work faster than mpd_get_property( x, y ), due to its greater versatility.
But if you have a simple map consisting of 2x2 blocks or 4x4 tiles with unique properties per tile (when different tiles do not share the same property),
then the built-in tile property data can be ignored and replaced with block/tile indices.
In this case, getting the properties of a tile is reduced to a single call to mpd_get_tile( x, y, TRUE/FALSE ), which is even faster.
---
* It is more complicated with 4x4 tiles, because they require additional data about the 2x2 blocks of which they are composed.
And this data is in ROM. In this case it is easier to use the existing function mpd_get_property( x, y ).
** Since mpd_get/set_tile_property(...) and mpd_get/set_tile(...) are macros or inline functions, and if you have many identical calls to them in your code, it may be better to wrap these calls with function(s).
Should I always use RLE compression from this point forward?
I haven't tested this yet?
Because completely unique maps without repeating tiles cannot be compressed using RLE.
And at the moment, all maps either have to be compressed, or RLE compression cannot be used.
I will make ignoring of incompressible maps to make the operation more transparent for user.
Three frames per tile...
I realize that in this case my approach is wrong.
A) Drawing these tiles to screen every 5 ticks is taxing
B) I am wasting tile space by having three frames of animation.
The real method here would be palette cycling.
With MAPeD I can get as far as inserting the 6 colour tile...would you ever consider incorporating this palette shifting functionality?
Or is this better suited being manually coded?
In either case I'm very excited about this prospect but I'm not sure how to proceed with offsetting and injecting colours into specific indexes and insights would be a big help. I don't know of any examples of this behavior off hand.
Try to use the HuC's set_color(...)/get_color(...) functions. Using them, you can get and change all the 512 colors in the palette.
But you should do it right after vsync() to avoid glitches on the screen.
Sorry, but I have a feeling that you have already written the game and only animated tiles are left as a finishing touch. Or am I wrong?..