home.social

#godotdash — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #godotdash, aggregated by home.social.

fetched live
  1. new release: https://codeberg.org/godot-dash/godot-dash/releases/tag/v1.0.0-alpha.4

    Enhancements
    - Optimized trails, with an important optimization specifically for the wave trail
    - Tweaked the default MSAA level since
    MSAA_8x isn't a reasonable default (diminishing returns)
    - Disabled search bars on popups on Android (since it made the on-screen keyboard automatically pop up)

    Fixes
    - The swing could crash into ceilings

    #godot #gamedev #godotdash

  2. i just did a small but satisfying refactor!
    we used to duplicate objects in our level editor by packing them into a PackedScene then instantiating it, every object one by one in a
    map operation.
    but it turns out that level serialization and deserialization code is modular enough to have a function to do it at the object level, and that's what the refactor uses.
    in a worst-case scenario, it avoids the allocation of
    n unique PackedScenes, which will save memory!

    func _clone_object(object: Node2D) -> Node2D:
        if object is Player:
            return object
    -   NodeUtils.change_owner_recursive(object, object)
    -   var packer := PackedScene.new()
    -   packer.pack(object)
    -   var clone := packer.instantiate()
    -   NodeUtils.change_owner_recursive(object, level)
    -   NodeUtils.change_owner_recursive(clone, level)
    -   clone.scene_file_path = object.scene_file_path
    -   return clone
    +   var object_data: Dictionary = Level.serialize_object(object, Serialize.Reason.SAVE)
    +   var cloned_object: Node2D = Level.instantiate_object_from_data(object_data)
    +   Level.deserialize_data_to_object(object_data, cloned_object, level, true)
    +   cloned_object.set_meta(Constants.LAYER_META, object.get_parent())
    +   return cloned_object

    #godotengine #gamedev #godotdash

  3. over the last few days, i optimized level loading times when restarting a level from ~600ms to ~50ms on a benchmark level with 2000 objects.
    it's still not enough, since we're expecting levels to be a lot heavier than 2k objects, but it's already a good start.

    the first optimization was to make the game set the deserialized data on all the objects when restarting, instead of re-instantiating the level from scratch.

    the second optimization was to remove as many
    get_node calls as possible, and replace them with storing a reference once in metadata, and getting that reference back using get_meta (which is essentially a hashmap lookup, i checked). get_node is slow because it has to traverse the tree and do a bunch of string matching and stuff.

    #godotengine #gamedev #godotdash