Skip to content

Releases: libriscv/godot-sandbox

v0.25: API and stability improvements

23 Oct 15:06
78a41cf
Compare
Choose a tag to compare

A small release that adds stability and continues to improve the C++ API surface

  • Adds complete support for the Plane variant type
  • Adds opaque RID support, pass-through
  • Adds constructors to all Vector classes
  • Add print/stdout redirect to Callable
  • Add new PROPERTY(name) macro for objects to simplify adding properties
  • Add proper index operator Array that can get/set
  • Improve performance of getting/setting properties on objects
  • Improve performance of get_node() and derivatives
  • Prevent reloading/resetting a Sandbox while it's in a function call
  • Expose ELFScript::get_content() so that the program bytes can be directly loaded into a Sandbox
  • Several other bug fixes

PRs

New Contributors

Full Changelog: v0.24...v0.25

v0.24: New restriction system

19 Oct 21:17
f03f962
Compare
Choose a tag to compare

This release adds new features for Sandbox restrictions, completes the C++ API for Array, Dictionary and String, and fixes many problems.

  • Add new property to Sandbox called restrictions
  • Add support for user-provided Callables for handling classes, objects, methods, properties and resources respectively
  • Add setting for disabling custom named Sandbox instances
  • Automatically build CMake project when CMakeLists.txt is detected instead of trying to use Docker
  • Precise simulation now also applied to VM calls, making them easier to debug
  • Fix a bug when creating Packed*Arrays. They are not mananged by reference in Variants.
  • Fix issue when using sandbox.vmcall() with no arguments
  • Fix issue with counting active global Sandbox instances
  • Fix issue with assigning temporary to permanent Variants. It is now kept permanent.

The new restrictions system is documented here.

The rules for CMake building is documented here.

The Sandbox node API reference

What's Changed

Full Changelog: v0.23...v0.24

v0.23: Bugfixes

13 Oct 12:45
96f1d69
Compare
Choose a tag to compare

This release fixes many bugs reported and otherwise.

  • Add missing Locale environment variables for compatibility with other libraries, eg. Mir
  • Clear Variants fully when re-initializing Sandboxes (hot-reloading). They would fill up over time and generate errors.
  • Remember to stop async compilation thread on exit. Prevents hanging executable on Windows. Thanks @CycloneRing
  • Fix C++, Rust and Zig scripts appearing in New Scene dialogue. Thanks @CycloneRing
  • Implement remaining Quaternion ops.
  • Add Variant::is_permanent() to check if it's permanently stored.
  • The current tree base of a Sandbox could become clobbered by re-entrant calls. Fixed.

Full Changelog: v0.22...v0.23

v0.22: Hot-reloadable programs, 3D variants

10 Oct 20:40
55633cf
Compare
Choose a tag to compare

There is now support for Transform2D, Transform3D, Basis and Quaternion. Some Variants can be now in-place updated, including permanent ones. And finally, if a program is updated it will be reloaded in the editor, including its properties. Property values are retained across updates.

  • Added Variant::make_permanent() to promote/move a temporary variant into permanent storage
  • Some Variants can now be in-place updated, including permanent ones
  • Improved error messaging around Variants and Objects
  • Hot-reloadable Sandboxes with preserved Sandbox property values
  • Introduce wrappers and several methods for Transform2D, Transform3D, Basis and Quaternion
  • Implement several new methods for Vector2
  • Add use_precise_simulation property to Sandbox for the purposes of debugging exceptions
  • Add new experimental binary translation option automatic N-bit address space, which improves performance but won't support all types of programs

What's Changed

  • Add initial support for Transform2D, Transform3D and Basis by @fwsGonzo in #172
  • Add support for in-place reuse of Variant references by @fwsGonzo in #173
  • Reload sandboxes when ELF files change by @fwsGonzo in #174

Full Changelog: v0.21...v0.22

v0.21: High-performance binary translations

06 Oct 15:57
f324db7
Compare
Choose a tag to compare

High-performance binary translation support has now been added, with support for all platforms including Web. The exact process is documented here. The extension has also been upgraded to 4.3 in order to work around a bug in Web export.

We're seeing 6-30x performance improvements in benchmarks against GDScript.

  • Binary translations can now be emitted at run-time and written to .cpp files, later to be embedded. They auto-activate by themselves.
  • It's now possible to disable Docker usage completely. It's a project setting.
  • Added initial support for tracing system calls. It's a compile-time flag for the moment.
  • Avoid caching functions when loading Sandbox from buffer. Instant instantiation.
  • Add a new resumable mode which lets you slowly initialize a Sandbox over many frames, if needed. Must not be called into, while doing this, as it will disable resumable mode.

What's Changed

Full Changelog: v0.20...v0.21

v0.20: Modding and custom builds support

03 Oct 19:50
551b273
Compare
Choose a tag to compare

In this release focus has been on supporting the creation of sandboxes that take remotely downloaded programs as input. There is now also Callable support that can refer to C++ lambdas, which can be used with signals. Finally, asynchronous compilation has been made available, enabled by default. It is backed by a single worker thread to avoid problems with ccache and Ctrl+Z + Ctrl+S, where a long compilation would eventually overwrite a newer one.

  • Added support for Callable with wrapper in the C++ API
  • Allow Sandboxes to be created using PackedByteArray
  • Add support for loading resources
  • Add settings for global defines and debug info for C++ programs
  • Add asynchronous compilation setting, default enabled
  • There is now a LuaJit example that can be embedded into C++ programs
  • Simplify and improve CMake build system for easier integration into game projects

LuaJit example

What's Changed

Full Changelog: v0.19...v0.20

v0.19: Various improvements and fixes

29 Sep 20:51
18b0bba
Compare
Choose a tag to compare

This release completes much of the work done in previous release to be able to support most (if not all) of Variant types in the sandbox.

  • Most Variant types are now supported.
  • It's now possible to create Variants during startup, which won't be forgotten
  • There is now a CMake project for building complex sandbox projects, meant to be used in Ubuntu or WSL
  • The Sandbox programs in the unittests are now being built using the new CMake project
  • Most properties are now visible in the inspector for shared Sandbox instances too
  • PackedStringArray was missing among the packed arrays, but is now fully supported
  • The C++ docker image has been reduced 25% in size, which should reduce project startup times

Example of how to create Variants that can be used between calls:

// This works: it's being created during initialization
static Dictionary d = Dictionary::Create();

extern "C" Variant add_to_dict(Variant key, Variant val) {
	d[key] = val;
	return d;
}
extern "C" Variant failing_add_to_dict(Variant key, Variant val) {
	// This won't work: it's being created after initialization
	static Dictionary fd = Dictionary::Create();
	fd[key] = val;
	return fd;
}

PRs

  • Add getters/setters for registers and resume functionality for Sandbox by @fwsGonzo in #145
  • Allow using Variants that were created during initialization by @fwsGonzo in #146
  • Add an example CMake project for building complex Sandbox programs by @fwsGonzo in #148
  • Add test for CMake example program by @fwsGonzo in #149
  • Build the unittest ELF file in GA by @fwsGonzo in #150
  • Expose properties from shared instances in the inspector through ScriptInstance by @fwsGonzo in #152
  • Implement support for PACKED_STRING_ARRAY by @fwsGonzo in #153

Full Changelog: v0.18...v0.19

v0.18: Restrictions on objects and classes

26 Sep 08:02
d7fce5f
Compare
Choose a tag to compare

This release adds basic restrictions through sandbox.allow_object(obj) and sandbox.allow_class("class_name"). You can see how it works from the test cases. It's now also possible to make arbitrary calls on Variants, and with the addition of the METHOD(name) macro in C++, one could implement the entire API fairly quickly with only that macro in wrapper classes. Example:

struct Array {
        ....

	METHOD(append_array);
	METHOD(assign);
	METHOD(duplicate);
	METHOD(find);
};

The macro doesn't need to know about any types, arguments or return value. It will just work as long as you call the function correctly when you're using it. It should trivialize future work on fleshing out missing API. PRs welcome.

Create Skydome 16x4, optimized mesh

As a proof-of-concept I implemented a skydome creation function and benchmarked it against GDScript, with good results.

C++ code: https://gist.github.com/fwsGonzo/9977281a75e247b89093d7845dad633f
GDScript: https://gist.github.com/fwsGonzo/ff6934ed9007db27613c7e80606d1e2e

What's Changed

  • Implement several system calls for Vector3, vector hashes by @fwsGonzo in #132
  • Implement more Vector3 functions and fix issues with Math operations by @fwsGonzo in #133
  • Implement access to methods on arbitrary Variants by @fwsGonzo in #135
  • Simplify EXTERN_SYSCALL and add CREATE_METHOD helper by @fwsGonzo in #138
  • Allow PackedStringArray pass-through, add fetch Array to std::vector by @fwsGonzo in #139
  • Add restrictions on Object access and Class instantiation by @fwsGonzo in #143

Full Changelog: v0.17...v0.18

v0.17: Support for more Variant types, math functions

20 Sep 16:31
383ef4b
Compare
Choose a tag to compare

Notable feature:

  • A variety of 32- and 64-bit Math functions has been added.
  • The C++ container now uses ccache to reduce compilation times.
  • Making function calls on objects is now much faster than before.
  • Worked around a nasty bug in ObjectDB::instantiate(). Variant destructors overwrite something in the underlying godot::Object*.

This release adds proper support and testing for:

  • Vector3/3i
  • Vector4/4i
  • Color
  • PackedInt32Array
  • PackedInt64Array
  • PackedVector2Array
  • PackedVector3Array
  • PackedColorArray
  • Other remaining Variants are passed by reference, and can still be used.

What's Changed

Full Changelog: v0.16...v0.17

v0.16: Zig support, unit tests, typed arguments

16 Sep 18:31
b90acf7
Compare
Choose a tag to compare

image

  • Initial Zig scripting support was added. It lacks a proper API but all the foundation is in place up to and including build containers.
  • Unit tests were added, allowing us to not accidentally introduce regressions.
  • A new typed primitives mode has been added and made default, requiring a rebuild of all programs. The new mode uses registers instead of Variant where possible, and is quite a bit faster as a result.
  • Improved support for packed arrays in the C++ API. Packed arrays now have a wrapper class with proper methods.

What's Changed

Full Changelog: v0.15...v0.16