Although you have not mentioned the game you play, I can give you general exercises that can act as warm-up prior to your game. You can start by either moving on the spot or walking about slowly building up the pace just slightly. Alongside you can do some joint rotation and flexibility work, starting with the neck by rolling it side to side, the shoulders, the waist and the knees and ankles. Forward and backward bending of the back will also help lumber up the torso region.
After doing these, hold each of the stretches for about 5-10 seconds, to prepare the body for the action that is to follow. This whole process should take about 10 minutes.
Then you can get into your game by slowly mimicking the actions that will be included in your game and you are ready to go! Remember to cool down, making sure to bring your heart rate down gradually and to stretch by holding each stretch for about 15-20 seconds.
As far as the knocking in the knees go, if there is discomfort or pain associated with it, you may want to go see a doctor.