Both look overkill enough, min is a dedicated gpu with at least 4GB vram(especially if u handle 4k textures) and 16GB ram to multi task such using Krita and ue4 at same time.
For compilation and any cpu workload, dont go with too much cores(like over 16 with low freq). You would do more single threaded task in ue4 so less cores more freq
You could also look for a lower specs, laptop wont last that long as PC do.
In you live in a hot area, the keyboard and backplate tend to bend/expand after few years.
So you should consider going for an Aluminium chassis and an easy to repair laptop if you plan to use it on the long run.