TechnicalDifficulty :
I live in the Middle East and I want to get a CPU for my build, right now I'm torn out between the i7 7700k and the Ryzen 7 1700. I'm leaning towards the Ryzen since it has 8 cores which really helps later on, and games could get optimized for AMD cpus, but I'm not sure what will happen.
Same as what Makentox said. All talk about more cores being better for gaming in the future is hypothetical. Right now, and for as long as PC gaming has been a thing, speed is what makes a bigger difference. This MIGHT change in the future, but for now anybody saying so is just guessing. They were guessing the same thing when I bought my i5-3450 years ago, but it didn't come true between then and now yet.
Now is actually a pretty bad time to buy a new CPU. While Ryzen didn't do as well in games as hoped, it did set Intel back for the first time in years, and now Intel is scrambling to come up with some new innovations. AMD is surely not going to just rest on Ryzen, and Ryzen 2 and 3 should be even more impressive (Ryzen 2 I think is estimated early next year). Anyway, basically we are in the middle of the first CPU fight between Intel and AMD in years... tech is about to go through some pretty major improvements after being stagnant for quite a while because Intel had no serious competition while AMD laid around pooping out crappy processors.
If you need a new CPU now specifically for gaming, the i7 is your best bet and is the best gaming CPU by quite a bit. Get it and be happy. If you don't NEED a new CPU now and can continue using what you have for a year, you will find much more attractive products out in summer 2018 than there are right now in 2017, because by summer 2018 Intel and AMD will have engaged fully in their fight and will be releasing impressive stuff.
(Although this is just another "guess" based on the evidence at hand.) Again, though, if your need is immediate, you should not feed bad about buying an i7. Or a Ryzen 7 for that matter. Debating which is better is kind of funny when both can run all modern games just fine if you pair it with a good GFX card.
Also in a year it should be apparent if games really are going to start utilizing more cores because of Ryzen, or if they are all still performing better with 4 cores and fast speeds, because game companies will have had time to optimize for Ryzen at that point... right now they haven't.