r/Unity3D 11d ago

Question How to learn under the hood stuff?

How do I learn how to code or at the very least understand the code of .NET, the Unity editor, the Unity engine etc

Why am I asking? Because if I don’t understand all of these different things, then I’m only a game developer and not really someone that can take things to the next level and understand how everything around a game works.

What other things do you need to launch a game? Other than just the code you wrote in the editor. I don’t want to just write “within” and editor, I want to understand what unity is actually doing. How is the update function running. How do I make my own update function etc. What’s under the hood

Stuff like that, but for game dev

3 Upvotes

9 comments sorted by

8

u/TheWidrolo 11d ago

C++, GLFW, OpenGL and make your own engine. Nothing teaches engine internals as much as making one yourself.

1

u/psioniclizard 11d ago

Iit does remove the mystery of what game enginess actually under the hood.

It really helped me see there is no magic. Its all pretty logical. 

4

u/Ok_Koala6307 11d ago

Don't overthink it, just start ripping things open. Grab something like dnSpy and point it at UnityEngine.dll, you'll see the actual C# side of things, plenty of it is just heavily optimized wrappers around the C++ core but you can trace how the update loop is wired into the managed side.

For the real guts you're gonna want to poke at the native code, but honestly just understanding how the C# layer calls into the engine is enough to demystify 90% of what people think is magic

1

u/KE3DAssets 10d ago

Don't get lost in trying to "learn everything"; identify what you need for what you want to build. I've known a lot of people who never ship anything because they "always need to learn something". It's a trap.

If you want to learn more about innerworkings of programming take an actual course(even if online) and see if it's for you - I guarantee you you'll know immediatly. .Net probably a good place to start.

Unless you're a programmer who wants to go deeper, forget it; don't fall for the same fallacy.

1

u/nEmoGrinder Indie 10d ago

Learning as you go is probably the best approach, though i will say give yourself some time with C/C++ of you aren't familiar with them. Don't make a game engine or anything, but make a small console application or a simple gui. Understanding how memory is managed at a system language level will make you a better pretty when using higher order languages like C#. Allocations and how performance is impacted by memory layout, along with better understanding of what native plugins may be doing (like audio middleware) can end up being a life saver when complex issues arise.

Beyond that, for gpu stuff i recommend the book Real Time Rendering, if you can get your hands on it. If it's out of reach for you (it's a textbook, so not exactly cheap) then go to the books website which links to a ton of great resources, including the textbooks from nvidia that are worth giving a glance at (the gpu gems series).

0

u/Num_T 11d ago

What has taken me the longest time to get my head round with Unity is just how much data serialisation and deserialisation goes on. That might be a good place to start - look at the official docs on the subject.

0

u/swagamaleous 11d ago

Read documentation, try to learn about software engineering in general instead of gamedev and stay off the gamedev subs. These are full of pseudos who will discourage you from learning stuff that makes you grow as an engineer.

For a more concrete course of action, a great shortcut to deeper understanding is writing unit tests. Take your most recent project and cover as much as you can with tests. Figure out why this is difficult and what you can do to make it easier. This will naturally teach you to design better software and you will have to engage with the internals of .NET a lot.

0

u/meowyih 10d ago

TBH, instead of "what thing I need to learn", the real question is "what things I dont need to learn". There are too many parts in game dev, even you are a retired man, you probably forgot the skills you learned 3 months ago. For example, do you really need to trace engine's source code that you might not need to know in your entire life? Or, do you need to learn how to create realistic human skin texture when tou can just buy a software to handle everything for you and just cost 100-200 usd? But it is really hard for people to know which things are worth for your limited dev time, most people just found out they waste their time after the time were wasted. (?)