Specialized components
Visual scripting
Profiles
18 min
overview profiles are modular collections of related node definitions and value types that extend the capabilities of the ir engine visual scripting system they provide a structured way to organize, load, and manage specialized sets of visual scripting components for different domains or purposes by grouping related functionality into profiles, the system remains modular, extensible, and focused, allowing developers to include only the components needed for their specific applications this chapter explores the concept, structure, and implementation of profiles within the ir engine core concepts profile purpose profiles serve several important purposes in the visual scripting system organization they group related node types and value types into cohesive, domain specific collections modularity they allow the system to be extended with new capabilities without modifying core components customization they enable developers to tailor the visual scripting environment to specific project needs maintainability they promote separation of concerns by isolating domain specific functionality performance they allow loading only the components that are actually needed for a particular application by organizing functionality into profiles, the system becomes more manageable, adaptable, and focused on the specific requirements of each project common profiles the ir engine includes several standard profiles that provide functionality for different domains core profile provides fundamental components used in almost all visual scripts basic value types float, integer, string, boolean essential nodes math operations, logic gates, flow control, basic events scene profile provides components for working with 2d and 3d scenes spatial value types vec2, vec3, quaternion, transform visual value types color, texture scene nodes position/rotation manipulation, visibility control, physics interactions struct profile provides components for working with structured data collection value types list, map, set object value types custom data structures collection nodes create, add, remove, iterate, filter ui profile provides components for user interface interactions ui value types rect, anchor, alignment ui nodes button events, text manipulation, layout control these profiles can be combined as needed to provide the specific functionality required for a particular application implementation profile registration profiles are registered with the system through registration functions // simplified from src/profiles/core/registercoreprofile ts import { iregistry } from ' / /engine/registry'; import { floatvalue, stringvalue, booleanvalue } from ' /values'; import { addnode, subtractnode, branchnode } from ' /nodes'; export function registercoreprofile(registry iregistry) iregistry { // collect value types for this profile const valuetypes = { 'float' floatvalue, 'string' stringvalue, 'boolean' booleanvalue // additional value types }; // collect node definitions for this profile const nodedefinitions = { 'math/add' addnode, 'math/subtract' subtractnode, 'flow/branch' branchnode // additional node definitions }; // return a new registry with the profile's components added return { values { registry values, valuetypes }, nodes { registry nodes, nodedefinitions }, dependencies { registry dependencies } }; } this function collects all value types defined by the profile collects all node definitions defined by the profile creates a new registry that includes these components along with any existing ones returns the updated registry profile module structure each profile is typically organized as a module with a consistent structure src/profiles/ ├── core/ # core profile │ ├── values/ # value type definitions │ │ ├── floatvalue ts │ │ ├── stringvalue ts │ │ └── │ ├── nodes/ # node definitions │ │ ├── math/ │ │ │ ├── addnode ts │ │ │ └── │ │ ├── flow/ │ │ │ ├── branchnode ts │ │ │ └── │ │ └── │ ├── coreprofilemodule ts # exports all profile components │ └── registercoreprofile ts # registration function ├── scene/ # scene profile │ ├── values/ │ ├── nodes/ │ ├── sceneprofilemodule ts │ └── registersceneprofile ts └── # additional profiles this structure organizes value types and node definitions into separate directories groups related node definitions into subdirectories by category provides a module file that exports all components includes a registration function for adding the profile to the registry profile module exports each profile typically includes a module file that exports all its components // simplified from src/profiles/core/coreprofilemodule ts // export value types export from ' /values/floatvalue'; export from ' /values/stringvalue'; export from ' /values/booleanvalue'; // additional value types // export node definitions export from ' /nodes/math/addnode'; export from ' /nodes/math/subtractnode'; export from ' /nodes/flow/branchnode'; // additional node definitions // export registration function export from ' /registercoreprofile'; this file exports all value types defined by the profile exports all node definitions defined by the profile exports the registration function makes it easy to import all profile components with a single import statement profile dependencies profiles can depend on components from other profiles // simplified from src/profiles/scene/registersceneprofile ts import { iregistry } from ' / /engine/registry'; import { vec3value, colorvalue } from ' /values'; import { setpositionnode, getpositionnode } from ' /nodes'; export function registersceneprofile(registry iregistry) iregistry { // check for required dependencies from other profiles if (!registry values\['float']) { throw new error('scene profile requires float value type from core profile'); } // collect value types for this profile const valuetypes = { 'vec3' vec3value, 'color' colorvalue // additional value types }; // collect node definitions for this profile const nodedefinitions = { 'scene/setposition' setpositionnode, 'scene/getposition' getpositionnode // additional node definitions }; // return a new registry with the profile's components added return { values { registry values, valuetypes }, nodes { registry nodes, nodedefinitions }, dependencies { registry dependencies } }; } this function checks that required dependencies from other profiles are present adds its own value types and node definitions to the registry ensures that profiles are registered in the correct order registry initialization the complete registry is typically initialized by registering multiple profiles in sequence // simplified from src/functions/createregistry ts import { iregistry } from ' /engine/registry'; import { registercoreprofile } from ' /profiles/core/registercoreprofile'; import { registersceneprofile } from ' /profiles/scene/registersceneprofile'; import { registerstructprofile } from ' /profiles/struct/registerstructprofile'; export function createbaseregistry() iregistry { // start with an empty registry const emptyregistry iregistry = { values {}, nodes {}, dependencies {} }; // register profiles in dependency order let registry = registercoreprofile(emptyregistry); registry = registersceneprofile(registry); registry = registerstructprofile(registry); // additional profiles can be registered as needed // registry = registercustomprofile(registry); return registry; } this function creates an empty registry registers profiles in order, with each profile building on the previous ones returns the fully populated registry with components from all profiles the registration order is important, as profiles may depend on components from other profiles profile registration workflow the process of registering profiles follows this workflow sequencediagram participant app as application participant registry as registry participant coreprofile as core profile participant sceneprofile as scene profile participant structprofile as struct profile app >>registry create empty registry app >>coreprofile register core profile coreprofile >>registry add core value types coreprofile >>registry add core node definitions coreprofile >>app return updated registry app >>sceneprofile register scene profile sceneprofile >>registry check for core dependencies sceneprofile >>registry add scene value types sceneprofile >>registry add scene node definitions sceneprofile >>app return updated registry app >>structprofile register struct profile structprofile >>registry check for dependencies structprofile >>registry add struct value types structprofile >>registry add struct node definitions structprofile >>app return updated registry app >>app use fully populated registry this sequence ensures that profiles are registered in the correct order each profile can build on components from previously registered profiles the final registry contains all components from all registered profiles custom profiles developers can create custom profiles to extend the system with specialized functionality // example of a custom profile for audio functionality import { iregistry } from ' / /engine/registry'; import { audioclipvalue } from ' /values'; import { playsoundnode, stopsoundnode } from ' /nodes'; export function registeraudioprofile(registry iregistry) iregistry { // check for required dependencies if (!registry values\['string']) { throw new error('audio profile requires string value type from core profile'); } // collect value types for this profile const valuetypes = { 'audioclip' audioclipvalue }; // collect node definitions for this profile const nodedefinitions = { 'audio/playsound' playsoundnode, 'audio/stopsound' stopsoundnode }; // return a new registry with the profile's components added return { values { registry values, valuetypes }, nodes { registry nodes, nodedefinitions }, dependencies { registry dependencies } }; } custom profiles follow the same structure and registration pattern as built in profiles, making the system easily extensible benefits of profiles the profile system provides several key benefits modularity functionality is organized into cohesive, self contained modules extensibility new capabilities can be added without modifying existing code customization applications can include only the profiles they need clarity related components are grouped together, making the system easier to understand maintainability changes to one domain don't affect others scalability the system can grow with new profiles without becoming unwieldy these benefits make the visual scripting system more flexible, maintainable, and adaptable to different use cases conclusion profiles are the organizational framework that brings structure and extensibility to the ir engine visual scripting system by grouping related node definitions and value types into cohesive collections, profiles enable a modular, customizable approach to visual scripting that can be tailored to specific application domains throughout this documentation, we've explored the fundamental components of the ir engine visual scripting system visual script graph the container that holds nodes and defines the overall structure visual script node the building blocks that perform specific operations socket & link the connection system that enables nodes to communicate node definition the blueprints that define the behavior of node types valuetype the data type system that defines how information flows between nodes execution engine the runtime system that processes and executes visual scripts node & value registry the central repository for all available components profiles the organizational framework that groups related components together, these components form a comprehensive visual scripting system that enables non programmers to create complex, interactive behaviors through a visual interface