From what you've said, you realize your brain needs some downtime after gaming before sleeping. Give it what it needs. I have a neurological problem that results in restless sleep with what I describe as "stuck" thoughts - the same thoughts over and over no matter how many times I wake up and doze back off. It's more maddening than a dripping faucet! Over time I have learned some triggers, and I avoid them like the plague. Our brain is very good at repeating patterns. You may want to consider breaking your gaming time into shorter segments. Getting one's sleep all out of whack is miserable and not healthy. Guard your sleep like it's your most precious asset. Do your part to help yourself, and if need be, see a doctor.
Hi
The reason behind you not getting proper sleep is prolonged involvement in the games during late hours at night. You should practice good sleep hygiene such as going to bed at a regular time, avoiding any games or watching TV in bedroom, keeping your bedroom dark and cool, and getting out of bed if not getting sleep and then again trying after sometime. All these would surely help restore your sleep cycle and make you feel better.
If this doesn’t help, I would advise you consult your a sleep therapist for a complete evaluation. He might advise a sleep study (polysomnogram). Sometimes cognitive behavioral therapies are also helpful.
Take care!