✅ Can I make my own Game Engine with C#?
Title say it.
Anyways i'm aware of Unity and Godot support C#, you may ask why would i ask this question, it's simple... I'm just curious about it, i've seen some dev make their own Game Engines via C++ or Java on YouTube but i've searched on YouTube for C# but there's lack of info of making your Game Engine with C#. I could learn C++ since the Unity Engine itself is made in C++ (From what i've heard)
But should i really learn C++ and stick to C# still? Because i've used and learnt C# in Unity during 3 years if i remember but i'm not really a professional on C#, I would like to hear some answers, thanks!
7 Replies
you definitely can
you'll need to get familiar with p/invoke or use other wrapper libraries because most game-related libraries like graphics, physics, etc are still C++
C# has some core behaviors that can be hard to work around in games, like not being able to control when the garbage collector runs which can lead to stutters
so i might need to learn bit of C++ to be safe than sorry? seen some devs use this thing called "Raylib" to make their games saw they support C# in their website somewhere
if you don't use existing wrapper libraries you will need some knowledge of C++ if only to be able to call into native libraries
so from what i'm reading from you just now, lemme recap this for myself. I don't need to learn C++ as long i use existing Libraries like Graphics and Physics like you said?
but if i want to make them from ground up i need to learn C++ for the "Libraries" to make the game engine itself?
https://www.raylib.com anyways here's this raylib i saw
yes, with this for example the library itself is written in C so you would need to find a C# library that wraps it or write bindings yourself
ah excellent thank you very much!