Does anyone know the logic behind drawing the shadow tiles in VX?
I notice there's no shadow pen and no shadow layer like Ace and later engines have, so the game must do all the calculations at the time the map loads.
Hoping it's not too complicated.
If it's anything like how VXAce and MV handle it, it is probably done by the hidden Tilemap class within the RGSS dll.
The entire process of assembling the map from the tileset images and the MapXXX data files appears to be handled by Tilemap in MV including drawing the shadows (look at Tilemap's "_drawShadow()" function in it in rpg_core.js) so I would assume the same applies for VX too.
Unfortunately, that means you'd need someone able to reverse-engineer the dll in order to find out how it works in detail. Even if those people exist, I'm not sure if you'd find anyone willing to admit to it around here.
That's interesting - I thought it was just a flag that says there's a shadow on that tile or there's not. But looking at that function, it looks like each tile is broken up into 4, and each quarter may or may not have a shadow.
Not interested in reverse engineering - just hoping there's a simple set of rules that can be followed. Does this sound plausible?
A3 and A4 tiles generate shadows on the tile to their right.
A shadow is drawn on a tile (x,y) if:
- (x,y) does not have an A3 or A4 tile AND
- (x-1,y) DOES have an A3 or A4 tile AND
- (x-1,y-1) DOES have an A3 or A4 tile
So this caters for no shadow beside the top tile, but shadows beside ever other tile all the way to the bottom.
When a shadow is drawn, it covers the left half of the tile. I cannot see any situation that would cause a shadow to be drawn on the right half of a tile, and I cannot see any situation that would cause a shadow to be drawn in only the top left or bottom left corner.
I discovered that about A5 (well, at least the first tile on the second row) but I didn't know it applied to the entire first two rows, or the A1 sheet. Thanks for that.
Other than those two things, I managed to get it working, so I'll go add those now. Thanks 🙂
Interestingly, MV will draw a shadow on an A1 autotile (at least the normal water - haven't tested them all) if you draw to the left of it with an A3 or A4 tile.