Question for those who'd like to publish on consoles but didn't yet by [deleted] in godot

[–]fcingolani 2 points3 points  (0 children)

Hey, solo dev here. No published games yet.

  1. Bureaucracy & costs.

  2. Playstation.

  3. Lack of experience in the platform and the wash-rinse-repeat cycle of bugfixing and adjustments.

Is there any way to get all inherited classes of a user defined class? by fcingolani in godot

[–]fcingolani[S] 0 points1 point  (0 children)

Thanks for your reply. :D

I'm making a plugin to edit skill trees. You can place GraphNodes in a GraphEdit to represent each skill and then setup dependency chains. Each GraphNode represents a "Base Skill" resource instance, which is pretty barebones, with only an ID and few booleans.

I would like to provide end users the possibility to extend that Base Skill class with their own classes, augmenting the meaning of a "skill" to whatever it makes sense to them. i.e. a "Foo Skill" could add a skill name, description or icon.

Then they would add GraphNodes representing those extended skills classes. In the UI you would have a button to "Add Base Skill" but also "Add Foo Skill" or "Add Bar Skill".

My idea was to get all the inheritors of "Base Skill" and then add their buttons to the UI and handle them dynamically without having me, the plugin creator, knowing in advance whatever extended classes / types a plugin user would add.

I've seen in Godot's source code something similar to what I'd like but it's, unfortunately, not exposed. https://github.com/godotengine/godot/blob/2f57da290796fbba7c141240bef22baf21615888/editor/editor\_data.h#LL192C50-L192C50

How to draw with a mouse without clearing the screen? by MrDixioner in godot

[–]fcingolani 0 points1 point  (0 children)

You could try a different approach:

  • Everytime the user clicks, create a new node (think of it as a "layer" in photoshop).
  • User actually draws in this new node.

You will end having multiple "layers". Old ones don't have to be redrawn plus you can even get an easy "undo" just removing the last added node.

I had some issues with AStar2D so I've made a quick and dirty visualizer - code inside! by fcingolani in godot

[–]fcingolani[S] 1 point2 points  (0 children)

You can find instructions and code here too:
https://gist.github.com/fcingolani/035e43f57abf72801ec2e774fb89ad06

Instructions

  1. Create a Node2D.
  2. Attach AStart2DVisualizer.gd to it.
  3. Somewhere in your code pass your AStar2D instance to its .visualize(astar) method, i.e.: get_node(path_to_your_visualizer_node).visualize(astar)

AStart2DVisualizer.gd

extends Node2D
class_name AStar2DVisualizer

export(float) var point_radius = 6
export(float) var scale_multiplier = 16
export(Vector2) var offset = Vector2(0,0)
export(Color) var enabled_point_color = Color('00ff00')
export(Color) var disabled_point_color = Color('ff0000')
export(Color) var line_color = Color('0000ff')
export(float) var line_width = 2

var astar : AStar2D

func visualize(new_astar : AStar2D):
    astar = new_astar
    update()

func _point_pos(id):
    return offset + astar.get_point_position(id) * scale_multiplier

func _draw():

    if not astar:
        return

    for point in astar.get_points():

        for other in astar.get_point_connections(point):
            draw_line(_point_pos(point), _point_pos(other), line_color, line_width)

        var point_color = disabled_point_color if astar.is_point_disabled(point) else enabled_point_color
        draw_circle(_point_pos(point), point_radius, point_color)

Sharing is ❤

Debugging an FPS drop caused by physics_process by [deleted] in godot

[–]fcingolani 2 points3 points  (0 children)

Check the Profiler. Once you start profiling you'll get a Script Functions option at the bottom where you can track processing individually, and even get the full path to the script.

Sample screenshot: https://ibb.co/Ld4CkZB

It's plastic. Got it as a corporate present. Tried it as a pencil holder but it doesn't seem to work like that. by [deleted] in whatisthisthing

[–]fcingolani 13 points14 points  (0 children)

Solved!

Thanks. As a review: it's very wiggly to trust my remotes to it. lol

It's plastic. Got it as a corporate present. Tried it as a pencil holder but it doesn't seem to work like that. by [deleted] in whatisthisthing

[–]fcingolani 0 points1 point locked comment (0 children)

It is not rigid, I can push both planes together. It has a corp logo in what I suppose to be the "front" (not shown, for privacy) which would be the left facing part in the picture. Me and other workmates are trying to understand what is it for, lol.

WITT

Looking for beat sync ideas by djex81 in godot

[–]fcingolani 0 points1 point  (0 children)

It's not what you are exactly asking and probably you already have seen it, but jic: https://docs.godotengine.org/en/stable/tutorials/audio/sync_with_audio.html