Giter Club home page Giter Club logo

godot-das's Introduction

Godot-Das: Daslang bindings for Godot

This project is a Godot module that integrates will integrate Daslang (former daScript) language into Godot game engine

Download

This project is build as an engine submodule, so you will need to download Godot repo:

git clone -b 4.2 [email protected]:godotengine/godot.git

The develompent is done on Godot's 4.2 branch (will move to the next version once it's stable)

Next, clone this repo to godot/modules/. Rename the directory to daslang:

cd godot/modules
git clone [email protected]:ilyabelow/godot-das.git daslang

You will also need Daslang itself, so download its repo as a submodule:

cd daslang
git submodule update --init

Don't use clone with --recurse-submodules, as it will download Daslang submodules which are not needed

Note: if daScript repo is finally renamed, this will not work, so if I forget to update this, please remind me and in the meantime download Daslang by hand

Bulding

First, build Daslang static library:

cmake -B __cmake_temp
cmake --build __cmake_temp -j<cores>

This will put liblibDaScript.a in lib directory. The project will only need headers from daScript/include/, so you can delete the rest in daScript directory

Next, build Godot:

cd <godot root directory>
scons (or pyston-scons, if configured, it should be a bit faster)

Daslang module will be enabled by default, you can disable it with module_daslang_enabled=no (or change is_enabled function in modules/daslang/config.py)

Use linker=lld or linker=mold because default ld is super slow

Important: Daslang is built with g++, so make sure not to use clang for building Godot!

Code generation

All files named *_gen.* are generated. To regenerate them, run the binary with --bind-das option (place it after --):

bin/<your godot binary> -- --bind-das

Change types variable in src/generate_bindings.cpp to generate bindings for required types (tmp solution)

Testing

For now, all Daslang code for Godot - casts, macros, utils - are located in boost directory. Also, daslib should be there too, for now soft link to daScript/daslib is created. boost directory should be copied or linked inside every Godot project that use Daslang (links are already in place for examples). Later all this code will be embedded into the binary

Finally, to run an example, from Godot root directory run

bin/<your godot binary> modules/daslang/examples/<example>/project.godot

You can add options tool = true to enable tool mode (so the object will be active inside editor, which can crash)

Add --windowed if using a big monitor

Don't forget to add dev_build=yes to scons config for debugging. If you want a release build, remove set(CMAKE_BUILD_TYPE Debug) from CMakeLists.txt

Build and debug jobs, as well as intellisense configuration for VSCode can be found in _vscode_files, to use them

cd <godot root directory>
ln -s modules/daslang/_vscode_files .vscode

Demo

This demo with just a bunch of staff to demostrate and test different features of the integration

Bunnymark

This is a port of Bunnymark, which is a crude sanity-check of language performance. Turns out, with GDScript framerate starts to drop after a significantly less bunnies than with Daslang!

More thorough testing will be performed later, this demo is mainly a proof of concept

godot-das's People

Contributors

ilyabelow avatar

Stargazers

 avatar

Watchers

Dima Granetchi avatar  avatar  avatar n.savichev avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.