-
Notifications
You must be signed in to change notification settings - Fork 13
Templating ‐ godot‐roguelite as a template for your own project
You may want to reference and or use all/some of the setups included in the godot-roguelite project for your own project, the following procedure should help you achieve this cleanly.
For starters you may want to download the project for either referencing it and generating something similar from scratch, or adapting it:
"Use this template > create new repository" button on the godot-roguelite github repository
This approach will allow you to create your own cloned repository based on roguelite straight on github, you can then pull it.
Alternatively you can simply download the project as a .zip
file, you can later adapt,
You can also just clone the project itself using git/your version control software of choice, and adapt it, contribute to it, or make a local copy of it and work from there.
The installation and use of Git Bash is recommended for quickly running git commands from a directory without having to run commands relatively or move to the adequate directory manually with the standard command prompt.
The following process should be enough to get things working, but it's quite probable you could encounter issues with the 3 SUBMODULES which come with the roguelite pull, specially if you pull and duplicate or move the original roguelite folder somewhere else read here for how to reset your submodules and get them properly setup
-
Follow the godot-roguelite root folder setup by having each directory and each file in from godot-roguelite root folder in your own root folder for your project.
It is recommended that you check out the root folder setup since it will help you map out where everything goes in the file system for the godot-roguelite project layout.
-
Exclude any of the following preexisting files and folders if present in your copy of roguelite, from your setup: (hidden)
.git
,.github
&.out
. -
Install git or some source control software that works with git (github desktop, sourcetree, fork...), make your project's root folder your own git repository using
git init
in that directory, or through your source control software. The result should be a hidden.git
file in your project's root folder. -
Write down an internal name to use in various parts of your project's setup, make sure it's lowercase alphanumeric + hyphens and not reserved by vcpkg, this will avoid issues (specially with vcpkg) further down the line.
-
In
project/
folder locate/add the.gdextension
file (which should be the one that's been copied from godot-roguelite). Set it's name step 4 name. Also open the file and change the name of the library for each path to step 4 name. -
Clear all contents in
project/
, except for the previously custom named.gdextension
file, and start your own godot project inside this folder. -
In
src/
folder, add/preserve any source code you're interested in initially, the original roguelite project has some good code that is recommended for checking out if you're interested in learning some basic godot API usage for C++. You can later open thesrc/
folder from your IDE. -
Open/add
vcpkg.json
and change the name entry to step 4 name. -
Open/add CMakeLists.txt and change "roguelite" in line 3 to step 4 name:
set(GDEXTENSION_LIB_NAME roguelite)
This will also be the name with which the gdextension .dll will be built.
After completing these steps you can proceed with checking if your IDE can properly open your source and reach godot's classes (if u'r using VS Community, opening from folder is suggested versus creating a project). Check out other tutorials in this wiki for further steps.
Moving "roguelite based setup" can cause the project to stop working. If classes are unreachable it could simply require one of these solutions or resetting the submodules
You can easily move/copy around your /src
and /project
contents to any new setup.
The submodules and the project itself most likely will require updating further on for newer godot versions if desired.