Last week was a busy one. We’re putting together a series of “Meet the Team” videos, so stay tuned for that. We’re also very close to working out a deal with some amazing musical talent. Hopefully, there will be an announcement this week. I find that music is a big part of shoot-em-ups, more so than other genres, because shoot-em-ups have a very rhythmic gameplay. I feel like I rarely even notice music in FPS games. The artist we’re hoping to work with has a style that couldn’t be more perfect for Ladon.
Programming hit a big snag last week, but I finally solved it over the weekend. I discovered that Unreal Engine has a problem with collisions. While searching for a fix, I found that lots of UE4 users had run into the same issue:      …
What’s happening in that image is that the ship is passing right through the background tile, which shouldn’t happen. The blue outlines are the “collision shapes” for the objects. Long story short, in a game, you create “collision shapes” so that when things run into each other, you can make something happen. You could make the objects bounce off of each other, or you could make them take damage and possibly be destroyed, and so on. You generally use simplified shapes because calculating whether or not they are touching takes a lot of math. In other words, you don’t want to test whether or not every single little detail of the ship is touching something. So, you create a kind of boxy shape that wraps around your objects and test that.
Well, the problem with UE4’s collision detection is that it doesn’t work for “attached” objects. Attachment means that when you move or rotate one object (usually called the “root” or “parent”), the attached objects (usually called “children”) come along for the ride. It’s not much different from attaching a wing to a fuselage in the real world. But in UE4, those wings would magically pass right through everything without taking any damage. This was a huge problem because Ladon is built entirely on the idea of attaching one thing to another.
The image at the top of this post shows collision working, finally. I had to dig into the code for the engine itself, which I really didn’t want to do. Sometimes, there’s no way around it, and this was one of those times. The gory details aren’t exciting, but the gist of it was finding the code that handled collision for the parent object and copying it to the children. I shared the fix on Epic’s forums to maybe help the other guys running into this same problem.