I've managed to make a little bit more progress on the platforming front yesterday for pushing and carrying things around.
I had a basic way to push objects pretty similar to how I used to have it set up in Verge, but now with all the fancy features of C# I'm able to do it in a more clean way. My old GML GameMaker code definitely had some if statements that went across the whole code window and more, so hopefully this version ends up being a little bit more organized than that.
So pushing one single block around seems to be working well enough now, but when it comes to big stacks of blocks there might be some problems.
My ideal scenario is that a stack of objects can be carried by another object, and I also want to make it work with pushing objects as well. Objects that can be pushed should always push each other, so a long stack of boxes should be able to be pushed by a moving object, and then after that I can take care of things of how much an object should slow down when pushing and all that good stuff.
On the real life front I am still in the middle of moving chaos, so things are a little weird for me still, but I'm somehow managing to make something work with my laptop at a coffee shop.
Game development ain't all birthday cakes and flowers as some may have you believe. As I move forward with this platformer game I'm realizing how much I actually don't know about platforming! You might think I know a lot with so many platformers under my belt, but now my ideas are way outpacing my abilities as a programmer.
Right now I'm trying to code this system and I'm making little to no progress even though a lot of code is being written. For example I'm currently working on the structure of how objects will update. The simplest way at first is to have each object go through its platforming operations one at a time in their execution order, but this leads to weird issues down the road. An object higher up in the order will have priority over other objects, and this is not something I want!
My new approach is to have each object update in parallel with one another, one pixel at a time. Each object will calculate its speeds and then buffer them into their remainder. Then a PhysicsHandler object goes through and moves all of the objects one pixel at a time each in parallel. This might not make any sense at all, but it's a set up for objects being able to push one another. For example if two moving objects collide, I want them to collide in the right spot, and I think the only way to do this is to move them one pixel at a time in parallel.
So I'm also working on the ability for objects to push one another. I have a simple box that I want to be pushable, but also solid so that objects can stand on it, and also I want it to be carried by other objects as well... but so far that is presenting a lot of challenges for how I've already coded things. For example I have no idea when I should be registering collisions on the side of a moving object now that objects can be pushed.
My assumption was that when I went to move one pixel to the side I could simply check for a pushable object and push that object to the side... however with the current way I check for surrounding collisions the results are not quite what I want. If an object can both collide with, and push the same object, the push only happens for one or two pixels and then the pushing object believes it's in front of a wall so it no longer moves.
As you can see I've already rambled for a number of paragraphs and I feel I haven't even scratched the surface of what's going on! I've been looking at my old Game Maker games platforming code to see if I can learn anything from my past self, but unfortunately the code leaves a lot to be desired. In Verge I did have boxes working that could be pushed, carried, and stood on, but I didn't cover a lot of corner cases and designed levels around not having huge bugs appear. I'm totally sick of designing levels around bugs though and I want to do this right! Unfortunately that means I'm driving myself insane as I try to handle all the possibilities I can imagine with this platforming engine.
I'm not feeling super great and I feel like everything sucks right now, but I guess I'll keep working on stuff and hope I can figure out small bits of it at a time.
Hi! I'm Kyle Pulver, and I make video games most of the time in Seattle, Washinton. Here you will find my thoughts, games, websites, doodles, and other stuff like that.
If you want to get a hold of me leave a comment, check out my email at the bottom of the page, or just tweet at me. Thanks for stoppin' by! You're the coolest.