Home Creators Posts Import Register Favorites Logout

Content

Setting up the new weapon was easy; I’d prefer it the bullets moved in a sine wave but I’m not that good yet, so I settled for a chain of five large bullets. With ten ricochets, they’d bounce between the walls for a good while, letting you fill a whole room with death over time. Well, that was the theory anyway. In practice, they immediately clipped into a wall, bounced around in that wall, and then shot out into the space beyond the walls, never to return.

The good news is that I actually was familiar with this problem, as it had been happening to the ricochet bullets since I implemented them. It’s caused by the fact that each wall is an individual square set in a line instead of one long rectangle—a side effect of the way that the procedural generation works. Basically, if you hit that seam between two wall tiles, the bullets would ricochet between them and get stuck, but with the extra several bounces, they were actually sometimes making it through the wall. I suspect making the bullets larger also made it ironically easier to slip between tiles because I’m fairly certain it happened more often with this weapon than when I previously tested ricochet.

Fixing the problem required some thought, however. There’s no solution to the wall problem; that’s just how my procedural generation works and I’d have to scrap the whole system to change that, and every method I’ve found of doing so in GMS2 works that way. I could change my ricochet system, but I’m currently using the engine’s inbuilt physics to figure out angles instead of having to math them on the fly, and having tried mathing them out each time, the physics are better. There was however something I could change about using the engine physics. I had the code set to use precise collisions to determine angle. Disabling that seems to have completely resolved the problem. There is a part of me that’s worried I had precise collisions on for a good reason that I’ve forgotten about, but I’ll cross that bridge when it explodes or however the saying goes.

And, for fun, I set it so that ricochet bullets will now bounce off of enemies as well as walls, giving ricochet more direct use against enemies.

Until Next Devlog!

-DeusVerve

DevLogs like these are brought to you by Patron(s) like Haelerin!

Comments

No comments found for this post.