Is it such possible to create fast games without using C/C++ ?

Started by
50 comments, last by shadowomf 11 years, 3 months ago
Comparing a C/C++ run-time to the Java/.NET framework dependency is a bit too much? The game I am working on has around 7 binary lib dependencies.. And they are all statically linked. The EXE has zero dependencies (other than standard Windows DLLs of course). Heck, it does not even need an installer. The only reason why most of the C++ games require MSVCR DLLs installed are because developers are lazy, don't want to build static libraries themselves for their compiler/MT/MD support and just link with the binary DLL packages they can find on the net.


Don't be so hasty to accuse people of laziness just because you don't understand their reasons.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Advertisement

But on the flip-side, huge games like EVE have their core written in C++ (for speed), with Python layered over it (for ease of coding and convenience).
Many games are actually written in two languages: C++ and a scripting language (often Lua or Javascript).

Its important to clarify this point...

Eve is not written in C++. It is written in PYTHON with some core components written in C++, either for speed or as an interface to the operating system (their IOCP module which exposes IOCP to stackless python). The core of the game is in Python, not the other way around.


My mistake, I thought I read that their graphics engine was written in C++ (which was a reasonable assumption). I assumed most the gameplay-related logic was handled by Python, but the graphics-related code was C++ since rendering and physics usually takes the vast majority of a frame. How their server is set up, I'm not sure - I know they use Python heavily there as well, but I don't know if they use C++ for some of the heavier computations their servers might be running.
All that being said, there is no reason not to start with a language that is a lot simpler. Such as python with pygl/pygame (or whatever the current frameworks are), or C#/XNA... or any number of other platforms.
Fully agree! Start with Python, and if you need your core graphics engine to run really fast... use the really fast graphic engines that are already made for Python.
<blockquote class="ipsBlockquote" data-author="simast" data-cid="5020520"><p>Comparing a C/C++ run-time to the Java/.NET framework dependency is a bit too much? The game I am working on has around 7 binary lib dependencies.. And they are all statically linked. The EXE has zero dependencies (other than standard Windows DLLs of course). Heck, it does not even need an installer. The only reason why most of the C++ games require MSVCR DLLs installed are because developers are lazy, don't want to build static libraries themselves for their compiler/MT/MD support and just link with the binary DLL packages they can find on the net.</p></blockquote>

Why would you statically link third party libraries ?

If a statically linked library contains a security hole and you don't patch your software immediatly you expose your users to unnecessary risks, if a dynamically linked library contains a security hole the user will get an updated version of the library installed automatically by the OS(Atleast on those with a modern package management system, Windows still only sends out updates for Microsofts software, but the RTE for C++ on Windows is Microsoft software and it does get security fixes, some critical, through Windows Update) as soon as it is available.

Here is an example: http://technet.microsoft.com/en-us/security/bulletin/ms11-025
a bug in the Visual C++ 2008 and 2010 redistributables (MFC part of it) that allowed attackers to execute arbitrary code on machines running software using some of those functions.

Now what is best, that the end user gets the fix through windows update or that he has to find out about the security flaw and then manually install a custom patch for EACH application whos developer used the affected functions but was too lazy to make a proper installer for his software.

Static linking is the lazy route, making sure your application installs properly is the proper way to go.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

[quote name='Servant of the Lord' timestamp='1357955609' post='5020578']
My mistake, I thought I read that their graphics engine was written in C++ (which was a reasonable assumption). I assumed most the gameplay-related logic was handled by Python, but the graphics-related code was C++ since rendering and physics usually takes the vast majority of a frame. How their server is set up, I'm not sure - I know they use Python heavily there as well, but I don't know if they use C++ for some of the heavier computations their servers might be running.
[/quote]

Their graphical component IS written in C++.But, like most games, it is a very small part of the overall game, once you have the "engine" setup, the rest is just a matter of shoving data at the subsystem and letting it handle it. All that logic is done in python. Physics is handled on the server side and is actually mostly in Python, there are some pieces that are offloaded to C++ using low-overhead bridges, but most of it is python. The way they have designed their systems they can rip out a performance intensive component of a calculation (say computing the current position of an object A that is set to orbit another object B at a range of 5,000 kilometers while attempting to move at full speed AS the other object attempts to counter orbit the object A, which happens a great deal in small fleet combat) and move that into a C++ module, which integrates seamlessly into their stackless python architecture.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Simast, you have it back to front.

I frequently statically link the runtime purely out of laziness because I can't be bothered to write an installer (for trivial, personal projects only of course). It is far, far more effort to link dynamically and also ensure that you provide the correct DLLs if they are not on the user's system and, obviously, best practice for the reasons SimonForsman outlines above.

My mistake, I thought I read that their graphics engine was written in C++ (which was a reasonable assumption). I assumed most the gameplay-related logic was handled by Python, but the graphics-related code was C++ since rendering and physics usually takes the vast majority of a frame. How their server is set up, I'm not sure - I know they use Python heavily there as well, but I don't know if they use C++ for some of the heavier computations their servers might be running.

Their graphical component IS written in C++.But, like most games, it is a very small part of the overall game, once you have the "engine" setup, the rest is just a matter of shoving data at the subsystem and letting it handle it. All that logic is done in python. Physics is handled on the server side and is actually mostly in Python, there are some pieces that are offloaded to C++ using low-overhead bridges, but most of it is python. The way they have designed their systems they can rip out a performance intensive component of a calculation (say computing the current position of an object A that is set to orbit another object B at a range of 5,000 kilometers while attempting to move at full speed AS the other object attempts to counter orbit the object A, which happens a great deal in small fleet combat) and move that into a C++ module, which integrates seamlessly into their stackless python architecture.

So in answer to the question, "Is it possible to create fast games without using C++?", we hold up Eve online as an example that's written in Python, except that the fast parts (the rendering) are written in C++?

I love using Eve Online as an example of a game written in Python, and I'm not saying it isn't possible to write fast games without C++ (it is!), I'm just pointing out Eve isn't the best example to use in context to the question of this thread. Unless I'm completely misunderstanding what you meant, which is likely. laugh.png

Case in point - MineCraft (java)
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
So in answer to the question, "Is it possible to create fast games without using C++?", we hold up Eve online as an example that's written in Python, except that the fast parts (the rendering) are written in C++?
Any particular game will have to interface with the operating system at some point. Chances are that interface will be written in... C++. That does not mean YOU have to write C++ to access it, as the interface may have been written for you. Python with PyGL or PyGame uses C++ (or C) at some level in order to access the underlying functions.

That being said, the majority of the C++ part of the eve graphical engine is mostly just wrapping up DX in a fashion to make it "usable" as a simple component of their core, python, engine (called Carbon).
I love using Eve Online as an example of a game written in Python, and I'm not saying it isn't possible to write fast games without C++ (it is!), I'm just pointing out Eve isn't the best example to use in context to the question of this thread. Unless I'm completely misunderstanding what you meant, which is likely. laugh.png
Eve certainly isn't the only game one can use as an example of a fast game that doesn't require C++. AI War, which is a .Net based game, used SlimDX as its core for rendering and input for a long while. It now uses unity as its core.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Case in point - MineCraft (java)

Minecraft isn't exactly "fast", In Minecraft I get 30-40 fps in most other games I get 60-75, In my game Engine I get 110-130 fps its written in C/C++ and looks a lot better than Minecraft. It all depends how fast you want to go. To write really really fast games you don't necessarily need C++ but you do need a compiled (or assembled) language. That said Minecraft is still fast enough to play and be amazingly fun (it used to have terrible performance back in alpha/beta) and alot of games written in other languages are fast enough. So unless you want your game to run really really fast you could use java or python or something.

<blockquote class="ipsBlockquote" data-author="ic0de" data-cid="5020851"><p><br /></p><blockquote class="ipsBlockquote" data-author="iMalc" data-cid="5020797"><p>Case in point - MineCraft (java)</p></blockquote>&nbsp;<br />Minecraft isn't exactly "fast", In Minecraft I get 30-40 fps in most other games I get 60-75, In my game Engine I get 110-130 fps its written in C/C++ and looks a lot better than Minecraft. It all depends how fast you want to go. To write really really fast games you don't necessarily need C++ but you do need a compiled (or assembled)&nbsp;language. That said Minecraft is still fast enough to play and be amazingly fun (it used to have terrible performance back in alpha/beta) and alot of games written in other languages are fast enough. So unless you want your game to run really really fast you could use java or python or something.<br />&nbsp;<br /><p><br /></p></blockquote><br />I'd bet that a large part of Minecrafts performance problems come from managing all those cubes/voxels rather than from Java though, there are far better looking and better performing games written in Java out there. (Not to mention games like dwarf fortress which look far worse than minecraft, are written in C or C++ and perform horribly).<br /><br />In fact, the graphics is probably the area where compiler/VM/language choice has the least impact on performance. (Your language/vm/compiler choice only affects the time it takes to issue a drawcall to the graphics API, the actual rendering will perform identically regardless of what language you issued the drawcall from).<br /><br />
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

This topic is closed to new replies.

Advertisement