CN113730917A - Game script generation method and device, computer equipment and storage medium - Google Patents

Game script generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113730917A
CN113730917A CN202111005168.8A CN202111005168A CN113730917A CN 113730917 A CN113730917 A CN 113730917A CN 202111005168 A CN202111005168 A CN 202111005168A CN 113730917 A CN113730917 A CN 113730917A
Authority
CN
China
Prior art keywords
branch
nodes
node
script
scenario
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111005168.8A
Other languages
Chinese (zh)
Inventor
陶学诚
谢金燕
黄晓欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Sanqi Network Technology Co ltd
Original Assignee
Guangzhou Sanqi Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Sanqi Network Technology Co ltd filed Critical Guangzhou Sanqi Network Technology Co ltd
Priority to CN202111005168.8A priority Critical patent/CN113730917A/en
Publication of CN113730917A publication Critical patent/CN113730917A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a game script generation method, a game script generation device, computer equipment and a storage medium. The method comprises the following steps: acquiring a flow chart of a game work, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart; traversing each scenario node according to the connection relation among the scenario nodes in the flow chart and a preset service execution logic so as to sequence the scenario nodes; and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the script contents and the sequencing results of the plot plots. By adopting the method, the efficiency of developing the game script can be improved.

Description

Game script generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of game development technologies, and in particular, to a game script generation method and apparatus, a computer device, and a storage medium.
Background
With the development of game development technology, the key to the smooth execution of game works by a computer is the writing of game scripts, which are a computer program written by specific descriptive words.
In the traditional game script development process, a programmer needs to manually compile a corresponding game script based on the logical relationship among scenarios in a game work, and especially when the complexity of the game work is high, the compilation of the game script consumes a great amount of time and energy of the developer, so that the development cost of the game script is high, and the efficiency is low.
Disclosure of Invention
In view of the above, it is desirable to provide a game script generation method, apparatus, computer device, and storage medium that can improve the efficiency of game script development.
A game script generation method, the method comprising:
acquiring a flow chart of a game work, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart;
traversing each scenario node according to the connection relation among the scenario nodes in the flow chart and a preset service execution logic to sequence the scenario nodes;
and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the sequencing results of the script contents and the plot nodes.
In one embodiment, the scenario nodes include a selection node and a branch node, the selection node is configured to guide generation of a plurality of flow branches in the flow chart, each flow branch includes at least one branch node, and the scenario nodes are traversed according to a connection relationship between the scenario nodes in the flow chart and a preset service execution logic to sequence the scenario nodes, including: determining the branch priority of each flow branch according to the service execution logic; and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the plurality of branch nodes in the plurality of flow branches.
In one embodiment, traversing each branch node in each flow branch according to the connection relationship between the branch nodes in each flow branch and the branch priority comprises: determining a target flow branch with the lowest priority according to the branch priority; inserting a virtual end node after a branch node at the tail of the target flow branch; and traversing each branch node in each flow branch to a virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
In one embodiment, the method further comprises: when traversing to the selection node, adding an interrupt mark for the selection node; and after finishing the sorting of the branch nodes in all the flow branches under the selection node, deleting the interrupt mark of the selection node.
In one embodiment, before obtaining the script content corresponding to each episode respectively, the method further includes: acquiring script conversion instructions and node configuration data corresponding to the episode nodes of each episode; calling script conversion templates corresponding to the episode nodes of the dramas according to the script conversion instructions; and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
In one embodiment, generating a script file of a game work according to the script contents and the sequencing result of the plurality of scenario nodes includes: and when receiving an instruction of previewing or publishing the works, integrating the script contents according to the sequencing result of the plot nodes to generate a script file of the game works.
In one embodiment, the method further comprises: and modifying the resource configuration file in the game engine according to the generated script file.
A game script generating apparatus, the apparatus comprising:
the node identification module is used for acquiring a flow chart of the game product, wherein the flow chart comprises a plurality of plot nodes and identifying each plot node in the flow chart;
the node sequencing module is used for traversing all the plot nodes according to the connection relation among the plot nodes in the flow chart and the preset service execution logic so as to sequence the plot nodes;
and the script generation module is used for respectively acquiring script contents corresponding to the scenario nodes of each drama and generating a script file of the game product according to the sequencing results of the script contents and the scenario nodes.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the game script generation method described above when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps of the game script generation method described above.
According to the game script generation method, the game script generation device, the computer equipment and the storage medium, a user only needs to draw a flow chart of a game product, the computer can identify all scenario nodes in the flow chart of the game product, the scenario nodes are sequenced according to the connection relation of the scenario nodes in the flow chart and the preset service execution logic, and when the game script is generated, the game script which meets the user requirements and the service execution logic can be quickly generated by respectively acquiring the script content corresponding to the scenario nodes and integrating the script content according to the sequencing result of the nodes, so that the efficiency of game script development is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for generating a game script according to an embodiment;
FIG. 2 is a flow diagram illustrating a method for generating a game script in one embodiment;
FIG. 3 is a flowchart illustrating the steps of sorting a plurality of storyline nodes in one embodiment;
FIG. 4 is a diagram illustrating an exemplary traversal order for traversing branch nodes in various flow branches;
FIG. 5 is a flowchart illustrating steps of traversing branch nodes in flow branches according to connection relationships between the branch nodes in the flow branches and branch priorities in one embodiment;
FIG. 6 is a diagram illustrating an exemplary traversal order for traversing the storyline nodes of the flowchart;
FIG. 7 is a block diagram showing the construction of a game script generation apparatus according to one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The game script generation method provided by the application can be applied to the application environment shown in FIG. 1. Illustratively, the terminal 102 is installed with software for drawing a game work flow chart, and a user can configure the game work flow chart through an editing interface provided by the software.
In one embodiment, the terminal 102 obtains a flowchart of a game product, the flowchart includes a plurality of scenario nodes, the terminal 102 identifies each scenario node in the flowchart, traverses each scenario node according to a connection relationship between the scenario nodes in the flowchart and a preset service execution logic to sequence the scenario nodes, the terminal 102 respectively obtains script contents corresponding to each scenario node, and generates a script file of the game product according to the sequencing results of each script content and the plurality of scenario nodes. The terminal 102 includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, desktop computers, and the like.
In another embodiment, the step of sorting the plot nodes and/or the step of obtaining the script content corresponding to each plot node and generating the script file of the game composition may also be performed by calling a server at the back end. The server may be implemented by an independent server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a game script generating method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
step S202: the method comprises the steps of obtaining a flow chart of the game works, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart.
The scenario node refers to a flow node representing a scenario trend, scenario content, or the like of the game work, and may be, for example, a chapter node in a chapter flow chart, or a scene node, a video node, a selection node, a branch node, or the like in the scenario flow chart.
Illustratively, the terminal may provide an editing interface capable of configuring the game product flowchart for the user, and the user may configure a plurality of scenario nodes in the editing interface and connect the scenario nodes according to a scenario trend desired to be implemented, thereby completing drawing of the game product flowchart.
Specifically, the terminal may obtain a flowchart of a game work configured by a user through an editing interface, where the flowchart may include a plurality of scenario nodes. The terminal can identify each scenario node contained in the flow chart by analyzing the acquired flow chart of the game product, and further can generate an unordered node set formed by the scenario nodes.
Step S204: and traversing the plot nodes according to the connection relation among the plot nodes in the flow chart and a preset service execution logic so as to sequence the plot nodes.
Specifically, the terminal may analyze a node connection line configured by the user in the flowchart, so as to determine a connection relationship between scenario nodes, and for scenario nodes having no connection relationship therebetween, may also determine the order of the scenario nodes by combining a preset service execution logic. The service execution logic refers to an expected presentation sequence of scenario nodes which are preset by a user and have no connection relation or flow branches where the scenario nodes are located in a game script. The terminal can execute logic traversal (access one by one) according to the connection sequence between the nodes and by combining with preset services based on the traversal algorithm of the nodes, thereby finishing the sequencing of the plot nodes.
In one embodiment, as shown in fig. 3, the scenario nodes include a selection node and a branch node, the selection node is configured to guide generation of a plurality of flow branches in the flow chart, each flow branch includes at least one branch node, and traversing each scenario node according to a connection relationship between the scenario nodes in the flow chart and a preset service execution logic to order the scenario nodes, the method includes:
s302: and determining the branch priority of each flow branch according to the service execution logic.
S304: and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the plurality of branch nodes in the plurality of flow branches.
In this embodiment, the flow chart of the game composition includes at least one selection node, and a plurality of flow branches can be guided and generated in the flow chart through the selection node. Since there may not be an association relationship of mutual connection between scenario nodes (branch nodes) in different flow branches, the execution order (branch priority) of each flow branch may be determined first through a preset service execution logic, and then the order of all branch nodes in all flow branches under the selected node is determined by combining the connection relationship of each branch node in the same flow branch.
Illustratively, reference may be made to fig. 4, where fig. 4 shows a schematic diagram of a traversal order of traversing branch nodes in each flow branch in one embodiment, where the traversal order of nodes may refer to the order indicated by arrows in fig. 4. The terminal may determine an execution order (branch priority) of each flow branch according to the service execution logic, for example, flow branch 1> flow branch 2> flow branch 3> … > flow branch N, then may preferentially traverse each branch node in flow branch 1 with the highest priority according to the determined branch priority, then traverse each branch node in flow branch 2 with the next highest priority, and so on until each branch node in flow branch N with the lowest priority is traversed, thereby completing the sorting of a plurality of branch nodes in a plurality of flow branches.
For example, since the service execution logic may be configured by self-defining according to the requirements of the user, according to different preset service execution logics, the branch priorities determined during node sorting are also different, and if the service execution logic set by the user is "it is expected to present each branch node in the game script in a positive order from flow branch 1 to N", the branch priorities correspondingly determined during node sorting may be flow branch 1> flow branch 2> flow branch 3> … > flow branch N; if the service execution logic set by the user is that "each branch node is expected to be presented in the game script in the reverse order of the flow branches N to 1", the correspondingly determined branch priority in the node sorting may be flow branch N > … > flow branch 3> flow branch 2> flow branch 1; of course, the user may also customize the presentation order of the branch nodes in each flow branch in the game script according to the scenario requirement, for example, the service execution logic may be set to "it is expected to present each branch node in the game script in the order of flow branch 2-flow branch 3-flow branch 1", and then, the correspondingly determined branch priority may be flow branch 2> flow branch 3> flow branch 1.
In an embodiment, referring to fig. 5, fig. 5 shows a step of traversing each branch node in each flow branch according to a connection relationship between the branch nodes in each flow branch and a branch priority in an embodiment, which may specifically include:
s502: and determining the target flow branch with the lowest priority according to the branch priority.
S504: and inserting a virtual end node after the branch node at the tail of the target flow branch.
S506: and traversing each branch node in each flow branch to a virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
In this embodiment, it is further supported that a virtual end node is inserted at the end of a flow branch with the lowest priority of a selection node, that is, after the last branch node, because a user does not configure a corresponding end node at a position where a non-real scenario ends when configuring a flow chart of a game product, however, in an actual scenario generation process, if a selection node is added, a corresponding scenario statement needs one more end statement to ensure that no error is reported when the scenario is executed, and therefore, accuracy in scenario conversion can be improved by supporting insertion of a virtual end node.
In one embodiment, the method further comprises: when traversing to the selection node, adding an interrupt mark for the selection node; and after finishing the sorting of the branch nodes in all the flow branches under the selection node, deleting the interrupt mark of the selection node.
In this embodiment, the number of the selection nodes may be multiple, and when the number of the selection nodes is multiple, and when any selection node is traversed, a corresponding interrupt marker may be added to the traversed selection node, where the interrupt marker may play a role of a temporary marker, and is used to characterize the order of all branch nodes that temporarily do not complete all flow branches under the selection node. By adding the interrupt mark, the problem of node traversal omission can be prevented under the condition that a plurality of selection nodes are nested in a multilayer manner, so that the accuracy of node sequencing can be further improved, and the accuracy of subsequent script conversion can be improved.
Illustratively, reference may be made to fig. 6, where fig. 6 shows a traversal order diagram for traversing the plot nodes in the flowchart in one embodiment, where the traversal order of the nodes may refer to the order indicated by the arrows in fig. 6.
When traversing to the first selected node, add an interrupt flag S1 to the first selected node, and store the flag in the temporary storage area, when traversing to the second selected node in the flow branch 1 of the first selected node, also add an interrupt flag S2 to the first selected node, when traversing to the virtual end node 1 at the end of the flow branch with the lowest priority of the second selected node, it indicates that all branch nodes in all flow branches under the second selected node have completed sorting, at this time, delete the interrupt flag S2 in the temporary storage area, and continue to complete sorting of branch nodes in the flow branches under the first selected node, until all branch nodes in all flow branches under the first selected node have completed sorting, that is, when traversing to the virtual end node 2 in fig. 6, delete the interrupt flag S1 added in the temporary storage area.
Step S206: and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the sequencing results of the script contents and the plot nodes.
Specifically, the corresponding script content may be configured for each scenario node in advance by taking the node as a unit, and the back end may generate a script file meeting the user requirements and the writing specifications by analyzing the flowchart and combining with the preset service execution logic only by configuring the flowchart of the game product on the front end editing interface by the user.
In one embodiment, before obtaining the script content corresponding to each episode respectively, the method further includes: and acquiring script conversion instructions and node configuration data corresponding to the episode nodes, calling script conversion templates corresponding to the episode nodes according to the script conversion instructions, and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
In this embodiment, corresponding script conversion instructions may be configured for each scenario node in advance in units of nodes, each script conversion instruction may be respectively associated with or mapped to a different script conversion template, and the script conversion template corresponding to each script conversion instruction may be respectively called according to each script conversion instruction.
Illustratively, the user may configure the relevant data for the scenario node in a self-defined manner through the node data configuration interface, for example, when the scenario node is a scene node, the user may configure data such as a background picture, background music, a character role, a conversation, a voice-over, a special effect, and the like, which need to be presented in the scenario of the game work based on the scene node, or when the scenario node is a video node, the user may add video data and the like, which need to be presented in the game work based on the content configuration interface of the video node.
The script content of each scenario node can be pre-generated based on the node configuration data and the script conversion template of each scenario node, the pre-generated script content can be stored in a database table as data corresponding to each scenario node, and when an instruction of issuing or previewing a work is received, for example, the terminal can directly call the pre-generated script content from the database table. By pre-generating the script content, the processing time and the traversal depth of the node when converting the script are shortened, the algorithm performance is effectively improved, and the speed of generating, previewing and releasing the game script is improved.
In one embodiment, generating a script file of a game work according to the script contents and the sequencing result of the plurality of scenario nodes includes: and when receiving an instruction of previewing or publishing the works, integrating the script contents according to the sequencing results of the plot nodes to generate a script file of the game works.
In this embodiment, when receiving a command of previewing or publishing a work triggered by a user through an editing interface of a game work, a game script meeting the user requirements and service execution logic can be quickly and accurately generated by integrating script contents corresponding to scenario nodes according to the sequencing result of the scenario nodes.
In one embodiment, the method further comprises: and modifying the resource configuration file in the game engine according to the generated script file.
In this embodiment, since various resources, such as videos, backgrounds, characters, sounds, and the like, are used in the game composition, after the game script is generated, the resource configuration files corresponding to the resources in the game engine can be modified synchronously, and the game engine can achieve the functions of preloading and pre-loading the resources by modifying the resource configuration files.
According to the game script generation method, the user only needs to draw the flow chart of the game product, the computer can identify all scenario nodes in the flow chart of the game product, all scenario nodes are sequenced according to the connection relation of all scenario nodes in the flow chart and the preset service execution logic, and when the game script is generated, the game script which meets the user requirements and the service execution logic can be quickly generated by respectively obtaining the script content corresponding to all scenario nodes and integrating the script content according to the sequencing result of the nodes, so that the development efficiency of the game script is improved.
It should be understood that although the various steps in the flowcharts of fig. 2, 3 and 5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 3 and 5 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided a game script generating apparatus including: a node identification module 710, a node ordering module 720, and a script generation module 730, wherein:
the node identification module 710 is configured to obtain a flowchart of a game product, where the flowchart includes a plurality of scenario nodes and identifies each scenario node in the flowchart.
And the node sequencing module 720 is configured to traverse the scenario nodes according to the connection relationship between the scenario nodes in the flowchart and a preset service execution logic to sequence the scenario nodes.
The script generating module 730 is configured to obtain script contents corresponding to the scenario nodes of each scenario, and generate a script file of the game product according to the sequencing results of the script contents and the scenario nodes.
In one embodiment, the node ordering module 720 determines the branch priority of each flow branch according to the service execution logic; and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the plurality of branch nodes in the plurality of flow branches.
In one embodiment, the node ranking module 720 determines the lowest priority target flow branch according to the branch priority; inserting a virtual end node after a branch node at the tail of the target flow branch; and traversing each branch node in each flow branch to a virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
In one embodiment, the node sorting module 720 is further configured to add an interrupt flag to the selected node when traversing to the selected node; and after finishing the sorting of the branch nodes in all the flow branches under the selection node, deleting the interrupt mark of the selection node.
In one embodiment, the script generating module 730 is further configured to obtain a script conversion instruction and node configuration data corresponding to each episode; calling script conversion templates corresponding to the episode nodes of the dramas according to the script conversion instructions; and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
In one embodiment, when receiving an instruction for previewing or publishing a work, the script generating module 730 integrates the script contents according to the sequencing result of the scenario nodes to generate a script file of the game work.
In one embodiment, the script generation module 730 is further configured to modify the resource configuration file in the game engine according to the generated script file.
For specific limitations of the game script generation apparatus, reference may be made to the above limitations of the game script generation method, which are not described herein again. The respective modules in the game script generating apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a game script generation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring a flow chart of a game work, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart; traversing each scenario node according to the connection relation among the scenario nodes in the flow chart and a preset service execution logic to sequence the scenario nodes; and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the sequencing results of the script contents and the plot nodes.
In one embodiment, when the processor executes the computer program to traverse the scenario nodes according to the connection relationship between the scenario nodes in the flowchart and the preset service execution logic to sequence the scenario nodes, the following steps are specifically implemented: determining the branch priority of each flow branch according to the service execution logic; and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the plurality of branch nodes in the plurality of flow branches.
In one embodiment, when the processor executes the computer program to traverse each branch node in each flow branch according to the connection relationship between the branch nodes in each flow branch and the branch priority, the following steps are specifically implemented: determining a target flow branch with the lowest priority according to the branch priority; inserting a virtual end node after a branch node at the tail of the target flow branch; and traversing each branch node in each flow branch to a virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when traversing to the selection node, adding an interrupt mark for the selection node; and after finishing the sorting of the branch nodes in all the flow branches under the selection node, deleting the interrupt mark of the selection node.
In one embodiment, before the processor executes the computer program to respectively acquire the script contents corresponding to the episode nodes of the drama, the following steps are further implemented: acquiring script conversion instructions and node configuration data corresponding to the episode nodes of each episode; calling script conversion templates corresponding to the episode nodes of the dramas according to the script conversion instructions; and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
In one embodiment, when the processor executes the computer program to generate the script file of the game work according to the sequencing results of the script contents and the scenario nodes, the following steps are specifically realized: and when receiving an instruction of previewing or publishing the works, integrating the script contents according to the sequencing result of the plot nodes to generate a script file of the game works.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and modifying the resource configuration file in the game engine according to the generated script file.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a flow chart of a game work, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart; traversing each scenario node according to the connection relation among the scenario nodes in the flow chart and a preset service execution logic to sequence the scenario nodes; and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the sequencing results of the script contents and the plot nodes.
In one embodiment, when the computer program is executed by the processor to implement traversing the scenario nodes according to the connection relationship between the scenario nodes in the flowchart and the preset service execution logic to sequence the scenario nodes, the following steps are specifically implemented: determining the branch priority of each flow branch according to the service execution logic; and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the plurality of branch nodes in the plurality of flow branches.
In one embodiment, when the computer program is executed by the processor to traverse each branch node in each flow branch according to the connection relationship between the branch nodes in each flow branch and the branch priority, the following steps are specifically implemented: determining a target flow branch with the lowest priority according to the branch priority; inserting a virtual end node after a branch node at the tail of the target flow branch; and traversing each branch node in each flow branch to a virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
In one embodiment, the computer program when executed by the processor further performs the steps of: when traversing to the selection node, adding an interrupt mark for the selection node; and after finishing the sorting of the branch nodes in all the flow branches under the selection node, deleting the interrupt mark of the selection node.
In one embodiment, before the computer program is executed by the processor to obtain the script content corresponding to each episode respectively, the following steps are also implemented: acquiring script conversion instructions and node configuration data corresponding to the episode nodes of each episode; calling script conversion templates corresponding to the episode nodes of the dramas according to the script conversion instructions; and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
In one embodiment, when the computer program is executed by the processor to generate the script file of the game work according to the sequencing results of the script contents and the scenario nodes, the following steps are specifically realized: and when receiving an instruction of previewing or publishing the works, integrating the script contents according to the sequencing result of the plot nodes to generate a script file of the game works.
In one embodiment, the computer program when executed by the processor further performs the steps of: and modifying the resource configuration file in the game engine according to the generated script file.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A game script generation method, the method comprising:
acquiring a flow chart of a game work, wherein the flow chart comprises a plurality of scenario nodes, and identifying each scenario node in the flow chart;
traversing each scenario node according to the connection relation among the scenario nodes in the flow chart and a preset service execution logic so as to sequence the scenario nodes;
and respectively acquiring script contents corresponding to the plot plots, and generating a script file of the game works according to the script contents and the sequencing results of the plot plots.
2. The method of claim 1, wherein the scenario nodes comprise a selection node and a branch node, the selection node is configured to guide generation of a plurality of flow branches in the flow chart, each flow branch comprises at least one branch node, and traversing each scenario node according to a connection relationship between the scenario nodes in the flow chart and a preset business execution logic to order the scenario nodes comprises:
determining the branch priority of each flow branch according to the service execution logic;
and traversing each branch node in each flow branch according to the connection relation among the branch nodes in each flow branch and the branch priority so as to sort the branch nodes in the flow branches.
3. The method of claim 2, wherein traversing each branch node in each flow branch according to the branch priority and the connection relationship between the branch nodes in each flow branch comprises:
determining a target flow branch with the lowest priority according to the branch priority;
inserting a virtual end node after a branch node at the end of the target flow branch;
and traversing each branch node in each flow branch to the virtual end node according to the connection relation among the branch nodes in each flow branch and the branch priority.
4. The method of claim 2, further comprising:
when traversing to the selected node, adding an interrupt mark to the selected node;
and deleting the interrupt marks of the selected nodes after finishing the sequencing of the branch nodes in all the flow branches under the selected nodes.
5. The method according to claim 1, wherein before the obtaining of the script content corresponding to each of the episode nodes, the method further comprises:
acquiring script conversion instructions and node configuration data corresponding to the episode plots;
calling script conversion templates corresponding to the episode nodes according to the script conversion instructions;
and pre-generating script contents corresponding to the episode nodes according to the script conversion templates and the node configuration data.
6. The method of claim 1, wherein generating a script file for the game composition based on the script content and the ranking results of the plurality of scenario nodes comprises:
and when receiving an instruction of previewing or publishing the composition, integrating the script contents according to the sequencing result of the plot nodes to generate a script file of the game composition.
7. The method of any one of claims 1 to 6, further comprising:
and modifying the resource configuration file in the game engine according to the generated script file.
8. A game scenario generation apparatus, comprising:
the node identification module is used for acquiring a flow chart of the game product, wherein the flow chart comprises a plurality of plot nodes and identifying each plot node in the flow chart;
the node sequencing module is used for traversing each plot node according to the connection relation among the plot nodes in the flow chart and a preset service execution logic so as to sequence the plot nodes;
and the script generation module is used for respectively acquiring script contents corresponding to the scenario nodes and generating script files of the game works according to the script contents and the sequencing results of the scenario nodes.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111005168.8A 2021-08-30 2021-08-30 Game script generation method and device, computer equipment and storage medium Pending CN113730917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111005168.8A CN113730917A (en) 2021-08-30 2021-08-30 Game script generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111005168.8A CN113730917A (en) 2021-08-30 2021-08-30 Game script generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113730917A true CN113730917A (en) 2021-12-03

Family

ID=78733835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111005168.8A Pending CN113730917A (en) 2021-08-30 2021-08-30 Game script generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113730917A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114518908A (en) * 2022-02-17 2022-05-20 杭州网易云音乐科技有限公司 Service arranging method, medium, device and computing equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114518908A (en) * 2022-02-17 2022-05-20 杭州网易云音乐科技有限公司 Service arranging method, medium, device and computing equipment
CN114518908B (en) * 2022-02-17 2024-03-22 杭州网易云音乐科技有限公司 Service orchestration method, medium, device and computing equipment

Similar Documents

Publication Publication Date Title
CN108446116B (en) Application program page generation method and device, computer equipment and storage medium
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CN109670951B (en) Block chain intelligent contract debugging and publishing method and system
CN109032662B (en) Code file generation method and device, computer equipment and storage medium
CN110231994B (en) Memory analysis method, memory analysis device and computer readable storage medium
CN112988284B (en) Application program starting method and device, computer equipment and storage medium
CN109634654A (en) A kind of page packaging method, device, system, computer equipment and storage medium
CN110689232A (en) Workflow configuration optimization processing method and device and computer equipment
CN109597618B (en) Program development method, program development device, computer device, and storage medium
CN110704095A (en) Workflow-based configuration processing method and device, computer equipment and storage medium
CN110580189A (en) method and device for generating front-end page, computer equipment and storage medium
CN111666007A (en) Method and device for realizing mouse following special effect, computer equipment and storage medium
CN111061475A (en) Software code generation method and device, computer equipment and storage medium
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
CN112486828A (en) Test case generation method and device, computer equipment and storage medium
CN112486459A (en) Activity page generation method and device, computer equipment and readable storage medium
CN110543450A (en) Electronic document generation method and device, computer equipment and storage medium
CN112817657A (en) Application program starting item loading method, device and system and storage medium
CN112667246A (en) Application function extension method and device and electronic equipment
CN112882769A (en) Skill pack data processing method, skill pack data processing device, computer equipment and storage medium
CN113730917A (en) Game script generation method and device, computer equipment and storage medium
CN110874216B (en) Complete code generation method, device, equipment and storage medium
US8769498B2 (en) Warning of register and storage area assignment errors
CN110647350A (en) Interface document generation method and device, computer equipment and storage medium
CN112148351B (en) Cross-version compatibility method and system for application software

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination