Top
70°

Experienced Points: Why Video Games Need Their Own Programming Language

Shamus Young:

You've probably heard of Jon Blow. He's the designer of Braid and The Witness, and one of the first of the new-wave indie auteurs that began this whole indie craze a few years ago. Back in September he posted a two-hour video where he talked about the need for a new programming language designed specifically for games. He's certainly not the first to notice this need, and I'm sure he won't be the last, but I'm bringing this up because he's yet another important voice pointing out the awful situation our industry is in.

Read Full Story >>
escapistmagazine.com
The story is too old to be commented.
uth111103d ago

I've written my own games in C, and in other languages. It takes longer in C, mainly because where other languages will tell you that "you can't do that!" C won't complain and let you do that stupid thing (usually involving misusing pointers or memory allocation) and then your code will start behaving bizarrely or crashing and you will spend hours pulling your hair out trying to figure out why.

Anyway, the article is a little bit wrong about why C is used. It's not simply because it's popular. Java is popular too. C allows you to code close to the metal. Java doesn't. Most languages don't. If you want to squeeze the most performance out of your hardware, you need a low level language like C.

That doesn't mean it has to be C/C++. It should be a language that allows the low-level access of these languages and maybe even keeping the syntax, but it needs to add thing that can speed up game programming. Maybe more automated memory allocation, while allowing you to still do it by hand if needed.

Askanison41102d ago

In pretty much any avenue I find C# hard to beat. Sure, it has lots of fluff and that doesn't result in great performance unless you REALLY know what you're doing but it's easy to write as a beginner and amazing when you're a professional and know a lot of the ins-and-outs.

I use it personally for Unity3d work. All that being said, a new language designed for games specifically is something I'd be all for. A new paradigm that focuses on the repeated code loops you get with games would be a great idea.

360ICE1102d ago (Edited 1102d ago )

C# is my favorite language, but it's pretty easy to beat when it comes to optimisation.

One important reason why C# and Unity have become so popular is because we now have immensely powerful hardware that can tackle games like Crysis 3, while we also buy less demanding indie games like Teslagrad and Hearthstone (both of which are written in C#, using Unity). In other words, indie developers can afford to waste some power.

C# is a high level language like Javascript and Java (meaning removed from the hardware). That makes it easier to not mess up, but it also makes it hard to really optimise memory allocation and such.

Also, regarding the article:
The main difference between C and C++ is that C++ is object-oriented. This may not sound like much, but it's pretty hard to make big games without that.

And I think the article misses that people who know C and C++ tend to love them. In web development, we see new languages and frameworks being added all the time, so if something better than C++ comes around, I'm sure people would consider adopting.

Richard Cypher1102d ago

I think that what is needed is a langage with all these :
- low level access (optimize your memory accesses and structure in memory)
- good structuring support : object support for code modularity needed when doing big projects (possible without it but much more costly)
- quality tooling (especially compilation/debugging tools)
- access to more common library efficiently (library accessible in efficient form)

For that, i would prefer go to the C++ above other langages.

But let's not forget the biggest problem is your quality of programming that is to say :
- your knowledge in structures and algorithm (knowing how to calculate your algorithm complexity and reduce it)
- the quality of your memory access strategy (knowing what to load or not in memory and doing this the good way to avoid unnecessary operations)
- your quality of high level structuration of code. Maybe one in 10 programmer i meet know how to do quality object code and one in 100 really master it.
- for gaming programming, you need one more which is a really good understanding in math and geometry.

So, in my opinion, the main problem is much more in the skills that in the langage.

A dedicated langage wouldn't increase performance just by himself, it would just make it more simple for less efficient programmers.

But highly efficient code demands highly efficient algorithm and memory management.
And no langage will do that for you, at best some good generic purpose library will simplify your life (lower the entry cost) but won't allow you to achieve the highest results without the needed skills.

(this is an educated opinion, i work in the field, this does not go out of my *** ^^)

donthate1101d ago (Edited 1101d ago )

C# is really a bridge between the best of Java and C/C++ sans the speed for obvious reason.

I agree that the C++ syntax is somewhat nasty, but to get C/C++ performance, you are going to for the most part have to deal with C/C++ like problems.

You might be able to get slightly nicer syntax, but all that low level stuff is what makes C/C++ the language of choice. Well known, well studied, well optimized and well used language in the gaming industry.

Until we move away from "graphics" as the benchmark, C/C++ will continue to be "the" language. Although we are slowly moving away from "graphics" and that is why we now have Unity and so on.

My favorite language is C# as well, but likely because it is reminiscent of C/C++ and Java. Python is very nice, but has some rally odd quirks and backwards incompatibility between v2.x and v3.x and I don't like languages that break between versions. Java did it right there.

Ultraplayerxp1102d ago

/*...and then your code will start behaving bizarrely or crashing and you will spend hours pulling your hair out trying to figure out why.*/

God, I miss that feeling. I totally hated it but damn did it feel good when you managed to figure it out.

hay1102d ago

Yes, but games aren't made by people who can hardly get their head around debugging. They are written by specialists who know their stuff around language, nuances and acceptable practices in order not to screw around by some noobie mistakes.

C++ is really good for this purpose. Optimizes well, has all the features game dev needs and if you know your way around there are no problems with debugging.

I've been starting my coding career with Python but one cannot be serious with interpreted language while making high performance high variety apps, went through C# but despite is easy to write and debug, it's a bit too bloated for specialized purposes, PHP has a bit too big overhead, JavaScript runs in a browser or embedable engine which sets requirements on your environment and eventually ended with C++ which is the only language with proper robustness for that purpose IMO. The rest is just up to the way the individual in question codes and the design of the code itself.
If one genuinely knows what he writes, there's very little space for super mysterious bugs.

Askanison41102d ago

Eh, even the best of us can write a few "mysterious bugs". It's not reserved for the n00bs :P

hay1102d ago

That's why the "very little space" is reserved for in my original post. We cannot fall into generalization, even my personal experience with language results will differ even by the implementation methods with entirely different outcome. But speaking of font as an information carrier, one has to keep in mind the compromise between substance and word count, therefore need to leave some content out to prevent TLDR; fallbacks.

This is not a topic for N4G comment box, but a good food for thought appetizer.

Agent_hitman1102d ago (Edited 1102d ago )

It would be tricky for the developers if they do that cause most of the Engine were being used in today's videogames were written C/C++. And if they modify or create new programming language for that, chances are the development of current project will be scrapped and start from the scratch all over again.

uth111102d ago

heh, I want to learn to write in lolcode

Gh05t1102d ago (Edited 1102d ago )

So he is writing an article about programming but wont make the distinction between C and C++ because only coders care... Who is your target audience again? If your audience isn't the programmers than why are you even discussing a new programming language with people who don't program.

C++ is not used because it is newer and hipper... What a load of bull, the libraries are better, the use of object oriented programming, and the less steep learning curve are some good reasons just to name a few.

This article sounds like it is written by someone who just passed their second semester in a computer science degree program.

" There are lots of fussy details in the language designed to save a few bytes of memory that, in today's world, simply do not matter."

Are you serious? I have an xbox360 sitting on my shelf with only 512 MB of memory in it. That isn't a lot and look what they were able to pull off. Every aspect of memory matters in professional software creation...

" in return they're saving CPU cycles and memory which are now relatively plentiful."

As I look back at N4G at all the articles complaining about resolution, FPS, and a battle about CPU and Memory usage.

"So how did we end up building an entire industry of complex entertainment software on top of a language designed for writing operating systems in 1972?"

Because the work came before the play... Its not like we are coding in COBALT!

"but if you're making a big-name AAA game targeted at modern consoles, then you still need to worry about every processor cycle."

Didn't that just contradict what you said earlier...

"If one of their rivals created one and offered to share,"

You mean like C#?

1102d ago Replies(1)
Show all comments (17)