+1 vote

Hello. I saw the news the 3.0 was well on its way. I scanned older news but I wasn't clear on whether C++ will ever be built into Godot, without the need for modules, so that you can just open up a project template (SLN file), code a few lines and see a sprite on the screen. This looks like such an awesome engine but I'm really used to C/C++ and the current directions to use it are both complex and also missing things (like setting up Visual Studio under Configuring an IDE).

As an example, this code loads and displays a model in another engine I currently use. I'm wondering if Godot will ever be able to do similar in a few lines of code.

#include "Leadwerks.h"

using namespace Leadwerks;

Light* light = NULL;

int main(int argc, const char *argv[])
{
    Leadwerks::Window* window = Leadwerks::Window::Create();
    Context* context = Context::Create(window);
    World* world = World::Create();

    Camera* camera = Camera::Create();
    camera->SetRotation(0, 180, 0);
    camera->Move(0, 1, -2);

    Light* light = DirectionalLight::Create();
    light->SetRotation(35, 35, 0);

    Model* model = Model::Load("Models/Goblin/goblin.mdl");

    while (true)
    {
        if (window->Closed() || window->KeyDown(Key::Escape)) return false;

        Leadwerks::Time::Update();
        world->Update();
        world->Render();
        context->Sync();
    }
    return 0;
}
in Engine by (15 points)

Aha Leadwerks, that brings back some memories. I think it was the first 3D engine I learned and gave up on. I tried LWs, Unity, C4, back to Unity, then Unreal and now Godot. I think I even messed around with Garage Games at some point. Its hard to find an engine you can click with.

Yeah, Leadwerks is still the most ideal for me because I love the direct simplicity of it. No runaround. Just open your project file and start coding and go into the editor if you need to. I would love that from Godot.

1 Answer

+1 vote

Search on something called GDNative that's coming for version 3.0.

by (249 points)

Thank you. I found an article from April that seems promising though it's a different approach than I'm used to (the simplicity mentioned above). No mention of setting up Visual Studio but I assume that's in the works.

I'm hoping at some point C++ will just be directly integrated without the extra steps of modules and scripts and whatever else.

Well I don't think there are any plans to integrate C++ that tightly, so GDNative is the best you can hope for.

I had to break out of the old mindset to learn the Godot way, which is very different to other engines and you will have to as well. This guy warlaan's comments helped me to do that. He posts at reddit and I just noticed he posts here as well, so there is more for me to read. :)

"Another thing to keep in mind is that like most engines Godot offers more than one language and the decision which language to use for which part of the code plays an important role in creating readable code. In Godot's case there are three main languages to choose from: 1. C++ for backend code 2. GDscript for imperative game code 3. The editor interface for declarative game code.

Your priority should always be: use 3 whenever possible, use 1 when 3 isn't enough and your code can be written in a non-game-specific way and use 2 only as a last resort."

https://www.reddit.com/r/godot/comments/5w6at1/writing_pretty_and_readable_gdscript/de9sk3c/

Speaking for myself I just use 2 and 3. When GDNative comes out and they've ironed out all the wrinkles I might try using 1.

Old habits are hard to break but there's wisdom in expanding your horizons, especially for a powerful engine like this one. Leadwerks fits me well for now but I'll check back with Godot every few months. Thank you for the help.

I share your vision exactly, word for word. What solution have you found? I want to get inspired from people that think alike me.

It seems like with the release of Godot 3 this may be more possible than ever. Now the only thing that's really missing is a 10-minute video that goes through everything step by step (preferably for Windows) and gets a simple bitmap moving left and right with the help of C++ code.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.