I have a habit of spending my Sunday mornings messing around with experimental new features in my projects. For me, its a good way to clear my head. It kind of allows me to get away from the project while still actually working on it. Today, I played around with a feature I've been dreaming about since before I even started work on When Pigs Fly: banner towing. I have long wanted to have banners hidden around the map that you could swoop down and pick up. I even started implementing a system that would allow players to write custom messages on the banners, but today I figured I should actually get a banner towable before I waste too much time on that.
After just a few minutes of work reconfiguring some aerodynamic components and setting up joints, I had something that works... sometimes. I have worked with ropes in Unity before (see Hoist
) by chaining small rigidbodies linked together with configurable joints. This works well under the right conditions, but has a problem with stretching. Even worse, if it stretches too far, things start to explode. In Bucket and Hoist, I was able to mostly avoid these problems. With the banners in When Pigs Fly, however, the forces are much greater and sometimes very abrupt (picking up the banner). As you can see, I don't have it working 100% yet:
There is another problem that I haven't fully wrapped my head around yet. Every now and then the banner will sort of lock up in a curve. This curve causes it to generate lift, which causes it to start swing back and forth, then start spinning. It will continue to oscillate more and more until it eventually rips the back of the plane off. I haven't figured out yet if the curve is caused by my aerodynamics code or a problem with the joints.
Little experiments like this are crucial to keeping me excited and interested in a project. This is a low-priority feature that won't make it into the 0.3 update, but seeing them sort of working has inspired me to add them to the official 'to-implement' list.