Skip to content

ParadoxV5/Godot.rb

Move aside, Py, there’s a new sheriff in town!

Godot.rb – Ruby in Godot Engine justforfunnoreally.dev badge

Caution: This project is still developing.

While the Ruby land designs are mostly set, the C side code are all still experiments. Even the core components see occasional rewrites.

Moreöver, the lead maintainer is a C novice, so thank you early adopters for beïng prepared to encounter and report segfaults and core dumps 😅.

Getting Started

  1. As betaware, only Windows and RubyInstaller2 without Devkit is tested currently. It also needs MinGW in the PATH. Things will go unexpected with the MSYS2 Devkit.

    • Support for Devkit and Linux are planned, but not for Windows going through WSL (but Linux support means yes for Godot Engine and Ruby both contained in WSL).
  2. I might publish this project to RubyGems in the future. For now, download/clone this repo to a consistent place (i.e., not the Downloads folder) and run:

    gem install mingw-make
    gem install rake rake-compiler json
    rake
    rake clean # optional, delete leftovers

    If you don’t have symlink permissions, consider admin elevation for the rake line so the script symlinks Ruby DLLs rather than duplicating them.

  3. Copy-paste or symlink generated/godot_rb.gdextension in your Godot Project (Unlike nearly all GDExtensions, this one uses absolute paths so multiple projects can share the same install.)

  4. Have fun with real singletons! 💎 (No ideas on exporting projects currently…)

A couple of reminders for Godot.rb development

  • The Rakefile is for building, not setting up…

  • bundle install fails on RubyInstaller no-Devkit because of the Gemfile app steep’s transitive dependency ffi. Gem insists to use the platform-independent version of the ffi gem, which doesn’t know about bin/ruby_builtin_dlls/libffi-8.dll and must compile libffi from scratch with libffi own Makefile. I’m unable to work around this problem one way or another (#help-wanted).

  • RubyInstaller Ruby utilizes the new Universal C Runtime, but Godot Engine still uses the old MS VC++ Runtime, for they support (on a best-effort basis) the minority who refuse to upgrade their outdated Windows versions. See godotengine/godot-proposals#9111 regarding the situations. Fortunately, while mixing runtimes is unsupported, the only known issue is that Ruby cannot print to console (only Godot#print and etc. can).

Features

☑️️ Current

[TBA]

📝 Beta

[TBA]

🔜 Planned

[TBA]

⏳ Backlog

[TBA]

🧊 Anti-Features

[TBA]

License

Copyright (c) 2014-present Godot Engine contributors. https://godotengine.org/license/

The rest of this project

Copyright 2024 ParadoxV5

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.