How to make a new project from the Project Template

edited November 2019 in Tutorials

This is a work-in-progress tutorial! Please post below if something is wrong or is not clear.

This is intended to get you started. Helpful Git tips for further managing a project would be welcome in posts below, or even better in a separate tutorial. 

Overview:

If you are not using Git version control, you should! However, Git has a steep learning curve when you are just getting started. If you prefer to put this off for now, that's OK. I cover getting started without Git and with Git below.

Here is the file/directory structure that you are going for...

Godot.exe
my_project_directory
    |- .git (directory)
    |- .import (Godot makes this directory when you "import" the project)
    |- ivoyager (this is a Git tracked submodule!)
        |- (ivoyager code files, LICENCE.md, etc.)
    |- ivoyager_assets (this is NOT Git tracked!)
        |- (ivoyager image/media files & large binaries)
    |- my_project
        |- (your project that extends ivoyager into a game or whatever)
    |- .gitignore
    |- .gitmodules
    |- MY_LICENCE.md
    |- MY_README.md
    |- project.godot
"ivoyager" is a Git submodule! If you are using Git version control, each commit of your project points to a particular ivoyager commit. You can pull the latest ivoyager version at any time, revert to an old one, or use your own modified ivoyager fork as needed. You can also make a pull request with ivoyager changes while developing and editing your larger project (even if your larger project is in a private repository).

"ivoyager_assets" is not Git tracked! You can obtain the latest version as a zipped directory from the Download page, or current or older versions from https://github.com/ivoyager/ivoyager/releases. (FYI, I was using Git LFS to track these for a while, but abandoned this for various reasons.)

Unless you plan to contribute to the core ivoyager submodule, you should do all of your coding outside of the ivoyager directory. See comments in ivoyager/singletons/project_builder.gd to get started on your own project after initial setup.

Step-by-step without Git:

1. Get the correct Godot Engine version

On the Download page you can find the correct Godot Engine version for the current I, Voyager version (we might be one behind if there has been a recent Godot update). Download that from the provided link and extract. You can rename this to Godot.exe.

2. Download the Project Template, extract, and rename

Download the "Project Template" using the link in the Godot Projects section of the Download page. Extract the .zip file in the same directory as Godot.exe. Rename the top directory to whatever you want. I'd also suggest editing the project name in project.godot using any text editor: under "[application]", change "config/name" and "name" to whatever you want. (Or if you prefer, you can rename the project later from within the Godot editor.)

3. Import the project into the Godot editor

Run Godot.exe, select import, navigate to "project.godot" in your project directory, then press "Import & Edit". Make some coffee or go for a walk....... It will take a long time for Godot to import all of the solar system images. You will see errors. I suggest closing Godot after it has finished the import. Restart, select your project, and click "Edit" (there should be no errors this time). Hit the Play button to run it! When you are ready to start creating your own project, the place to look first is res://ivoyager/singletons/project_builder.gd.

4. [later] Learn Git and init your project as a new repository

[TODO: include Git commands.]

Step-by-step with Git version control:

There are other ways to handle the submodule that will work, and I am certainly no Git expert! Feel free to make suggestions below (it can help to see alternatives). I highly recommend GitKraken as an alternative to cmd-line Git. It's free for public repositories.

1. Get the correct Godot Engine version

Exactly as above.

2. (Optional) Fork the ivoyager submodule

Go to https://github.com/ivoyager/ivoyager and fork the repository to your own GitHub account. You'll want this if you plan to modify the core submodule code, and hopefully contribute improvements back via pull requests. (You can do this step later if you want.)

3. Make a new project repository from the template

Go to https://github.com/ivoyager/ivoyager_project_template and click the green button "Use this template". This works just like creating a new repository, so give it your new project repository name and set it to public or private.

4. Clone your project repository to your local computer

From cmd-line, navigate to where you want your project. Then,
git clone --recurse-submodules https://github.com/your_account/your_repository
This clones the main project and also inits the ivoyager submodule (if we had submodules in our submodule, it would init those too!). Or you can do this step-wise as described here

5. Fix .gitmodules to point to your own ivoyager fork (if needed due to step 2)

Open .gitmodules in a text editor. At this time .gitmodules points to https://github.com/ivoyager/ivoyager for the ivoyager submodule. If you did step 2, you'll want to edit this so that it points to your own ivoyager fork. (There is a Git command to do this, but I don't know it off of the top of my head.)

6. Rename in project.godot

You can edit the project name in project.godot using any text editor. Under "[application]", change "config/name" and "name" to whatever you want. (Or if you prefer, you can rename the project later from within the Godot editor.)

7. Download ivoyager_assets and add to your local project directory

Wait! We're not done yet?! No. Image/media files and large binaries (i.e., asteroid data) are in a separate un-tracked directory called "ivoyager_assets". Click the link on the Download page, or find it in https://github.com/ivoyager/ivoyager/releases. Download, extract, and add it to your project directory.

8. Import the project into the Godot editor

Same as step 3 from Step-by-step without Git above.

Sign In or Register to comment.