Visual programming method and system and storage medium

By introducing a hybrid programming method of custom scripting language zScript and main process visual nodeization in visual programming, the problem of poor complexity and readability of logical node graphs in the prior art is solved, and the simplification and coding efficiency of logical graphs are achieved. Improved, suitable for coding needs of non-professional and professionals.

CN119201081APending Publication Date: 2024-12-27XIAMEN LEITING INTERACTION NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411290953.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

In the existing visual programming methods, the logical node graph is complex and complex, resulting in poor readability and difficulty in troubleshooting problems. At the same time, the coding ability of professional programmers is limited.

Method used

Adopt a hybrid programming method of visual nodeization of main process and scripting of node parameters. By combining the custom scripting language zScript and visual nodes, the main process and detailed logic are separated, the node graph is simplified, and the node graph is improved through intelligent encoding windows and syntax sugar expansion functions. Coding efficiency.

Benefits of technology

It significantly improves the readability and information density of the logic diagram, simplifies the node diagram, improves R&D efficiency, meets the coding needs of non-professional and professionals, and reduces the difficulty of troubleshooting bugs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201081A_ABST
    Figure CN119201081A_ABST
Patent Text Reader

Abstract

The invention discloses a visual programming method and system and a storage medium, and belongs to the technical field of game editing.A mixed programming method of main process visual nodal and node parameter scripting is adopted, a main process tree is constructed through visual nodes, node parameter scripting is achieved in cooperation with a user-defined script language zScript, main logic and parameter details are separated, and the main process visual nodal and node parameter scripting efficiency is improved. Nodes on the graph are fewer and simplified, the main process is free of interference of parameter details, the information amount is greatly reduced, the main process is higher in readability, the problems that traditional visual programming is poor in readability and bug checking is difficult are solved, a user-defined script language zScript is matched with an intelligent coding window, and compared with a dragging mode in the prior art, when complex logic details are constructed, the method has the advantages that the complexity is reduced, and the efficiency is improved. The research and development efficiency is higher, and logic construction requirements of non-program and program personnel can be considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of game editing, and in particular relates to a visual programming method, system and storage medium. Background Art

[0002] In traditional game development, the logic part is mainly implemented through coding in conventional programming languages ​​(such as C++, C# or Lua, etc.). With the development of game technology, in response to the need for cooperation among multiple departments, a visual programming method has been developed, allowing non-programming professionals (such as planners or artists) to participate in the writing of logic, which usually involves skill implementation, gameplay implementation, AI implementation, etc. It is used by more and more games because of its advantages such as being friendly to non-professional programmers, real-time editing, and hot updating.

[0003] In existing visual programming, logic is mainly written by dragging various visual nodes and connecting them. There are various types of visual nodes, including action nodes, calculation nodes, blackboard nodes, conditional nodes or parameter nodes. The parameters required for node execution are passed in as input ports, and the output parameters are also passed to other nodes as output port connections. After the user's logic organization is completed, it is generally saved or exported into a certain configuration for use when the game is running. The more mainstream solutions for current game engines are Unity's BOLT and Unreal Engine's blueprint. There are three disadvantages: 1. Complex logic requirements, the visualized node diagram is very complicated, with so many nodes that it takes several screens to fit, and poor readability; 2. The visualized nodes and connections often present a mesh structure, making it difficult to troubleshoot problems; 3. It is not friendly enough to professional program developers, which limits the coding ability of professional programs (most project programs are the main force for logic construction). Summary of the invention

[0004] The purpose of the present invention is to provide a visual programming method, system and storage medium. By combining a hybrid programming method of visual nodes and a custom scripting language zScript parsing, the main logic process and details are separated, the node diagram is greatly simplified, and the needs of non-programmers and programmers are met at the same time.

[0005] The present invention provides a visual programming method, which adopts a hybrid programming method of main process visual nodeization and node parameter scripting, and comprises the following steps: Step 1. The user builds and edits the main process tree by dragging and connecting visual nodes to implement the overall logical chain of the main process; Step 2. The user writes a custom script language zScript. The user edits the zScript text through the zScript coding window with smart prompts to obtain the edited zScript text: The basic syntax of the custom scripting language zScript is consistent with that of the C# language, with the addition of custom features; the custom features include custom parameter nodes and syntax sugar; The custom parameter node uses the node name as a function in the custom scripting language zScript, and uses the node input as the function parameter to pass in the parameters required for single node execution. That is, the user implements a new parameter node type to add a new C# function, uses the node name as the function name, uses the input port and node parameters as the function input parameters, and uses the output port as the function return value; The custom syntax sugar refers to the syntax sugar that users implement outside the language rules by overloading the default rules of parameter nodes, allowing specific parameter nodes to be mapped to other syntax forms for extended coding methods, including constructors, mathematical operators, ternary operators and member functions; Step 3. The user starts the build process, filters and selects all executable nodes in the main process tree, and sorts them according to the execution order of the nodes, and sets the first index node as the entry execution node. The executable nodes include macro nodes, but do not include annotation nodes and container nodes; Step 4. Traverse all macro nodes and perform expansion operations, so that the macro nodes are replaced by executable nodes of the macro graph, and assign unique index IDs to all expanded executable nodes; Step 5. Analyze the overall logic chain of the main process tree, construct the parameter configuration required for the execution of a single node in the runtime logic chain, and generate a parameter node tree. The generation of the parameter node tree supports both the implementation of visual nodes and the implementation of custom scripts zScript, ensuring that the implementation of visual nodes and the implementation of custom script language zcript are consistent at the operation level, and users can choose by themselves; The process of generating a parameter node tree through a custom script zScript is as follows: First, the context of the grammar rules is collected, all parameter node types are collected and the grammar rules are constructed; then, the zScript text edited by the user is parsed and converted into an expression parse tree to generate a zScript parse tree; then, an intermediate expression tree is generated based on each Token-Value information of the zScript parse tree, and a parameter node is generated based on the rule information provided when implementing the parameter node type, and finally the generation of the entire parameter node tree is completed; Step 5: Optimize and post-process the generated parameter node tree, including removing unused executable nodes, application container nodes and optimizing blackboard variables, and finally export the optimized parameter node tree into a configuration file.

[0006] The user edits the zScript text through the zScript coding window with intelligent prompts, which means that a list of function names matched by mapping is called out through shortcut keys, that is, a list of parameter node names, and the user only needs to select one to complete the function name; a complete function declaration is obtained in the same way and presented to the user through a bubble box, wherein the function declaration consists of a node name, node input, node output, and constant parameters; and class method members are automatically completed in the above manner.

[0007] A visual programming system, comprising: one or more processors; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned visual programming method.

[0008] A computer readable medium stores a computer program, which implements the above-mentioned visual programming method when executed by a processor.

[0009] Since the present invention adopts a hybrid programming method of visual nodeization of the main process and scripting of node parameters, the main process tree is constructed by visual nodes, and the node parameter scripting is realized by cooperating with the custom scripting language zScript, the main logic and parameter details are separated, and the nodes on the diagram are fewer and more streamlined. Since the main process is not interfered by parameter details, the amount of information is greatly reduced, so the main process is more readable, which solves the problems of poor readability and difficulty in troubleshooting bugs in traditional visual programming. The custom scripting language zScript is combined with the intelligent coding window. On the one hand, it has higher R&D efficiency than the drag-and-drop method of the prior art when constructing complex logical details. On the other hand, it has higher information density than the prior art, and is more in line with the linear reading method of humans; and the custom scripting language zScript supports syntax sugar expansion, which is more free and has greater potential than the pure node method, and can take into account the logic construction needs of non-programmers and programmers. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is the main flow chart of the present invention; Figure 2 A flowchart of generating a parameter node tree by using a custom script zScript in the present invention; Figure 3 It is a schematic block diagram of the visual programming system of the present invention. DETAILED DESCRIPTION

[0011] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0012] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0013] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. Embodiment 1 Embodiment 1 of the present invention provides a visual programming method, such as Figures 1 to 2 As shown, a hybrid programming method of main process visual nodeization and node parameter scripting is adopted, including the following steps: Step 1. The user builds and edits the main process tree by dragging and connecting visual nodes to implement the overall logical chain of the main process; Step 2. The user writes a custom script language zScript. The user edits the zScript text through the zScript coding window with smart prompts to obtain the edited zScript text: The basic syntax of the custom scripting language zScript is consistent with that of the C# language, with the addition of custom features; the custom features include custom parameter nodes and syntax sugar; The custom parameter node uses the node name as a function in the custom scripting language zScript, and uses the node input (input port) as the function parameter to pass in the parameters required for single node execution, that is, the user implements a new parameter node type to add a new C# function, uses the node name as the function name, uses the input port and node parameters as the function input parameters, and uses the output port as the function return value; The custom syntax sugar refers to the syntax sugar that users implement outside the language rules by overloading the default rules of parameter nodes, allowing specific parameter nodes to be mapped to other syntax forms, including constructors, mathematical operators, ternary operators, and member functions, thereby expanding a more user-friendly and concise coding method; The user edits the zScript text through the zScript coding window with smart prompts, which means that the function name list matched by the mapping is called out through the shortcut key, that is, the parameter node name list, and the user only needs to select one to complete the function name; in the same way, the complete function declaration can also be obtained and presented to the user through the bubble box, and the function declaration consists of the node name, node input, node output and constant parameters; similarly, the class method members can also be automatically completed; Step 3. The user starts the build process, filters and selects all executable nodes in the main process tree, and sorts them according to the execution order of the nodes. To facilitate runtime execution, it is necessary to ensure that the first index node is the entry execution node. The executable nodes include macro nodes, but do not include annotation nodes and container nodes. Step 4. Traverse all macro nodes and perform expansion operations, so that the macro nodes are replaced by executable nodes of the macro graph, and assign unique index IDs to all the expanded executable nodes; Step 5. Analyze the overall logic chain of the main process tree, construct the parameter configuration required for the execution of a single node in the runtime logic chain, and generate a parameter node tree. The generation of the parameter node tree supports both the implementation of visual nodes and the implementation of custom scripts zScript, ensuring that the implementation of visual nodes and the implementation of custom script language zcript are consistent at the operation level, and users can choose by themselves; like Figure 2 As shown, the process of generating a parameter node tree by using a custom script zScript is as follows: First, the context of the grammar rules is collected, all parameter node types are collected and the grammar rules are constructed; then, the zScript text edited by the user is parsed and converted into an expression parse tree to generate a zScript parse tree; then, an intermediate expression tree is generated based on each Token-Value information of the zScript parse tree, and a parameter node is generated based on the rule information provided when implementing the parameter node type, and finally the generation of the entire parameter node tree is completed; Step 5: Optimize and post-process the generated parameter node tree, including removing unused executable nodes, application container nodes, and optimizing blackboard variables, and finally export the optimized parameter node tree into a configuration file.

[0014] Embodiment 2 The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0015] Specifically, each step of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor, or a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.

[0016] Embodiment 2 of the present invention provides a visual programming system, such as Figure 3 As shown, the system 700 may include: a memory 710 and a processor 720, wherein the memory 710 is used to store a computer program and transmit the program code to the processor 720. In other words, the processor 720 may call and run the computer program from the memory 710 to implement the method in the embodiment of the present application. For example, the processor 720 may be used to execute the method in the above-mentioned embodiment 1 according to the instructions in the computer program. In some embodiments of the present application, the processor 720 may include but is not limited to: General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0017] In some embodiments of the present application, the memory 710 includes, but is not limited to, volatile memory and / or non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAMbus RAM (DRRAM).

[0018] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 700.

[0019] like Figure 3As shown, the system may further include: a transceiver 730, which may be connected to the processor 720 or the memory 710. The processor 720 may control the transceiver 730 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 730 may include a transmitter and a receiver. The transceiver 730 may further include an antenna, and the number of antennas may be one or more.

[0020] It should be understood that the various components in the system 700 can be connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0021] Embodiment 3 Embodiment 3 of the present invention further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to execute the method of embodiment 1 above.

[0022] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the first embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state disk (solid state disk, SSD)), etc.

[0023] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. Visual programming method, characterized in that: A hybrid programming method of visual nodeization of the main process and scripting of node parameters is adopted, including the following steps: Step 1. The user builds and edits the main process tree by dragging and connecting visual nodes to implement the overall logical chain of the main process; Step 2. The user writes a custom script language zScript. The user edits the zScript text through the zScript coding window with smart prompts to obtain the edited zScript text: The basic syntax of the custom scripting language zScript is consistent with that of the C# language, with the addition of custom features; the custom features include custom parameter nodes and syntax sugar; The custom parameter node uses the node name as a function in the custom scripting language zScript, and uses the node input as the function parameter to pass in the parameters required for single node execution. That is, the user implements a new parameter node type to add a new C# function, uses the node name as the function name, uses the input port and node parameters as the function input parameters, and uses the output port as the function return value; The custom syntax sugar refers to the syntax sugar that users implement outside the language rules by overloading the default rules of parameter nodes, allowing specific parameter nodes to be mapped to other syntax forms for extended coding methods, including constructors, mathematical operators, ternary operators and member functions; Step 3. The user starts the build process, filters and selects all executable nodes in the main process tree, and sorts them according to the execution order of the nodes, and sets the first index node as the entry execution node. The executable nodes include macro nodes, but do not include annotation nodes and container nodes; Step 4. Traverse all macro nodes and perform expansion operations, so that the macro nodes are replaced by executable nodes of the macro graph, and assign unique index IDs to all expanded executable nodes; Step 5. Analyze the overall logic chain of the main process tree, construct the parameter configuration required for the execution of a single node in the runtime logic chain, and generate a parameter node tree. The generation of the parameter node tree supports both the implementation of visual nodes and the implementation of custom scripts zScript, ensuring that the implementation of visual nodes and the implementation of custom script language zcript are consistent at the operation level, and users can choose by themselves; The process of generating a parameter node tree through a custom script zScript is as follows: First, the context of the grammar rules is collected, all parameter node types are collected and the grammar rules are constructed; then, the zScript text edited by the user is parsed and converted into an expression parse tree to generate a zScript parse tree; Then, an intermediate expression tree is generated based on the Token-Value information of the zScript parsing tree, and a parameter node is generated based on the rule information provided when implementing the parameter node type, and finally the generation of the entire parameter node tree is completed; Step 5: Optimize and post-process the generated parameter node tree, including removing unused executable nodes, application container nodes and optimizing blackboard variables, and finally export the optimized parameter node tree into a configuration file.

2. Visual programming method, characterized in that: The user edits the zScript text through the zScript coding window with intelligent prompts, which means that a list of function names matched by mapping is called out through shortcut keys, that is, a list of parameter node names, and the user only needs to select one to complete the function name; a complete function declaration is obtained in the same way and presented to the user through a bubble box, wherein the function declaration consists of a node name, node input, node output, and constant parameters; and class method members are automatically completed in the above manner.

3. A visual programming system, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the visual programming method as claimed in any one of claims 1 to 2.

4. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the visual programming method as claimed in any one of claims 1 to 2 is implemented.