Let's face it. Rumble and XNA haven't had the best history. I still hear people refer to "massage games" and such when people talk about Xbox Live Indies, but there are many out there who can now look past the sea of undesirables and see the potential and successful. It's come a long way since it's innocent beginnings. Yet many developers still shy away from utilizing force feedback and some that do, use it in a brute force kind of way that can annoy the player. Even some AAA titles seem to just set the motors at full blast for three seconds when you crash off the road. Ugh. When it comes to rumble, subtle is the way to go.
Before I go on, I'd like to say that the following code is free to use in your game and is licensed under the Microsoft Permissive License with one caveat. You can not use this component in a game where the sole purpose is to vibrate the controller. You cannot use this for a "massage game" or any other where the purpose of the application is rumble based. You can only use it to enhance existing gameplay where otherwise, not having rumble will not change the objective of the game. Hate that I have to say it, but it needs to be said.
Here I've implemented a time dependent, dynamic based rumble component. I've played many indie games that accidentally leave the motors running until I quit to the dashboard. You can get around this by using time based triggers. When an event happens that requires force feedback (say a collision) just add a new rumble for a set amount of time and when the times up, the rumble stops.
To make things subtle I use the idea of dynamics. Since sound is a vibration, we can use it as an example in which to compare. In music, dynamics are control over the volume of the sound, or intensity of the vibration. By varying the dynamics over time, I could apply a "shape" to the controller's rumble. I've added the ability to change to different rumble shapes by calling them by name, such as binary (on/off), linear (start at minimum and increase to maximum over time) or parabolic (fade in to maximum by time/2 and fade out to minimum by time).
Before I go on, I'd like to say that the following code is free to use in your game and is licensed under the Microsoft Permissive License with one caveat. You can not use this component in a game where the sole purpose is to vibrate the controller. You cannot use this for a "massage game" or any other where the purpose of the application is rumble based. You can only use it to enhance existing gameplay where otherwise, not having rumble will not change the objective of the game. Hate that I have to say it, but it needs to be said.
Here I've implemented a time dependent, dynamic based rumble component. I've played many indie games that accidentally leave the motors running until I quit to the dashboard. You can get around this by using time based triggers. When an event happens that requires force feedback (say a collision) just add a new rumble for a set amount of time and when the times up, the rumble stops.
To make things subtle I use the idea of dynamics. Since sound is a vibration, we can use it as an example in which to compare. In music, dynamics are control over the volume of the sound, or intensity of the vibration. By varying the dynamics over time, I could apply a "shape" to the controller's rumble. I've added the ability to change to different rumble shapes by calling them by name, such as binary (on/off), linear (start at minimum and increase to maximum over time) or parabolic (fade in to maximum by time/2 and fade out to minimum by time).