![]() I did some minimal work on Saturday to faciliate vertical attacks while airborne, a la the downthrust and jump thrust attacks from Zelda 2 (or the pogo attack from Ducktales, or from Shovel Knight, or whatever). Sprite rendering isn’t a bottleneck at the moment, however, so I probably won’t go down this road, but it’s certainly interesting to think about. This would depend on packing every sprites’ sheet into another texture atlas and maintaining a fixed-size dynamic vertex buffer whose vertices could be allocated to each sprite’s quad, in much the same way I handle font rendering. In fact, with a little more work, this pattern could be generalized to encompass sprite rendering as well, such that I could draw all the on-screen sprites in a single draw call. My solution is to aggregate all the palettes into a texture atlas (shown below in PIX) and then index into this texture with a new texture coordinate channel added to the environment’s vertex buffer. By contrast, each layer of the environment is drawn all at once in a single draw call, which means all the colors for each 8×8 tile must be specified somehow. ![]() Each sprite is rendered in a separate draw call, so I can simply set each of the three palette colors as shader parameters prior to drawing. On the game side, this works a little differently than sprite recoloring. For Gunmetal, this should be a huge win in terms of coaxing a variety of aesthetics from a smaller number of tilesets. This is another feature that I contemplated for Super Win but rejected due to time constraints. I can now apply this same process to every 8×8 tile of each tileset in order to palettize environments. The next major feature I worked on this week is an extension of the palette swapping feature I implemented for sprites a couple months ago. In this case, the full-size standing collision primitive would intersect the ceiling, and, in the absence of any proper handling, we could walk or jump through those blocks.) But in the general case, at least, this is working correctly, and I’ve been able to prove that crouching under projectiles will function as intended. (Consider the case of standing up after being crouched beneath a low ceiling. ![]() For instance, I’m not doing any checks to see whether the new collision primitive is fully encompassed by the previous one if it’s not, we run the risk of intersecting solid geometry and falling out of the world. There are still a few lingering issues left to solve here. At runtime, the game looks for changes to this setting whenever the current topmost animation sequence changes (as I mentioned in a previous blog, multiple prioritized sequences may be playing at once, with the highest priority sequence being the one seen on the screen) and toggles the appropriate collision primitive for that sequence. My editor now has a list of primitives which may be associated with animation sequences. For Gunmetal, I wanted to have a proper crouch that could be used to avoid enemy shots, and that meant tackling this issue. Historically, my entities have had one primary collision primitive that never changes in size or relative location, which is why holding the down button in Super Win just makes the character tilt his head down rather than crouching. The first of these was to alter the size of the player’s bounding box in response to crouching and standing. ![]() I chose to spend this week knocking out a few tasks that had been looming overhead for a while, the last few things that need to happen before I feel like the complete set of immediate player actions exists in some form. I’m back! Well technically, I was back from my honeymoon last Monday, but I had already scheduled that post in advance, so this is the first new material I’ve written since getting married and traipsing around Europe. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |