CN102035857B - Method for simulating group self-organization behaviors of multiple game characters - Google Patents

Method for simulating group self-organization behaviors of multiple game characters Download PDF

Info

Publication number
CN102035857B
CN102035857B CN 201010624447 CN201010624447A CN102035857B CN 102035857 B CN102035857 B CN 102035857B CN 201010624447 CN201010624447 CN 201010624447 CN 201010624447 A CN201010624447 A CN 201010624447A CN 102035857 B CN102035857 B CN 102035857B
Authority
CN
China
Prior art keywords
information
packet
data center
field
type
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.)
Active
Application number
CN 201010624447
Other languages
Chinese (zh)
Other versions
CN102035857A (en
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 Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software 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 Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN 201010624447 priority Critical patent/CN102035857B/en
Publication of CN102035857A publication Critical patent/CN102035857A/en
Application granted granted Critical
Publication of CN102035857B publication Critical patent/CN102035857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for simulating the group self-organization behaviors of multiple game characters, which comprises the following steps that: a game simulating system comprising a blackboard data center and at least two independent game character simulating terminals is preset; each game character simulating terminal in the game simulating system respectively establishes transmission control protocol (TCP) connection with the blackboard data center; and the game character simulating terminal performs group interaction with other game character simulating terminals in the game simulating system through the TCP connection with the blackboard data center and according to an interactive policy stored in the game character simulating terminal. By the method, the complicated group self-organization behaviors of a large number of game characters can be effectively simulated, and various requirements of a game test are met.

Description

A kind of method of simulating colony's self-organizing behavior of a plurality of game roles
Technical field
The present invention relates to network communications technology field, particularly a kind of method of simulating colony's self-organizing behavior of a plurality of game roles.
Background technology
In the development process of online game, often need to align the online game under development test of playing accordingly, with correctness and the stability of the systemic-function of authentication server or client.In the test process of online game, generally all wish to have the game role (be the game role that is operated by game user in the online game, also can be described as player role) of some levels to participate in test, to improve the accuracy of test.But, usually can't frequently and effectively organize on stream outside game user to participate in such game test, and the tester's of development company inside limited amount, the more player role of operation amount is finished test simultaneously.Under this condition, robot simulation's technology of a kind of simulation user operate game role is arisen at the historic moment.
In the prior art, more common implementation method is: set in advance a plurality of robots, a game role by the game user operation in online game is simulated respectively by each robot; Then, control simultaneously all robots by a control system, the state of each game role in the computing network game one by one, then according to result of calculation to each robot sending controling instruction, control each robot and move according to result of calculation, thereby finish test to online game.
But, in above-mentioned method, owing to be the group interaction management that in same control system, realizes between all robots, each robot is the group interaction order (being control command) of executive control system transmission passively, and can not carry out alternately with control system, and can not realize Interact and Exchange between the robot, therefore the behavior of the robot game role of simulating is stiff, lack otherness, can't produce groups' behavior between the game role of each simulation, therefore be difficult to simulate colony's self-organizing behavior (various interbehaviors in namely playing between each game role of the complexity between a large amount of game roles, for example, chat, form a team, fight side by side, marry etc.), thus be difficult to satisfy the needs that game is tested.In addition, in the said method in the prior art, the integrated level of above-mentioned control system is very high, is difficult for revising, and customizability is poor, therefore also can't satisfy changeable game function testing requirement.
Summary of the invention
In view of this, the invention provides a kind of method of simulating colony's self-organizing behavior of a plurality of game roles.By using said method, the various demands that game is tested are satisfied in the colony's self-organizing behavior that can simulate the complexity between a large amount of game roles.
According to above-mentioned purpose, technical scheme of the present invention is achieved in that
A kind of method of simulating colony's self-organizing behavior of a plurality of game roles, the method comprises:
Set in advance and comprise the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two;
Each game role pseudo-terminal in the described game analogue system is set up TCP with described blackboard data center respectively and is connected;
Described game role pseudo-terminal is connected by the TCP with described blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals in the described game analogue system.
Described and described blackboard data center sets up TCP and is connected and comprises:
Described blackboard data center when starting or afterwards, the port numbers A on the monitoring service device IP address;
Each game role pseudo-terminal sends the TCP connection request to preassigned server ip address and port numbers A when starting;
The TCP connection request that described blackboard data center receives according to the port numbers A from the server ip address of monitoring is set up TCP with the game role pseudo-terminal that sends described TCP connection request and is connected.
Described basis is stored in the interactive strategy in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals and comprises:
Described game role pseudo-terminal is connected the packet that carries operation information to the transmission of blackboard data center according to the interactive strategy that is stored in the described game role pseudo-terminal by the TCP with blackboard data center;
The type of received packet is known by analysis in described blackboard data center, and according to type and the operation information in the packet of packet the group interaction information of storing in the blackboard data center is operated.
Described game role pseudo-terminal is connected by the TCP with described blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals and comprise:
Described game role pseudo-terminal is connected to described blackboard data center by the TCP with blackboard data center and writes group interaction information;
Perhaps, described game role pseudo-terminal is connected from described blackboard data center by the TCP with blackboard data center and reads required group interaction information;
Perhaps, described game role pseudo-terminal is connected the deletion group interaction information from described blackboard data center by the TCP with blackboard data center.
Described game role pseudo-terminal is connected by the TCP with blackboard data center and writes group interaction information to described blackboard data center and comprise:
Described game role pseudo-terminal is connected by the TCP with blackboard data center, sends the writing information packet that carries group interaction information to described blackboard data center;
After described blackboard data center receives the said write information packet, know the type of said write information packet;
Described blackboard data center reads group interaction information from the said write information packet, and the group interaction information that reads is stored in the described blackboard data center.
At least comprise in the described group interaction information: information type, information index and the information content.
Comprise in the said write information packet: data package size field, type of data packet field, character string size field, information type field, information index size field, information index field, information cache size field, information cache field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type;
Described information cache size field is for the size that represents described information cache field;
Described information cache field is used for carrying group interaction information.
Described blackboard data center knows that the type of said write information packet comprises:
Described blackboard data center is according to the content of the type of data packet field in the said write information packet and data package size field, and the type of knowing this packet is the writing information packet.
Described blackboard data center reads group interaction information and comprises from the said write information packet:
Read group interaction information in information type field, information index field and the information cache field of described blackboard data center from the said write information packet.
The method further comprises:
An information type Hash mapping table and at least one information content Hash mapping table are set in described blackboard data center;
Wherein, described information type Hash mapping table is used for the information type of storage group interaction information, and described information content Hash mapping table is used for information index and the information content of storage group interaction information; Each bar record in the described information type Hash mapping table is corresponding to an information content Hash mapping table; Each bar record in the described information content Hash mapping table is corresponding to an information index and the information content corresponding with described information index.
Described blackboard data center is stored in the group interaction information that reads in the described blackboard data center and comprises:
Described blackboard data center searches corresponding information content Hash mapping table according to the information type in the group interaction information that reads from self canned data type Hash mapping table;
Corresponding information index is searched according to the information index in the described group interaction information by described blackboard data center from the information content Hash mapping table that finds, and uses the information content in the described group interaction information to replace the corresponding information content of information index that finds.
The method also further comprises:
When described blackboard data center fails to find corresponding information content Hash mapping table from information type Hash mapping table, described blackboard data center joins the information type in the group interaction information that reads in information type Hash mapping table, and according to the newly-built information content Hash mapping table of described information type; Information index in the group interaction information that reads and the information content are stored in the newly-built information content Hash mapping table.
The method also further comprises:
When described blackboard data center failed to find corresponding information index from the information content Hash mapping table that finds, described blackboard data center added the information index in the group interaction information that reads and the information content in the described information content Hash mapping table that finds to.
Described game role pseudo-terminal is connected by the TCP with blackboard data center and reads required group interaction information from described blackboard data center and comprise:
Described game role pseudo-terminal is connected by the TCP with blackboard data center, sends the reading information packet to described blackboard data center;
After described blackboard data center receives described reading information packet, know the type of described reading information packet;
Described blackboard data center is according to described reading information packet, from the group interaction information of storing, read the required group interaction information of game role pseudo-terminal, and the return information Packet Generation that will carry the group interaction information that reads is to some extent given this game role pseudo-terminal;
Described game role pseudo-terminal obtains required group interaction information from the return information packet that receives.
At least comprise in the described reading information packet: information type, information content and information index.
Comprise in the described reading information packet: data package size field, type of data packet field, character string size field, information type field, information content field, information index size field, information index field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information content field represents the quantity n of the required group interaction information that reads;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type.
Described blackboard data center knows that the type of described reading information packet comprises:
Described blackboard data center is according to the content of the type of data packet field in the described reading information packet and data package size field, and the type of knowing this packet is the reading information packet.
Described blackboard data center is according to described reading information packet, from the group interaction information of storing, read the required group interaction information of game role pseudo-terminal, and the return information Packet Generation that will carry the group interaction information that reads to some extent comprises for this game role pseudo-terminal:
Described blackboard data center parses information type, information index and the information content of the required group interaction information that reads from described reading information packet;
Described blackboard data center searches corresponding information content Hash mapping table according to the described information type that parses from self canned data type Hash mapping table;
Described blackboard data center is according to the described information index that parses and information content, from the information content Hash mapping table that finds, read group interaction information, and the group interaction information that reads is carried at sends to this game role pseudo-terminal in the return information packet.
The method further comprises:
When described blackboard data center did not find corresponding information content Hash mapping table, it was 0 return information packet that described blackboard data center sends the group interaction information that reads to described game role pseudo-terminal.
Described blackboard data center is according to the described information index that parses and information content, from the information content Hash mapping table that finds, read group interaction information, and the group interaction information that reads is carried at sends to this game role pseudo-terminal in the return information packet and comprise:
When the described information content n that parses>0,
Described blackboard data center reads the record that the n bar comprises information index and the corresponding information content thereof from the information content Hash mapping table that finds, and the record that reads is carried at sends to this game role pseudo-terminal in the return information packet;
Wherein, if the sum of the record in the described information content Hash mapping table less than n, then described blackboard data center reads all records in the described information content Hash mapping table;
When the described information content n that parses is 0,
The information content corresponding with the described information index that parses will be searched by described blackboard data center from the information content Hash mapping table that finds;
When finding the information content corresponding with the information index that parses, blackboard data center reads this information content, and the information content that this reads is carried at sends to the game role pseudo-terminal in the return information packet; Otherwise it is 0 return information packet that described blackboard data center sends the group interaction information that reads to described game role pseudo-terminal.
At least comprise in the described return information packet: information type, information content, information index and the information content.
Comprise in the described return information packet: data package size field, type of data packet field, character string size field, information type field, information content field, information index size field, information index field, information cache size field, information cache field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information content field represents the quantity n of the required group interaction information that reads;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type;
Described information cache size field is for the size that represents described information cache field;
Described information cache field is used for carrying group interaction information;
Wherein, when n>0, then will comprise n information index size field, a n information index field, a n information cache size field and n information cache field in the described return information packet, represent respectively entrained n bar group interaction information.
Described game role pseudo-terminal obtains required group interaction information and comprises from the return information packet that receives:
Described game role pseudo-terminal is according to the content of the type of data packet field in the received return information packet and data package size field, and the type of knowing this packet is the return information packet;
Parse information index and the information content of information content and required each bar group interaction information in information content field, information index field and the information cache field of described game role pseudo-terminal from described return information packet.
The method also further comprises:
Described game role pseudo-terminal stores the group interaction information of obtaining in the information array into.
Described game role pseudo-terminal is connected from described blackboard data center deletion group interaction information by the TCP with blackboard data center and comprises:
Described game role pseudo-terminal is connected by the TCP with described blackboard data center, sends the deletion information packet of the group interaction information that carries required deletion to described blackboard data center;
After described blackboard data center receives described deletion information packet, know the type of this deletion information packet;
Described blackboard data center parses information type and the information index of the group interaction information of required deletion from described deletion information packet;
Described blackboard data center is according to the information type of resolving and information index, the group interaction information of the required deletion of deletion from the group interaction information of storing.
At least comprise in the described deletion information packet: information type, information index and the information content.
Comprise in the described deletion information packet: data package size field, type of data packet field, character string size field, information type field, information index size field, information index field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type.
After described blackboard data center receives described deletion information packet, know that the type of this deletion information packet comprises:
Described blackboard data center knows that according to the content of the type of data packet field in the described deletion information packet and data package size field the type of this packet is the deletion information packet.
Described blackboard data center parses the group interaction information of required deletion from described deletion information packet information type and information index comprise:
Described blackboard data center from described deletion information packet the information type field and the information index field in read information type and the information index of the group interaction information of required deletion.
Described blackboard data center is according to the information type of resolving and information index, and the group interaction information of the above-mentioned required deletion of deletion comprises from the group interaction information of storing:
Described blackboard data center searches corresponding information content Hash mapping table according to the information type of resolving from self canned data type Hash mapping table;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find corresponding information content Hash mapping table, then the information content corresponding with the information index of resolving will be searched by blackboard data center from the information content Hash mapping table that finds;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find the corresponding information content, then the information content that finds will be deleted by blackboard data center from the above-mentioned information content Hash mapping table that finds.
As from the foregoing, the invention provides a kind of method of simulating colony's self-organizing behavior of a plurality of game roles, because in the method, comprise the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two with setting in advance, and each game role pseudo-terminal will be set up TCP with blackboard data center respectively and be connected, then, described game role pseudo-terminal is connected by the TCP with blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carry out group interaction with other game role pseudo-terminals, thereby can effectively simulate colony's self-organizing behavior of the complexity between a large amount of game roles, satisfy the various demands of game test.
Description of drawings
Fig. 1 is the method flow diagram of colony's self-organizing behavior of a plurality of game roles of simulation of the present invention.
Fig. 2 is the structure information storage schematic diagram of blackboard data center among the present invention.
Embodiment
In order to make the purpose, technical solutions and advantages of the present invention clearer, below lift specific embodiment and with reference to accompanying drawing, the present invention is described in more detail.
The invention provides a kind of method of simulating colony's self-organizing behavior of a plurality of game roles, in the method, comprise the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two with setting in advance, and each game role pseudo-terminal will be set up transmission control protocol (TCP) with blackboard data center respectively and be connected, then, described game role pseudo-terminal is connected by the TCP with blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carry out group interaction with other game role pseudo-terminals, thereby can effectively simulate colony's self-organizing behavior of the complexity between a large amount of game roles, satisfy the various demands of game test.
Fig. 1 is the method flow diagram of colony's self-organizing behavior of a plurality of game roles of simulation of the present invention.As shown in Figure 1, the method for colony's self-organizing behavior of a plurality of game roles of described simulation comprises step as described below:
Step 101 sets in advance and comprises the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two.
In this step, will set in advance a game analogue system, in this game analogue system, comprise independently game role pseudo-terminal of a blackboard data center and at least two.Wherein, each game role pseudo-terminal is simulated respectively a game role by the game user operation in online game.
Step 102, each game role pseudo-terminal is set up TCP with blackboard data center respectively and is connected.
In this step, each the game role pseudo-terminal in the described game analogue system will be set up TCP with blackboard data center respectively and be connected.For example, in specific embodiments of the invention, the process that the above-mentioned TCP of foundation connects can comprise step as described below:
1.1) blackboard data center when starting or afterwards, the port numbers A on the monitoring service device IP address.
Specifically, when blackboard data center starts or afterwards, this blackboard data center will monitor the port numbers A on the server ip address.
1.2) each game role pseudo-terminal when starting, all will send the TCP connection request to preassigned server ip address and port numbers A;
Wherein, above-mentioned server ip address and port numbers A will when the game role pseudo-terminal starts, specify and send to this game role pseudo-terminal by system or user by the mode of command line parameter.
1.3) TCP connection request that blackboard data center receives according to the port numbers A from the server ip address of monitoring, set up TCP with the game role pseudo-terminal that sends described TCP connection request and be connected.
Step 103, the game role pseudo-terminal is connected by the TCP with blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals.
When blackboard data center and game role pseudo-terminal are set up after TCP is connected, game role pseudo-terminal in the described game analogue system can carry out transfer of data with blackboard data center by this TCP connection, namely connect to blackboard data center by this TCP and send information write request, information deletion request and/or information read requests, and pass through the data that this TCP connects the transmission of reception blackboard data center, thereby other game role pseudo-terminals in realization and the described game analogue system carry out group interaction.
Therefore, in this step, above-mentioned basis is stored in the interactive strategy in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals and can be:
The game role pseudo-terminal is connected the packet that carries operation information to the transmission of blackboard data center according to the interactive strategy that is stored in the described game role pseudo-terminal by the TCP with blackboard data center;
The type of received packet is known by analysis in blackboard data center, and according to type and the operation information in the packet of packet the group interaction information of storing in the blackboard data center is operated.
Specifically, according to the interactive strategy that is stored in the described game role pseudo-terminal, carry out group interaction with other game role pseudo-terminals and can be:
The game role pseudo-terminal is connected to blackboard data center by the TCP with blackboard data center and writes corresponding group interaction information;
Perhaps, the game role pseudo-terminal is connected from blackboard data center by the TCP with blackboard data center and reads required group interaction information;
Perhaps, the game role pseudo-terminal is connected from blackboard data center by the TCP with blackboard data center and deletes corresponding group interaction information.
Below will further introduce in the mode of specific embodiment.
Embodiment one,
In specific embodiments of the invention, above-mentioned game role pseudo-terminal is connected by the TCP with blackboard data center and writes corresponding group interaction information to blackboard data center and can comprise step as described below:
2.1) the game role pseudo-terminal is connected by the TCP with blackboard data center, sends the writing information packet that carries group interaction information to blackboard data center;
In this step, comprise at least in the described group interaction information: information type, information index and the information content.Wherein, information type and information index are character string types.
For example, in specific embodiments of the invention, the said write information packet can be used packet structure as shown in the table:
Field name Field size, type The field implication
Data package size (nPacketSize) 2 bytes, short The size of expression packet
Type of data packet (nCmd) 2 bytes, short The type of expression packet
Character string size (nTypeSize) 2 bytes, short The size of expression information type character string
Information type (szTypeName) NTypeSize byte, character string The expression information type
Information index size (nKeySize) 2 bytes, short The size of expression information index character string
Information index (szKeyName) The nKeySize byte, character string The information index of expression information
Information cache size (nValueSize) 2 bytes, short The size of expression information cache
Information cache (pValueBuffer) The nValueSize byte, buffering area Represent required information of carrying
Table 1
Wherein, the data package size in the above-mentioned table 1 (nPacketSize) field list shows the size of packet, can be used for cutting apart different message bags.The size of dissimilar packets can be not identical, therefore, all has this field in the packet of any type, can know the size of this packet by this field;
Type of data packet (nCmd) field, the type of expression packet all has this field in the packet of any type, can know the type of this packet by this field.For example, when the value of nCmd field is eMsgType_Write, represent that this packet is a kind of writing information packet;
Character string size (nTypeSize) field, the size of expression information type field;
Information type (szTypeName) field is a character string, and the expression information type is used for distinguishing different types of group interaction information;
Information index size (nKeySize) field, the size of expression information index field;
Information index (szKeyName) field is a character string, is used for distinguishing the information contents different under the same information type.For example, can be the name of the game role pseudo-terminal game role of simulating in the information index field, show that this packet is the information that is write by certain game role pseudo-terminal.In specific embodiments of the invention, the content of described information index field can be not limited to the name of game role pseudo-terminal.
Information cache size (nValueSize) field is for the size of expression information cache field;
Information cache (pValueBuffer) field is used for carrying concrete group interaction information.Group interaction information in this field does not have concrete call format, therefore, can fill arbitrarily required group interaction information of carrying in this field.
2.2) after blackboard data center receives the said write information packet, know the type of this writing information packet;
In this step, the type of this packet can be known according to the type of data packet field in this writing information packet in blackboard data center after receiving the said write information packet.For example, if use packet structure as shown in table 1, then blackboard data center can be according to the content of the type of data packet field in this writing information packet and data package size field, and the type of knowing this packet is the writing information packet.
2.3) blackboard data center reads group interaction information from the said write information packet;
In this step, if use packet structure as shown in table 1, then blackboard data center can read corresponding group interaction information in information type field, information index field and the information cache field from the writing information packet, and this group interaction information comprises: information type, information index and the information content.
2.4) blackboard data center is stored in the group interaction information that reads in the blackboard data center.
In specific embodiments of the invention, an information type Hash mapping table and at least one information content Hash mapping table are set in described blackboard data center.Wherein, information type Hash mapping table is used for the information type of storage group interaction information, and information content Hash mapping table is used for information index and the information content of storage group interaction information.
Fig. 2 is the structure information storage schematic diagram of blackboard data center among the present invention.As shown in Figure 2, each the bar record in the described information type Hash mapping table is all corresponding to an information content Hash mapping table; And each the bar record in the information content Hash mapping table is all corresponding to an information index and the information content corresponding with this information index.
Therefore, in this step, the group interaction information that blackboard data center can read it is stored in the blackboard data center.For example:
Blackboard data center can be first searches corresponding information content Hash mapping table according to the information type in the group interaction information that reads from self canned data type Hash mapping table;
Then, from the information content Hash mapping table that finds, search corresponding information index according to the information index in the group interaction information, and use the information content in the above-mentioned group interaction information to replace the corresponding information content of information index that finds.
In addition, when blackboard data center fails to find the corresponding information content Hash mapping table when (namely corresponding information content Hash mapping table does not exist) from information type Hash mapping table, then blackboard data center joins the information type in the group interaction information that reads in information type Hash mapping table, and according to the newly-built information content Hash mapping table of this information type; Information index in the described group interaction information and the information content are stored in the newly-built information content Hash mapping table.
In addition, when blackboard data center fails to find corresponding information index when (namely the information index of correspondence does not exist) from the information content Hash mapping table that finds, then blackboard data center adds the information index in the described group interaction information and the information content in the described information content Hash mapping table that finds to.
Embodiment two,
In specific embodiments of the invention, above-mentioned game role pseudo-terminal is connected by the TCP with blackboard data center and reads required group interaction information from blackboard data center and can comprise step as described below:
3.1) the game role pseudo-terminal is connected by the TCP with blackboard data center, sends the reading information packet to blackboard data center.
In this step, comprise at least in the described reading information packet: information type, information content and information index.Wherein, information type and information index are character string types.
For example, in specific embodiments of the invention, described reading information packet can use packet structure as shown in the table:
Field name Field size, type The field implication
Data package size (nPacketSize) 2 bytes, short The size of expression packet
Type of data packet (nCmd) 2 bytes, short The type of expression packet
Character string size (nTypeSize) 2 bytes, short The size of expression information type character string
Information type (szTypeName) NTypeSize byte, character string The expression information type
Information content (nCount) 2 bytes, short Expression information content n
Information index size (nKeySize) 2 bytes, short The size of expression information index character string
Information index (szKeyName) The nKeySize byte, character string The information index of expression information
Table 2
Wherein, the information content in the table 2 (nCount) field represents the quantity n of the required group interaction information that reads, and namely needs to read n bar group interaction information, and wherein n is nonnegative integer.The implication of the respective field in the table 2 in the implication of other fields and the table 1 is identical, does not repeat them here.
3.2) after blackboard data center receives described reading information packet, know the type of this reading information packet.
In this step, the type of this packet can be known according to the type of data packet field in this reading information packet in blackboard data center after receiving described reading information packet.For example, if use packet structure as shown in table 2, then blackboard data center can be according to the content of the type of data packet field in this reading information packet and data package size field, and the type of knowing this packet is the reading information packet.
3.3) blackboard data center is according to described reading information packet, from the group interaction information of storing, read the required group interaction information of game role pseudo-terminal, and the return information Packet Generation that will carry the group interaction information that reads is to some extent given this game role pseudo-terminal.
In this step, blackboard data center will at first parse information type, information index and the information content of the required group interaction information that reads from described reading information packet, then search corresponding information content Hash mapping table according to the described information type that parses from self canned data type Hash mapping table; Then according to the described information index that parses and information content, from the information content Hash mapping table that finds, read corresponding group interaction information, and the group interaction information that reads is carried at sends to this game role pseudo-terminal in the return information packet.
For example, blackboard data center can resolve information type, information index and the information content of the required group interaction information that reads from information type field, information index field and the information content field of described reading information packet, and searches corresponding information content Hash mapping table according to the described information type that parses from self canned data type Hash mapping table;
If do not find corresponding information content Hash mapping table, then blackboard data center to send the group interaction information that reads to described game role pseudo-terminal be 0 return information packet;
When the information content Hash mapping table that finds correspondence, and the described information content n that parses>0 o'clock, then blackboard data center will read the record that the n bar comprises information index and the corresponding information content thereof from the information content Hash mapping table that finds; If the sum of the record in the information content Hash mapping table, then reads all records in this information content Hash mapping table less than n; The record that reads is carried at sends to the game role pseudo-terminal in the return information packet.Wherein, blackboard data center can read the record that the n bar comprises information index and the corresponding information content thereof by any recording start from the information content Hash mapping table that finds continuously when reading n bar record.In addition, in the process that reads continuously said n bar record, when the last item when record in this information content Hash mapping table of being recorded as of reading, after reading this last item record, with article one recording start from this information content Hash mapping table, continue to read required record, until read n bar record or read all records in this information content Hash mapping table.
When finding corresponding information content Hash mapping table, and the described information content n that parses is 0 o'clock, and then the information content corresponding with the information index that parses will be searched by blackboard data center from the information content Hash mapping table that finds; When finding the information content corresponding with the information index that parses, blackboard data center reads this information content, and the information content that this reads is carried at sends to the game role pseudo-terminal in the return information packet; Otherwise the group interaction information that blackboard data center reads to described game role pseudo-terminal transmission is 0 return information packet.
Therefore, in this step, blackboard data center comprises in the return information packet of described game role pseudo-terminal transmission at least: information type, information content, information index and the information content.Wherein, information type and information index are character string types.
For example, in specific embodiments of the invention, described return information packet can use packet structure as shown in the table:
Field name Field size, type The field implication
Data package size (nPacketSize) 2 bytes, short The size of expression packet
Type of data packet (nCmd) 2 bytes, short The type of expression packet
Character string size (nTypeSize) 2 bytes, short The size of expression information type character string
Information type (szTypeName) NTypeSize byte, character string The expression information type
Information content (nCount) 2 bytes, short Expression information content n
Information index size [1] (nKeySize[1]) 2 bytes, short The size of expression information index character string
Information index [1] (szKeyName[1]) The nKeySize byte, character string The information index of expression information
Information cache size [1] (nValueSize[1]) 2 bytes, short The size of expression information cache
Information cache [1] (pValueBuffer[1]) The nValueSize byte, buffering area Represent required information of carrying
... ... ...
Information index size [n] (nKeySize[n]) 2 bytes, short The size of expression information index character string
Information index [n] (szKeyName[n]) The nKeySize byte, character string The information index of expression information
Information cache size [n] (nValueSize[n]) 2 bytes, short The size of expression information cache
Information cache [n] (pValueBuffer[n]) The nValueSize byte, buffering area Represent required information of carrying
Table 3
Wherein, the information content in the table 3 (nCount) field represents the information content n that reads namely to represent to have carried in this return information packet n bar group interaction information; When n=0, represent not carry group interaction information in this return information packet, can ignore other fields after the nCount field this moment; And when n>0, then in this return information packet, will comprise n nKeySize field, a n szKeyName field, a n nValueSize field and n pValueBuffer field, represent respectively entrained n bar group interaction information.The implication of the respective field in the implication of each field of other in the table 3 and table 1 and the table 2 is identical, does not repeat them here.
3.4) the game role pseudo-terminal from the return information packet that receives, obtain required group interaction information.
In this step, the game role pseudo-terminal can be known according to the type of data packet field in this return information packet the type of this packet after receiving described return information packet.
For example, if the return information packet uses packet structure as shown in table 3, then the game role pseudo-terminal can be according to the content of the type of data packet field in the return information packet that receives and data package size field, and the type of knowing this packet is the return information packet.
Then, the game role pseudo-terminal then can be from this return information packet obtains required group interaction information.For example, the game role pseudo-terminal parses information index and the information content of information content and required each bar group interaction information in can information content field, information index field and information cache field from receive described return information packet.
In addition, the game role pseudo-terminal also can store the group interaction information of obtaining in the information array.If the information content of the group interaction information of obtaining is 0, then this information array is empty.
After this, the game role pseudo-terminal can and be stored in interactive strategy in the described game role pseudo-terminal according to the group interaction information of obtaining, carry out various group interaction behaviors with other game role pseudo-terminal, thereby realize the group interaction between a plurality of game role pseudo-terminals.
Embodiment three,
In specific embodiments of the invention, above-mentioned game role pseudo-terminal is connected by the TCP with blackboard data center to be deleted corresponding group interaction information from blackboard data center and can comprise step as described below:
4.1) the game role pseudo-terminal is connected by the TCP with blackboard data center, sends the deletion information packet of the group interaction information that carries required deletion to blackboard data center;
In this step, comprise at least in the described deletion information packet: information type, information index and the information content.Wherein, information type and information index are character string types.
For example, in specific embodiments of the invention, described deletion information packet can be used packet structure as shown in the table:
Field name Field size, type The field implication
Data package size (nPacketSize) 2 bytes, short The size of expression packet
Type of data packet (nCmd) 2 bytes, short The type of expression packet
Character string size (nTypeSize) 2 bytes, short The size of expression information type character string
Information type (szTypeName) NTypeSize byte, character string The expression information type
Information index size (nKeySize) 2 bytes, short The size of expression information index character string
Information index (szKeyName) The nKeySize byte, character string The information index of expression information
Table 4
Wherein, the implication of the respective field in the above-mentioned table 4 in the implication of each field and table 1~3 is identical, does not repeat them here.
4.2) after blackboard data center receives described deletion information packet, know the type of this deletion information packet;
In this step, the type that type of data packet field in the information packet is known this packet can be deleted according to this by blackboard data center after receiving described deletion information packet.For example, if use packet structure as shown in table 4, then type of data packet field in the information packet and the content of data package size field can be deleted according to this by blackboard data center, know that the type of this packet is the deletion information packet.
4.3) blackboard data center parses information type and the information index of the group interaction information of required deletion from described deletion information packet;
In this step, if use packet structure as shown in table 4, then blackboard data center can from deletion the information packet the information type field and the information index field in read information type and the information index of the group interaction information of required deletion.
4.4) blackboard data center is according to the information type of resolving and information index, the group interaction information of the above-mentioned required deletion of deletion from the group interaction information of storing.
For example, in specific embodiments of the invention, blackboard data center can be first searches corresponding information content Hash mapping table according to the information type of resolving from self canned data type Hash mapping table;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find corresponding information content Hash mapping table, then the information content corresponding with the information index of resolving will be searched by blackboard data center from the information content Hash mapping table that finds;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find the corresponding information content, then the information content that finds will be deleted by blackboard data center from the above-mentioned information content Hash mapping table that finds.
Below, also will take concrete group interaction behavior as example, technical scheme of the present invention further be introduced.
Embodiment four, group interaction behavior are the concrete methods of realizing of the tourney between the game role.
In the game of reality, the tourney between each game role is a kind of important group interaction behavior.Below, will the realization of this group interaction behavior be described in detail.
In specific embodiments of the invention, the tourney operation between the described game role can comprise step as described below:
Step 1, the game role pseudo-terminal that needs to participate in tourney is connected by the TCP with blackboard data center, sends the writing information packet that carries tourney information to blackboard data center.
In this step, can comprise in the described writing information packet that carries tourney information: information type field, information index field and information content field.Wherein, the value of described information type field is match, represents that this group interaction behavior is tourney; The name of the game role that the value of information index field is simulated for this game role pseudo-terminal; First byte in the described information content field represents the grade of this game role, the occupation of its another this game role of byte representation.
Step 2, the game role pseudo-terminal that needs to participate in tourney is connected by the TCP with blackboard data center, sends the reading information packet that reads tourney information to blackboard data center.
In this step, can comprise in the described reading information packet that reads tourney information: information type field, information content field and information index field.Wherein, the value of described information type field is match; The name of the game role that the value of information index field is simulated for other game role pseudo-terminals or the content of desired seek; When the value n of information content field>0, can ignore the value of information index field; The value of described information content field can be the value (for example, 100) that sets in advance, and represents the quantity of the required tourney information that reads.
Step 3, the reading information packet that blackboard data center sends according to the game role pseudo-terminal, from the group interaction information of storing, read the required tourney information of this game role pseudo-terminal, and carry the return information packet of the tourney information that reads to some extent to this game role pseudo-terminal transmission.
Step 4, receive the return information packet of the tourney information that carries that blackboard data center sends when the game role pseudo-terminal after, if the quantity of tourney information is 0, process ends then; Otherwise, execution in step 5.
Step 5, the game role pseudo-terminal reads tourney information from the return information packet that carries tourney information, according to game role pseudo-terminal of the tourney Information Selection that reads, and to selected game role pseudo-terminal transmission tourney invitation.
Wherein, above-mentioned game role pseudo-terminal is when selecting to carry out the game role pseudo-terminal of tourney, read first the information such as name, grade and occupation of each game role pseudo-terminal in the tourney information from the return information packet, and select corresponding game role pseudo-terminal according to filtercondition.Wherein, described filtercondition can be: with the professional identical game role pseudo-terminal of self, and/or and self grade between difference more than or equal to 3 grades game role pseudo-terminal.Then, this game role pseudo-terminal can select a game role pseudo-terminal as the tourney object the game role pseudo-terminal after filtering, and sends tourney invitation to selected game role pseudo-terminal.
Step 6 is agreed to carry out tourney if receive the game role pseudo-terminal that tourney is invited, and then two game role pseudo-terminals will begin to carry out tourney, process ends; Carry out tourney if receive the game role pseudo-terminal refusal that tourney is invited, then execution in step 7.
Step 7, judge and whether do not send in addition the game role pseudo-terminal that tourney is invited in the game role pseudo-terminal after the above-mentioned filtration, if, then never sending in the game role pseudo-terminal that tourney invites selects a game role pseudo-terminal as the tourney object, and to selected game role pseudo-terminal transmission tourney invitation, return step 6; Otherwise, return execution in step 2.
By above-mentioned steps 1~7, can finish the tourney between each game role.
Embodiment five, group interaction behavior are the concrete methods of realizing of forming a team between the game role.
In the game of reality, forming a team between each game role also is a kind of important group interaction behavior.Below, will the realization of this group interaction behavior be described in detail.
In specific embodiments of the invention, forming a team between the described game role operates and can comprise step as described below:
Step 1 needs passive game role pseudo-terminal of forming a team to be connected by the TCP with blackboard data center, sends the writing information packet that carries self information to blackboard data center.
In this step, can comprise in the described writing information packet that carries self information: information type field, information index field and information content field.Wherein, the value of described information type field is group, represents that this group interaction behavior is to form a team; The name of the game role that the value of information index field is simulated for this game role pseudo-terminal; First byte in the described information content field represents the grade of this game role, the occupation of its another this game role of byte representation.
Step 2, the game role pseudo-terminal that requires initiatively to form a team is connected by the TCP with blackboard data center, sends the reading information packet that reads the information of forming a team to blackboard data center.
In this step, can comprise in the described reading information packet that reads the information of forming a team: information type field, information content field and information index field.Wherein, the value of described information type field is group; The name of the game role that the value of information index field is simulated for other game role pseudo-terminals or the content of desired seek; When the value n of information content field>0, can ignore the value of information index field; The value of described information content field can be the value (for example, 100) that sets in advance, and represents the quantity of the required information of forming a team that reads.
In specific embodiments of the invention, do not do any restriction for the execution sequence between above-mentioned steps 1 and the step 2.Described step 1 and step 2 can be carried out simultaneously, also can successively carry out.
Step 3, the reading information packet that the game role pseudo-terminal that blackboard data center initiatively forms a team as requested sends, from the group interaction information of storing, read the required information of forming a team of game role pseudo-terminal that this requirement is initiatively formed a team, and carry the return information packet of the information of forming a team that reads to some extent to the game role pseudo-terminal transmission that this requirement is initiatively formed a team.
Step 4, after the game role pseudo-terminal that requires initiatively to form a team receives the return information packet that carries the information of forming a team that blackboard data center sends, if the quantity of the information of forming a team is 0, process ends then; Otherwise, execution in step 5.
Step 5, the game role pseudo-terminal that requires initiatively to form a team reads the information of forming a team from the return information packet that carries the information of forming a team, according at least one the game role pseudo-terminal of Information Selection of forming a team that reads, and send to selected game role pseudo-terminal and to form a team to invite.
Wherein, the game role pseudo-terminal that above-mentioned requirements is initiatively formed a team is when selecting the game role pseudo-terminal of forming a team, read first the information such as name, grade and occupation of each game role pseudo-terminal in the information of forming a team from the return information packet, and select corresponding game role pseudo-terminal according to filtercondition.Wherein, described filtercondition can be: meet the professional ratio (for example, soldier 2 people, Master 2 people, doctor 2 people etc.) of standard troop, and grade than with the difference of the average angle colour gradation of the present troop game role pseudo-terminal less than 3 grades.Then, this game role pseudo-terminal selects can the game role pseudo-terminal after filtering a game role pseudo-terminal as forming a team object, and sends to selected game role pseudo-terminal and to form a team to invite.
Step 6 is agreed to form a team if receive the game role pseudo-terminal of forming a team to invite, and the game role pseudo-terminal of then this agreement being formed a team joins in the troop, execution in step 7; Form a team if receive the game role pseudo-terminal refusal of forming a team to invite, then direct execution in step 7.
Step 7 judges whether to finish to form a team, if so, and process ends then; Otherwise, execution in step 8.
Step 8, judge in the game role pseudo-terminal after the above-mentioned filtration and whether do not send in addition the game role pseudo-terminal of forming a team to invite, if, then never sent and select a game role pseudo-terminal as forming a team object in the game role pseudo-terminal of forming a team to invite, and send to selected game role pseudo-terminal and to form a team to invite, return step 6; Otherwise, return execution in step 2.
By above-mentioned steps 1~8, can finish forming a team between each game role.
By above-mentioned introduction as can be known, in the method for colony's self-organizing behavior of a plurality of game roles of above-mentioned simulation provided by the present invention, comprise the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two owing to will set in advance, and each game role pseudo-terminal will be set up TCP with blackboard data center respectively and be connected, then, described game role pseudo-terminal is connected by the TCP with blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carry out group interaction with other game role pseudo-terminals, thereby can be by the autonomy of robot, simulate better colony's self-organizing behavior of the complexity between a large amount of game roles, satisfy the various demands of game test.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of making within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (28)

1. the method for colony's self-organizing behavior of a plurality of game roles of simulation is characterized in that the method comprises:
Set in advance and comprise the independently game analogue system of game role pseudo-terminal of a blackboard data center and at least two;
Each game role pseudo-terminal in the described game analogue system is set up TCP with described blackboard data center respectively and is connected;
Described game role pseudo-terminal is connected by the TCP with described blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals in the described game analogue system;
Wherein, described and described blackboard data center sets up TCP and is connected and comprises:
Described blackboard data center when starting or afterwards, the port numbers A on the monitoring service device IP address;
Each game role pseudo-terminal sends the TCP connection request to preassigned server ip address and port numbers A when starting;
The TCP connection request that described blackboard data center receives according to the port numbers A from the server ip address of monitoring is set up TCP with the game role pseudo-terminal that sends described TCP connection request and is connected;
Wherein, described basis is stored in the interactive strategy in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals and comprises:
Described game role pseudo-terminal is connected the packet that carries operation information to the transmission of blackboard data center according to the interactive strategy that is stored in the described game role pseudo-terminal by the TCP with blackboard data center;
The type of received packet is known by analysis in described blackboard data center, and according to type and the operation information in the packet of packet the group interaction information of storing in the blackboard data center is operated.
2. the method for claim 1, it is characterized in that, described game role pseudo-terminal is connected by the TCP with described blackboard data center, and according to the interactive strategy that is stored in the described game role pseudo-terminal, carries out group interaction with other game role pseudo-terminals and comprise:
Described game role pseudo-terminal is connected to described blackboard data center by the TCP with blackboard data center and writes group interaction information;
Perhaps, described game role pseudo-terminal is connected from described blackboard data center by the TCP with blackboard data center and reads required group interaction information;
Perhaps, described game role pseudo-terminal is connected the deletion group interaction information from described blackboard data center by the TCP with blackboard data center.
3. method as claimed in claim 2 is characterized in that, described game role pseudo-terminal is connected by the TCP with blackboard data center and writes group interaction information to described blackboard data center and comprise:
Described game role pseudo-terminal is connected by the TCP with blackboard data center, sends the writing information packet that carries group interaction information to described blackboard data center;
After described blackboard data center receives the said write information packet, know the type of said write information packet;
Described blackboard data center reads group interaction information from the said write information packet, and the group interaction information that reads is stored in the described blackboard data center.
4. method as claimed in claim 3 is characterized in that, comprises at least in the described group interaction information: information type, information index and the information content.
5. method as claimed in claim 3, it is characterized in that, comprise in the said write information packet: data package size field, type of data packet field, character string size field, information type field, information index size field, information index field, information cache size field, information cache field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type;
Described information cache size field is for the size that represents described information cache field;
Described information cache field is used for carrying group interaction information.
6. method as claimed in claim 5 is characterized in that, described blackboard data center knows that the type of said write information packet comprises:
Described blackboard data center is according to the content of the type of data packet field in the said write information packet and data package size field, and the type of knowing this packet is the writing information packet.
7. method as claimed in claim 5 is characterized in that, described blackboard data center reads group interaction information and comprises from the said write information packet:
Read group interaction information in information type field, information index field and the information cache field of described blackboard data center from the said write information packet.
8. method as claimed in claim 5 is characterized in that, the method further comprises:
An information type Hash mapping table and at least one information content Hash mapping table are set in described blackboard data center;
Wherein, described information type Hash mapping table is used for the information type of storage group interaction information, and described information content Hash mapping table is used for information index and the information content of storage group interaction information; Each bar record in the described information type Hash mapping table is corresponding to an information content Hash mapping table; Each bar record in the described information content Hash mapping table is corresponding to an information index and the information content corresponding with described information index.
9. method as claimed in claim 8 is characterized in that, described blackboard data center is stored in the group interaction information that reads in the described blackboard data center and comprises:
Described blackboard data center searches corresponding information content Hash mapping table according to the information type in the group interaction information that reads from self canned data type Hash mapping table;
Corresponding information index is searched according to the information index in the described group interaction information by described blackboard data center from the information content Hash mapping table that finds, and uses the information content in the described group interaction information to replace the corresponding information content of information index that finds.
10. method as claimed in claim 9 is characterized in that, the method also further comprises:
When described blackboard data center fails to find corresponding information content Hash mapping table from information type Hash mapping table, described blackboard data center joins the information type in the group interaction information that reads in information type Hash mapping table, and according to the newly-built information content Hash mapping table of described information type; Information index in the group interaction information that reads and the information content are stored in the newly-built information content Hash mapping table.
11. method as claimed in claim 9 is characterized in that, the method also further comprises:
When described blackboard data center failed to find corresponding information index from the information content Hash mapping table that finds, described blackboard data center added the information index in the group interaction information that reads and the information content in the described information content Hash mapping table that finds to.
12. method as claimed in claim 2 is characterized in that, described game role pseudo-terminal is connected by the TCP with blackboard data center and reads required group interaction information from described blackboard data center and comprise:
Described game role pseudo-terminal is connected by the TCP with blackboard data center, sends the reading information packet to described blackboard data center;
After described blackboard data center receives described reading information packet, know the type of described reading information packet;
Described blackboard data center is according to described reading information packet, from the group interaction information of storing, read the required group interaction information of game role pseudo-terminal, and the return information Packet Generation that will carry the group interaction information that reads is to some extent given this game role pseudo-terminal;
Described game role pseudo-terminal obtains required group interaction information from the return information packet that receives.
13. method as claimed in claim 12 is characterized in that, comprises at least in the described reading information packet: information type, information content and information index.
14. method as claimed in claim 13, it is characterized in that, comprise in the described reading information packet: data package size field, type of data packet field, character string size field, information type field, information content field, information index size field, information index field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information content field represents the quantity n of the required group interaction information that reads;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type.
15. method as claimed in claim 14 is characterized in that, described blackboard data center knows that the type of described reading information packet comprises:
Described blackboard data center is according to the content of the type of data packet field in the described reading information packet and data package size field, and the type of knowing this packet is the reading information packet.
16. method as claimed in claim 14, it is characterized in that, described blackboard data center is according to described reading information packet, from the group interaction information of storing, read the required group interaction information of game role pseudo-terminal, and the return information Packet Generation that will carry the group interaction information that reads to some extent comprises for this game role pseudo-terminal:
Described blackboard data center parses information type, information index and the information content of the required group interaction information that reads from described reading information packet;
Described blackboard data center searches corresponding information content Hash mapping table according to the described information type that parses from self canned data type Hash mapping table;
Described blackboard data center is according to the described information index that parses and information content, from the information content Hash mapping table that finds, read group interaction information, and the group interaction information that reads is carried at sends to this game role pseudo-terminal in the return information packet.
17. method as claimed in claim 16 is characterized in that, the method further comprises:
When described blackboard data center did not find corresponding information content Hash mapping table, it was 0 return information packet that described blackboard data center sends the group interaction information that reads to described game role pseudo-terminal.
18. method as claimed in claim 16, it is characterized in that, described blackboard data center is according to the described information index that parses and information content, from the information content Hash mapping table that finds, read group interaction information, and the group interaction information that reads is carried at sends to this game role pseudo-terminal in the return information packet and comprise:
As the described information content n that parses〉0 the time,
Described blackboard data center reads the record that the n bar comprises information index and the corresponding information content thereof from the information content Hash mapping table that finds, and the record that reads is carried at sends to this game role pseudo-terminal in the return information packet;
Wherein, if the sum of the record in the described information content Hash mapping table less than n, then described blackboard data center reads all records in the described information content Hash mapping table;
When the described information content n that parses is 0,
The information content corresponding with the described information index that parses will be searched by described blackboard data center from the information content Hash mapping table that finds;
When finding the information content corresponding with the information index that parses, blackboard data center reads this information content, and the information content that this reads is carried at sends to the game role pseudo-terminal in the return information packet; Otherwise it is 0 return information packet that described blackboard data center sends the group interaction information that reads to described game role pseudo-terminal.
19. method as claimed in claim 12 is characterized in that, comprises at least in the described return information packet: information type, information content, information index and the information content.
20. method as claimed in claim 19, it is characterized in that, comprise in the described return information packet: data package size field, type of data packet field, character string size field, information type field, information content field, information index size field, information index field, information cache size field, information cache field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information content field represents the quantity n of the required group interaction information that reads;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type;
Described information cache size field is for the size that represents described information cache field;
Described information cache field is used for carrying group interaction information;
Wherein, as n〉0 the time, then will comprise n information index size field, a n information index field, a n information cache size field and n information cache field in the described return information packet, represent respectively entrained n bar group interaction information.
21. method as claimed in claim 20 is characterized in that, described game role pseudo-terminal obtains required group interaction information and comprises from the return information packet that receives:
Described game role pseudo-terminal is according to the content of the type of data packet field in the received return information packet and data package size field, and the type of knowing this packet is the return information packet;
Parse information index and the information content of information content and required each bar group interaction information in information content field, information index field and the information cache field of described game role pseudo-terminal from described return information packet.
22. method as claimed in claim 21 is characterized in that, the method also further comprises:
Described game role pseudo-terminal stores the group interaction information of obtaining in the information array into.
23. method as claimed in claim 2 is characterized in that, described game role pseudo-terminal is connected from described blackboard data center deletion group interaction information by the TCP with blackboard data center and comprises:
Described game role pseudo-terminal is connected by the TCP with described blackboard data center, sends the deletion information packet of the group interaction information that carries required deletion to described blackboard data center;
After described blackboard data center receives described deletion information packet, know the type of this deletion information packet;
Described blackboard data center parses information type and the information index of the group interaction information of required deletion from described deletion information packet;
Described blackboard data center is according to the information type of resolving and information index, the group interaction information of the required deletion of deletion from the group interaction information of storing.
24. method as claimed in claim 23 is characterized in that, comprises at least in the described deletion information packet: information type, information index and the information content.
25. method as claimed in claim 24 is characterized in that, comprises in the described deletion information packet: data package size field, type of data packet field, character string size field, information type field, information index size field, information index field; Wherein,
Described data package size field, the size of expression packet;
Described type of data packet field, the type of expression packet;
Described character string size field, the size of expression information type field;
Described information type field, the expression information type is used for distinguishing different types of group interaction information;
Described information index size field, the size of expression information index field;
Described information index field is used for distinguishing the information contents different under the same information type.
26. method as claimed in claim 25 is characterized in that, after described blackboard data center receives described deletion information packet, knows that the type of this deletion information packet comprises:
Described blackboard data center knows that according to the content of the type of data packet field in the described deletion information packet and data package size field the type of this packet is the deletion information packet.
27. method as claimed in claim 25 is characterized in that, described blackboard data center parses the group interaction information of required deletion from described deletion information packet information type and information index comprise:
Described blackboard data center from described deletion information packet the information type field and the information index field in read information type and the information index of the group interaction information of required deletion.
28. method as claimed in claim 25 is characterized in that, described blackboard data center is according to the information type of resolving and information index, and the group interaction information of the above-mentioned required deletion of deletion comprises from the group interaction information of storing:
Described blackboard data center searches corresponding information content Hash mapping table according to the information type of resolving from self canned data type Hash mapping table;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find corresponding information content Hash mapping table, then the information content corresponding with the information index of resolving will be searched by blackboard data center from the information content Hash mapping table that finds;
If do not find corresponding information content Hash mapping table, then stop to carry out follow-up step;
If find the corresponding information content, then the information content that finds will be deleted by blackboard data center from the above-mentioned information content Hash mapping table that finds.
CN 201010624447 2010-12-31 2010-12-31 Method for simulating group self-organization behaviors of multiple game characters Active CN102035857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010624447 CN102035857B (en) 2010-12-31 2010-12-31 Method for simulating group self-organization behaviors of multiple game characters

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010624447 CN102035857B (en) 2010-12-31 2010-12-31 Method for simulating group self-organization behaviors of multiple game characters

Publications (2)

Publication Number Publication Date
CN102035857A CN102035857A (en) 2011-04-27
CN102035857B true CN102035857B (en) 2013-10-16

Family

ID=43888180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010624447 Active CN102035857B (en) 2010-12-31 2010-12-31 Method for simulating group self-organization behaviors of multiple game characters

Country Status (1)

Country Link
CN (1) CN102035857B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102820976A (en) * 2012-07-31 2012-12-12 苏州松之林网络科技有限公司 Method for automatically creating team channel
CN105279031B (en) * 2015-11-20 2020-06-26 腾讯科技(深圳)有限公司 Information processing method and system
CN105760308B (en) * 2016-03-31 2018-09-14 网易(杭州)网络有限公司 Multi-client cooperates with test method and device
CN110474900B (en) * 2019-08-13 2021-11-02 腾讯科技(深圳)有限公司 Game protocol testing method and device
CN110928791B (en) * 2019-11-27 2022-03-01 腾讯科技(深圳)有限公司 Program testing method, program testing device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076113A (en) * 1997-04-11 2000-06-13 Hewlett-Packard Company Method and system for evaluating user-perceived network performance
CN1540547A (en) * 2003-10-27 2004-10-27 �Ϻ���ŵ���簲ȫ������չ�ɷ����޹� Controlling method for accessing networked games and method of charging
CN101336441A (en) * 2005-12-22 2008-12-31 Pkr有限公司 Improvement of on-line game
CN101408913A (en) * 2007-07-30 2009-04-15 Jg游戏控股有限公司 Video game for interactive engagement between multiple on-line participants in competition over internet websites
CN100487636C (en) * 2006-06-09 2009-05-13 中国科学院自动化研究所 Game control system and method based on stereo vision

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076113A (en) * 1997-04-11 2000-06-13 Hewlett-Packard Company Method and system for evaluating user-perceived network performance
CN1540547A (en) * 2003-10-27 2004-10-27 �Ϻ���ŵ���簲ȫ������չ�ɷ����޹� Controlling method for accessing networked games and method of charging
CN101336441A (en) * 2005-12-22 2008-12-31 Pkr有限公司 Improvement of on-line game
CN100487636C (en) * 2006-06-09 2009-05-13 中国科学院自动化研究所 Game control system and method based on stereo vision
CN101408913A (en) * 2007-07-30 2009-04-15 Jg游戏控股有限公司 Video game for interactive engagement between multiple on-line participants in competition over internet websites

Also Published As

Publication number Publication date
CN102035857A (en) 2011-04-27

Similar Documents

Publication Publication Date Title
CN102035857B (en) Method for simulating group self-organization behaviors of multiple game characters
US7537523B2 (en) Dynamic player groups for interest management in multi-character virtual environments
US7457737B2 (en) System and method for simulating network connection characteristics
CN104731896B (en) A kind of data processing method and system
CN105930121B (en) The person's handwriting synchronous method and system of multi-client
CN108460041A (en) The treating method and apparatus of data
CN108205577A (en) A kind of array structure, the method, apparatus and electronic equipment of array inquiry
CN100388690C (en) Automatic testing system and method for command of command line interface of data communication apparatus
US6935960B2 (en) Server for mapping application names to tag values in distributed multi-user application
CN110413595A (en) A kind of data migration method and relevant apparatus applied to distributed data base
CN108132868A (en) A kind of data monitoring method, device, computing device and storage medium
AU2001296187A1 (en) Server for mapping application names to tag values in distributed multi-user application
CN107145673A (en) A kind of combined simulation system and method
CN103326925A (en) Message push method and device
CN106874392A (en) The method and apparatus that the index storage of audient's user profile and advertising message are delivered
CN104202398A (en) Remote control method, device and system
CN101783742B (en) Discovery method and device of network topology
CN108521456A (en) Network establishment contest system based on block chain
CN108418752A (en) A kind of creation method and device of aggregation group
CN106776014A (en) Parallel acceleration method and system in Heterogeneous Computing
CN106878052A (en) A kind of customer shift method and device
CN107404440A (en) A kind of forwarding-table item sending method, message forwarding method and device
CN109597577A (en) A kind of method, system and relevant apparatus handling NVME agreement read write command
CN108345699A (en) Obtain the method, apparatus and storage medium of multi-medium data
CN106512410A (en) Data processing method and device for interacting with off-line players and server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant