Sunday, April 1, 2007

Rumble, Intersection, Sever, Death

Last night, I finished up the gamepad rumble support. I now have a queue of rumble "requests" that expire after a time. The highest rumble intensity of course is the one sent to the controller. After that one expires, the next one kicks in. Or I can set a continuous rumble at a certain intensity, but I have to remember to turn it off when I'm done with it.

After that, I worked on detecting line intersections when the user tries to build a route over an existing one. I'm pretty good at figuring math out on my own, so I tried to do it myself, but after a few hours (maybe four) of frustration, I threw my hands in the air and googled it. Sure enough, it's some complex equation that I never would have figured out, so I'd wasted four hours for nothing. But I did figure out how to detect whether a line intersects with a circle (route crosses a node).

You see, I graduated highschool in only Algebra 2, but I was placed in Calculus in college, so I skipped everything in between. I've had to teach myself a whole lot. I think I've become a little too self-reliant. But when it comes to indie development and all I've got is myself, self-reliance is an asset.

Most of today was spent getting the routes to retract correctly after they're severed. The biggest challenge was managing the people in the routes as it happened. When the retracting route outruns the people, they die. I had bug after bug, but it's finally solved. However, severing at the moment is done only by the player to his own route (right-click). The only time when a player would sever his own route is in an emergency when he needs to do something else with the route really fast.

When you want to salvage the people in the route, you can suck the route back in at the speed people travel so that they have a chance to evacuate (some may still die if there's a traffic jam). This could come in handy when you're attacking the enemy; you can retract one route as you build another so you never run out of people. This function is my next project.

After I fixed the severing, I had to work on displaying the "dead" people. When people die, I add them to a list of dead people, each with an expiration. As they near the expiration, they fade. However, I wanted them to be distinguishable from the live ones, so I made their blend mode additive, which really made them look cool. Then, I decided to do the same for the destroyed nodes, only with bigger white circles. Finally, I made a big intricate route system, and severed it, just to watch the chain reaction. It was great.

Soon, I'll be adding some screens of what I've done so far.

clevceo

No comments: