Skip to content

Node API redesign #31

@fydar

Description

@fydar

Currently RPGCore.Behaviour has been demoted to an experimental library. I'm unhappy with the flexibility of the current API and how poorly it interacts with conventional serializers.

Currently RPGCore.Behaviour can only represent node state in rigid data types that have to be classes. Allowing node state to be represented by structs will allow RPGCore.Behaviour to represent node state in an ECS infrastructure.

API Redesign

The current API for a node looks as follows:

Current API

Removing the duplicate definition of a "Socket"

Currently, a "Socket" is represented both on the template for a node and the instance. This makes serialisation complicated and requires serializers to use custom converters.

Removing the notion of a "node instance" entirely will mean I will no longer have the socket state represented inside the instance data.

Currently, the instance data is strongly associated with the node template; which makes RPGCore.Behaviour inflexible when it comes to interactions with pre-existing code architecture.

Making the instance data optional

There are also many nodes that will not require any instance data. Many logic and maths nodes (Add, Subtract, AND, e.t.c) read from their inputs and immediately provide an output. The output value can be stored on the connection rather than the node. This will reduce the amount of serialised data required to run a graph and allow for graphs that are purely computation (have no runtime information).

Metadata

Metadata

Assignees

Labels

New feature or request📦 RPGCore.BehaviourIssue related to the RPGCore.Behaviour package

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions