Making a camera and room system

WOW that took a while. Was kind of mindblown typing out the post name here and seeing it's already almost been a month???? HUH??!?!?! IT'S ALMOST DECEMBER!??!?!?!?!?!?!
For the past few days I’ve been doodling around with a basic player sprite (I’m not very happy with it but I need SOMETHING that looks okay to start testing) and some tileset art. So today I started trying to see what I wanted with resolution and camera stuff!
Warning that this entry is definitely gonna be kind of technical (as technical as I can get to be fair), usually I focus a lot harder on design over technical stuff but the beginning of the project is going to have a lot of technical stuff. Everything needs a lot of setting up.
In my project I currently just have the camera object and the player object, with basic movement in the player. I’m reading the sprites straight from a sprite sheet with a script so I don’t need to manually import and edit individual sprite files every time I make a minor change in my Aseprite project file.
I still create individual sprite files, but those have no image data. Basically there so I don’t have to do any name setup, and don’t have to type quotes whenever I’m setting a sprite. I can set sprite = spr_catR and not need to worry.

(It broke for a bit)

And now it works!
Even with a “pixel perfect” look the camera won’t be limited to pixel perfect positions and scales since anything “pixel perfect” is achieved by just flooring a sprites positions. Probably won’t be too difficult to stick to that, might just need to use a custom sprite draw script that does that stuff for me so I never forget. To be fair it would be really funny if one single object ends up not committing to the pixel grid and I just never notice.
(Honestly, one day later Audie here, I might just stick to pixellated again. Who knows)
Next goal is rooms (I’m writing this as I work) so my goals are:

I believe the way I did rooms in the original project was by just checking which room the player was physically touching and moving the camera to THAT.. I’m going to check, but I’m probably going to go with the same method.
(Fact check, the camera actually was locked to the same position as the player, and the CAMERA was colliding with the rooms… maybe not the best idea. I’m going to try checking with the player so it’s all following the same hitbox)
(FACT fact check, the camera actually had a single pixel hitbox. I’m going to use that!)

The comically hard part of this is going to be the transitions.

ONE DAY LATER...

Okay so I worked for a while, got some sleep, and things are looking okay. The thing that always makes transitions difficult is when you’re dealing with a transition from 2 rooms with different sizes.
Like if you were to transition from the bottom of a single screen room into a room with more space for the camera to move around, how would the camera do this? Back in my original project the camera made it work but it was very jerry-rigged together, and would only move into the correct position within the room once the actual transition had finished and control had been given back to the player.

There’s a few options for how you’d do this. Usually I default to moving stuff on the X and Y axes independently of one another, but that ends up with a weird issue: unless the camera is moving at a direct 45-degree angle, it’s going to stop moving in one direction sooner than the other. I’m fixing this by instead moving the camera by getting the angle it needs to move to its destination, and moving it towards that.
And voila:

The thing I’m currently feeling odd about though, is that you need to actually intersect the camera’s boundaries in order to transition.. I’d rather have you just touch the very edge of the screen to begin the transition. In the original project, the camera had “transition hitboxes” bordering the screen, and when you touched one you’d trigger a transition. THAT’S JANKY! Instead I’m going to do something actually infinitely more janky but not require a bunch of other hitboxes and objects and just check for the player's position on the screen and shift the hitbox over if the player's nearing the edge.

The other issue I’ve been encountering is that for some reason transitions sometimes overshoot for a frame then jump back into position. In general they’re kind of janky…? I’m unsure if that’s a framerate issue or not.

So as of… 3:01 AM tonight, the camera works.
It transitions and stays within room boundaries, can follow the player around within larger rooms, moves the player object while it transitions, reposition where it checks for your current room so the cat always touches the side of the camera’s boundary instead of walking partially offscreen… that’s basically done. Outside of disabling objects off screen (there aren’t any objects yet to be disabled), that’s everything I wanted to do!
My next goals are basically get the player set up with basic movement, i.e. gravity and walls. Walls are the collideable object that make things a total optimization pain since there’s so many of them, so I’m going to stick to either disabling them or figuring out using a ds grid to check for walls. I remember that still not being very optimized the last time I tried it, but I could be wrong.
It feels really good to be working in a small project file again. When a project gets big suddenly launching a test build takes 30 seconds, right now everything’s so nice and small. It’s freeing.

Thank you for reading! I actually wrote this a few days ago (the 21st) and have actually made a lot of progress on random junk I don't need to talk about here.