Re: Rotating room collision.
Posted: Fri May 04, 2018 4:58 am
In extension of rainwarrior's brilliant post, I'd like to add that it's only really a problem when you're doing world collision, and trying to enforce the function of solid walls or platforms, which is what I'm assuming is the end goal when you are talking about a "rotating room".
Comparing two individually rotated rectangles isn't really a big issue if you don't have too many objects to compare, and you just want to find out stuff like if there's a character hurting another character. However, when you want to push back an object along a rotated normal vector, things start getting pretty complex.
I'm not sure how you guys do your background collisions, but one of the reasons character-to-background collisions are so easy to do solidly on an NES or a SNES (and similar old school hardware), is that we are expecting the backgrounds to always fit into an aligned grid, meaning you can look up the nature of every single surface directly from the coordinates.
Once you're working with arbitrary polygons and floating point vectors, it becomes much more complex to make your polygons function as actual solid walls, which is why almost any 3D game ever created has some sort of glitchy way for your character to go out of bounds. Skyrim is a field day.
Now imagine doing this in a SNES game - you absolutely need some way to simplify your calculations in a subtle way that works compared to your game design. In this case, the first thing I'd look at is how much does your room actually rotate. If it never veers more than 45 degrees, that's a big advantage, as you can make floors keep acting like floors, and walls keep acting like walls. The "waving" section of the tower of Pisa in Castlevania Bloodlines is one of my favourite examples. As fas as I can tell, the floor remains as axis aligned tiles, but moved around similarly to the rotation effect itself. Also, collisions are exclusively calculated for the main character.
I'd love to see how Mohawk and Headphone Jack did it on the SNES though.
Comparing two individually rotated rectangles isn't really a big issue if you don't have too many objects to compare, and you just want to find out stuff like if there's a character hurting another character. However, when you want to push back an object along a rotated normal vector, things start getting pretty complex.
I'm not sure how you guys do your background collisions, but one of the reasons character-to-background collisions are so easy to do solidly on an NES or a SNES (and similar old school hardware), is that we are expecting the backgrounds to always fit into an aligned grid, meaning you can look up the nature of every single surface directly from the coordinates.
Once you're working with arbitrary polygons and floating point vectors, it becomes much more complex to make your polygons function as actual solid walls, which is why almost any 3D game ever created has some sort of glitchy way for your character to go out of bounds. Skyrim is a field day.
Now imagine doing this in a SNES game - you absolutely need some way to simplify your calculations in a subtle way that works compared to your game design. In this case, the first thing I'd look at is how much does your room actually rotate. If it never veers more than 45 degrees, that's a big advantage, as you can make floors keep acting like floors, and walls keep acting like walls. The "waving" section of the tower of Pisa in Castlevania Bloodlines is one of my favourite examples. As fas as I can tell, the floor remains as axis aligned tiles, but moved around similarly to the rotation effect itself. Also, collisions are exclusively calculated for the main character.
I'd love to see how Mohawk and Headphone Jack did it on the SNES though.