A CLI tool to manage your godot-rust projects

Overview

ftw

A CLI tool to manage your godot-rust project!

Table of contents

General Information

This is a tool to help you manage your game project by providing commands to (1) create a project, (2) create a class, (3) create a singleton class, (4) build the library, (5) export your game, (6) run your project (and more to come in the future!). Its like rails but for game development 😉 .

Setup

It leverages tools like godot and godot-headless to make it all work! In Linux you can install both godot and godot-headless, on others only godot. For additional setup instructions, check the wiki of the default template.

$ cargo install ftw

Usage

ftw new <project-name> [template]

Creates a new project directory

$ ftw new my-awesome-game # this creates a new project using the default template
$ ftw new my-awesome-game default # same as above
$ ftw new my-awesome-game /path/to/custom/template # creates a new project using a custom template

Note: The custom template should have same structure as the default template

ftw class <class-name> [node-type]

Creates a class

$ ftw class MyHero # creates a class called `MyHero` that is deriving from `Node` as default
$ ftw class MyHero Area2D # creates a class that derives from `Area2D`

Note: This creates the following files rust/src/my_hero.rs, godot/scenes/MyHero.tscn and godot/native/MyHero.gdns then adds the class inside rust/src/lib.rs

You could also organize rs, tscn and gdns files into submodules or subfolders
$ ftw class heros/marvel/avengers/IronMan Area2D # creates a class that derives from `Area2D`

Note: This creates the following files rust/src/heros/marvel/avengers/iron_man.rs, godot/scenes/heros/marvel/avengers/IronMan.tscn, godot/native/heros/marvel/avengers/IronMan.gdns and mod.rs files in each subfolder in rust/src then adds the class inside rust/src/lib.rs

ftw singleton <class-name>

Creates a singleton class for autoloading

$ ftw singleton MySingleton # creates a class called `MySingleton` that derives from `Node`

Note: This creates the following rust/src/my_singleton.rs and godot/native/MySingleton.gdns then adds the class inside rust/src/lib.rs

You can also organize the files into submodules/subfolders as in ftw class command
$ ftw singleton network/Network # creates a class called `Network` that derives from `Node`

ftw build [target] [build-type]

Builds the library for a particular target

$ ftw build # builds the library for your current platform as target using `debug` as default
$ ftw build linux-x86_64 # builds the library for the `linux-x86_64` platform using `debug` as default
$ ftw build linux-x86_64 debug # same as above
$ ftw build linux-x86_64 release # builds the library for the `linux-x86_64` platform using `release`

[target] can be one of the following

  • android-aarch64
  • android-arm
  • android-x86
  • android-x86_64
  • ios-aarch64
  • linux-x86
  • linux-x86_64
  • macos-x86_64
  • windows-x86-gnu
  • windows-x86-msvc
  • windows-x86
  • windows-x86_64-gnu
  • windows-x86_64-msvc
  • windows-x86_64

ftw export [target] [build-type]

Exports the game for a particular target

$ ftw export # exports the game for your current platform as target using `debug` as default
$ ftw export linux-x86_64 # exports the game for the `linux-x86_64` platform using `debug` as default
$ ftw export linux-x86_64 debug # same as above
$ ftw export linux-x86_64 release # exports the game for the `linux-x86_64` platform using `release`

ftw run

Builds the library using debug then runs your game

$ ftw run # enjoy! 😆

Contact

Michael Angelo Calimlim <[email protected]>

Comments
  • Missing

    Missing "use" in lib.rs with generated class at path

    I ran ftw class chars/Player KinematicBody but when I tried to run the whole game (ftw run), Rust gave an error that it couldn't find player in handle.add_class::<player::Player>();. This seemed to be because the generated code added mod chars; to the top, but not use chars::*; or at least use chars::player; and I had to add it myself.

    I'm using the released ftw 0.6.0

    opened by Zennii 11
  • ftw run:

    ftw run: "FsExtra error: The system cannot find the path specified. (os error 3)"

    I'm on Windows and godot is in my PATH; I'm able to run it from the command line.

    I've created a new project: ftw new foo. Then I try to run it with cd foo; ftw run; and I get the following error after it successfully builds: "FsExtra error: The system cannot find the path specified. (os error 3)".

    opened by photex 9
  • Add ability to create tool scripts

    Add ability to create tool scripts

    Currently, FTW supports creating regular classes and singletons using the class and singleton commands. I propose adding another command tool.

    Currently, ftw overwrites the lib.rs file and the init function. This means that custom handle.add_class<> calls are removed from the file. In order to register a tool script with godot-rust, you have to do something like

    fn init(handle: InitHandle) {
      handle.add_tool_class::<MyClass>();
    }
    

    but this will be overwritten if you ever run a command like ftw class again.

    I tried implementing this command, but I got stuck because the current implementation reads the source-dir and looks for [NativeClass] using a regex. I couldn't think of a good approach for tool scripts so I decided to post an issue here and get some feedback from you before I proceed. For example, I thought of adding some custom attribute, but this would require users to import a crate into their project which feels messy and against the current approach. I also thought of making the user add a comment but this approach is not always popular.

    Another option, instead of implementing this tool command, is some workaround that allows you to call some custom code from the lib.rs file.

    opened by aclave1 3
  • Fix: import gdnative prelude in lib.rs template

    Fix: import gdnative prelude in lib.rs template

    The default lib.rs template has a compiler error with newer versions of the gdnative library. Importing the Variant type is now required to run the godot_init macro. I decided to include the prelude instead of just importing Variant to hopefully prevent these API changes from breaking things in future versions.

    Test Plan:

    ftw new test
    cd test
    ftw build
    

    Error Output:

    error[E0433]: failed to resolve: use of undeclared type `Variant`
      --> rust\src\lib.rs:13:1
       |
    13 | godot_init!(init);
       | ^^^^^^^^^^^^^^^^^ not found in this scope
       |
       = note: this error originates in the macro `$crate::godot_nativescript_init` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider importing this struct
       |
    4  | use gdnative::core_types::Variant;
       |
    
    For more information about this error, try `rustc --explain E0433`.
    error: could not compile `example` due to 2 previous errors
    ï…¥ ERROR: The system cannot find the file specified. (os error 2)
    Error: ()
    

    lib.rs

    mod game;
    mod spinning_cube;
    
    use gdnative::prelude::{godot_init, InitHandle};
    
    // Function that registers all exposed classes to Godot
    fn init(handle: InitHandle) {
        handle.add_class::<game::Game>();
        handle.add_class::<spinning_cube::SpinningCube>();
    }
    
    // macros that create the entry-points of the dynamic library.
    godot_init!(init);
    
    
    
    opened by aclave1 2
  • Remove Build Dependency on game.gdnlib

    Remove Build Dependency on game.gdnlib

    given that this is just a node in the game world, I'm not sure if this should be a hard requirement on building the game or not. after all, within gdnative, you can pick and choose which classes you want to expose.

    opened by jakyle 2
  • provide a way to customize which godot binary

    provide a way to customize which godot binary

    provide a way to customize which godot binary to be used to invoke commands that use godot. For example, instead of having godot binary on $PATH, I want to have a custom batch or shell script file to invoke godot...

    opened by macalimlim 2
  • control number of dependencies to reduce compile time

    control number of dependencies to reduce compile time

    @Bromeon as per your suggestion, I have reduced the number of dependencies used by ftw.

    This is the dependency tree from main branch of ftw ftw-main.txt and this is the dependency tree from this branch ftw-control-deps.txt

    The dependency tree might be different on windows...

    I have noticed that the compile time was a little faster than before...

    opened by macalimlim 0
  • run game in server mode

    run game in server mode

    Run the game in server mode, ftw run should have an option to run in server mode in addition to running via desktop. This feature is only available in Linux...

    opened by macalimlim 0
Owner
Michael Angelo Calimlim
Michael Angelo Calimlim
compare gdnative rust based physics against Godot built-in physics

Godot vs. Rapier Rapier is an open source physics framework written in Rust. This project pits godots built-in physics against Rapier. It uses godot-r

Stephan Dilly 75 Nov 17, 2022
An egui backend for godot-rust

Godot Egui An egui backend for godot-rust. Rationale Godot has a perfectly valid GUI system, so why egui? Here are my personal reasons: Simplicity: No

null 109 Jan 4, 2023
jlang--godot bridge, built in rust

jlang-rs-gd J is an extremely high-level mathematical notation and programming language. Godot is a game / gui / multimedia engine. jlang-rs-gd lets y

tangentstorm 2 Feb 15, 2022
An artisanally made PSD Importer for Godot, written in Rust

PSD Importer for Godot Speed up your import workflow ✨ An artisanally made PSD Importer for Godot 3.5, written in Rust. ✨ Getting Started | ?? Documen

Bram Dingelstad 4 Jan 26, 2023
GDDB is a superfast in-memory database designed for use in Godot

GDDB GDDB is a superfast in-memory database designed for use in Godot. This database aims to provide an easy frontend to an efficient in-memory databa

Richard Patching 5 Dec 4, 2022
A Godot 3.4 binding for Live2D

godot-cubism A Godot 3.4 binding for cubism-rs which itself is a binding for the native cubism sdk. Usage var factory = load("path_to_your_native_scri

null 16 Dec 23, 2022
A crate for using Bevy with the Godot Engine.

bevy_godot A crate for using Bevy with the Godot Engine. This crate is in active development and is not ready for production use. Features Godot Scene

Abby Bryant 63 Dec 17, 2022
Plugin to generate flowfields from tilemaps in the Godot Engine!

Godot Tilemap Flowfields RTS-Style optimized path-finding for crowds of agents. Built for the Godot game engine, written with performance in mind in R

Arne Winter 18 Jan 10, 2023
A direct ecs to low-level server implementation for Godot 4.1

godot_ecs What if Godot 4.1 and Bevy got married? Well, you'd get one interesting duo of data driven goodness. In Development This crate is not produc

null 5 Oct 6, 2023
An extendable system made up of autonomous execution services known as nodes organized in a tree of processes. Inspired by Godot!

NodeTree NodeTree is a framework to create large scalable programs and games through a tree of processes. Each process is fully autonomous and is capa

LunaticWyrm 3 Apr 10, 2024
Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases

Libium Libium is the backend of Ferium. It helps manage Minecraft mods from Modrinth, CurseForge, and Github Releases There are 3 main components in L

Ilesh Thiada 14 Dec 13, 2022
Manage light-weight sandbox environments for development

Cubicle development container manager Cubicle is a program to manage containers or sandbox environments. It is intended for isolating development envi

Diego Ongaro 8 Nov 29, 2022
A Bevy helper to easily manage resources that need to persist across game sessions.

bevy-persistent A Bevy helper to easily manage resources that need to persist across game sessions. Background In games, there are a lot of resources

Umut 5 Mar 25, 2023
A Bevy plugin to easily create and manage windows that remember where they were.

bevy-persistent-windows A Bevy plugin to easily create and manage windows that remember where they were. Background When you're developing a game, thu

Umut 4 Aug 12, 2023
Rushes are new ephemeral projects at Hive Helsinki. Wordle is the first in this series with 48 hours time window

Rushes are new ephemeral projects at Hive Helsinki. Wordle is the first in this series with 48 hours time window

Jiri Novotny 1 Feb 24, 2022
rpg-cli —your filesystem as a dungeon!

rpg-cli is a bare-bones JRPG-inspired terminal game written in Rust. It can work as an alternative to cd where you randomly encounter enemies as you change directories.

Facundo Olano 1.2k Jan 4, 2023
NeosPeeps is tool that allows for listing your NeosVR friends quickly, without having to actually open the whole game

Neos Peeps NeosPeeps is tool that allows for listing your NeosVR friends quickly, without having to actually open the whole game. It also has a bunch

LJ 6 Sep 12, 2022
This tool allows you to open one or more notebooks in Visual Studio and go hog wild exploring your systems in Bevy.

Bevyrly Bevy is rly useful, but requires some hygiene! Pronounced as /ˈbɛvə(ɹ)li/, derives from Old English, combining befer ("beaver") and leah ("cle

null 4 Feb 28, 2024
Decryption tool for assets.pie from Teenage Mutant Ninja Turtles: The Cowabunga Collection. This tool was made in its entirety by SowwyItsAnAlt.

Cowabunga Decryption tool for assets.pie from Teenage Mutant Ninja Turtles: The Cowabunga Collection. This tool was made in its entirety by SowwyItsAn

Masquerade 8 Dec 22, 2022