Game activity generation method and apparatus, server, server cluster, and medium
By using a random number table and mapping table to generate monthly events in an MMORPG game server cluster, the problem of inconsistent monthly events between servers is solved, achieving both randomness and consistency in events, and improving novelty and operational efficiency.
Patent Information
- Application Number
- CN202411877741.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-12-19
AI Technical Summary
In MMORPG games, current technology cannot guarantee that the monthly activities of each server are consistent in the same month, and the configuration operation is cumbersome and prone to errors.
In the server cluster, each server stores the same random number table and mapping table. Random parameters are calculated using a random number seed, and monthly activities are generated by selecting activity identifiers to ensure randomness and consistency for the same month in different years.
It enhances the novelty of game activities for players, simplifies the process of configuring and maintaining monthly activities, and improves the efficiency of generating game activities.
Smart Images

Figure CN119792909B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the game technical field, and in particular to a game activity generation method and device, a server, a server cluster and a medium. BACKGROUND
[0002] In MMORPG (Massively Multiplayer Online Role-Playing Game, large multiplayer online role-playing game), a game activity is refreshed every month, and this game activity is called a monthly activity. There are two ways to configure the monthly activity in the server at present: the first way is to pre-configure a fixed monthly activity in each server every month. However, this way will cause the same month to be the same game activity all the time, which will make the players lack of freshness. Moreover, if the game activity is modified, the configuration needs to be manually modified, which will cause tedious operation and is prone to errors. The second way is to configure multiple monthly activities in each server, and then randomly select one from the multiple monthly activities as the monthly activity of the current month in each server. However, this way cannot guarantee that the monthly activities of the same month in each server are consistent. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a game activity generation method and device, a server, a server cluster and a medium.
[0004] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0005] In the first aspect, the present application provides a game activity generation method applied to each server in a server cluster, each server storing the same random number table and mapping table, the random number table including a random number seed corresponding to each month, and the mapping table including an index value corresponding to each activity identifier, the game activity generation method comprising:
[0006] According to the current month, a corresponding random number seed is obtained from the random number table to obtain an initial random number seed;
[0007] According to the current year and the initial random number seed, a target random number seed is determined, and a random parameter is calculated according to the target random number seed; the value range of the random parameter is the same as the range of the index value;
[0008] An index value same as the value of the random parameter is taken as a target index value, and according to the target index value, a corresponding activity identifier is obtained from the mapping table to obtain a target activity identifier;
[0009] Based on the target activity identifier, a game activity is generated and taken as the monthly activity of the current month.
[0010] In an optional embodiment, each server stores the same start time in the format of year-month-day-hour-minute-second; and each random number seed is a different reference time in the format of month-day-hour-minute-second, wherein the month is consistent with the corresponding month;
[0011] The step of determining the target random number seed according to the current year and the initial random number seed comprises:
[0012] Obtaining the initial random number seed to obtain an initial reference time;
[0013] Combining the current year and the initial reference time to obtain a target time; the target time is in the format of year-month-day-hour-minute-second;
[0014] Calculating a time difference according to the target time and the start time, and taking the time difference as the target random number seed.
[0015] In an optional embodiment, the step of calculating a random parameter according to the target random number seed comprises:
[0016] Dividing the time difference by the total number of all activity identifiers, and taking the remainder as the value of the random parameter.
[0017] In an optional embodiment, the mapping table is a hash table, which stores the index value corresponding to each activity identifier by key-value pairs, wherein the index value is the key and the activity identifier is the value.
[0018] The step of obtaining a target activity identifier from the mapping table according to the target index value comprises:
[0019] Performing a hash operation based on the target index value to obtain a target hash code;
[0020] Obtaining a target activity identifier from the hash table according to the target hash code.
[0021] In an optional embodiment, each activity identifier has a corresponding activity content table.
[0022] The step of generating a game activity based on the target activity identifier and taking it as the monthly regular activity of the current month comprises:
[0023] Obtaining the activity content table corresponding to the target activity identifier to obtain a target activity content table;
[0024] Generating a game activity according to the target activity content table, and taking the game activity as the monthly regular activity of the current month.
[0025] In a second aspect, the present application provides a game activity generation device applied to each server in a server cluster, each of the servers storing a same random number table and a mapping table, the random number table including a random number seed corresponding to each month, and the mapping table including a plurality of activity identifiers each corresponding to an index value, the game activity generation device including:
[0026] an obtaining module configured to obtain a corresponding random number seed from the random number table according to a current month to obtain an initial random number seed;
[0027] determine a target random number seed according to the current year and the initial random number seed, and calculate a random parameter according to the target random number seed, the random parameter having a same range of values as the index value;
[0028] a selecting module configured to select an index value same as a value of the random parameter as a target index value, and obtain a corresponding activity identifier from the mapping table according to the target index value to obtain a target activity identifier;
[0029] a generating module configured to generate a game activity based on the target activity identifier and as a monthly activity of the current month.
[0030] In an optional implementation, each of the servers stores a same start time, the start time being in a format of year-month-day-hour-minute-second, each of the random number seeds being a reference time, the reference time being in a format of month-day-hour-minute-second and having a same month as the corresponding month, and the obtaining module is further configured to:
[0031] obtain the initial random number seed to obtain an initial reference time;
[0032] combine the current year and the initial reference time to obtain a target time, the target time being in a format of year-month-day-hour-minute-second;
[0033] calculate a time difference according to the target time and the start time, and use the time difference as the target random number seed.
[0034] In a third aspect, the present application provides a server including a processor and a memory, the memory storing a computer program, and the processor implementing a game activity generation method according to any one of the preceding embodiments when executing the computer program.
[0035] In a fourth aspect, the present application provides a server cluster including the server according to the preceding embodiments.
[0036] In a fifth aspect, the present application provides a storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the game activity generation method in any one of the preceding embodiments.
[0037] The game activity generation method, device, server, server cluster and medium provided by the present application, each server in the server cluster stores the same random number table and mapping table, the random number table includes a random number seed corresponding to each month, and the mapping table includes index values corresponding to a plurality of activity identifiers. The method comprises the following steps: first, obtaining the random number seed corresponding to the current month from the random number table to obtain an initial random number seed; then determining a target random number seed according to the current year and the initial random number seed, and calculating a random parameter according to the target random number seed, the value range of the random parameter being the same as the range of the index value; then taking the index value with the same value as the random parameter as a target index value, and obtaining the target activity identifier from the mapping table according to the target index value; and finally generating a game activity based on the target activity identifier as the monthly activity of the current month. Through the simple activity selection method, the monthly activity of the same month in different years of the same server is random, and the monthly activity of each server in the same month is consistent. Thus, the freshness of the game activity for the player is improved, the operation process of configuring and maintaining the monthly activity is simplified, and the efficiency of generating the game activity is improved.
[0038] In order to make the above objectives, characteristics and advantages of the present application more apparent, clear and easy to understand, the following preferred embodiments are specifically described below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0040] Figure 1 Fig. 1 shows a block schematic diagram of a server provided by an embodiment of the present application;
[0041] Figure 2 Fig. 2 shows a flowchart of a game activity generation method provided by an embodiment of the present application;
[0042] Figure 3 Fig. 3 shows another flowchart of a game activity generation method provided by an embodiment of the present application;
[0043] Figure 4Fig. 1 shows a function block diagram of the game activity generation device according to an embodiment of the present application.
[0044] Fig. 1 shows a function block diagram of the game activity generation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0046] Therefore, the detailed description of the embodiments of the present application provided in the accompanying drawings below is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0047] It should be noted that the relational terms such as "first" and "second" and the like are used only to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations exist in any such actual relationship or order. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus including the element.
[0048] Please refer to Figure 1 Fig. 1 shows a function block diagram of the game activity generation device according to an embodiment of the present application.
[0049] The processor 110 is configured to read / write data or programs stored in the memory 120 and perform corresponding functions, and can be a general processor including a CPU (Central Processing Unit), a NP (Network Processor), etc., a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0050] The memory 120 is configured to store programs or data. The memory 120 can be a RAM (Random Access Memory), a ROM (Read Only Memory), a PROM (Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0051] The communication module 130 is configured to perform signaling or data communication with other devices.
[0052] It can be understood that, Figure 1 The structure shown is only a structural schematic diagram of the server 100, and the server 100 can further include more or less components than those shown in the figures, or have a different configuration from that shown in the figures. Figure 1 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 1 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 1 The components shown in the figures can be implemented in hardware, software or a combination thereof.
[0053] The server 100 described above will be taken as an execution subject to perform each step in each method provided by the embodiments of the present application, and to achieve the corresponding technical effects.
[0054] Please refer to Figure 2 is a flow schematic diagram of a game activity generation method provided by the embodiments of the present application.
[0055] In step S202, an initial random number seed is obtained according to a corresponding random number seed in a random number table according to the current month.
[0056] In step S204, a target random number seed is determined according to the current year and the initial random number seed, and a random parameter is calculated according to the target random number seed; the value range of the random parameter is the same as the range of the index value.
[0057] It should be noted that the execution process of each server of the server cluster in the embodiment of the application is similar, and for the sake of brevity, the embodiment of the application is described by taking one server as an example.
[0058] In the embodiment, each server in the server cluster stores the same random number table and mapping table. The random number table includes a random number seed corresponding to each month, and the random number seed can be understood as an initial value for generating a random number; and the mapping table includes an index value corresponding to each activity identifier, that is, each type of activity has a corresponding index value.
[0059] The server can obtain the random number seed corresponding to the current month from the pre-stored random number table, and then obtain the initial random number seed. Then, the target random number seed is determined according to the current year and the initial random number seed, and the random parameter is calculated according to the target random number seed, and the value range of the random parameter is the same as the range of the index value.
[0060] It can be understood that, since the random number table in each server is the same, the initial random number seed obtained by each server in the same month is the same, and then the target random number seed is determined based on the current year and the initial random number seed, so that the random number seed of each server in the same month in the same year is the same, and the random number seed of the same month in different years is different.
[0061] In step S206, the index value same as the value of the random parameter is taken as the target index value, and the target activity identifier is obtained from the mapping table according to the target index value.
[0062] In step S208, the game activity is generated based on the target activity identifier and is taken as the monthly activity of the current month.
[0063] In the embodiment, since the value range of the random parameter is the same as the range of the index value, the index value same as the value of the random parameter can be taken as the target index value. Then, the target activity identifier is obtained from the mapping table according to the target index value, and then the target activity identifier is obtained. Then, the game activity is generated based on the target activity identifier, and is taken as the monthly activity of the current month.
[0064] It can be understood that, in the above manner, the random number seed used by one server in the same month in different years can be different, so that the value of the random parameter calculated based on the random number seed has randomness, and the selected activity identifier also has randomness, so that the monthly regular activity in the same month in different years can have randomness, thereby improving the freshness of the game activity for the player. Moreover, the random number seed used by all servers in the same month in the same year can be the same, so that the value of the random parameter calculated by each server based on the random number seed is the same, and the selected activity identifier is also the same, thereby ensuring that the monthly regular activity in the same month is consistent among all servers.
[0065] It can be seen that based on the above steps, first, the corresponding random number seed is obtained from the random number table according to the current month to obtain an initial random number seed; then the target random number seed is determined according to the current year and the initial random number seed, and the random parameter is calculated according to the target random number seed, the value range of the random parameter is the same as the range of the index value; then the index value with the same value as the random parameter is taken as the target index value, and the corresponding activity identifier is obtained from the mapping table according to the target index value to obtain the target activity identifier; finally, the game activity based on the target activity identifier is generated and taken as the monthly regular activity of the current month. Through the simple activity selection method, the monthly regular activity of the same server in the same month in different years has randomness, and the monthly regular activity of each server in the same month is consistent. Thus, the freshness of the game activity for the player is improved, the configuration and maintenance operation process of the monthly regular activity is simplified, and the efficiency of generating the game activity is improved.
[0066] Alternatively, for the process of determining the target random number seed according to the current year and the initial random number seed in step S204, the present embodiment provides a possible implementation manner, please refer to Figure 3 .
[0067] In step S204-1, the initial random number seed is obtained to obtain an initial reference time.
[0068] In step S204-3, the current year and the initial reference time are combined to obtain a target time; the format of the target time is year-month-day-hour-minute-second.
[0069] In step S204-5, the time difference is calculated according to the target time and the start time, and the time difference is taken as the target random number seed.
[0070] In the present embodiment, each server stores the same start time, and the format of the start time is year-month-day-hour-minute-second; each random number seed is a different reference time, and the format of the reference time is month-day-hour-minute-second and the month is consistent with the corresponding month. The start time can be the start time stamp of the operating system of the server, such as the Unix system.
[0071] For ease of understanding, an example is provided in the embodiments of the present application. For example, the starting time stored by each server is January 1, 1970, 00:00:00. It is assumed that the current month is January, and the random number seed corresponding to January is January 1, 05:05:00.
[0072] The random number seed corresponding to the current month is obtained, the initial random number seed is obtained, that is, the initial reference time, that is, January 1, 05:05:00. Then, the current year, such as 2024, is combined with the initial reference time to obtain the target time, that is, January 1, 2024, 05:05:00. Then, the time difference between the target time, that is, January 1, 2024, 05:05:00, and the starting time, that is, January 1, 1970, 00:00:00, is calculated, and the time difference is 1704085500 seconds, which is taken as the target random number seed.
[0073] It should be understood that the starting time and the random number seed corresponding to each month, that is, the reference time, can be set according to actual conditions, and the embodiments of the present application are not limited thereto.
[0074] Optionally, for the process of calculating the random parameter according to the target random number seed in step S204, the embodiments of the present application provide a possible implementation manner, please continue to refer to Figure 3 .
[0075] Step S204-7, divide the time difference by the total number of all activity identifiers, and take the remainder of the two as the value of the random parameter.
[0076] In the present embodiment, the total number of activity identifiers and the value range of the index value have the following relationship: the total number of activity identifiers is m, and the value range of the index value is a positive integer in [0, m-1].
[0077] For ease of understanding, the above example is continued to be described. For example, it is assumed that there are 9 types of activities, that is, there are 9 activity identifiers, and the value range of the index value is a positive integer in [0, 8], that is, 0, 1, 2, 3, 4, 5, 6, 7 and 8. Based on the target random number seed obtained above, that is, 1704085500, divide by the total number of all activity identifiers, that is, 9, and take the remainder of the two as the value of the random parameter, then the value of the random parameter is 3. Then, the index value 3 is taken as the target index value, and the target activity identifier is selected based on the target index value. It should be understood that the total number of activity identifiers can be set according to actual conditions, and the embodiments of the present application are not limited thereto.
[0078] It can be understood that the embodiment of the application sets the value range of the index value through the total number of the activity identifiers, and obtains the random parameter by performing a remainder operation on the target random seed and the total number of the activity identifiers. Thus, the value range of the random parameter is ingeniously made the same as the range of the index value, and the activity identifier can be selected based on the value of the random parameter. That is, the random selection of the activity is realized in a simple way, the generation efficiency of the game activity is improved, and the calculation resources of the server are saved.
[0079] Optionally, for the process of obtaining the target activity identifier from the mapping table according to the target index value in step S206, the embodiment of the application provides an implementation manner.
[0080] In step S206-1, the target hash code is obtained by performing a hash operation based on the target index value.
[0081] In step S206-3, the target activity identifier is obtained by obtaining the corresponding activity identifier from the hash table according to the target hash code.
[0082] In the embodiment, the mapping table can be a hash table (HashMap), which stores the index value corresponding to each activity identifier in the form of a key-value pair (Key-Value). The index value is the key (Key), and the activity identifier is the value (Value).
[0083] For ease of understanding, the above example is continued to be described. For example, based on the obtained target index value 3, a hash operation is performed on the target index value 3 to obtain a target hash code. The target hash code represents the position of the key-value pair with the target index value 3 as the key (Key) in the hash table. Then, based on the target hash code, the key-value pair can be taken out from the corresponding position in the hash table, and the value (Value) in the key-value pair can be obtained, so as to obtain the activity identifier corresponding to the target index value 3, that is, the target activity identifier.
[0084] It can be understood that the embodiment of the application records the mapping relationship between the activity identifier and the index value through the hash table, which can realize fast access and thus improve the generation efficiency of the game activity.
[0085] Optionally, for step S208, the embodiment of the application provides a possible implementation manner.
[0086] In step S208-1, the target activity content table is obtained by obtaining the activity content table corresponding to the target activity identifier.
[0087] In step S208-3, the game activity is generated according to the target activity content table, and the game activity is taken as the monthly regular activity of the current month.
[0088] It can be understood that each activity identifier has a corresponding activity content table, and the activity content table includes an activity name, an activity description such as a participation method, a participation condition, and the like, an activity time including a start time and an end time, and an activity reward such as in-game currency, a prop, an experience value, and a title. It should be understood that the specific information in the activity content table can be set according to actual conditions, and the embodiments of the present application are not limited in this regard.
[0089] In the present embodiment, based on the obtained target activity identifier, the corresponding activity content table can be obtained to obtain a target activity content table. Then, a game activity is generated according to the target activity content table, and the game activity is used as a monthly activity of the current month.
[0090] In order to perform the corresponding steps in the above embodiments and various possible manners, an implementation manner of a game activity generation device is given below. Please refer to Figure 4 is a functional module diagram of the game activity generation device 300 provided by the embodiments of the present application. It should be noted that the game activity generation device 300 provided by the present embodiment has the same basic principles and technical effects as the above embodiments, and for brief description, the present embodiment is not mentioned in the above embodiments. The corresponding content can be referred to. The game activity generation device 300 includes:
[0091] The obtaining module 310 is configured to obtain a corresponding random number seed from the random number table according to the current month to obtain an initial random number seed, determine a target random number seed according to the current year and the initial random number seed, and calculate a random parameter according to the target random number seed. The value range of the random parameter is the same as the range of the index value.
[0092] The selecting module 330 is configured to take an index value with the same value as the random parameter as a target index value, and obtain a target activity identifier from the mapping table according to the target index value.
[0093] The generating module 350 is configured to generate a game activity based on the target activity identifier and use the game activity as a monthly activity of the current month.
[0094] Optionally, the obtaining module 310 is further configured to obtain the initial random number seed to obtain an initial reference time, combine the current year and the initial reference time to obtain a target time, the format of the target time is year-month-day-hour-minute-second, calculate a time difference according to the target time and the start time, and take the time difference as the target random number seed.
[0095] Optionally, the obtaining module 310 is further configured to divide the time difference by the total number of all activity identifiers, and take the remainder of the two as the value of the random parameter.
[0096] Optionally, the selecting module 330 is further configured to perform a hash operation based on the target index value to obtain a target hash code; and obtain the target activity identifier from the hash table according to the target hash code.
[0097] Optionally, the generating module 350 is further configured to obtain a target activity content table corresponding to the target activity identifier to obtain a target activity content table; and generate a game activity according to the target activity content table, and take the game activity as a monthly regular activity of the current month.
[0098] The embodiment of the present application further provides a server, comprising a processor and a memory, the memory stores a computer program, and the processor implements the game activity generation method disclosed by the embodiment of the present application when executing the computer program.
[0099] The embodiment of the present application further provides a server cluster, comprising the server provided by the embodiment of the present application.
[0100] The embodiment of the present application further provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the game activity generation method disclosed by the embodiment of the present application.
[0101] In several embodiments provided by the present application, it should be understood that the disclosed device and method can also be implemented by other manners. The device embodiment described above is only schematic, for example, the flow chart and block diagram in the drawings show the possible implementation architecture, function and operation of the device, method and computer program product according to the embodiments of the present application. In this regard, each block in the flow chart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that, in some alternative implementation manners, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flow chart, and the combination of blocks in the block diagram and / or flow chart, can be implemented by a special hardware-based system for implementing the specified function or action, or can be implemented by a combination of special hardware and computer instructions.
[0102] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0103] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0104] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating game activities, characterized in that, This is applied to each server in a server cluster. Each server stores the same start time, random number table, and mapping table. The random number table includes a random number seed corresponding to each month. The mapping table includes index values corresponding to multiple activity identifiers. The start time is in the format of year, month, day, hour, minute, and second. Each random number seed is a different reference time. The reference time is in the format of month, day, hour, minute, and second, and the month is consistent with the corresponding month. The method for generating game activities includes: Based on the current month, obtain the corresponding random number seed from the random number table to obtain the initial random number seed; Obtain the initial random number seed to get the initial reference time; The target time is obtained by combining the current year with the initial reference time; the target time is in the format of year, month, day, hour, minute, and second. Calculate the time difference based on the target time and the start time, and use the time difference as the target random number seed; Divide the time difference by the total number of all activity identifiers, and use the remainder as the value of the random parameter; the range of the random parameter is the same as the range of the index value. The index value that is the same as the value of the random parameter is used as the target index value, and the corresponding activity identifier is obtained from the mapping table according to the target index value to obtain the target activity identifier; Game activities are generated based on the target activity identifier and used as monthly regular activities for the current month.
2. The game activity generation method according to claim 1, characterized in that, The mapping table is a hash table, which stores the index value corresponding to each activity identifier through key-value pairs, where the index value is the key and the activity identifier is the value. The step of obtaining the target activity identifier from the mapping table based on the target index value includes: The target hash code is obtained by performing a hash operation based on the target index value; Based on the target hash code, the corresponding activity identifier is obtained from the hash table to obtain the target activity identifier.
3. The game activity generation method according to claim 1, characterized in that, Each activity icon has a corresponding activity content table; The step of generating a game activity based on the target activity identifier and using it as a monthly activity for the current month includes: Obtain the activity content table corresponding to the target activity identifier to obtain the target activity content table; Game activities are generated based on the target activity content table, and these game activities are designated as monthly regular activities for the current month.
4. A game activity generation device, characterized in that, This is applied to each server in a server cluster. Each server stores the same start time, random number table, and mapping table. The random number table includes a random number seed corresponding to each month. The mapping table includes index values corresponding to multiple activity identifiers. The start time is in the format of year, month, day, hour, minute, and second. Each random number seed is a different reference time. The reference time is in the format of month, day, hour, minute, and second, and the month is consistent with the corresponding month. The game activity generation device includes: The acquisition module is used to obtain the corresponding random number seed from the random number table according to the current month, and obtain the initial random number seed; Obtain the initial random number seed to get the initial reference time; The target time is obtained by combining the current year with the initial reference time; the target time is in the format of year, month, day, hour, minute, and second. Calculate the time difference based on the target time and the start time, and use the time difference as the target random number seed; Divide the time difference by the total number of all activity identifiers, and use the remainder as the value of the random parameter; the range of the random parameter is the same as the range of the index value. The selection module is used to select the index value that is the same as the value of the random parameter as the target index value, and obtain the corresponding activity identifier from the mapping table according to the target index value to obtain the target activity identifier; The generation module is used to generate game activities based on the target activity identifier and use them as monthly regular activities for the current month.
5. A server, characterized in that, It includes a processor and a memory, the memory storing a computer program, and when the processor executes the computer program, it implements the game activity generation method according to any one of claims 1 to 3.
6. A server cluster, characterized in that, Includes the server described in claim 5.
7. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the game activity generation method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Game configuration table reading method and device, storage medium and electronic equipment
CN112685413A
Method and system for determining random result in game, terminal equipment and server
CN114917591A