Why aren't more games programmed in C?
Why aren't more games programmed in C?
Popular games are always triple AAA.
Because object-orientated programming is very useful for video games.
...
Read this OP: zeroequalsfalse.press
They didn't use C, but they would encounter the same problems if they went with C (if not more). In short: difficulty, costs, time and effort that can be easily avoided if you use an existing engine, so there's really no point in doing this unless you game is soooo special (and most of the time it's not). On top of that you really don't want stuff like undefined behavior messing up your 1 billion LOC application.
because OOP allows poopjeets to make quick shit
Bekaus C sits for CUcK
Because the goal is to reduce the amount of bugs, not increase it.
The real question is why aren't more games programmed in Lisp
Most 6th-gen games were actually written in C (or even Assembly sometimes). The only reason we don't use it anymore is because millennials started getting hired by game development studios and millennials are lazy pieces of shit who don't worry about optimization and only copy-paste code from the internet until it kind of works.
So, AAA AAA AAA?
Because it isn't the right tool for the job.
Or maybe, just MAYBE, plain C is fucking obsolete as a programming language for anything other than private accountant-like applications and small shell scripts.
Fuck off
Complaing of having to use a different high level imperative programming language than the one you are used to is the sign of a bad programming. Stop bitching. (Unless it's AngularJS. Fuck that garbage)
Also, like the anons mentioned here, OOP is too convient for videogame development.
This
I'm a computer engineer, and older than you, so YOU fuck off with your baseless assumptions, child.
What can C do better than C++?
Nothing. C is for old farts who graduated in the 90s and can't update their knowledge for shit to keep them relevant in the job market.
this user knows what ze's talking about
>private accountant-like applications
>in C
>small shell scripts
>in C
this user doesn't know what ze's talking about
>I just starded learning programming
Bitch, I know x86, x64 and ARM assembly. I optimized the few games I made to an unhealthy extent. I have also programmed complex interpreters in C, with full error tracking and shit. And I will tell that, if in this day and age, you actually try to develop a big game, with modern day standards, mainly in C, you are simply retarded.
iOS apps use Objective-C and Swift.
Android apps can be programmed in C#.
Xamarin apps work by translating the previous two into C# then compiling to native.
Basically, a good part of all the mobile development is based on some form of C, just not plain C.
Except java based android.
Unity = best graphics, great for learning to
O O P
O
P
the "zero-cost" abstractions of C++ aren't zero-cost in reality
it's fine if you know what you're doing though
Yeah, I work for the government making both public and private desktop, web and mobile applications, but I absolutely don't know what I'm talking about.
>not knowing you can run C programs from a shell script
>not knowing basic accountant applications are so simple you can actually use an old shit language like plain C for them, if you dont have any alternative (which you always do)
Go suck a cheesy dick.
C++ gives you the freedom to ignore those abstractions and write C (or extremely C-like) datastructures.
In other words, you can write noncritical code quickly and easily while critical code can be manually optimized.
These days, if you want to get into gamedev, you want to learn Java.
Exactly.
If you don't know Java you are not relevant in this job.
Still C++ is best
It's not convenient for game development at all. What makes people think that?
I could see it if you meant a smalltalk type OOP. That's not what anybody means though. Nobody needs help making polymorphic calls. That's practically all you get with OOP for games.
ECS is very often used in games and they're hardly ever implemented through inheritance because that's ridiculously slow. Or maybe that's why games are painfully slow nowadays.
The problem with C++ is that it's programmers are promised that those abstractions will be fast, as they're called 'zero cost abstractions' . They're not really that but people don't realize it because it requires inspection of the code. Performance oriented programmers will know that but normal programmers don't understand the extent of these problems. Things that are considered strictly compile time like recursive templates just hammer performance into the ground frequently. And C++ is a very big language with many very stupid features and a a Turing complete template system (though it really shouldn't be). If you look at what the C++ community does with their language it's really vile.
For instance:
youtu.be
This would be fun as just a toy. But it's intended for use. You'll find it all over.
Many game studios heavily restrict their developers use of C++ because of its problems.
C++ is not a good solution to anything. It's just not a 40 year old language like C.
No Java isn't regarded as a serious language with gamedevs. Maybe if you're an indie you can be fine with it but if you're an indie developer you could write in anything you want because you're self employed.
Obvious exception is android, where you'd forced to do some of it in Java. Lots of people move into the NDK asap though.
Now that's just ludicrous user. Most games are written in C#, C++ and assorted scripting languages (lua for instance).
I was under the impression that you actually wrote your "small shell scripts" mainly in C for some reason, which made no sense
Still, why not simply use something like pypy?
You're right. STL is crippled with a lot of bizarrely slow containers, for example. If you're using C++ for performance you should know how to profile and you should know how to open the hood and build your own abstractions.
Almost all games now are made with game engine creation kits like Unreal engine, you don't have teams of programmers making games from scratch anymore.
Most of the more complex stuff is done in C still but the majority of the game is created without the need for programming.
No practically nobody writes small scripts in C. There's a few enthusiasts. Sean Barrett from looking glass who made the wonderful stb header only libraries uses C for everything I'm told.
github.com
I say it's too difficult to bother most of the time. It'd have to be for something you're already attempting to abstract quite a bit. Not for normal programming really.
For the same reason car companies don't reinvent the wheel four times for each new model.
Don't forget to wear your programming socks!
Why would anyone think that C has issues with code reuse?
Games ARE made in C or some C derivative except for the oddities like minecraft. And the big popular game engines are written in C or C derivatives, even if the games built on top of them somehow weren't.
Also using C doesn't magically make any code you shit out optimal. When you have an Eva situation even ASM wouldn't save you, because the problem is not the language itself but the coder being a tongue-slapping retard.
Programming in C is comfy
github.com
>"""template""" macros
Horrifying.
I can't wait until millennial numale faggots start shipping full js games on disc.
People say C is outdated and yet we have fully 2D games that stutter for garbage collecting in 2017. If modern """devs""" knew how to program that shit would run on a toaster.
I'm not saying all C all the time, but "import VideoGame" faggots need to be weeded out of the industry already. Low-level engine in C, high level scripting in Scheme or Lua. It's not rocket surgery.
I know python, and only python.
How fucked am I?
Why use C hen you have C+ and even C++
Forcing your code monkeys to read C is too inhumane even for gavedev companies.
If you are comfortable with being a brainlet, then it's fine. But Python is unironically the single worst first language to learn for programming. It teaches you nothing other than how to write Python.
You should either start with C (to learn how computers work in a mechanical sense)
or Scheme (to learn how computer science works in a theoretical sense)
Both languages are small which fosters actual learning instead of syntax jockeying.
Python is bretty gud
Knowing a language doesnt mean much. You can learn to use a high level language in a night or two. It's understanding programming and computers in general that's important.
I just today started working with D. I've really only used python as a robust toolbox for physics and engineering.
t. nuMale who hates being surrounded by his 40+ year old coworkers who make him feel like a brainlet
Why aren't more houses only built with hammers and nails?
We have better tools now
This must be a joke. Nobody is stupid enough to not see that templates is just a very weak metaprogramming language. Doing a partial reimplementation of them using macros is just retarded.
C is more like a complete toolbox of handpicked well made tools while C++ is a bestbuy. (no good tools)
And no you can't write C in C++.
>Why aren't more houses only built with hammers and nails?
Costs too much money. There's a reason old houses took 20 minutes to burn down.
Whatever you see.
>t. brainlet
Stop posting from your phone, you normie
What C features can't I use in C++?
You don't need to fucking understand how computers work if you're just an indiedev you fucking spastic.
t. guy who makes mario clones that can barely run at 15 fps
this is not videogames you fucking nerds
go back to /gd/
Why are numale millennials so full of hubris? There's no other demographic that would say "You don't need to understand X to make something that runs on top of X."
You absolutely do, or else your """game""" will run like shit. You don't have to write in C, but if you have no idea how memory is allocated and freed, you are fucking incompetent.
Get a real hobby, manchild
Knowing only the most convenient of tools without trying to understand how the underlying stuff works is how we ended up with the current flood of lazy indie devs copypasting directly from StackOverflow and buying and using Unity store assets as-is.
ah yes))) my good ((((old friend (((((((((lisp
Because it's not object oriented, holy shit, why would you even think to use a language that isn't
functional programming is good when you don't give a shit about performance
Personally I wrote most of my code in Lisp (extremely high level and garbage collected) but I know where my programs can benefit from bounded contiguous stretches of memory that is modified in place vs "just throw another list at it lol"
Numale millennials unironically think "coding" is just another foreign language like French or Esperanto. They think if they know the vocabulary they're good to go. Fucking imbeciles.
You don't always need OOP
>videogame wannabe maker call me manchild
HAHAHA
Literally just use plain old structs you brainlet. Methods and inheritance are probably the most Jewish shit I've ever seen. Program like a white man.
As long as you know a good OOL does it fucking matter which one you pick? The problem isn't the language, its the way it's being utilized.
RAII is good and you should use it if you don't have a GC.
Aw, he thinks I want to make video games for a living. Like a literal retard.
I read something the other day I find hard to swallow, about optimizations of code.
Since a bunch of you monkeys are in here now, lets see if its true:
>the code that is using upwards of 90% of the cpu time can actually be very small, so the majority of optimization is just done on these few lines
is this correct?
i feel like a dumb piece of shit
you guys sound so knowledgeable, i want to get into coding, just started studying CS but apart from doing a little bit of shit in GMS i have no experience whatsoever and it just feels very overwhelming
Yes. There's a reason CPU caches are so important.
They work for me fine, and Im only doing this for data structures that I use a lot and don't want wak typing
>the code that is using upwards of 90% of the cpu time can actually be very small
ye
>while (true);
Download DrRacket, read SICP, and follow along with a tutorial blog if you don't understand anything.
You will learn the essence of computer science in the first two chapters.
Just keep working at it, and don't let yourself feel overwhelmed. You'll get the hang of it.
>Automatic garbage collection with no way to control it yourself
>Gamedev
Please off yourself as quickly as possible.
>>while(true);
>;
It's actually a gray zone depending the software you're working on.
Because using C you will just end up doing the work C++ would simplify for you.
Even if you could do a better job writing in C and making the game work fast, chances are that you might screw it up and make it work even worse.
but why aren't more games made in HTML5?
>C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.
Closer to hardware applications, smaller performance footprint, embedded applications.
Please stop falling for Bjarne's meme, holy shit.
It won't compile without that ya silly.
>mfw casually working on a website in C# and JS will give me a more comfy, less stressful life and more money than being a big time game dev
lmaoing @ ur lives
C++ can be written to be just as close to the hardware with identical performance. C++ supports many paradigms.
It's hard to monetize web games
What are we looking for here? More of it or faster? Both?
Enjoy learning a new framework every 6 months faggot
You have no idea how to program, do you?
why reinvent the wheel?
Macros is where the fun starts in C. If you don't want your code to look like everloving clusterfuck and want to have some sort of portability you will need them sooner or later.
It's how you denote the end of lines in C based languages m8. idk what shitty scripting ur used to
>i want to get into coding
>just started studying CS
Something seems a bit off here.
Anyway, wiki.installgentoo.com
C Programming: A Modern Approach by K. N. King is bretty gud to get into coding. ebook-dl_com has it if you don't want to give away your shekels. Just read it thoroughly and do the exercises. Eventually you'll feel like a less dumb piece of shit.