What is the distinction between copying and learning legally?

Hi, i am considering subscribing to UE4 mainly for studying purposes but would like to get clarification on an issue.

From FAQ/Legal

Can I copy and paste the Unreal Engine code into my own project or
engine?

If you use any Unreal Engine code in
your product (even just a little),
then your entire product is governed
by the EULA, and royalties are due.

Can I study and learn from the Unreal Engine code, and then utilize
that knowledge in writing my own game
or competing engine?

Yes, as long as you don’t copy any of
the code. Code is copyrighted, but
knowledge is free!

So if i learn a cool trick, design, algorithm, pattern, etc. and implement it in my own engine, is this considered copying? Because since it is an algorithm/design even if i don’t copy the code, end result would still be pretty similar. If i put this kind of code into my own program and make money out of it, would i owe royalties to Epic?

Thanks in advance.

Learning algorithms and ideas from Unreal and then independently writing a new implementation elsewhere is fine. Copyright law doesn’t covers the code but not the underlying idea or algorithm.

Generally, a good process is to very clearly separate your learning of techniques in one code base from your implementation of them in another.

If you find yourself looking at Epic code in one window while writing your own engine in another window, you’re in a danger zone where you risk copying the code or it’s structure. If you do it that way, you risk creating a copy of our code under copyright law, even if you choose different variable and function names. In the case of UE4, this means the difference between owing a royalty for using Epic code and having independently authored code.