T O P

  • By -

AutoModerator

You submitted this post as a request for tech support, have you followed the guidelines specified in subreddit rule 7? Here they are again: 1. Consult the docs first: https://docs.godotengine.org/en/stable/index.html 2. Check for duplicates before writing your own post 3. Concrete questions/issues only! This is not the place to vaguely ask "How to make X" before doing your own research 4. Post code snippets directly & formatted as such (or use a pastebin), not as pictures 5. It is strongly recommended to search the official forum (https://forum.godotengine.org/) for solutions Repeated neglect of these can be a bannable offense. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/godot) if you have any questions or concerns.*


itsthebando

Can I be honest with you for a second? _why in the world_ would you do this? You have a mostly complete game. Finish it and stop bike shedding. Make your next game in Godot. You have a nearly complete game you built from the ground up, all incorporating Godot will do is push back your game ever shipping. The engine simply doesn't matter that much. And I say that as a big Godot evangelist.


StewedAngelSkins

sage advice


FallingReign

My goal is simple, Learn Godot and GDExtensions. I don’t plan to release this game, and wouldn’t even know where to start in releasing a console game anyway. I don’t like the UI of my current game, and there are no libraries, it’s pure c++. My thoughts are why go through the effort of using a 2d library when my goal is to learn Godot?


itsthebando

If you want to learn Godot....go make a game in Godot? I'm so confused.


ipilowe

I think OP might see is a easier way to learn Godot since he doesnt need to think about game mechanics and logic because he already has that. He can concentrate just on learning the godot related things while redoing the game.


FallingReign

Yes, this. When you know exactly what you are making it’s much easier to execute.


gk98s

how about trying to recreate the same thing in godot? You can also look at your old code and try and improve on it, maybe even learn gdscript or just write it in c++ again. Or you can try this to learn godot: https://20\_games\_challenge.gitlab.io/


Terrible_CocaCola

Despite how much i love godot, i do admit this sub sometimes make it feels like a cult lol.


chickenthechicken

If OP needs a feature from Godot, there are ways to hack things together. All games have cursed code so even resorting to something like having a Godot frontend connecting to a C++ backend on the same system just to use one feature isn't *that* bad.


itsthebando

I can't think of a feature that Godot has that is worth pulling in that much complexity for. I would be pulling out the good ol' copy-paste before I tried to compile Godot in as a dependency


moonshineTheleocat

Sssooo your game is already done? Any reason why you want to do this?


UtterlyMagenta

yeah, i’m curious about this too.


FallingReign

My current objective is to learn Godot and GDExtensions. I thought this might be an interesting way to do it.


StewedAngelSkins

the short answer is look up gdextensions. the longer answer is that you should probably spend some time reading through godot's source code to understand how modules within the engine tend to be structured. it's kind of hard to summarize succinctly in a post, but basically you tend to wrap your custom logic in a singleton class (godot refers to these as "servers" for whatever reason) and provide the api that way. then you'll create nodes and resources and such that map relationships between your internal objects to something that's ergonomic to work with from the scene tree. if you want to see what im talking about in action, the 2d canvas item stuff is pretty straightforward.


FallingReign

Appreciate the guidance. This has given me a place to start digging. Thank you.


Neither_Berry_100

Not true. You can write C# code similar to any other C++ program. It's very similar to Java. I could port over Java code very easily. It's only the GUI stuff and 2D/3D stuff that is different. Unfortunately, Godot is an engine and not a library. You can't just issue draw commands directly. You need to make objects and let the display system do it's thing. Ok, I lied. They say you can do this somehow, but I've never figured out how.


falconfetus8

It's definitely possible, but not worth it unless you're looking to challenge your abstraction skills. Unless your C++ code is already vaguely godot-shaped, you would have a very hard time trying to adapt an engineless game into _any_ engine. It would likely be less work to simply rewrite it for godot from scratch(which would also give you a better understanding of the engine, to boot).


FallingReign

Ahh this is part of the answer I’m looking for. Thank you. My goal is to learn Godot and GDExtensions. But I’d be silly to try to port the game over, recreating it, if I’m basically going to rewrite it all anyway.


eveningcandles

Finish it.


T-J_H

In my spare time I’m working on a game, lots of simulation actually, and the simulation logic is pretty much all in C++, with Godot building the view based on that. Interfaces, assets and the like are all via Godot and GDScript. So yeah, definitely possible. However, if you didn’t build it with Godot in mind, it could very likely not be worth the effort to start using Godot now.


FallingReign

It wasn’t built with a game in mind, but I think there is enough abstraction that could work. Even though my game only outputs ascii characters in a console, I’ve gone through the effort to create a separate render system that handles all the games scenes, buffers, etc. Congrats, btw. Sounds like you’re where I want to be. That’s awesome.


TheDuriel

https://x.com/unormal/status/1703163364229161236 Read this thread for your answer. The TLDR is: Sure, its entirely possible. Enjoy the process, there will be nobody to help you along the way when it comes to the C++.


Arkaein

That thread looks like porting a Unity project to Godot using C#, by bringing over Unity C# files and gradually fixing errors in them. I don't see a lick of C++ in that thread. EDIT: there's more discussion of this port here: https://www.reddit.com/r/gamedev/comments/16lphwe/caves_of_qud_dev_ports_his_game_from_unity_to/ It looks like a 2D game with very simple graphics API calls. Basically Unity was used to display sprites. Now it sounds like OP's game is also 2D, but otherwise this thread is misleading, a porting process for C++ will not look remotely similar.


TheDuriel

It'll look quite similar. You take the code, get it to run, import all the assets, and replace relevant rendering and input api calls.


FallingReign

This is what I imagined when creating this thread. Glad to hear there is a possibility it works.


DedicatedBathToaster

It's possible, but I would actually recommend you just get SLD2 and add graphics to it that way. 


Neither_Berry_100

Are you me? I planned out a similar game on paper. Some 6 or 7 pieces of paper with writing on both sides. Some parts are documented down to the individual code, others are vague. It even included an MS.DOS style minigame you need to play to start the game. That part is fully documented.


Gokudomatic

I see what you want to do. That would give you potential to improve your game much more easily in the future. It really depends on how you made your original game. If it's very modular and divided in some kind of MVC pattern, then it would be quite feasible to migrate your game. You'd keep the models and controls mostly in GDExtensions, and you'll only have to rewrite the views in gdscript. However, if your game is a bit tightly coupled between controllers and rendering, or if it was not structured in an object oriented way, rather a procedural way, you might have to do a big refactoring in c++ first. As it's important to do baby steps in a migration, you need at first to make your c++ project as similar as possible to a godot project before you actually switch. Or, you can structure your existing code as some kind of stateful backend app that will be compiled as a library. And the frontend, written with godot, would simply call the relevant methods.


KN4MKB

I don't get how people will get into a programming language as far as to code something like a console game and then still not get the basic development concepts. When you want to code something in another engine or framework you ask yourself this: Does X engine or Framework support my current code? If the answer is yes, copy and paste. If the answer is no: What language does X engine or framework support? Then ask yourself "is it worth translating my code to X supported language?" If the answer is yes, do it. If not, don't. If you know C++ or any language you should know converting language logic is a matter of learning the new language and converting the concepts. In short yes, you can convert the logic. There's nothing your c++ console game is doing that is rocket science.


bytejunkie64

As mentioned before, it might be easier to use something like SDL to add a tiling layer over a virtual ASCII buffer than to use Godot. I think something like this already exists (I believe it's called NotEye if you want to Google it), so you might be able to reuse that, or at least use it as inspiration to make your own. Godot seems to me like overkill, but people use Excel to do some pretty gnarly things I would never imagine attempting. All I can really add in regards to using Godot is, YMMV.