التخطي إلى المحتوى الرئيسي

Why is C++ so popular in game programming And why not other languages such as Python or C# or Java etc

The assumption here is that games are written in one and only one language, and that's very often not that case.  Many games today have multiple 'layers of systems communicating with one another, typically in different languages that are better suited to different tasks.
For example, we might have layers such as rendering, physics, AI, gameplay, high level scripting, and the backend (which itself could be composed of one or several languages).
When people say "C++ is the best language for games", they're almost always either one of two things:
  1. Speaking specifically about low-level engine code like the renderingand physics subsystems.
  2. Naive and parroting what someone else has told them.
Low level systems are usually written in C++ because there simply aren't a lot of alternatives, and of the few that exist C++ strikes a good balance between high performance and ease of use (when compared to, say, assembly language).  The languages mentioned in the question details -- Python, Java, and C# -- are all high level languages that attempt to abstract away concepts like graphics hardware and memory management.  But these ideas are critical in systems like physics simulation that need to be called constantly with a lot of complex calculations and calls to specialized hardware.
But in other layers, C++ is not so critical.  You may know that C# is the most commonly used language for gameplay programming in Unity.  You may also know that Unity's rendering and physics simulation is written in C++.  So Unity is a perfect example of a modern engine that uses a multi-layer approach to separate the performance critical code (C++) from the less resource constrained gameplay logic (C#).
Lodex Solutions  uses Java as its gameplay programming language, but all the rendering is handled by JOGL (a C++ library that Java can make calls to).  PyGame is written in Python.  I've never used it, but I'm guessing it uses C++ libraries for performance critical tasks as well (a common design pattern with Python).
So to answer your question directly: languages other than C++ are used in games all the time, but C++ is also the obvious choice for certain tasks in the game development pipeline.  The important takeaway here is that games can be written in many languages working together.


تعليقات

المشاركات الشائعة من هذه المدونة

Difference between UX and UI designer and web designer?

UI Designers "UI" stands for " User interface ". Traditionally, that means the actual buttons, text, and pixels that appear on the screen. So the UI designer would be responsible for everything about how a web site or application appears in the interface - this would include visuals (e.g. "Are the buttons pink or blue?" "Do they have gradients or are they flat?") as well as overall architecture of the page (e.g. "We should put the Sign Up button at the top of the screen because it's the most important thing").  UX Designers "UX" stands for " User experience ". This is a much broader and higher-level discipline than UI, because it includes not just the interface, but also all the systems and interactions that support it. For example, the UX designer should care about what happens when a frustrated user calls the help desk as well as how pixels appear on the screen.  Interestingly enough, because thi...

What is a KPI - A Key Performance Indicator Meaning

A  Key Performance Indicator  is a measurable value that demonstrates how effectively a company is achieving key business objectives. Organizations use KPIs at multiple levels to evaluate their success at reaching targets. High-level KPIs may focus on the overall performance of the enterprise, while low-level KPIs may focus on processes in departments                           such as sales, marketing or a call center.  lodex solutions 

Why are so many game developers opposed to gamification?

"Gamification" and "bringing game mechanics to serious endeavors" are not necessarily the same thing. It's hard to talk for all the game developers, but I will give you my take on this issue: The most basic characteristic about games is they are  intrinsically motivated  activities which  challenge  players in a specific  skill  (I am not talking about other types of play, which are not games by definition). Games are a  voluntary  activity - because when they are not, they aren't games anymore, they are a chore, a task, a job. Most of the other  extrinsic  motivation-creating game mechanics (that include badges, levels, coins, etc.) are not unique to games. Moreover, they are used by organisations for decades (or more?) to generate (extrinsic) motivation (just think about schools and workplaces). I admit that the game industry perfected these extrinsic motivations better than others, as these mechanisms be...