Writing game engines with C# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Writing game engines with C#

I've made a few games with Unity and Monogame. I'd like to go over step below and create my own soft engine (using just the processor, not DirectX/OpenGL/Vulcan), I just want to practice and learn more C#. I know some of the math involved like line linear algebra, matrices, vectors... Most stuff I found is for C++ what's totally understandable. But I bet there's some C# also. I found some and I''m looking for more. Do you know any? I'm thinking of books, samples in GitHub and etc.

20th Oct 2019, 9:58 PM
Rodrigo Oliveira
Rodrigo Oliveira - avatar
8 Answers
+ 7
Aymane Boukrouh there could always be some highly experienced people here who may comment, so maybe a post is never too advanced here IMHO.
21st Oct 2019, 3:26 AM
Sonic
Sonic - avatar
+ 6
Saiffyros Ah... I see now. There were some parts of the question that were unclear to me. Specifically, the reference to "soft engine" (or "software engine") is a term I don't believe is familiar in the software industry, at least not among my dev peers or the wide range of tech material I read. While the term is used in the davrous.com article, there doesn't seem to be a clear definition for this on Wikipedia or other sources making a distinction between CPU over GPU usage. So, the context was lost on me. Also, the reference to "soft engine" was followed by, "(using just the processor, not DirectX/OpenGL/Vulcan)." I interpreted this as you wanting to implement a custom API for the GPU in C# rather than using an existing one written in C or C++. Again, one could interpret the reference to "processor" to mean GPU in this context. I'm only pointing out my own confusion to help clarify for anyone else who might come along with similar misunderstandings based on the current wording of the question.
21st Oct 2019, 4:53 AM
David Carroll
David Carroll - avatar
+ 5
Saiffyros hi. Making your own game engine good stuff. I have had a similar idea. It is a lot of work. I made one in C/C++. I believe it is a good experience. I learned a lot from making my game engine. Such as better memory management, and organizing files.
20th Oct 2019, 11:09 PM
Manual
Manual - avatar
+ 5
Saiffyros Here are some other links you might be interested in: ======== New CPU based Physics Engine written in C# -------- bepuphysics v2 ---- - Blog: https://www.bepuentertainment.com/ (Contains a lot of good technical content you might be looking for.) - https://github.com/bepu/bepuphysics2 bepuphysics v2: out of beta! - https://youtu.be/sfgC_eNx9M8 - https://www.reddit.com/r/gamedev/comments/bfjpss/the_fastest_cpu_based_physics_engine_is_written/?utm_source=share&utm_medium=web2x ======== Other interesting links that are unrelated to C#, but worth reviewing. -------- Visualizing Quaternions: ---- - https://eater.net/quaternions - https://eater.net/quaternions/video/intro -------- 8-bit Guy: How "oldschool" graphics worked ---- Part 1 - Commodore and Nintendo - https://youtu.be/Tfh0ytz8S0k Part 2 - Apple and Atari - https://youtu.be/_rsycfDliZU
21st Oct 2019, 5:29 AM
David Carroll
David Carroll - avatar
+ 3
This a too big for anyone here to answer correctly, you'll have to figure out yourself. But it doesn't involve 'some' math, it involves a 'lot lot' of it, and yes I read that most of them are written in C++ because of it's speed. Game engine take more than just programming, so I don't think you'll find useful answers here. Google is your friend
20th Oct 2019, 10:10 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Thank you for your answer. I've done that already. Just checking, maybe someone here has gone that way. I'm studying linear algebra and I've played with view matrices and projection matrices already. So I have an idea of the math involved. Thanks though.
20th Oct 2019, 10:15 PM
Rodrigo Oliveira
Rodrigo Oliveira - avatar
+ 2
David, the links you posted are related to GPU control. If that was the case I'd go with OpenGL, DirectX12 or Vulkan. I made a game ith monoGame for example. I'm looking for something like this: https://www.scratchapixel.com/index.php?redirect https://www.davrous.com/2013/06/13/tutorial-series-learning-how-to-write-a-3d-soft-engine-from-scratch-in-c-typescript-or-javascript/ https://www.youtube.com/watch?v=ih20l3pJoeU&t=63s
21st Oct 2019, 1:30 AM
Rodrigo Oliveira
Rodrigo Oliveira - avatar