Is it a good idea to code a Game Engine with C in 2018

closed account (DEhqDjzh)
Yes I know, creating a game engine with c++ for someone learning c/c++ is not the best idea but, what about creating a game engine with C? Why? because I love C, Mostly I love low-level languages. If I found enough source to learn assembly I'd learn, without a doubt. So anyway, is it harder to code an engine in C? is it a good idea?
Last edited on
You can still code Cish C++ and you can still do mixed language programming.
The right answer is probably a mix of assembler, C, and C++ with the vast majority of the code in c++ and the critical sections going to lower levels for performance if you can show an improvement. Cish c++ is not in style these days, but sections done this way may also show a performance gain. The key is to get the code done, debugged, working, and do the performance pass last. Then you can chew on a few areas that might need a rewrite in another language or a lower level style, prove that it is significantly faster, and go from there.

so.. step 1 .. get it working :)

Now, that aside, if you just WANT to code it in C, then do so. But you are making it harder for yourself -- dozens of key datastructures and algorithms that you could have had have to be hand written and debugged. You are going back 3 decades of progress --- it may be fun, but good idea? Not IMHO.

memguy,

I don't know how new or experienced you are at programming, so apologies if I assume or don't assume certain skills.

A big mistake beginners make is trying to build a game engine instead of a game. It's a difference between theory and practicality. Making a full "game engine" is a huge task, and it entails making a huge number of features, depending what you want to implement. A lot of beginners make the mistake of starting with nothing and then trying to build some complex, versatile system, and they quickly get in over their heads. I myself am guilty of this at times. Some people will design a game engine, and then realize it is just frustrating to actually make a game with their engine, so then they waste time re-designing their engine.

I have to ask, how many games have you made, even if small? If you've made games, and are looking to go beyond this by making a robust, reusable game engine with your own custom tweaks, then go for it. But if you are trying to make a game engine before you even have experience making small games, in my opinion that will most likely end up with an abandoned project.

PS: Your actual question is about whether to use C or C++. I don't think that's the right question to ask. Many people use C for their projects, it is what it is, you do you. If you don't want (in my opinion) cool features like templates, better type safety, polymorphism, or the C++ standard library, then by all means, use C. The bigger goals and design questions will remain the same.
closed account (E0p9LyTq)
Most games in 2018 are created using a preexisting game engine, either 3rd party or one created in house for previous games. All done by TEAMS of developers. Lots and lots of very talented and knowledgeable people who have spent years programming.

Creating a game engine from scratch by a solo developer, especially one who is a beginner in learning the rudiments of programming, is not even remotely a sensible idea.

Unless you want to get frustrated.

A couple of books that I have and found good for teaching the BASICS of game programming, both console and Windows API.

C++: https://www.amazon.com/gp/product/1305109910/

Win32 API: https://www.amazon.com/gp/product/0672326590/

Both are outdated and newer compilers will "choke" on some of the older code. Trying to correct and update outdated code is a very good learning experience.
I will say, there are successful indy developers that work solo or in a very small team. Of course, it's few compared to the big industry games, but still.

Btw, here's a blog post I found on GitHub, titled "Programming lessons learned from making my first game and why I'm writing my own engine in 2018"
It's about a solo developer and their experiences. There might be some opinions you disagree with, but it's interesting to hear the perspective of someone that has actually released a game on Steam.
https://github.com/SSYGEN/blog/issues/31
Topic archived. No new replies allowed.