As far as I’m aware, UDK doesn’t really take advantage of multithreading at all. The situation in UE4 is vastly better insofar as a lot of its subsystems have been multithreaded, but generally, you’re not going to see much performance benefit after six physical cores maximum. The only time you’re feasibly going to see any performance benefit from systems with more cores than that will basically just be offline rendering tasks. Even Zbrush can only utilise six physical cores max IIRC.
TL;DR version:
UDK - No, stick with less physical cores, higher clockspeeds.
UE4 - Possible benefit to lightmass render times, otherwise complete overkill, will still benefit from higher clockspeeds.
Rendering - Yes.
But honestly, if you’re looking to futureproof your desktop rig for general purpose use, you’d be far better off going for something like one of the newer i7 Extreme CPUs, or one of the older generation Xeons that had less cores but could clock higher. Not saying that new Xeons are bad CPUs by any stretch, but their usefulness outside of enterprise computing is pretty limited.