A method and system for automatically generating game plots
By converting Json data into a unified plot structure and generating a blocking timeline, it solves the problems of low interactivity and difficult maintenance in game plot generation technology, realizes multi-directional interactive control and dynamic construction, and reduces development costs and cycles.
Patent Information
- Application Number
- CN202111225554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-10-21
AI Technical Summary
Existing game plot generation technology is difficult to achieve high interactivity, support timeline control and dynamic construction, resulting in single-direction execution of the plot, which is complex and difficult to maintain.
By converting Json data into a unified plot data structure, a timeline that supports blocking conditions is generated, and the data distribution module is used to distribute plot data according to the timeline. The data execution module executes plot instructions to achieve interactive control of the blocking timeline.
It realizes multi-directional interactive control, dynamic construction and maintenance of the game plot, reduces development costs, shortens the development cycle, supports custom expansion of plot instructions, and is suitable for various game projects.
Smart Images

Figure CN113908554B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game production, and in particular to a method and system for automatically generating game plots. Background Art
[0002] The plot is considered by many faithful players and developers to be the soul of the game. For a player, there is nothing wrong with this; but as a developer, there is a problem that cannot be ignored when designing the plot - the low interactivity of the plot. The game plot can be perfectly expressed in words, pictures, and animations, but it is difficult to express it very accurately in an interactive way. Existing technologies for generating game plots include dynamically generating game plots based on configuration, generating game plots based on Json, etc.; the existing technologies have high limitations on generation, usually only generating specific game plots, and do not support interactive control by blocking the timeline, making it difficult to expand and cannot be widely used. Summary of the invention
[0003] To overcome the above problems, the purpose of the present invention is to provide a method for automatically generating game plots, which solves the problems of single-direction execution of game plots, lack of support for control in a timeline manner, complex use and difficulty in maintenance, and inability to dynamically construct.
[0004] The present invention is implemented by the following scheme: a method for automatically generating a game plot, the method comprising the following steps:
[0005] Step S1, input the plot data for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; go to step S2; if yes, directly go to step S2;
[0006] Step S2, parsing the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing;
[0007] Step S3, distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop and end the process; if no, proceed to step S4;
[0008] Step S4, executing the scenario instructions in the scenario data, and continuing to distribute the scenario data corresponding to the blocking time axis according to the blocking time axis.
[0009] Furthermore, the step S1 further specifically includes:
[0010] Step S11, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S12, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S12, if no, stop the process;
[0011] Step S12, identifying the Json data as a Json instance type;
[0012] Step S13, creating a plot data structure;
[0013] Step S14, fill the basic data in the Json data into the corresponding field value of the plot data structure;
[0014] Step S15, the data without matching fields is filled into the extended field queue of the plot data structure;
[0015] Step S16, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data;
[0016] Step S17, determine whether the Json data contains sub-data, if yes, go to step S13; if no, return to the created root node plot data and end the process.
[0017] Furthermore, the blockage time axis generated by the parsed and converted data is further specifically:
[0018] Step S21, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported;
[0019] Step S22, creating a blocking timeline;
[0020] Step S23, reading all plot node data in the plot data used for game plot creation; adding all plot node data to a plot node data queue;
[0021] Step S24, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S25;
[0022] Step S25, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis is moved backward to the time value accessed in the plot node data;
[0023] Step S26, determine whether the plot node data records a blocking value, which is a data value corresponding to the blocking condition; if not, proceed to step S27; if yes, add a blocking condition node to the blocking timeline, set the blocking value to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S27;
[0024] Step S27, determine whether there are other plot data nodes in the plot data node queue, if yes, execute step S25; if no, return to the blocked timeline and end the process.
[0025] Furthermore, the congestion timeline includes: a progress value and a time node set of the congestion timeline, the time node set is composed of a plurality of time nodes, and each time node includes a time length, a progress value, and a congestion condition.
[0026] Furthermore, the step S3 further specifically includes:
[0027] Step S31, inputting the plot data corresponding to the blocking time axis;
[0028] Step S32, reading the progress value of the blocking time axis;
[0029] Step S33, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read;
[0030] Step S34, reading the plot instruction data set in the plot data, and adding the data in the plot instruction data set to a plot instruction data queue;
[0031] Step S35, determine whether the plot instruction data queue is empty, if yes, update the blocking time axis progress value to the next node and execute step S33, if no, execute step S36;
[0032] Step S36, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data;
[0033] Step S37, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S36; if not, update the blocking time axis progress value to the next node, and execute step S33.
[0034] Furthermore, step S4 further specifically includes: step S41, inputting plot instruction data, and reading plot instructions in the plot instruction data;
[0035] Step S42: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S43.
[0036] Step S43, executing the corresponding execution mode to input the plot instruction data;
[0037] Step S44, determine whether to execute the execution mode synchronously; if not, wait for the asynchronous execution mode to be completed and return an execution success event; the plot instruction is executed; if yes, return an execution success event and the plot instruction is executed.
[0038] The present invention also provides an implementation system for automatically generating game plots, the implementation system comprising a data conversion module, a data analysis module, a data distribution module, and a data execution module;
[0039] The data conversion module is used to input the plot data used for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; execute the data parsing module; if yes, directly execute the data parsing module;
[0040] The data parsing module is used to parse the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing;
[0041] The data distribution module is used to distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop the process; if no, execute the data execution module;
[0042] The data execution module is used to execute the plot instructions in the plot data and continue to distribute the plot data corresponding to the blocked time axis according to the blocked time axis.
[0043] Furthermore, the implementation of the data conversion module further specifically includes:
[0044] Step S51, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S52, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S52, if no, stop the process;
[0045] Step S52, identifying the Json data as a Json instance type;
[0046] Step S53, creating a plot data structure;
[0047] Step S54, fill the basic data in the Json data into the corresponding field value of the plot data structure;
[0048] Step S55, the data without matching fields is filled into the extended field queue of the plot data structure;
[0049] Step S56, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data;
[0050] Step S57, determine whether the Json data contains sub-data, if yes, go to step S53; if no, return to the created root node plot data and end the process.
[0051] Furthermore, the blockage time axis generated by the parsed and converted data is further specifically:
[0052] Step S61, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported;
[0053] Step S62, creating a blocking timeline;
[0054] Step S63, reading all the plot node data in the plot data used for creating the game plot; adding all the plot node data into a plot node data queue;
[0055] Step S64, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S65;
[0056] Step S65, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis moves backward to the time value accessed in the plot node data;
[0057] Step S66, determine whether the plot node data records a blocking value, which is the data value corresponding to the blocking condition; if not, proceed to step S67; if yes, add a blocking condition node to the blocking timeline, set the blocking value to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S67;
[0058] Step S67, determine whether there are other plot data nodes in the plot data node queue, if yes, execute step S65; if no, return to the blocked timeline and end the process.
[0059] Furthermore, the congestion timeline includes: a progress value and a time node set of the congestion timeline, the time node set is composed of a plurality of time nodes, and each time node includes a time length, a progress value, and a congestion condition.
[0060] Furthermore, the implementation of the data distribution module further specifically includes:
[0061] Step S71, inputting the plot data corresponding to the blocking time axis;
[0062] Step S72, reading the progress value of the blocking time axis;
[0063] Step S73, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read;
[0064] Step S74, reading the plot instruction data set in the plot data, and adding the data in the plot instruction data set to a plot instruction data queue;
[0065] Step S75, determine whether the plot instruction data queue is empty, if yes, update the blocking time axis progress value to the next node and execute step S73, if no, execute step S76;
[0066] Step S76, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data;
[0067] Step S77, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S76; if not, update the blocking time axis progress value to the next node, and execute step S73.
[0068] Furthermore, the implementation of the data execution module further specifically includes: step S81, inputting plot instruction data, and reading plot instructions in the plot instruction data;
[0069] Step S82: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S83.
[0070] Step S83, executing the corresponding execution mode to input the plot instruction data;
[0071] Step S84, determine whether to execute the execution mode synchronously; if not, wait for the asynchronous execution mode to be completed and return the execution success event; the plot instruction is executed; if yes, return the execution success event and the plot instruction is executed.
[0072] The beneficial effects of the present invention are as follows: the present invention generates a unified general plot data structure from the game plot Json data, and the data parsing module generates a blocking timeline. When the user starts the plot, the data distribution module distributes the plot data according to the blocking timeline, and the data execution module executes the plot instructions in the plot data, thereby realizing a complete game plot playback and interactive control system.
[0073] The present invention generates game plot data of the blocked timeline type through game plot Json data or dynamically constructed general plot data, which reduces the development consumption of game plot and interactive logic, shortens the game plot development cycle, and speeds up the development progress. In addition, the game plot in the present invention has a unified calling style, fewer game plot-related files and codes, is easier to maintain, and has lower later maintenance costs.
[0074] The game in the present invention provides an interactive method for blocking the timeline, supports playing the plot according to the timeline, and setting the plot to play at any time; any type of game project can quickly access and use the game plot through the present invention, and the development and maintenance are simple and efficient, and support customized expansion plot instructions to adapt to various usage requirements of the game plot. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a schematic flow chart of the method of the present invention.
[0076] Figure 2 It is a flow chart of data conversion operation in the method of the present invention.
[0077] Figure 3 It is a schematic diagram of the flow of performing data analysis to generate plot data corresponding to a blocking timeline in the method of the present invention.
[0078] Figure 4 It is a schematic diagram of the data structure of the congestion time axis of the present invention.
[0079] Figure 5 It is a schematic diagram of the flow of distributing plot data according to the blocking time axis in the method of the present invention.
[0080] Figure 6 It is a flowchart of executing the plot instructions in the plot data in the method of the present invention.
[0081] Figure 7 It is a system principle block diagram of the present invention. DETAILED DESCRIPTION
[0082] The present invention will be further described below in conjunction with the accompanying drawings.
[0083] The present invention can be applied to the generation and interaction process of all types of game plots. Different from the development of conventional game plots, the present invention generates a blocking timeline by extracting the description information of the game plot and supports the plot interaction logic based on the blocking timeline.
[0084] See also Figure 1 As shown, a method for automatically generating a game plot of the present invention comprises the following steps:
[0085] Step S1, input the plot data for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; go to step S2; if yes, directly go to step S2;
[0086] Step S2, parsing the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing;
[0087] Step S3, distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop and end the process; if no, proceed to step S4;
[0088] Step S4, executing the scenario instructions in the scenario data, and continuing to distribute the scenario data corresponding to the blocking time axis according to the blocking time axis.
[0089] The present invention will be further described below in conjunction with a specific embodiment:
[0090] Step S1, input the plot data for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; go to step S2; if yes, directly go to step S2; the plot data includes plot data for game plot creation, plot data corresponding to the blocking time axis, plot instruction data, etc.;
[0091] See also Figure 2 As shown, the step S1 further specifically includes:
[0092] Step S11, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S12, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S12, if no, stop the process;
[0093] Step S12, identifying the Json data as a Json instance type;
[0094] Step S13, creating a plot data structure;
[0095] Step S14, fill the basic data in the Json data into the corresponding field value of the plot data structure;
[0096] Step S15, the data without matching fields is filled into the extended field queue of the plot data structure;
[0097] Step S16, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data;
[0098] Step S17, determine whether the Json data contains sub-data, if yes, go to step S13; if no, return to the created root node plot data and end the process.
[0099] Step S2: parse the converted data to generate a blocking time axis; the blocking time axis is a time axis that supports blocking conditions.
[0100] See also Figure 3 As shown, the data generated after the analysis and conversion is further specifically:
[0101] Step S21, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported;
[0102] Step S22, creating a congestion timeline; the congestion timeline is a timeline with multiple time nodes, and a congestion condition node is a time node containing a congestion condition, and the time is paused before the congestion condition is met, and the next node is entered after the congestion condition is met;
[0103] Step S23, reading all plot node data in the plot data used for game plot creation; adding all plot node data to a plot node data queue;
[0104] Step S24, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S25;
[0105] Step S25, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis is moved backward to the time value accessed in the plot node data;
[0106] Step S26, determine whether the plot node data records a blocking value, which is a data value corresponding to the blocking condition; if not, proceed to step S27; if yes, add a blocking condition node in the blocking timeline, set the blocking value to adjust to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S27; the definition of the blocking value is the data value corresponding to the blocking condition parameter in the plot data, which can be set or not set in the plot data, and when set, blocking occurs, and when not set, execution is performed in chronological order;
[0107] Step S27: determine whether there are other plot data nodes in the plot data node queue. If yes, execute step S25; if no, return to the blocked timeline and end the process. Figure 4 , wherein the congestion timeline includes: a progress value and a time node set of the congestion timeline, wherein the time node set is composed of a plurality of time nodes, each of which includes a time length, a progress value, and a congestion condition. The definition of the congestion condition in the present invention includes but is not limited to a character arriving at a specified location, a user clicking on an interface, a user interacting with a certain character, and the like.
[0108] Step S3, distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop and end the process; if no, proceed to step S4;
[0109] An example of parsing the transformed data to generate a blocking timeline is as follows:
[0110] On the blocking timeline, add a blocking condition node in the blocking timeline and set the blocking value to the blocking condition recorded in the plot node data:
[0111] The entry animation is played at time 0, and the duration is 5;
[0112] The time 5 node adds a blocking condition to wait for the user to click, and the time length is 1;
[0113] Time 6 node adds the main character's action A animation, with a duration of 2;
[0114] Time 6 node adds NPC1 playing action B animation, the duration is 2;
[0115] The time 7 node adds NPC2 playing action C animation, the time length is 2;
[0116] Then the effect of playing when the timeline is blocked is:
[0117] The entry animation starts playing at time 0 and plays for 5 time units;
[0118] Wait for the user to click, and the playback time value jumps to 6 seconds;
[0119] The protagonist plays the action A animation, and NPC1 plays the action B animation;
[0120] When the time reaches 7 o'clock, NPC2 plays the action C animation.
[0121] See also Figure 5 , as shown, the step S3 of the present invention further specifically includes:
[0122] Step S31, inputting the plot data corresponding to the blocking time axis;
[0123] Step S32, reading the progress value of the blocking time axis;
[0124] Step S33, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read;
[0125] Step S34, read the plot instruction data set in the plot data, and add the data in the plot instruction data set to a plot instruction data queue; the definition of plot instructions in the present invention includes but is not limited to displaying characters, setting the position, rotation or size of characters, playing character actions, character pathfinding, character dressing, playing character special effects, moving, zooming or shaking the camera lens, plot UI display, etc.
[0126] Step S35, determine whether the plot instruction data queue is empty, if yes, update the blocking time axis progress value to the next node and execute step S33, if no, execute step S36;
[0127] Step S36, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data;
[0128] Step S37, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S36; if not, update the blocking time axis progress value to the next node, and execute step S33.
[0129] Step S4, execute the plot instructions in the plot data, and continue to distribute the plot data corresponding to the blocking time axis according to the blocking time axis:
[0130] See also Figure 6As shown, step S4 of the present invention further specifically includes: step S41, inputting plot instruction data, and reading plot instructions in the plot instruction data;
[0131] Step S42: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S43.
[0132] Step S43, executing the corresponding execution mode to input the plot instruction data;
[0133] Step S44, determine whether to execute the execution mode synchronously; if not, wait for the asynchronous execution mode to be completed and return an execution success event; the plot instruction is executed; if yes, return an execution success event and the plot instruction is executed.
[0134] The present invention generates a unified general plot data structure based on the game plot Json data, and then generates the blocking timeline plot data through the data parsing module. When the user starts the plot, the data distribution module distributes the plot data according to the blocking timeline, and the data execution module executes the plot instructions in the plot data to realize a complete game plot playback and interactive control system.
[0135] See also Figure 7 As shown, the present invention also provides an implementation system for automatically generating game plots, the implementation system comprising a data conversion module, a data parsing module, a data distribution module, and a data execution module;
[0136] The data conversion module is used to input the plot data used for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; execute the data parsing module; if yes, directly execute the data parsing module;
[0137] The data parsing module is used to parse the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing;
[0138] The data distribution module is used to distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop the process; if no, execute the data execution module;
[0139] The data execution module is used to execute the plot instructions in the plot data and continue to distribute the plot data corresponding to the blocked time axis according to the blocked time axis.
[0140] Data conversion module: This module provides data conversion capabilities for the data parsing module to convert Json data or Json file paths into unified plot data.
[0141] Data parsing module: This module provides the ability to parse data to generate blocked timeline plot data, realizes parsing unified plot data into blocked timeline plot data, and provides a data source for the data distribution module.
[0142] Data distribution module: This module provides the ability to distribute plot data according to the blocking timeline, realizes the merging and distribution of plot instruction data sets from the plot data, and promotes the execution of plot instructions.
[0143] Data execution module: This module provides the ability to execute plot instructions, implements the process of executing plot instructions, and applies the data described in the plot instructions to the scene.
[0144] The implementation of the data conversion module further specifically includes:
[0145] Step S51, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S52, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S52, if no, stop the process;
[0146] Step S52, identifying the Json data as a Json instance type;
[0147] Step S53, creating a plot data structure;
[0148] Step S54, fill the basic data in the Json data into the corresponding field value of the plot data structure;
[0149] Step S55, the data without matching fields is filled into the extended field queue of the plot data structure;
[0150] Step S56, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data;
[0151] Step S57, determine whether the Json data contains sub-data, if yes, go to step S53; if no, return to the created root node plot data and end the process.
[0152] The data generated after analysis and conversion is further specifically:
[0153] Step S61, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported;
[0154] Step S62, creating a blocking timeline;
[0155] Step S63, reading all the plot node data in the plot data used for creating the game plot; adding all the plot node data into a plot node data queue;
[0156] Step S64, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S65;
[0157] Step S65, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis moves backward to the time value accessed in the plot node data;
[0158] Step S66, determine whether the plot node data records a blocking value, which is the data value corresponding to the blocking condition; if not, proceed to step S67; if yes, add a blocking condition node to the blocking timeline, set the blocking value to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S67;
[0159] Step S67, determine whether there are other plot data nodes in the plot data node queue, if yes, execute step S65; if no, return to the blocking timeline and end the process. The blocking timeline includes: the progress value and time node set of the blocking timeline, the time node set consists of multiple time nodes, each time node includes time length, progress value, and blocking condition.
[0160] The implementation of the data distribution module further specifically includes:
[0161] Step S71, inputting the plot data corresponding to the blocking time axis;
[0162] Step S72, reading the progress value of the blocking time axis;
[0163] Step S73, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read;
[0164] Step S74, reading the plot instruction data set in the plot data, and adding the data in the plot instruction data set to a plot instruction data queue;
[0165] Step S75, determine whether the plot instruction data queue is empty, if yes, update the blocked timeline progress value to the next node and execute step S73, if no, execute step S76; the definition of plot instructions in the present invention includes but is not limited to displaying characters, setting the position, rotation or size of characters, playing character actions, character pathfinding, character dressing, playing character special effects, moving, zooming or shaking the camera lens, plot UI display, etc.
[0166] Step S76, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data;
[0167] Step S77, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S76; if not, update the blocking time axis progress value to the next node, and execute step S73.
[0168] The implementation method of the data execution module further specifically includes: step S81, inputting plot instruction data, and reading plot instructions in the plot instruction data;
[0169] Step S82: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S83.
[0170] Step S83, executing the corresponding execution mode to input the plot instruction data;
[0171] Step S84, determine whether to execute the execution mode synchronously; if not, wait for the asynchronous execution mode to be completed and return the execution success event; the plot instruction is executed; if yes, return the execution success event and the plot instruction is executed.
[0172] The present invention is applicable to the generation and interaction processes of all types of game plots, including but not limited to the generation and interaction processes of game plots in 2D games, the generation and interaction processes of game plots in 3D games, the generation and interaction processes of game plots in AR, VR games or applications, and the generation and interaction processes of game plots in other types of games.
[0173] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
Claims
1. A method for automatically generating a game plot, characterized in that: The method comprises the following steps: Step S1, input the plot data for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; go to step S2; if yes, directly go to step S2; Step S2, parsing the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing; Step S3, distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop and end the process; if no, proceed to step S4; Step S4, executing the plot instructions in the plot data, and continuing to distribute the plot data corresponding to the blocking time axis according to the blocking time axis; The data generated after analysis and conversion is further specifically: Step S21, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported; Step S22, creating a blocking timeline; Step S23, reading all the plot node data in the plot data used for game plot creation; adding all the plot node data into a plot node data queue; Step S24, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S25; Step S25, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis is moved backward to the time value accessed in the plot node data; Step S26, determine whether the plot node data records a blocking value, which is a data value corresponding to the blocking condition; if not, proceed to step S27; if yes, add a blocking condition node to the blocking timeline, set the blocking value to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S27; Step S27, determine whether there are other plot data nodes in the plot data node queue, if yes, execute step S25; if not, return to the blocked timeline and end the process.
2. The method for automatically generating a game plot according to claim 1, characterized in that: The step S1 further specifically includes: Step S11, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S12, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S12, if no, stop the process; Step S12, identifying the Json data as a Json instance type; Step S13, creating a plot data structure; Step S14, fill the basic data in the Json data into the corresponding field value of the plot data structure; Step S15, the data without matching fields is filled into the extended field queue of the plot data structure; Step S16, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data; Step S17, determine whether the Json data contains sub-data, if yes, go to step S13; if no, return to the created root node plot data and end the process.
3. The method for automatically generating a game plot according to claim 1, characterized in that: The congestion timeline includes: a progress value and a time node set of the congestion timeline, wherein the time node set is composed of a plurality of time nodes, and each time node includes a time length, a progress value, and a congestion condition.
4. The method for automatically generating a game plot according to claim 3, characterized in that: The step S3 further specifically includes: Step S31, inputting the plot data corresponding to the blocking time axis; Step S32, reading the progress value of the blocking time axis; Step S33, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read; Step S34, reading the plot instruction data set in the plot data, and adding the data in the plot instruction data set to a plot instruction data queue; Step S35, determine whether the plot instruction data queue is empty, if yes, update the blocking time axis progress value to the next node and execute step S33, if no, execute step S36; Step S36, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data; Step S37, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S36; if not, update the blocking time axis progress value to the next node, and execute step S33.
5. The method for automatically generating game plots according to claim 3, characterized in that: Step S4 further specifically includes: Step S41, inputting plot instruction data, and reading plot instructions in the plot instruction data; Step S42: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S43. Step S43, executing the corresponding execution mode to input the plot instruction data; Step S44, determine whether to execute the corresponding execution mode synchronously; if not, wait for the asynchronous execution mode to complete, and return an execution success event; the plot instruction is executed; if yes, return an execution success event, and the plot instruction is executed.
6. A system for automatically generating game plots, characterized in that: The implementation system includes a data conversion module, a data analysis module, a data distribution module, and a data execution module; The data conversion module is used to input the plot data used for game plot creation, determine whether the input plot data type is Json data, if not, perform data conversion on the input plot data; execute the data parsing module; if yes, directly execute the data parsing module; The data parsing module is used to parse the converted data to generate a blocking timeline; the blocking timeline is a timeline that supports blocking conditions, wherein when the blocking condition node is not set in the plot node data of the blocking timeline, the timeline will run normally in chronological order; when the blocking condition is set, the playback time stops updating when the playback time is updated to the blocking condition node, and waits until the blocking condition is met before the playback time moves to the start position of the next node to continue playing; The data distribution module is used to distribute the plot data corresponding to the blocked time axis according to the blocked time axis; determine whether the plot data corresponding to the blocked time axis has been distributed; if yes, stop the process; if no, execute the data execution module; The data execution module is used to execute the plot instructions in the plot data and continue to distribute the plot data corresponding to the blocking time axis according to the blocking time axis; The data generated after analysis and conversion is further specifically: Step S61, input the converted plot data for game plot creation; the plot data contains a plurality of sub-plot data, and the data recorded in the plot data includes plot instructions and their execution methods, plot node time length, whether the node is blocked, blocking conditions, and whether skipping is supported; Step S62, creating a blocking timeline; Step S63, reading all the plot node data in the plot data used for creating the game plot; adding all the plot node data into a plot node data queue; Step S64, determine whether the plot node data queue is empty, if yes, return to the blocked timeline and end the process; if no, proceed to step S65; Step S65, read a plot node data from the plot node data queue, add the plot node data to the current node position of the blocking time axis; the current time value of the blocking time axis moves backward to the time value accessed in the plot node data; Step S66, determine whether the plot node data records a blocking value, which is the data value corresponding to the blocking condition; if not, proceed to step S67; if yes, add a blocking condition node to the blocking timeline, set the blocking value to the blocking condition recorded in the plot node data; move the current timeline of the blocking timeline backward by a blocking node unit time value, and proceed to step S67; Step S67, determine whether there are other plot data nodes in the plot data node queue, if yes, execute step S65; if no, return to the blocked timeline and end the process.
7. The system for automatically generating game plots according to claim 6, characterized in that: The implementation of the data conversion module further specifically includes: Step S51, input the plot data for creating the game plot, determine whether the input plot data type is Json data, if yes, go to step S52, if no, determine whether it is a Json file path, if yes, read the Json data in the file and go to step S52, if no, stop the process; Step S52, identifying the Json data as a Json instance type; Step S53, creating a plot data structure; Step S54, fill the basic data in the Json data into the corresponding field value of the plot data structure; Step S55, the data without matching fields is filled into the extended field queue of the plot data structure; Step S56, determining whether the plot data in the plot data structure is root node data, if not, adding it to the child data of the parent node plot data; if yes, recording it as root node plot data; Step S57, determine whether the Json data contains sub-data, if yes, go to step S53; if no, return to the created root node plot data and end the process.
8. The system for automatically generating game plots according to claim 6, characterized in that: The congestion timeline includes: a progress value and a time node set of the congestion timeline, wherein the time node set is composed of a plurality of time nodes, and each time node includes a time length, a progress value, and a congestion condition.
9. A system for automatically generating game plots according to claim 8, characterized in that: The implementation of the data distribution module further specifically includes: Step S71, inputting the plot data corresponding to the blocking time axis; Step S72, reading the progress value of the blocking time axis; Step S73, judging whether the blocking timeline is executed, if yes, the distribution of the plot data corresponding to the blocking timeline is completed and the process is ended, if no, the plot data of the current progress value is read; Step S74, reading the plot instruction data set in the plot data, and adding the data in the plot instruction data set to a plot instruction data queue; Step S75, determine whether the plot instruction data queue is empty, if yes, update the blocking time axis progress value to the next node and execute step S73, if no, execute step S76; Step S76, reading a plot instruction data from the plot instruction data queue, and executing the plot instruction data; Step S77, determine whether there are other plot instruction data in the plot instruction data queue, if yes, execute step S76; if not, update the blocking time axis progress value to the next node, and execute step S73.
10. The system for automatically generating game plots according to claim 8, characterized in that: The implementation method of the data execution module further specifically includes: step S81, inputting plot instruction data, and reading plot instructions in the plot instruction data; Step S82: determine whether the plot instruction has a corresponding execution mode registered. If not, the plot instruction is executed and the process ends. If yes, proceed to step S83. Step S83, executing the corresponding execution mode to input the plot instruction data; Step S84, determine whether to execute the corresponding execution mode synchronously; if not, wait for the asynchronous execution mode to complete, and return an execution success event; the plot instruction is executed; if yes, return an execution success event, and the plot instruction is executed.
