{"repo":"KoBeWi/Godot-Ref-Serializer","free":true,"listed":false,"github":"https://github.com/KoBeWi/Godot-Ref-Serializer","clone":"git clone https://github.com/KoBeWi/Godot-Ref-Serializer.git","description":"Utility class for registering and serializing light-weight RefCounted-based structs in Godot Engine.","language":"GDScript","stars":42,"topics":["godot"],"license":"MIT","category":"game-templates","readme_excerpt":"Godot Ref Serializer Helper class to serialize and deserialize light-weight RefCounted objects in Godot Engine. Requires Godot 4.4 or newer. But why Godot currently lacks struct support. The only available serializable data type are Resources (and technically nodes, but they are stored as PackedScene Resource). While they allow you to pass data, serialize it and store, they come with unnecessary bloat. All Resources are stored in a global cache and custom resources can't be saved without referencing their original script, making the files verbose. Example Item resource with a single value property: RefSerializer provides an alternative for storing data - you can use simple RefCounted objects. They are lighter than Resources and store in a compact format. The same Item stored as RefCounted: Notice how it doesn't reference any script, only storing a type. It's nice and compact, but comes with some caveats explained below. How does it work RefCounted objects can't be serialized normally. RefSerializer has a custom serialization code that makes it possible. But it doesn't work on just any RefCounted object - you need to register them. The way registration works gives some nice possibilities. To register a class, you need to provide its name and a constructor, e.g. The constructor is a Callable that returns RefCounted object. It can be new() method of a class or a custom method. This means that you can register any class - it can be an internal class or a class defined in built-in","default_branch":null,"files":null,"tree":[],"storefront":"/r/KoBeWi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/KoBeWi/Godot-Ref-Serializer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}