Search code examples
javascriptc++directxgame-enginev8

C++ or v8 for game engine


I have built a few games using various engines in js/html5 and even in c++ using irrlicht (tried ogre, but i prefer irrlicht's simplicity).

The next step I want to take is building a game engine, and since i have experience with c++ and have used v8, I have been thinking of making a windows only game engine that use's v8 to wrap directx for graphics and bullet for physics (haven't decided the rest), and then calls a js file/string that has the bulk of my game engine which call's these c++ api's, and then the user can build their game entirely using js.

The question though is, if I were to make a commercial game that competes with other AAA titles on the pc, should I really use a v8/js powered game engine or should I just do everything in c++?

Why am I asking this?
1) All the C++ api's that I will be using will be wrapped by v8 for use in js.
2) v8/js win over C++ pointers and manual memory management (garbage collection)

If it weren't for point 2, I'd use c++, but right now I'd prefer using js, but that leads to my question as I one day want to make a real game (maybe not a AAA title, but that's the performance and quality that I want), and would prefer to make one game engine only, rather then making a new one (or picking a new one) for each new project/game, but if I consider point 1, that's allot of C++ api's that I will be wrapping, so I'm wondering if I will have performance issues?


Solution

  • C++ has been used in development of several game engines because of its high performance. So if you want to make a game that is more efficient and fast (it also depends on how you code, efficient code definitly makes the difference). Yes C++ lack garbage collection but the performance it offer is definitly worth to manually handle memory managment. If your preferences are making a efficient game engine and if you have time, you should go with C++.