Cart #dualgridgrasssprites-1 | 2024-09-05 | Code ▽ | License: CC4-BY-NC-SA
6

This is my first attempt at using the dual grid system for world tiles, which is a way to save on the amount of tiles needed for tile blending. More is explained in this video (Not mine)

Use a mouse or touchscreen to change tiles between grass and dirt, the X button shows the world grid, and the O button shows the sprite grid (what the sprites actually look like)

Interesting approach, yet even if we "only" use 16 tiles, these tiles are 2x2 pico-8 tiles, so 64 tiles for the background, witch is 25% of the total available.
Since we're not using map() anyway to display the floor, we could reuse a single full green tile and maybe also use sprite horizontal and vertical flips to display the 16 big tiles with much less pico-8 tiles, and a little more tokens spent.

@RealShadowCaster They don't have to be 2×2, they can be 1 sprite. I used 2×2 for more detail. And you could rotate tiles if you don't mind the roundings looking exactly the same, which would mean you only need 5 sprites. I thought about that, but I don't actually know how to do it

1

Your 2x2 sprites are

 ```0 2 4 6 32 34 36 38 64 66 68 78 96 98 100 102```

16 sprites

If we use symmetries :

sprite 96 grass
36 dirt
2 sprites

98 0
64 102
Small island of grass
1 sprite

38 68
4 32
small island of earth
1 sprite

2 70
vertical band if grass

6
66
horizontal band of grass

These two could in theory use a single tile, but spr() only allows horizontal and vertical flips, not sprite rotation, so 2 sprites, unless we are willing to use tlines to rotate the sprite.

100 32 diagonal fills
These two could be horizontal or vertical flips, 1 tile regardless of chosen flip axis.

Total : 7 tiles interested of 16. Not sure how you counted 5. Maybe one less if you allow rotation so 2 70 6 66 counts as 1 tile and another one if you don't count full dirt as it's an optional background not part of your grass set ?

Here's what that would give with 7 big tiles (48 8x8 tiles)
13 of these 48 are fully green, so this could be reduced to 36 pico tiles with a bit of extra code.

Cart #nikenukaze-0 | 2024-09-03 | Code ▽ | No License
1

I counted 5 based on rotating instead of flipping, not counting the dirt. The 15 is if you want extra variety with each orientation

And I know the sprites can be optimized but that isn't the point of the demonstration, the important part is the dual grid system itself which lowers the amount of tiles you need for dynamic tile blending. You could make those tiles with much less sprites, but that wasn't the focus

I'm just showing off a cool trick I found, and I hope people who find it can make good use of it in whatever way they choose

Makes sense, thanks for sharing

1

I watched that same video and played around with it as well. I didn't do anything dynamic or advanced. I just made a small test map by hand. I like the ability to have all the transitions be mid-tile while still having paths that are just one sprite wide.

Cart #dual_grid_test-1 | 2024-09-04 | Code ▽ | License: CC4-BY-NC-SA
1

@TommySezSoWhat That's a really nice and simplistic look, I like it

@0xFFFF967F Thanks. It's more my lack of pixel art artistic ability than anything else. :)

2

Very nice, I was working on this problem myself. I couldn't decide which way to read maps.
I ended up using 6 tiles (7 if you count a ground but can be draw with cls(11) if solid color) and a lookup table to determine the flip of the x or y.
I placed them them in a single row and used the check to create a 4 bit number that is used as the lookup table index

I posted about it here: https://www.lexaloffle.com/bbs/?tid=143710

Cart #dual_grid_noesisra_0-1 | 2024-09-05 | Code ▽ | License: CC4-BY-NC-SA
2