CN112245924A - Method and device for generating non-player character, storage medium and electronic equipment - Google Patents

Method and device for generating non-player character, storage medium and electronic equipment Download PDF

Info

Publication number
CN112245924A
CN112245924A CN202011183808.XA CN202011183808A CN112245924A CN 112245924 A CN112245924 A CN 112245924A CN 202011183808 A CN202011183808 A CN 202011183808A CN 112245924 A CN112245924 A CN 112245924A
Authority
CN
China
Prior art keywords
player character
component
target
player
template
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
CN202011183808.XA
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.)
Beijing Bingfeng Mutual Entertainment Technology Co ltd
Original Assignee
Beijing Bingfeng Mutual Entertainment 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 Beijing Bingfeng Mutual Entertainment Technology Co ltd filed Critical Beijing Bingfeng Mutual Entertainment Technology Co ltd
Priority to CN202011183808.XA priority Critical patent/CN112245924A/en
Publication of CN112245924A publication Critical patent/CN112245924A/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/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/6009Methods for processing data by generating or executing the game program for importing or creating game content, e.g. authoring tools during game development, adapting content to different platforms, use of a scripting language to create content

Abstract

The invention provides a method and a device for generating a non-player character, a storage medium and electronic equipment, wherein the method comprises the following steps: configuring a generic non-player character template, wherein the generic non-player character template contains the basic logic of all non-player character types, and the generic non-player character template encapsulates the logic codes of a plurality of generic services; searching a plurality of target service components matched with service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a non-player role of one type, and each service component encapsulates a logic code corresponding to a service; and mounting the target business component to the universal non-player character template to generate a target non-player character. The invention solves the technical problem of low efficiency of developing the non-player character of the game in the related technology, improves the development efficiency of the non-player character and shortens the development period of the non-player character.

Description

Method and device for generating non-player character, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a non-player character, a storage medium and electronic equipment.
Background
In the related art, a Non Player Character (NPC) is a type of Character in a game, belongs to a game element, and refers to all objects in the game that can interact or have logic of themselves, such as monsters, task Non-Player characters, treasure boxes, and the like. Different non-player characters are designed according to the functional requirements of game strategies, such as monsters, minerals, treasure boxes, organs, mission non-player characters, pets and the like, and the data structures of the non-player characters are greatly different.
In the related art, when a non-player character with a specific function is developed, a large amount of development cost is wasted by editing codes, although the non-player character is used for realizing different requirements, monsters, minerals, mission non-player characters and the like have a large amount of overlapped logic, such as display, refresh and destruction, basic interaction and the like, a large amount of repeated design, development and test workload exists in the part of logic, and particularly, a large amount of extra development cost is caused for a large-scale project. And the maintenance cost is increased, because the data structures of the non-player roles with different functions are different, when cross-department cooperation and work handover occur, a large amount of communication cost is increased, and if the configuration latent rule exists, the risk of bug occurrence can be increased, and obvious additional maintenance cost is brought. Meanwhile, the non-player characters developed by the related technology have the defects of flexibility and expansibility. In the game development process, situations often occur that multiple functions need to be combined, such as a treasure box monster that can run, a mechanism that can handover tasks, and even a monster that can collect resources, which all require multiple business parts to be jointly developed, have poor flexibility, and cannot be expanded on an existing template.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for generating a non-player character, a storage medium and electronic equipment.
According to an embodiment of the present invention, there is provided a method of generating a non-player character, including: configuring a generic non-player character template, wherein the generic non-player character template contains the basic logic of all non-player character types, and the generic non-player character template encapsulates the logic codes of a plurality of generic services; searching a plurality of target service components matched with service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a non-player role of one type, and each service component encapsulates a logic code corresponding to a service; and mounting the target business component to the universal non-player character template to generate a target non-player character.
Optionally, configuring the generic non-player character template comprises: configuring a model resource code of the generic non-player character template, configuring an interface display code of the generic non-player character template, configuring a combat behavior code of the generic non-player character template, and configuring an attack and defense attribute code of the generic non-player character template, wherein the model resource code is used for representing visual size information of the target non-player character in a game scene, the interface display code is used for representing display content and a display path of the target non-player character in the game scene, the combat behavior code is used for representing battle information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used for representing fighting ability of the target non-player character in the game scene; and combining the model resource code, the interface display code, the combat behavior code and the attack and defense attribute code into the universal non-player character template.
Optionally, searching for a plurality of target service components matched with the service requirement information in the preset component library includes: determining a non-player character type matched with the service requirement information; searching at least one target business component matched with the non-player character type in a preset component library, wherein the target business component comprises the following components: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
Optionally, mounting the target service component to the universal non-player character template to generate a target non-player character, including: locating a designated directory file under a root directory in the script file of the universal non-player character template; and mounting the universal non-player character template and the target service component by taking the appointed directory file as a mounting point so as to generate a target non-player character.
Optionally, if the target non-player character is an ore non-player character, mounting the target service component to the general non-player character template to generate a target non-player character, including: configuring collection parameters of a collection component, wherein the collection parameters are used for representing the amount of virtual resources acquired by collecting the ore non-player character in a game scene; mounting the collection component to the generic non-player character template to generate an ore non-player character.
Optionally, if the target non-player character is an animal non-player character, mounting the target service component to the universal non-player character template to generate a target non-player character, including: the method comprises the steps of configuring acquisition parameters of an acquisition component and configuring action parameters of an AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the animal non-player character in a game scene, and the action parameters are used for representing the playing animation of the animal non-player character in the game scene;
mounting the acquisition component and the AI component to the generic non-player character template to generate an animal non-player character.
Optionally, if the target non-player character is a farm animal non-player character, mounting the target business component to the generic non-player character template to generate a target non-player character, including: configuring acquisition parameters of an acquisition component, configuring action parameters of an AI component and configuring livestock parameters of a livestock component, wherein the acquisition parameters are used for representing the virtual resource amount acquired by acquiring the livestock non-player character in a game scene, the action parameters are used for representing the playing animation of the livestock non-player character in the game scene, and the livestock parameters are used for representing the breeding area of the livestock non-player character in the game scene; mounting the acquisition component, the AI component, and the livestock component to the generic non-player character template to generate a livestock non-player character.
Optionally, after the target business component is mounted to the generic non-player character template to generate a target non-player character, the method further includes: after the target non-player character is triggered in a game scene, judging whether the life value of the target non-player character is lower than a first preset value and/or judging whether the distance between a player control character and the target non-player character is smaller than a second preset value; if the life value of the target non-player character is lower than a first preset value and/or the distance between the player control character and the target non-player character is smaller than a second preset value, generating auxiliary resources of the target non-player character, and distributing the auxiliary resources to the game account of the player control character.
Optionally, after the target business component is mounted to the generic non-player character template to generate a target non-player character, the method further includes: after the target non-player character is triggered in a game scene, detecting the switch state of a switch component of the target non-player character, wherein the switch component is used for controlling the start-stop state of a controlled component, and the controlled component comprises at least one of the following components: the target business component comprises the switch component and the controlled component; if the switch state of the switch component is the opening state, the logic code of the controlled component is operated; and if the switching state of the switching component is the off state, the logic code of the controlled component is forbidden to run.
According to another embodiment of the present invention, there is provided a non-player character generating apparatus including: a configuration module configured to configure a generic non-player character template, wherein the generic non-player character template contains basic logic of all non-player character types, and the generic non-player character template encapsulates logic codes of a plurality of generic services; the searching module is used for searching a plurality of target service components matched with the service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a type of non-player role, and each service component encapsulates a logic code corresponding to a service; and the mounting module is used for mounting the target service component to the universal non-player role template so as to generate a target non-player role.
Optionally, the configuration module includes: a configuration unit, configured to configure a model resource code of the generic non-player character template, configure an interface display code of the generic non-player character template, configure a combat behavior code of the generic non-player character template, and configure an attack and defense attribute code of the generic non-player character template, where the model resource code is used to characterize visual size information of the target non-player character in a game scene, the interface display code is used to characterize display content and display path of the target non-player character in the game scene, the combat behavior code is used to characterize play information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used to characterize combat ability of the target non-player character in the game scene; and the combination unit is used for combining the model resource code, the interface display code, the combat behavior code and the attack and defense attribute code into the universal non-player character template.
Optionally, the searching module includes: the determining unit is used for determining the type of the non-player character matched with the service requirement information; a searching unit, configured to search a preset component library for at least one target business component matching the non-player character type, where the target business component is: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
Optionally, the mount module includes: a positioning unit, configured to position a specified directory file under a root directory in a script file of the generic non-player character template; and the mounting unit is used for mounting the universal non-player character template and the target service component by taking the specified directory file as a mounting point so as to generate a target non-player character.
Optionally, if the target non-player character is an ore non-player character, the mount module includes: the device comprises a first configuration unit, a second configuration unit and a third configuration unit, wherein the first configuration unit is used for configuring collection parameters of a collection component, and the collection parameters are used for representing the amount of virtual resources acquired by collecting the ore non-player character in a game scene; a first mounting unit for mounting the collection component to the generic non-player character template to generate an ore non-player character.
Optionally, if the target non-player character is an animal non-player character, the mount module includes: the second configuration unit is used for configuring acquisition parameters of the acquisition component and configuring action parameters of the AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the animal non-player character in a game scene, and the action parameters are used for representing the playing animation of the animal non-player character in the game scene; and the second mounting unit is used for mounting the acquisition component and the AI component to the universal non-player character template so as to generate an animal non-player character.
Optionally, if the target non-player character is a livestock non-player character, the mount module includes: a third configuration unit, configured to configure acquisition parameters of an acquisition component, configure action parameters of an AI component, and configure livestock parameters of a livestock component, wherein the acquisition parameters are used to characterize an amount of virtual resources acquired by acquiring the livestock non-player character in a game scene, the action parameters are used to characterize a playing animation of the livestock non-player character in the game scene, and the livestock parameters are used to characterize a breeding area of the livestock non-player character in the game scene; a third mounting unit for mounting the acquisition component, the AI component, and the livestock component to the generic non-player character template to generate a livestock non-player character.
Optionally, the apparatus further comprises: the judging module is used for judging whether the life value of the target non-player character is lower than a first preset value or not and/or judging whether the distance between a player control character and the target non-player character is smaller than a second preset value or not after the target service component is mounted to the universal non-player character template by the mounting module to generate the target non-player character and the target non-player character is triggered in a game scene; and the allocation module is used for generating auxiliary resources of the target non-player character and allocating the auxiliary resources to the game account of the player-controlled character if the life value of the target non-player character is lower than a first preset value and/or the distance between the player-controlled character and the target non-player character is smaller than a second preset value.
Optionally, the apparatus further comprises: a detecting module, configured to detect a switch state of a switch component of a target non-player character after the target business component is mounted to the generic non-player character template by the mounting module to generate the target non-player character and the target non-player character is triggered in a game scene, where the switch component is used to control a start-stop state of a controlled component, and the controlled component includes at least one of: the target business component comprises the switch component and the controlled component; the control module is used for operating the logic code of the controlled component if the switching state of the switching component is the opening state; and if the switching state of the switching component is the off state, the logic code of the controlled component is forbidden to run.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the universal non-player role template is configured, then a plurality of target service components matched with the service requirement information are searched in the preset component library, the target service components are mounted to the universal non-player role template to generate the target non-player roles, and the non-player roles with individual functions can be generated on the basis logic of the universal non-player roles by mounting the universal non-player role template and the target service components, so that the code editing amount of repeated functions is reduced, the flexible configuration and expansion of a plurality of functions can be realized at the same time, the technical problem of low efficiency in developing game non-player roles in the related technology is solved, the flexibility of non-player role function configuration is increased, the configuration cost of the non-player roles is reduced, the development efficiency of the non-player roles is improved, and the development cycle of the non-player roles is shortened.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of a hardware architecture for generating a non-player character in accordance with an embodiment of the present invention;
FIG. 2 is a flow diagram of a method for generating a non-player character in accordance with an embodiment of the present invention;
FIG. 3 is a diagram of the organization of data for a non-player character according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a mining non-player character according to an embodiment of the present invention;
fig. 5 is a block diagram showing the construction of a non-player character generating apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the embodiment one of the present application can be executed in a server, a computer or a similar electronic device. Taking a computer as an example, fig. 1 is a block diagram of a hardware structure for generating a non-player character according to an embodiment of the present invention. As shown in fig. 1, computer 10 may include one or more (only one shown in fig. 1) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is illustrative only and is not intended to limit the configuration of the computer described above. For example, computer 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for generating a non-player character in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to computer 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. In the present embodiment, the processor 104 is configured to control the target virtual character to perform a specified operation to complete the game task in response to the human-machine interaction instruction and the game policy. The memory 104 is used for storing program scripts of the electronic game, configuration information, attribute information of the virtual character, and the like.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by the communications provider of computer 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Optionally, the input/output device 108 further includes a human-computer interaction screen for acquiring a human-computer interaction instruction through a human-computer interaction interface;
in this embodiment, a method for generating a non-player character is provided, and fig. 2 is a flowchart of a method for generating a non-player character according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, configuring a universal non-player role template, wherein the universal non-player role template comprises basic logics of all non-player role types, and the universal non-player role template encapsulates logic codes of a plurality of universal services;
the universal non-player character template of the embodiment is a component for all universal non-player character types, and encapsulates logic codes of basic logic necessary for all types of non-player characters, such as the form, size, attack and defense attributes and other fields of the non-player characters.
Step S204, searching a plurality of target service components matched with the service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a type of non-player role, and each service component encapsulates a logic code corresponding to a service;
the service component of this embodiment corresponds to the personalized service of the non-player character, the personalized services of different types of non-player characters are different, the target service components are also different, the data structures of the logic codes are also different, some complicated non-player characters may belong to a plurality of types of non-player characters at the same time, when the target service component is found, the component parameters of the target service component can be configured according to the service requirement information, such as the acquisition resource amount corresponding to the acquisition component, the playing animation of the AI component, and the like, and the individually packaged service component can be maintained independently, so that the bug amount can be reduced to the greatest extent, and the stability of the game can be increased;
step S206, mounting the target service component to a universal non-player role template to generate a target non-player role;
because the target service component and the universal non-player character template are configured and packaged codes or only simple parameter configuration is needed, various different non-player characters can be generated by mounting the target service component and the universal non-player character template without encoding complicated and fussy codes. A target non-player character is a type of game element in the game scene china.
Configuring a universal non-player role template through the steps, searching a plurality of target service components matched with service requirement information in a preset component library, mounting the target service components to the universal non-player role template, to generate a target non-player character, by mounting a generic non-player character template and a target business component, namely, the non-player character with individual function can be generated logically on the basis of the general non-player character, the code editing amount of the repeated function is reduced, meanwhile, the method can realize flexible configuration and expansion of a plurality of functions, solves the technical problem of low efficiency of developing the non-player role of the game in the related technology, increases the flexibility of function configuration of the non-player role, reduces the configuration cost of the non-player role, improves the development efficiency of the non-player role and shortens the development period of the non-player role.
In this embodiment, game elements that all player characters can interact with or possess autonomous behavior in a game scene are collectively referred to as a non-player character, fig. 3 is a data organization mode diagram of the non-player character according to an embodiment of the present invention, and the non-player character can be split into two pieces according to functions: generic templates (corresponding generic non-player character templates) and non-player character components (business components): the universal template is responsible for processing basic logic needed to be used by the non-player character, such as configuration of model resources, interface display content, general combat logic, basic attributes and the like; different non-player character components are then mounted to the respective non-player character generic templates to form non-player characters having a plurality of different functions, such as monsters, minerals, treasure boxes, mission non-player characters, and the like, according to different business needs.
In one embodiment of this embodiment, configuring the generic non-player character template includes: configuring a model resource code of a universal non-player character template, configuring an interface display code of the universal non-player character template, configuring a fighting behavior code of the universal non-player character template, and configuring an attack and defense attribute code of the universal non-player character template, wherein the model resource code is used for representing visual size information of a target non-player character in a game scene, the interface display code is used for representing display content and a display path of the target non-player character in the game scene, the fighting behavior code is used for representing formation information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used for representing fighting capacity of the target non-player character in the game scene; the model resource code, the interface display code, the combat behavior code, and the attack and defense attribute code are combined into a universal non-player character template. In the configuration process, the attribute values of the general attributes in the general non-player character template, such as the specific size, shape, attack capability and the like of the non-player character, can be configured by configuring the content or parameter values of the code fields in the general non-player character template.
In this embodiment, the model resource code, the interface display code, the combat behavior code, and the attack and defense attribute code are basic units of the generic non-player character template, each basic unit is composed of several fields, and forms a complete logic code, as shown in table 1, in one example, the fields of the generic non-player character template include:
TABLE 1
Figure BDA0002750904710000101
The fields in the universal template can realize all basic logics of the non-player characters in the game scene and corresponding universal functions, wherein the universal functions are functions which are possessed by each non-player character, such as character refreshing and destroying, model resource and non-player character interaction interface display, combat value calculation and the like. In the universal non-player character template, a plurality of different service components are supported and configured to realize the combination of a plurality of non-player character functions and generate a non-player character with a specific function.
In an implementation manner of this embodiment, searching for a plurality of target service components matching the service requirement information in the preset component library includes:
s11, determining the type of the non-player character matched with the service requirement information;
the non-player character type in this embodiment is a character type of the non-player character in the game, such as whether the non-player character can move or not, whether interaction can be performed or not, an activity area of the non-player character, and the like.
S12, searching at least one target service component matched with the non-player character type in a preset component library: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
Each different non-player character component has different data structures according to different functions borne by the non-player character component, and a plurality of different service components can be configured on each universal non-player character template through associating component types and component ids (configuration parameters of service components) with the non-player character universal template.
In one example, there are 16 business components in the preset component library, as shown in table 2:
TABLE 2
Figure BDA0002750904710000121
In some embodiments, for a business component that covers a broad but logically similar non-player character, such as a non-player character service component, the business component can be split into a plurality of independent service configuration items according to its corresponding different segment functions, and the various segment functions are allocated to the non-player character service component according to the service type + service parameter ID. Different services have different data structures, and the non-player character service includes: access tasks, submit tasks, conversations (including surveys), chat bubbles, intra-graph transfers, uni-directional transfers, tangent lines, game malls, and the like.
The embodiment can also open the target non-player character synthetic authority to the player, and the target non-player character synthetic authority is realized through the user interaction instruction, so that the participation sense of the player to the game is increased. Preferably, a player account whose player-controlled character attribute of the player meets a specific requirement is searched in the server, and then the non-player character composition permission is unlocked for the player account, and a player who meets the specific requirement, for example, the player-controlled character level is greater than or equal to a first threshold, or the skill of the player-controlled character reaches a second threshold, and so on, may have the non-player character composition permission, and the user selects a general non-player character template and a plurality of target service components through an interactive instruction, generates a target non-player character in a game scene, and then appears the non-player character which is synthesized by the user in a specific copy or a specific level. The non-player character synthesis page of the player comprises a non-player character component list which is opened to the player, and also comprises a selection button and a synthesis button which are used for selecting and synthesizing the required target non-player character component, for example, the non-player character component list comprises 8 non-player character components, and the number of the component functions which the user wants to have is selected or set through the selection button, for example, 5; the user triggers the synthesis button through an interactive instruction, the synthesis button polls 8 non-player character components to be selected according to the set component function number of 5, and selects 5 required non-player character components (target service components) according to a polling strategy, and the components are respectively used as a service function of the finally synthesized target non-player character. The polling strategy is related to the account number level or skill value of the user, the skill positioning of the player-controlled role, and the role form of the player-controlled role. Or 5 polling signals at a time, with a polling rate related to the player's level or skill value, and select the desired target business module at a time. In other examples, business components with the highest degree of matching with skill positioning are selected from the non-player character component list according to skill positioning (such as attack type, defense type, auxiliary type and the like) of the player-controlled character, and business components with the highest degree of matching with character morphology are selected from the non-player character component list according to character morphology (such as soft lovely sister, solo man and the like) of the player-controlled character. The polling strategy of the present embodiment is not limited to the above strategy. In the non-player character synthesis process, certain randomness is provided in the determined target business components, and the playability and freshness of the game are improved.
In one embodiment of this embodiment, mounting the target business component to a generic non-player character template to generate the target non-player character comprises: locating a specified directory file under a root directory in a script file of a universal non-player character template; and mounting the universal non-player character template and the target service component by taking the specified directory file as a mounting point to generate a target non-player character.
Optionally, the target service component may be mounted by a container, and a container creation instruction input by a user is received, where the container creation instruction carries identification information of the universal non-player character template and a mirror image corresponding to the target service component; sending a container creating instruction to the universal non-player character template according to the identification information of the universal non-player character template, wherein the container creating instruction carries a mirror image corresponding to the target service component and container folder mounting parameters, the container folder mounting parameters comprise an identification code of a container (namely the identification of the finally generated target non-player character), so that the universal non-player role template creates a Docker container according to the mirror image corresponding to the target service component, and creates a folder corresponding to the container root directory at the mount point according to the container folder mount parameters, creating a root directory and a corresponding target address of the universal non-player character template on the universal non-player character template, and mounting a folder corresponding to the root directory of the container into the target address corresponding to the root directory of the universal non-player character template, wherein the corresponding target address comprises an identification code of a Docker container; sending a container starting instruction to the universal non-player character template so that a Docker container of the universal non-player character template writes a target service component into a folder corresponding to a container root directory, wherein the folder is arranged in a target address corresponding to the root directory of the universal non-player character template, and the folder is provided with the target service component; and reading a folder corresponding to the container root directory of the Docker container from the target address according to the container identity code in the target address corresponding to the root directory of the universal non-player role template so as to execute the logic code corresponding to the target service component.
In an application scenario, creating an ore capable of collecting ore resources in a game, setting the ore as a non-player character in the game scenario, wherein a target non-player character is the ore non-player character, and mounting a target business component to a general non-player character template to generate the target non-player character, including: configuring collection parameters of a collection component, wherein the collection parameters are used for representing the quantity of virtual resources acquired by collecting the ore non-player characters in a game scene; the collection component is mounted to a generic non-player character template to generate an ore non-player character.
When configuring an acquirable mineral non-player character, such as a copper mine, firstly, acquiring 3-4 (which can be configured in an acquisition parameter by a user) copper ores in an acquisition assembly, and then configuring the acquisition assembly on a general template configured with a copper mine model. FIG. 4 is a schematic diagram of an embodiment of the invention for collecting mineral non-player characters, and a player obtains 4 or 2 virtual resource amounts by collecting copper ores.
In an application scenario, an animal which can move and can collect resources is created in a game and is set in the game scenario as a non-player character, a target non-player character is an animal non-player character, and a target business component is mounted to a general non-player character template to generate the target non-player character, including: the method comprises the steps of configuring acquisition parameters of an acquisition component and configuring action parameters of an AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring animal non-player characters in a game scene, and the action parameters are used for representing playing animations of the animal non-player characters in the game scene; the acquisition component and the AI component are mounted to a generic non-player character template to generate an animal non-player character.
If the animal is a wool ball sheep and is a wool ball sheep non-player character which can only obtain wool, considering that the sheep can have own behaviors, an AI component is configured for the wool ball sheep to enable the wool ball sheep to have the actions of moving, stuttering and the like, and then an acquisition component which can obtain 3-4 pieces of wool (can be configured in a user-defined manner in acquisition parameters) is configured for the non-player character, so that the 'mineral' with the autonomous behavior is realized, and the 'mineral' is displayed as the animal non-player character in a game scene.
In one application scenario, a poultry animal which can move and can collect resources is created in a game and is set in the game scenario as a non-player character, a target non-player character is a livestock non-player character, and a target business component is mounted to a universal non-player character template to generate the target non-player character, which comprises the following steps: configuring acquisition parameters of an acquisition component, action parameters of an AI component and livestock parameters of a livestock component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the livestock non-player character in a game scene, the action parameters are used for representing the playing animation of the livestock non-player character in the game scene, and the livestock parameters are used for representing the breeding area of the livestock non-player character in the game scene; the acquisition component, the AI component, and the livestock component are mounted to a generic non-player character template to generate a livestock non-player character.
If the animal is a wool ball sheep and is a wool ball sheep non-player character which can only obtain wool, considering that the sheep has own behaviors, an AI component is configured for the wool ball sheep to enable the wool ball sheep to have the actions of moving, stuttering and the like, then an acquisition component which can obtain 3-4 pieces of wool (can be configured in an acquisition parameter in a user-defined mode) is configured for the non-player character, and on the basis of the non-player character, if a livestock component is added to the wool ball sheep non-player character, the wool ball sheep which can be bred in a home garden (can be configured in the user-defined mode) is formed.
In an application scenario of this embodiment, after mounting the target business component to the generic non-player character template to generate the target non-player character, the method further includes: after a target non-Player Character is triggered in a game scene, judging whether the life value of the target non-Player Character is lower than a first preset value, and/or judging whether the distance between a Player-Controlled Character (PPC) and the target non-Player Character is smaller than a second preset value; if the life value of the target non-player character is lower than a first preset value and/or the distance between the player control character and the target non-player character is smaller than a second preset value, generating auxiliary resources of the target non-player character, and distributing the auxiliary resources to the game account of the player control character.
In an application scenario of this embodiment, after mounting the target business component to the generic non-player character template to generate the target non-player character, the method further includes: after a target non-player character is triggered in a game scene, detecting the switch state of a switch component of the target non-player character, wherein the switch component is used for controlling the start-stop state of a controlled component, and the controlled component comprises at least one of the following components: the system comprises an acquisition component, a non-player role service component and a blocking component, wherein a target business component comprises a switch component and a controlled component; if the switching state of the switching component is the opening state, running the logic code of the controlled component; and if the switch state of the switch assembly is the off state, the logic code of the controlled assembly is forbidden to run.
According to the method and the system, the start-stop states of other service components are controlled through the service components, the operation of part of the service components in the stop state is directly forbidden, the calling times of main logic can be reduced aiming at the non-player characters with large size and complex logic, the host resources consumed by the non-player characters can be reduced, and the operation fluency of the game can be improved.
By adopting the scheme of the embodiment, the basic logic of all interactive objects appearing in the game can be unified, the repeated development is avoided, the maintenance cost is reduced, the flexibility of the function configuration of the non-player character is increased, the realization of richer non-player character behaviors at lower cost becomes possible, and the development efficiency of the non-player character is improved.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a device for generating a non-player character is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description of which has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram showing a configuration of an apparatus for generating a non-player character according to an embodiment of the present invention, as shown in fig. 5, the apparatus including: a configuration module 50, a lookup module 52, a mount module 54, wherein,
a configuration module 50 configured to configure a generic non-player character template, wherein the generic non-player character template includes basic logic of all non-player character types, and the generic non-player character template encapsulates logic codes of a plurality of generic services;
the searching module 52 is configured to search a plurality of target service components matched with the service demand information in a preset component library, where the preset component library includes a plurality of service components, each service component corresponds to a type of non-player character, and each service component encapsulates a logic code corresponding to a service;
a mounting module 54, configured to mount the target business component to the generic non-player character template to generate a target non-player character.
Optionally, the configuration module includes: a configuration unit, configured to configure a model resource code of the generic non-player character template, configure an interface display code of the generic non-player character template, configure a combat behavior code of the generic non-player character template, and configure an attack and defense attribute code of the generic non-player character template, where the model resource code is used to characterize visual size information of the target non-player character in a game scene, the interface display code is used to characterize display content and display path of the target non-player character in the game scene, the combat behavior code is used to characterize play information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used to characterize combat ability of the target non-player character in the game scene; and the combination unit is used for combining the model resource code, the interface display code, the combat behavior code and the attack and defense attribute code into the universal non-player character template.
Optionally, the searching module includes: the determining unit is used for determining the type of the non-player character matched with the service requirement information; a searching unit, configured to search a preset component library for at least one target business component matching the non-player character type, where the target business component is: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
Optionally, the mount module includes: a positioning unit, configured to position a specified directory file under a root directory in a script file of the generic non-player character template; and the mounting unit is used for mounting the universal non-player character template and the target service component by taking the specified directory file as a mounting point so as to generate a target non-player character.
Optionally, if the target non-player character is an ore non-player character, the mount module includes: the device comprises a first configuration unit, a second configuration unit and a third configuration unit, wherein the first configuration unit is used for configuring collection parameters of a collection component, and the collection parameters are used for representing the amount of virtual resources acquired by collecting the ore non-player character in a game scene; a first mounting unit for mounting the collection component to the generic non-player character template to generate an ore non-player character.
Optionally, if the target non-player character is an animal non-player character, the mount module includes: the second configuration unit is used for configuring acquisition parameters of the acquisition component and configuring action parameters of the AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the animal non-player character in a game scene, and the action parameters are used for representing the playing animation of the animal non-player character in the game scene; and the second mounting unit is used for mounting the acquisition component and the AI component to the universal non-player character template so as to generate an animal non-player character.
Optionally, if the target non-player character is a livestock non-player character, the mount module includes: a third configuration unit, configured to configure acquisition parameters of an acquisition component, configure action parameters of an AI component, and configure livestock parameters of a livestock component, wherein the acquisition parameters are used to characterize an amount of virtual resources acquired by acquiring the livestock non-player character in a game scene, the action parameters are used to characterize a playing animation of the livestock non-player character in the game scene, and the livestock parameters are used to characterize a breeding area of the livestock non-player character in the game scene; a third mounting unit for mounting the acquisition component, the AI component, and the livestock component to the generic non-player character template to generate a livestock non-player character.
Optionally, the apparatus further comprises: the judging module is used for judging whether the life value of the target non-player character is lower than a first preset value or not and/or judging whether the distance between a player control character and the target non-player character is smaller than a second preset value or not after the target service component is mounted to the universal non-player character template by the mounting module to generate the target non-player character and the target non-player character is triggered in a game scene; and the allocation module is used for generating auxiliary resources of the target non-player character and allocating the auxiliary resources to the game account of the player-controlled character if the life value of the target non-player character is lower than a first preset value and/or the distance between the player-controlled character and the target non-player character is smaller than a second preset value.
Optionally, the apparatus further comprises: a detecting module, configured to detect a switch state of a switch component of a target non-player character after the target business component is mounted to the generic non-player character template by the mounting module to generate the target non-player character and the target non-player character is triggered in a game scene, where the switch component is used to control a start-stop state of a controlled component, and the controlled component includes at least one of: the target business component comprises the switch component and the controlled component; the control module is used for operating the logic code of the controlled component if the switching state of the switching component is the opening state; and if the switching state of the switching component is the off state, the logic code of the controlled component is forbidden to run.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Fig. 6 is a structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 6, the electronic device includes a processor 61, a communication interface 62, a memory 63, and a communication bus 64, where the processor 61, the communication interface 62, and the memory 63 complete mutual communication through the communication bus 64, and the memory 63 is used for storing a computer program;
the processor 61 is configured to implement the following steps when executing the program stored in the memory 63: configuring a generic non-player character template, wherein the generic non-player character template contains the basic logic of all non-player character types, and the generic non-player character template encapsulates the logic codes of a plurality of generic services; searching a plurality of target service components matched with service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a non-player role of one type, and each service component encapsulates a logic code corresponding to a service; and mounting the target business component to the universal non-player character template to generate a target non-player character.
Optionally, configuring the generic non-player character template comprises: configuring a model resource code of the generic non-player character template, configuring an interface display code of the generic non-player character template, configuring a combat behavior code of the generic non-player character template, and configuring an attack and defense attribute code of the generic non-player character template, wherein the model resource code is used for representing visual size information of the target non-player character in a game scene, the interface display code is used for representing display content and a display path of the target non-player character in the game scene, the combat behavior code is used for representing battle information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used for representing fighting ability of the target non-player character in the game scene; and combining the model resource code, the interface display code, the combat behavior code and the attack and defense attribute code into the universal non-player character template.
Optionally, searching for a plurality of target service components matched with the service requirement information in the preset component library includes: determining a non-player character type matched with the service requirement information; searching at least one target business component matched with the non-player character type in a preset component library, wherein the target business component comprises the following components: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
Optionally, mounting the target service component to the universal non-player character template to generate a target non-player character, including: locating a designated directory file under a root directory in the script file of the universal non-player character template; and mounting the universal non-player character template and the target service component by taking the appointed directory file as a mounting point so as to generate a target non-player character.
Optionally, if the target non-player character is an ore non-player character, mounting the target service component to the general non-player character template to generate a target non-player character, including: configuring collection parameters of a collection component, wherein the collection parameters are used for representing the amount of virtual resources acquired by collecting the ore non-player character in a game scene; mounting the collection component to the generic non-player character template to generate an ore non-player character.
Optionally, if the target non-player character is an animal non-player character, mounting the target service component to the universal non-player character template to generate a target non-player character, including: the method comprises the steps of configuring acquisition parameters of an acquisition component and configuring action parameters of an AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the animal non-player character in a game scene, and the action parameters are used for representing the playing animation of the animal non-player character in the game scene;
mounting the acquisition component and the AI component to the generic non-player character template to generate an animal non-player character.
Optionally, if the target non-player character is a farm animal non-player character, mounting the target business component to the generic non-player character template to generate a target non-player character, including: configuring acquisition parameters of an acquisition component, configuring action parameters of an AI component and configuring livestock parameters of a livestock component, wherein the acquisition parameters are used for representing the virtual resource amount acquired by acquiring the livestock non-player character in a game scene, the action parameters are used for representing the playing animation of the livestock non-player character in the game scene, and the livestock parameters are used for representing the breeding area of the livestock non-player character in the game scene; mounting the acquisition component, the AI component, and the livestock component to the generic non-player character template to generate a livestock non-player character.
Optionally, after the target business component is mounted to the generic non-player character template to generate a target non-player character, the method further includes: after the target non-player character is triggered in a game scene, judging whether the life value of the target non-player character is lower than a first preset value and/or judging whether the distance between a player control character and the target non-player character is smaller than a second preset value; if the life value of the target non-player character is lower than a first preset value and/or the distance between the player control character and the target non-player character is smaller than a second preset value, generating auxiliary resources of the target non-player character, and distributing the auxiliary resources to the game account of the player control character.
Optionally, after the target business component is mounted to the generic non-player character template to generate a target non-player character, the method further includes: after the target non-player character is triggered in a game scene, detecting the switch state of a switch component of the target non-player character, wherein the switch component is used for controlling the start-stop state of a controlled component, and the controlled component comprises at least one of the following components: the target business component comprises the switch component and the controlled component; if the switch state of the switch component is the opening state, the logic code of the controlled component is operated; and if the switching state of the switching component is the off state, the logic code of the controlled component is forbidden to run.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, which has instructions stored therein, and when the instructions are executed on a computer, the instructions cause the computer to execute the data processing method of the risk level in any one of the above embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for risk-level data processing as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (12)

1. A method for generating a non-player character, comprising:
configuring a generic non-player character template, wherein the generic non-player character template contains the basic logic of all non-player character types, and the generic non-player character template encapsulates the logic codes of a plurality of generic services;
searching a plurality of target service components matched with service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a non-player role of one type, and each service component encapsulates a logic code corresponding to a service;
and mounting the target business component to the universal non-player character template to generate a target non-player character.
2. The method of claim 1, wherein configuring a generic non-player character template comprises:
configuring a model resource code of the generic non-player character template, configuring an interface display code of the generic non-player character template, configuring a combat behavior code of the generic non-player character template, and configuring an attack and defense attribute code of the generic non-player character template, wherein the model resource code is used for representing visual size information of the target non-player character in a game scene, the interface display code is used for representing display content and a display path of the target non-player character in the game scene, the combat behavior code is used for representing battle information and skill gain information of the target non-player character in the game scene, and the attack and defense attribute code is used for representing fighting ability of the target non-player character in the game scene;
and combining the model resource code, the interface display code, the combat behavior code and the attack and defense attribute code into the universal non-player character template.
3. The method of claim 1, wherein searching a preset component library for a number of target business components matching the business requirement information comprises:
determining a non-player character type matched with the service requirement information;
searching at least one target business component matched with the non-player character type in a preset component library, wherein the target business component comprises the following components: a collection component, a home component, a building component, a pet capture component, a pickup component, a treasure box component, an Artificial Intelligence (AI) component, a carrier component, a trigger component, a switch component, a blocking component, a vestige component, a livestock component, a puzzle solving component, an interaction component, a non-player character service component.
4. The method of claim 1, wherein mounting the target business component to the generic non-player character template to generate a target non-player character comprises:
locating a designated directory file under a root directory in the script file of the universal non-player character template;
and mounting the universal non-player character template and the target service component by taking the appointed directory file as a mounting point so as to generate a target non-player character.
5. The method of claim 1, wherein mounting the target business component to the generic non-player character template to generate a target non-player character if the target non-player character is an ore non-player character, comprises:
configuring collection parameters of a collection component, wherein the collection parameters are used for representing the amount of virtual resources acquired by collecting the ore non-player character in a game scene;
mounting the collection component to the generic non-player character template to generate an ore non-player character.
6. The method of claim 1, wherein mounting the target business component to the generic non-player character template to generate a target non-player character if the target non-player character is an animal non-player character, comprises:
the method comprises the steps of configuring acquisition parameters of an acquisition component and configuring action parameters of an AI component, wherein the acquisition parameters are used for representing the amount of virtual resources acquired by acquiring the animal non-player character in a game scene, and the action parameters are used for representing the playing animation of the animal non-player character in the game scene;
mounting the acquisition component and the AI component to the generic non-player character template to generate an animal non-player character.
7. The method of claim 1, wherein mounting the target business component to the generic non-player character template to generate a target non-player character if the target non-player character is a stock non-player character, comprises:
configuring acquisition parameters of an acquisition component, configuring action parameters of an AI component and configuring livestock parameters of a livestock component, wherein the acquisition parameters are used for representing the virtual resource amount acquired by acquiring the livestock non-player character in a game scene, the action parameters are used for representing the playing animation of the livestock non-player character in the game scene, and the livestock parameters are used for representing the breeding area of the livestock non-player character in the game scene;
mounting the acquisition component, the AI component, and the livestock component to the generic non-player character template to generate a livestock non-player character.
8. The method of claim 1, wherein after mounting the target business component to the generic non-player character template to generate a target non-player character, the method further comprises:
after the target non-player character is triggered in a game scene, judging whether the life value of the target non-player character is lower than a first preset value and/or judging whether the distance between a player control character and the target non-player character is smaller than a second preset value;
if the life value of the target non-player character is lower than a first preset value and/or the distance between the player control character and the target non-player character is smaller than a second preset value, generating auxiliary resources of the target non-player character, and distributing the auxiliary resources to the game account of the player control character.
9. The method of claim 1, wherein after mounting the target business component to the generic non-player character template to generate a target non-player character, the method further comprises:
after the target non-player character is triggered in a game scene, detecting the switch state of a switch component of the target non-player character, wherein the switch component is used for controlling the start-stop state of a controlled component, and the controlled component comprises at least one of the following components: the target business component comprises the switch component and the controlled component;
if the switch state of the switch component is the opening state, the logic code of the controlled component is operated; and if the switching state of the switching component is the off state, the logic code of the controlled component is forbidden to run.
10. An apparatus for generating a non-player character, comprising:
a configuration module configured to configure a generic non-player character template, wherein the generic non-player character template contains basic logic of all non-player character types, and the generic non-player character template encapsulates logic codes of a plurality of generic services;
the searching module is used for searching a plurality of target service components matched with the service demand information in a preset component library, wherein the preset component library comprises a plurality of service components, each service component corresponds to a type of non-player role, and each service component encapsulates a logic code corresponding to a service;
and the mounting module is used for mounting the target service component to the universal non-player role template so as to generate a target non-player role.
11. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 9 when executed.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 9.
CN202011183808.XA 2020-10-29 2020-10-29 Method and device for generating non-player character, storage medium and electronic equipment Pending CN112245924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011183808.XA CN112245924A (en) 2020-10-29 2020-10-29 Method and device for generating non-player character, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011183808.XA CN112245924A (en) 2020-10-29 2020-10-29 Method and device for generating non-player character, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112245924A true CN112245924A (en) 2021-01-22

Family

ID=74269020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011183808.XA Pending CN112245924A (en) 2020-10-29 2020-10-29 Method and device for generating non-player character, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112245924A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965716A (en) * 2021-02-01 2021-06-15 北京三快在线科技有限公司 Page processing method and device, electronic equipment and readable storage medium
CN114119835A (en) * 2021-12-03 2022-03-01 北京冰封互娱科技有限公司 Hard surface model processing method and device and electronic equipment
TWI796933B (en) * 2021-02-05 2023-03-21 大陸商騰訊科技(深圳)有限公司 Message display method, device, electronic apparatus, computer readable storage medium, and computer program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100029382A1 (en) * 2008-07-22 2010-02-04 Sony Online Entertainment Llc System and method for providing persistent character personalities in a simulation
CN102810061A (en) * 2012-05-18 2012-12-05 北京像素软件科技股份有限公司 Method for editing non-player-controlled character
CN105561578A (en) * 2015-12-11 2016-05-11 北京像素软件科技股份有限公司 NPC behavior decision method
CN109285208A (en) * 2018-09-29 2019-01-29 吉林动画学院 Virtual role expression cartooning algorithm based on expression dynamic template library
CN110052031A (en) * 2019-04-11 2019-07-26 网易(杭州)网络有限公司 The imitation method, apparatus and readable storage medium storing program for executing of player
CN110780960A (en) * 2019-09-29 2020-02-11 中至数据集团股份有限公司 Webpage making method and system, readable storage medium and server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100029382A1 (en) * 2008-07-22 2010-02-04 Sony Online Entertainment Llc System and method for providing persistent character personalities in a simulation
CN102810061A (en) * 2012-05-18 2012-12-05 北京像素软件科技股份有限公司 Method for editing non-player-controlled character
CN105561578A (en) * 2015-12-11 2016-05-11 北京像素软件科技股份有限公司 NPC behavior decision method
CN109285208A (en) * 2018-09-29 2019-01-29 吉林动画学院 Virtual role expression cartooning algorithm based on expression dynamic template library
CN110052031A (en) * 2019-04-11 2019-07-26 网易(杭州)网络有限公司 The imitation method, apparatus and readable storage medium storing program for executing of player
CN110780960A (en) * 2019-09-29 2020-02-11 中至数据集团股份有限公司 Webpage making method and system, readable storage medium and server

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965716A (en) * 2021-02-01 2021-06-15 北京三快在线科技有限公司 Page processing method and device, electronic equipment and readable storage medium
TWI796933B (en) * 2021-02-05 2023-03-21 大陸商騰訊科技(深圳)有限公司 Message display method, device, electronic apparatus, computer readable storage medium, and computer program product
CN114119835A (en) * 2021-12-03 2022-03-01 北京冰封互娱科技有限公司 Hard surface model processing method and device and electronic equipment
CN114119835B (en) * 2021-12-03 2022-11-08 北京冰封互娱科技有限公司 Hard surface model processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN112245924A (en) Method and device for generating non-player character, storage medium and electronic equipment
WO2021244322A1 (en) Method and apparatus for aiming at virtual object, device, and storage medium
CN103838982A (en) Virtual game object generating method and device
CN104050353A (en) Effectuating Modifications Within An Instance Of Virtual Space Responsive To Detection Of A Token
CN108970117A (en) Dissemination method, terminal device and the medium of game resource packet
US20230326115A1 (en) Bullet screen comment display method and apparatus, bullet screen comment sending method and apparatus, computer device, computer-readable storage medium, and computer program product
CN108970116A (en) Virtual role control method and device
CN108228251B (en) Method and device for controlling target object in game application
CN111544889B (en) Behavior control method and device of virtual object and storage medium
CN111558221B (en) Virtual scene display method and device, storage medium and electronic equipment
CN107172501A (en) Recommend methods of exhibiting and system in a kind of live room
CN112691384B (en) Virtual article information sending method, virtual article information display device and terminal
US20230065576A1 (en) Battle settlement interface display method, apparatus, device, and storage medium
WO2023000877A1 (en) Interface display method and apparatus, device, and storage medium
CN107648854B (en) Game classification method and device and electronic equipment
CN111898037A (en) Method and device for updating ranking list data and server
CN111228813B (en) Virtual object control method, device, equipment and storage medium
CN107609065B (en) A kind of game classification method, apparatus and electronic equipment
CN112802164B (en) Method and device for realizing animation state machine, storage medium and electronic device
CN112619146A (en) Virtual resource allocation method and device, storage medium and electronic device
CN111265870A (en) Control method and device of virtual operation object and storage medium
CN112084044A (en) Event processing method in system and related device
CN114885199B (en) Real-time interaction method, device, electronic equipment, storage medium and system
CN114047918A (en) Task processing method, device, equipment, storage medium and product
CN111318016B (en) Map element display method and device, storage medium and electronic device

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