Coding in C++ with godot / godot vs cocos2dx

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ast
:warning: Old Version Published before Godot 3 was released.

Hi all,

I’ve been reading the godot docs for couple of days now. I have previously used cocos2dx, a C++ game engine. The godot seems to be a viable alternative to cocos2dx and it seems to have better tools for building maps, particle systems and animations. In cocos2dx the visual editor is cocos creator, which is not available for Linux and is closed source and does not support C++ (yet) but only javascript. That means no editor for me.

Now the question: Can one use godot and its awesome-looking editor and still code the game with C++? In docs it seems that the engine can be extended using C++ but I would only like to code my game logic with it.

There are not many C++ capable free game engines around. cocos2dx is pretty much the only good one around but not many are happy with it. UE4 is very big and not free. There could be a big market share for godot if it just could fill the need. It is not far away, at least.

Best,
ast

:bust_in_silhouette: Reply From: Taylor Hansen

You can technically still code in C++ by building a module and having Godot use it, or by just modifying the engine directly. Both of these methods require recompiling the entire engine, though. Here is some documentation about making modules in C++, but keep in mind that the use of GDScript is almost always preferred.

:bust_in_silhouette: Reply From: eons

Any reason to use C++?

You can create things really quick with GDScript to see if work first (is a OOP based language too so should not be a problem to use), then make modules on C++ with exactly the same logic.
People use to do this on critical parts of the games, where max performance is needed.

More or less like in Unreal.


Check GDNative post, Godot 3 will be able to use the engine API with almost any language (there are people working with Rust, Lua and others) but I would not recommend to use C++ (and I love { } ) or any languages without knowing the engine first.

Godot 3 will support C# too (not via Native scripts) but GDScript will stay as the main language.

:bust_in_silhouette: Reply From: MrMonk

I played a bit with Cocos2dx, and the C++ part seemed as easy/or difficult as in Godot. I think the compiling time is a bit longer for Godot, but I’m not so sure, here GDNative will make a big difference (too bad is not ported for the 2.1 branch).
Check this project out, you can see the gd script version and the C++ implementation: