{"id":14201,"date":"2024-10-21T00:25:14","date_gmt":"2024-10-21T04:25:14","guid":{"rendered":"https:\/\/www.sceneri.com\/?post_type=sceneri-pro-docs&p=14201"},"modified":"2024-11-01T23:42:18","modified_gmt":"2024-11-02T03:42:18","slug":"visual-scripting-backend","status":"publish","type":"sceneri-pro-docs","link":"https:\/\/www.sceneri.com\/sceneri-pro-docs\/introduction\/logic-graph\/visual-scripting-backend\/","title":{"rendered":"Visual Scripting Backend"},"content":{"rendered":"
\\Code\\Common\\Public\\Common\\Scripting\\Parser<\/code><\/li>\n- Interpreter
\\Code\\Common\\Public\\Common\\Scripting\\Interpreter<\/code><\/li>\n- Compiler
\\Code\\Common\\Public\\Common\\Scripting\\Compiler<\/code><\/li>\n- Virtual Machine
\\Code\\Common\\Public\\Common\\Scripting\\VirtualMachine<\/code><\/li>\n<\/ul>\n<\/div>\nOur Sceneri script asset type is<\/div>\n\n.script.source<\/code> for the text source file (we use LUA syntax for now)<\/li>\n.script.binary<\/code> compiled binary format of .script.source<\/code><\/li>\n<\/ul>\nCompilation of script files is done through the asset compiler which produces these two files.<\/div>\nCompilation Options<\/h3>\n\nSCRIPTING_USE_UNICODE<\/code><\/li>\n<\/ul>\nSwitches between ngine::String<\/code> and ngine::UnicodeString<\/code> as script string type<\/div>\nDefault<\/em>: Disabled <\/strong>because we prefer strings as long as we don’t need to support unicode<\/div>\n\nSCRIPTING_DEBUG_INFO<\/code><\/li>\n<\/ul>\n\n- Enables additional debug information in the compiled byte code. For now this is only line numbers.<\/li>\n
- Default<\/em>: Enabled <\/strong>for now, since we are still in development (should be disabled for release)<\/li>\n<\/ul>\n
\nSCRIPTING_DEBUG_TRACE_EXECUTION<\/code><\/li>\n<\/ul>\n\n- Enables virtual machine opcode execution tracing. Giving detailed output of each executed instruction with the current stack and upvalues.<\/li>\n
- Default<\/em>: Disabled <\/strong>should only be used when debugging VM execution bugs<\/li>\n<\/ul>\n
\nSCRIPTING_DEBUG_GC_LOG<\/code><\/li>\n<\/ul>\n\n- Enables detailed log output for the script garbage collection<\/li>\n
- Default<\/em>: Disabled <\/strong>should only be used when debugging VM garbage collection bugs<\/li>\n<\/ul>\n
\nSCRIPTING_VALUE_NAN_BOXING<\/code><\/li>\n<\/ul>\n\n- Enables nan boxing for compiled script values. This reduces the
ngine::Scripting::Value<\/code> size from 16 bytes to 8 bytes.<\/li>\n- Default<\/em>: Disabled <\/strong>because runtime cost seems higher with the memory saving.<\/li>\n<\/ul>\n
\nSCRIPTING_COMPONENT_USE_INTERPRETER<\/code><\/li>\n<\/ul>\n\n- Switches the script component to use AST interpretation instead of executing compiled code<\/li>\n
- Default<\/em>: Disabled <\/strong>because we prefer compiled code execution (optimized, smaller, faster)<\/li>\n<\/ul>\n
Parser<\/h3>\n