Virtual article storage method and device in game and electronic equipment
By introducing a virtual item storage method in the game, and determining the target subspace using shape parameters and unit subspace state parameters, the problem of difficulty in storing non-rectangular shape items in the prior art is solved, and the game experience is improved.
Patent Information
- Application Number
- CN202411129803.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-02-07
AI Technical Summary
In existing games, grid backpack systems have difficulty storing items in non-rectangular shapes, resulting in poor player gaming experience.
By introducing a virtual item storage method in the game, the number of unit subspaces occupied by the item and the relative position of the item is determined using shape parameters, and the target subspace is determined based on these parameters and unit subspace state parameters, so as to realize the storage of various shape items.
It enriches the expression of items in the virtual storage space, improves the player's gaming experience, and can store virtual items of various shapes.
Smart Images

Figure CN119386458A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game technology, and in particular to a method, device and electronic device for storing virtual items in a game. Background Art
[0002] In the game, the grid backpack is a common backpack form, providing an intuitive and flexible way to manage items. There are usually two forms of items placed in the grid backpack. The first is that the items do not have a grid shape, and all items occupy a fixed grid in the backpack. The second is that different types of items have different shapes, and the shapes of the items are composed of grids. One item can occupy multiple grids in the grid backpack.
[0003] In the related art, the shape of an item is usually represented as a rectangle, and the width and height are recorded in grid units. By simply modifying the width and height of the item, and then calculating according to the size of the grid unit and the coordinates of the lower left corner of the item in the grid backpack, the item can be quickly and conveniently loaded into the grid backpack. The above method limits the backpack to only rectangular items of different widths and heights, and it is difficult to store other special-shaped items. The display form is single, which limits the design of the backpack gameplay and the presentation of the items, making the player's gaming experience poor. Summary of the invention
[0004] In view of this, the purpose of the present disclosure is to provide a method, device and electronic device for storing virtual items in games, so as to store virtual items of various shapes through virtual storage space, enrich the expression form of items in the virtual storage space, and improve the game experience of players.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for storing virtual items in a game, providing a graphical user interface through a terminal device; the graphical user interface displays a preset virtual storage space; the virtual storage space includes multiple adjacent unit subspaces; the unit subspace has corresponding state parameters; the state parameters are used to indicate whether the unit subspace is occupied by a virtual item; the method includes: in response to a storage trigger event for a first virtual item, determining a shape parameter of the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces; based on the shape parameter of the first virtual item and the state parameters of the multiple unit subspaces, determining a target subspace among the multiple unit subspaces; storing the first virtual item in the target subspace, and displaying the first virtual item in a display area of the target subspace in the graphical user interface.
[0006] In a second aspect, an embodiment of the present disclosure provides a virtual item storage device in a game, which provides a graphical user interface through a terminal device; the graphical user interface displays a preset virtual storage space; the virtual storage space includes multiple adjacent unit subspaces; the unit subspace has corresponding state parameters; the state parameters are used to indicate whether the unit subspace is occupied by a virtual item; the device includes: a shape parameter determination module, which is used to determine the shape parameter of the first virtual item in response to a storage trigger event for the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces; a target subspace determination module, which is used to determine a target subspace among multiple unit subspaces based on the shape parameter of the first virtual item and the state parameters of the multiple unit subspaces; an item storage module, which is used to store the first virtual item in the target subspace, and display the first virtual item in the display area of the target subspace in the graphical user interface.
[0007] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for storing virtual items in the game.
[0008] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method for storing virtual items in the game.
[0009] The embodiments of the present invention bring the following beneficial effects:
[0010] The above-mentioned method, device and electronic device for storing virtual items in a game determine the shape parameters of the first virtual item in response to a storage trigger event for the first virtual item; the shape parameters are used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces; based on the shape parameters of the first virtual item and the state parameters of the multiple unit subspaces, determine the target subspace among the multiple unit subspaces; store the first virtual item in the target subspace, and display the first virtual item in the display area of the target subspace in the graphical user interface. In this method, the virtual item has shape parameters, and virtual items of various shapes can be defined by the shape parameters. By matching the shape parameters of the virtual item with the unit subspace in the virtual storage space, virtual items of various shapes can be stored, which enriches the expression form of the items in the virtual storage space and improves the game experience of the players.
[0011] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0012] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0014] Figure 1 A flowchart of a method for storing virtual items in a game provided by an embodiment of the present disclosure;
[0015] Figure 2 A schematic diagram of a graphical user interface provided by an embodiment of the present disclosure;
[0016] Figure 3 A schematic diagram of another graphical user interface provided by an embodiment of the present disclosure;
[0017] Figure 4 A schematic diagram of another graphical user interface provided by an embodiment of the present disclosure;
[0018] Figure 5 A schematic diagram of the shape of a virtual item provided in an embodiment of the present disclosure;
[0019] Figure 6 A schematic diagram of another graphical user interface provided by an embodiment of the present disclosure;
[0020] Figure 7 A schematic diagram of the shape of another virtual item provided in an embodiment of the present disclosure;
[0021] Figure 8 A schematic diagram of another graphical user interface provided by an embodiment of the present disclosure;
[0022] Fig. 9 A schematic diagram of another graphical user interface provided by an embodiment of the present disclosure;
[0023] Fig.10 A schematic diagram of the structure of a virtual item storage device in a game provided by an embodiment of the present disclosure;
[0024] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0026] In the game, the grid backpack is a common form of backpack, providing an intuitive and flexible way to manage items. The grid backpack interface consists of a two-dimensional grid, and each grid can be regarded as a sub-storage space. The number of rows and columns of the backpack grid may be fixed, or it may change as the backpack capacity increases. The grid cells can store items, and players can manage these items through operations such as dragging and dropping. There are two forms of items placed in the grid backpack. The first is that the items do not have a grid shape, and all items are fixed to occupy a grid in the backpack. The second is that different types of items have different shapes, and the shapes of the items are composed of grids as units. One item can occupy multiple grids in the grid backpack.
[0027] The implementation of the grid backpack system usually involves the following aspects: grid layout, item management, user interaction, and visual feedback. The details are as follows:
[0028] 1. Grid layout: The backpack interface consists of a fixed number of rows and columns, and the size of each grid unit is fixed. Then use UI controls to create a grid layout.
[0029] 2. Item management: Item data items use classes or structures to represent item type, icon and other attribute information, and are stored in a list or dictionary.
[0030] 3. User Interaction:
[0031] (1) Drag and drop operation:
[0032] a. Drag start: When the user clicks and drags an item, record the initial position of the item.
[0033] b. Dragging: The item icon moves with the mouse.
[0034] c. End of dragging: Determine whether the target position is valid and update the item position.
[0035] b) Click operation: Click to select an item and highlight it.
[0036] 4. Visual feedback:
[0037] (2) Selection effect: When a user selects an item, a highlight or border effect is used as a visual prompt.
[0038] (3) Valid position prompt: When dragging an item, it prompts whether the target position is valid.
[0039] In the related art, the shape of the items is represented as a rectangle, and the width and height are recorded in grid units. By simply modifying the width and height of the item, and then calculating according to the size of the grid unit and the coordinates of the lower left corner of the item in the grid backpack, the item can be quickly and conveniently loaded into the grid backpack. In addition, the UI control of the item instance is used as the response control for the event when dragging and clicking to select the item, so that you only need to focus on the logic of the item when operating the item.
[0040] The above method has certain defects. The way of representing the shape of items limits the technology to only processing rectangular items of different widths and heights, and it is difficult to represent non-rectangular shaped items (such as L-shaped and T-shaped). When responding to touch events with the UI control of the item instance, since the touch response area of the UI control can only be rectangular, non-rectangular shaped items are stacked in the backpack, and the touch response areas of different items overlap and it is impossible to determine the item that the player needs to select, which further limits the shape representation of the item.
[0041] Based on this, the embodiments of the present disclosure provide a method, device and electronic device for storing virtual items in a game. The technology can be applied to game scenarios where virtual item storage is required.
[0042] In one embodiment of the present invention, the method for storing virtual items in a game can be run on a local terminal device or a server. When the method for storing virtual items in a game is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0043] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the virtual item storage method in the game are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0044] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0045] See also Figure 1 First, a method for storing virtual items in a game provided by an embodiment of the present invention is introduced. A graphical user interface is provided through a terminal device; the graphical user interface displays a preset virtual storage space. In actual applications, the virtual storage space can be a two-dimensional virtual space, a three-dimensional virtual space, or both, which is not limited here. When the virtual storage space includes a three-dimensional virtual space, when the graphical user interface displays the three-dimensional virtual space, it can be displayed in a two-dimensional form, such as Figure 2 It can also be displayed in three-dimensional form, such as Figure 3 The specific settings can be made according to the requirements.
[0046] The virtual storage space usually includes a plurality of adjacent unit subspaces. When the virtual storage space is a two-dimensional virtual space, the unit subspace is usually a two-dimensional space of a square or rectangle; when the virtual storage space is a three-dimensional virtual space, the unit subspace is usually a three-dimensional space of a cube or a cuboid. The unit subspace usually has a corresponding state parameter, which can be used to indicate whether the unit subspace is occupied by a virtual item, and can also indicate which virtual item or items occupy the unit subspace. Generally speaking, a virtual item can occupy one or more unit subspaces, which is specifically related to the shape of the virtual item.
[0047] The method comprises the following steps:
[0048] Step S102, in response to a storage triggering event for the first virtual item, determining a shape parameter of the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative positions between the first unit subspaces.
[0049] The first virtual item can be any virtual item that can be stored by a virtual object in a game scene, and is not limited here. The first virtual item usually has a shape. The shape of the first virtual item needs to occupy a space in the virtual space. For the sake of convenience, the unit subspace that the first virtual item needs to occupy is called a "first unit subspace". Shape parameters can be pre-set for the first virtual item to describe the number of first unit subspaces and the relative positions between the first unit subspaces. When the first virtual item only needs to occupy one first unit subspace, its corresponding shape parameters do not need to describe the relative positions between the first unit subspaces.
[0050] The first virtual item is usually regarded as a whole and can only occupy adjacent unit subspaces. When there are multiple first unit subspaces corresponding to the first virtual item, the shape parameters of the virtual item can describe which directions around each first unit subspace have other first unit subspaces. When the virtual storage space is a two-dimensional virtual space, each first unit subspace has four directions around it, namely up, down, left, and right; when the virtual storage space is a three-dimensional virtual space, each first unit subspace has six directions around it, in addition to the above-mentioned up, down, left, and right, it also includes front and back. It can be set specifically according to needs and is not limited here.
[0051] The above-mentioned storage triggering events can be of various types. For example, the player controls the virtual object to pick up the first virtual item in the virtual scene, and the virtual storage space is a storage space prop carried by the virtual object. At this time, a storage triggering event for the first virtual item is triggered, and the first virtual item needs to be stored in the virtual storage space. When the teammate of the virtual object presents the first virtual item to the virtual object, a storage triggering event for the first virtual item may also be triggered. When the virtual object is used in multiple virtual storage spaces, the player can control the first virtual item to move from one virtual storage space to another virtual storage space through control operations, and a storage triggering event for the first virtual item is also generated. The specific settings can be made according to needs and are not limited here.
[0052] Step S104: determining a target subspace among the plurality of unit subspaces based on the shape parameters of the first virtual object and the state parameters of the plurality of unit subspaces.
[0053] The first virtual item needs to be stored in an unoccupied unit subspace, so it is necessary to determine the subspace to be occupied based on the state parameters of multiple unit subspaces. For the convenience of writing, the subspace to be occupied can be referred to as the "subspace to be occupied". When storing the first virtual item, if only one unit subspace needs to be occupied, a target subspace can be randomly determined from the subspace to be occupied to store the first virtual item; or the target subspace for storing the first virtual item can be determined from the subspace to be occupied according to a preset priority, such as from left to right, from top to bottom.
[0054] When storing the first virtual item, multiple unit subspaces need to be occupied, and the relative positions between the multiple unit subspaces are limited by shape parameters, it is necessary to determine from the subspace to be occupied multiple unit subspaces whose relative positions match the relative positions between the first unit subspaces corresponding to the first virtual item as target subspaces to store the first virtual item.
[0055] If the number of subspaces to be occupied is less than the number of first unit subspaces, the first virtual item cannot be stored. When the number of subspaces to be occupied is greater than or equal to the number of first unit subspaces, a first unit subspace of the first virtual item can be "aligned" with a subspace in the subspaces to be occupied, that is, assuming that the subspace to be occupied is the first unit subspace of the first virtual item. The unit subspace that needs to be "aligned" can be any first unit subspace of the first virtual item, which can be set according to needs.
[0056] After the "alignment", other first unit subspaces of the first virtual item can also correspond to other unit subspaces. If the corresponding unit subspaces are not occupied, these unit subspaces can be determined as target subspaces for storing the first virtual item. Otherwise, it is necessary to "align" other subspaces in the subspace to be occupied with a first unit subspace of the first virtual item to further determine whether the target subspace is obtained. The processing order of multiple subspaces to be occupied can also be preset, such as processing according to the priority from left to right and from top to bottom, which is not limited here.
[0057] If the corresponding target subspace cannot be determined, a prompt such as "space is full" may be displayed on the graphical user interface to prompt the player that the first virtual item cannot be stored.
[0058] Step S106: store the first virtual item in the target subspace, and display the first virtual item in a display area of the target subspace in the graphical user interface.
[0059] If the corresponding target subspace is found, the first virtual item can be stored in the corresponding target subspace. At this time, the position parameter of the first virtual item can be changed to indicate that the first virtual item is stored in the virtual storage space; usually, the state parameter of the target subspace also needs to be changed to indicate that the target subspace is occupied. Furthermore, the first virtual item can be displayed in the display area of the target subspace in the graphical user interface, specifically, the control widget of the first virtual item can be displayed, or the icon of the first virtual item can be displayed. Among them, the control widget or icon of the first virtual item usually covers all target subspaces. Figure 4 As shown, the first virtual item needs to occupy three target subspaces A1, A2 and B1, and the icon of the first virtual item covers the display areas of the three target subspaces, and the icon of the first virtual item is represented by gray.
[0060] The above-mentioned method for storing virtual items in a game determines the shape parameters of the first virtual item in response to a storage trigger event for the first virtual item; the shape parameters are used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative positions between the first unit subspaces; based on the shape parameters of the first virtual item and the state parameters of the multiple unit subspaces, determine the target subspace among the multiple unit subspaces; store the first virtual item in the target subspace, and display the first virtual item in the display area of the target subspace in the graphical user interface. In this method, the virtual item has shape parameters, and virtual items of various shapes can be defined by the shape parameters. By matching the shape parameters of the virtual item with the unit subspace in the virtual storage space, virtual items of various shapes can be stored, which enriches the expression of items in the virtual storage space and improves the game experience of players.
[0061] The following embodiment provides a specific method for determining a target subspace among a plurality of unit subspaces based on a shape parameter of a first virtual object and state parameters of a plurality of unit subspaces.
[0062] In practical applications, the shape of the first virtual item can be represented by a shape matrix. Each element in the shape matrix corresponds to a unit subspace; the relative positions between the elements are used to indicate the relative positions between the corresponding unit subspaces. When the virtual storage space is a two-dimensional storage space, the shape matrix can be a one-dimensional matrix or a two-dimensional matrix; when the virtual storage space is a three-dimensional storage space, the shape matrix can be a one-dimensional matrix, a two-dimensional matrix or a three-dimensional matrix. At least one element in each row and each column of the shape matrix represents the unit subspace occupied by the first virtual item. The shape matrix shape parameters include the number of rows and columns of the shape matrix, and the non-shape elements in the shape matrix. The unit subspace corresponding to the non-shape element is not occupied when the first virtual item is stored.
[0063] For example, when the shape parameters of the first virtual item are 3 rows and 1 column, the shape matrix is a one-dimensional matrix, and the first unit subspace corresponding to the first virtual item is three unit subspaces adjacent to each other in the horizontal direction, and the non-shape elements are omitted. When the shape parameters of the first virtual item are 3 rows and 2 columns, and the non-shape elements are (0, 1) and (2, 1), the relative position relationship between the first unit subspaces corresponding to the first virtual item is as follows: Figure 5 As shown, each square represents a unit subspace.
[0064] When the first unit subspaces corresponding to the first virtual item include multiple ones, the method of determining the target subspace is relatively complicated. First, based on the storage state of the unit subspace, at least one subspace to be occupied is determined; wherein the subspace to be occupied is not occupied. Then there is a process of matching the subspace to be occupied with the shape of the first virtual item. It is necessary to determine the current subspace from at least one subspace to be occupied, and the current subspace can be determined in a preset order, such as from left to right, from top to bottom, etc. And based on the relative positions between the first unit subspaces and the current subspace, multiple adjacent first candidate unit subspaces corresponding to the first virtual item are determined, the number of the first candidate unit subspaces is the same as the number of the first unit subspaces, and the relative positions between the first candidate unit subspaces match the relative positions between the first unit subspaces. When determining the first candidate unit subspace, the current subspace can be assumed to be a first unit subspace corresponding to the first virtual item, and further based on the relative position relationship between the first unit subspace and other first unit subspaces, multiple first candidate unit subspaces including the current subspace are determined.
[0065] Since the first virtual item needs to be stored in an unoccupied unit subspace, if the state parameter of any of the multiple adjacent first candidate unit subspaces indicates that the candidate unit subspace is occupied and cannot be used to store the first virtual item, the current subspace is determined as the first unmatched space. Next, it is necessary to determine the current subspace from the subspaces to be occupied except the first unmatched space, and repeat the process of determining the multiple adjacent first candidate unit subspaces corresponding to the first virtual item based on the current subspace determined here, until it is determined that the state parameters of the multiple adjacent first candidate unit subspaces indicate that the multiple adjacent first candidate unit subspaces are not occupied. At this time, the first candidate unit subspace can be used to store the first virtual item, so the multiple adjacent first candidate unit subspaces can be determined as the target subspace. It is also possible that the subspaces to be occupied are all first unmatched spaces, and the first virtual item cannot be stored in the virtual storage space in its current shape.
[0066] In order to store the first virtual item in the virtual storage space as much as possible, when all the subspaces to be occupied are the first unmatched spaces, the first virtual item can also be rotated to change the relative position between the first unit subspaces corresponding to the first virtual item. In specific implementation, it is necessary to update the relative positions between the multiple first unit subspaces corresponding to the first virtual item based on a preset rotation parameter, and the above rotation parameter is usually 90° counterclockwise rotation or 90° clockwise rotation.
[0067] After the rotation, similar to the above matching process, it is necessary to determine the current subspace from at least one subspace to be occupied, and then determine the multiple adjacent second candidate unit subspaces corresponding to the first virtual item based on the updated relative positions between the first unit subspaces and the current subspace. Similarly, if the state parameter of any candidate unit subspace among the multiple adjacent second candidate unit subspaces indicates that the candidate unit subspace is occupied, the second candidate unit subspace cannot store the rotated first virtual item, so the current subspace is determined as the second unmatched space. Continue to determine the current subspace from the subspace to be occupied except the second unmatched space, and repeat the process of determining the multiple adjacent second candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent second candidate unit subspaces indicate that the multiple adjacent second candidate unit subspaces are not occupied, at which time the multiple adjacent second candidate unit subspaces can be determined as the target subspace. If all the subspaces to be occupied are second unmatched spaces, the first virtual item cannot be stored in the virtual storage space in its current shape. The first virtual item may be rotated in a different direction (eg, 90° clockwise last time and 90° counterclockwise this time) and the above process may be repeated, or it may be directly determined that the first virtual item cannot be stored in the virtual storage space.
[0068] The following embodiment provides a specific method of storing a first virtual item in a target subspace and displaying the first virtual item in a display area of the target subspace in a graphical user interface.
[0069] After determining the target subspace, the first virtual item needs to be stored in the target subspace, and the parameter value of the state parameter of the target subspace needs to be updated to a preset value corresponding to the first virtual item; the preset value is used to represent the first virtual item. The preset value may be the number of the first virtual item. In the game, different numbers are usually set for different types of virtual items, and each virtual item may also be set with a number different from other virtual items, which is not limited here.
[0070] After a virtual item is stored in a virtual storage space, the item identifier of the virtual item is usually displayed in the display area of the unit subspace occupied by the virtual item. The virtual item in the virtual storage space can be selected by a touch operation. Specifically, in response to a first touch operation acting on the display area of the virtual storage space, based on the contact point position of the first touch operation, the selected subspace in the virtual storage space is determined; based on the state parameter of the selected subspace, the selected virtual item is determined.
[0071] The first touch operation can be any one of a click, a double click, and a long press operation. A touch layer control is usually set above the display area of the virtual storage space in the graphical user interface. In order not to affect the display of the virtual storage space, the touch layer control is usually displayed transparently and covers the display area. The touch layer control can be used to monitor touch events. After the user generates the first touch operation, the touch layer control can monitor the touch event generated by the first touch operation.
[0072] Each unit subspace has its own display area. When the contact point of the first touch operation falls in the display area of a unit subspace, the unit subspace can be regarded as a selected subspace. Corresponding to the occupation of the unit subspace, the parameter value of the state parameter of the unit subspace can be a preset value corresponding to the virtual item occupying the unit subspace, or it can also be a specified value, which means that the unit subspace is not occupied. The preset value is different from the specified value, for example, the specified value is -1, and the preset values are all positive integers. If the parameter value of the state parameter of the selected subspace is the specified value, it can be determined that the selected virtual item is empty; if the parameter value of the state parameter of the selected subspace is different from the specified value, the selected virtual item stored in the virtual space can be determined based on the parameter value of the state parameter.
[0073] The player can change the unit subspace occupied by the selected virtual item through a sliding operation. In response to the sliding operation acting on the item identifier of the selected virtual item, the item identifier of the selected virtual item is controlled to move following the touch point position; the sliding operation may be continuous with the first touch operation or may be discontinuous. In response to the end of the sliding operation, the unit subspace occupied by the selected virtual item is updated, and the item identifier of the selected virtual item is displayed in the display area of the updated unit subspace.
[0074] In actual application, when the sliding operation ends, it is necessary to determine the second unit subspace closest to the selected virtual item based on the current position of the item identifier of the selected virtual item. The second unit subspace can be determined based on a certain position in the item identifier of the virtual item, such as a preset anchor point, as a reference point; then, based on the shape parameters of the selected virtual item and the second unit subspace, the unit subspace occupied by the selected virtual item is updated. In this process, it is necessary to determine the unit subspace around the second unit subspace that matches the relative position between the first unit subspace indicated by the shape parameters, and the determined unit subspace is not occupied, and the selected virtual item can be moved to the determined unit subspace, otherwise the selected virtual item will be restored to the unit subspace occupied before being selected.
[0075] The user can also rotate the selected virtual item through control operations. For the rotation trigger operation of the selected virtual item, based on the shape parameters of the selected virtual item and the rotation parameters corresponding to the rotation trigger operation, it is determined whether the selected virtual item after rotation exceeds the virtual storage space. Specifically, the unit subspaces that may be occupied by the selected virtual item after rotation can be determined with the anchor point of the selected virtual item as the center, and then it can be determined whether these unit subspaces exist. If not, it means that the virtual storage space is exceeded, such as Figure 6 As shown, the dotted line indicates that the rotated virtual item has exceeded the virtual storage space.
[0076] At this time, the unit subspace occupied by the selected virtual item needs to be updated. Generally speaking, the selected virtual item needs to be translated. If the unit subspaces around the unit subspace occupied by the selected virtual item are occupied, the selected virtual item cannot be translated or rotated. After the selected virtual item is translated, the unit subspace corresponding to the rotated selected virtual item can be determined based on the updated unit subspace and the rotation parameters corresponding to the rotation trigger operation, and the rotated selected virtual item is stored in the determined unit subspace. The conditions for the rotation processing to be realized also include that the unit subspaces corresponding to the rotated selected virtual item are all occupied, otherwise it cannot be rotated.
[0077] The user can also delete the selected virtual item. The deletion operation on the selected virtual item will remove the selected virtual item from the virtual storage space.
[0078] When the game pre-sets that the first virtual item and the second virtual item have an association relationship, after the first virtual item is stored in the virtual storage space, in response to the second virtual item being stored in the virtual storage space, and the unit subspace occupied by the second virtual item being adjacent to at least part of the target subspace, a designated mark may be added at a designated position of the item mark of the first virtual item or the second virtual item displayed in the display area of the virtual storage space; or a designated mark may be added at the designated position of the item marks of both virtual items at the same time. The designated position may be close to the adjacent unit subspaces of the two virtual items, or may be a fixed position, such as the center of the item mark, which is not limited here.
[0079] If the unit subspace occupied by the second virtual item is not adjacent to any unit subspace in the target subspace, for example, the first virtual item is moved, rotated, etc., so that the unit subspace occupied by the second virtual item is not adjacent to the unit subspace occupied by the first virtual item, or the first virtual item or the second virtual item is moved out of the virtual storage space, the designated mark is displayed.
[0080] The present disclosure also provides another method for storing virtual items in a game. Figure 1 The method is implemented based on the method shown in the figure. This method represents the virtual storage space in the form of a "backpack" commonly seen in games, and the grids in the backpack correspond to the unit subspaces in the virtual storage space.
[0081] In this method, items placed in the backpack can be represented in various required shapes, not just rectangles, and functions such as selection, movement, rotation, adjacent item judgment, and removal of items from the backpack are realized. In addition, a storage method for items is realized in which an item is automatically placed in the backpack and a vacant position is automatically found and rotated to a suitable angle before being placed.
[0082] This method is implemented in the following way and includes the following parts:
[0083] 1. Define the item instance representation: Specifically use the dictionary to store the item type, icon and other attribute information, and represent the shape of the item in the form of a matrix, so that it can adapt to the representation of items of various shapes. At the same time, in order to reduce the traversal operation of the matrix, the matrix is stored and represented in the form of {width, height, emptyGrid}, such as Figure 7 As shown, width represents the grid cell width of the shape matrix, height represents the grid cell height of the shape matrix, and emptyGrid records the grid offset coordinates that are not within the shape in the shape matrix with (0, 0) as the coordinates of the lower left corner of the matrix.
[0084] 2. Define the backpack instance representation: Figure 8 As shown on the right, the backpack is represented as a layer container, and grid UI controls can be added according to the number of rows and columns of the backpack capacity. Fig. 9 As shown in the figure, when adding an item, the item's UI control will cover the grid UI control at the backpack location. A touch layer UI control of the same size as the backpack's visual range is added to the backpack to monitor touch events, and a backpack grid state matrix is added to record the state of each grid.
[0085] 3. Processing of item selection in backpack: When the player clicks a certain position in the backpack, the touch position monitored by the touch layer is obtained, the position is mapped to the coordinate representation of the grid unit, and the backpack grid matrix is queried according to the mapped coordinates. If the queried state value is -1, it means that no item is selected. Otherwise, the query value is the selected item number, and the item instance corresponding to the item number is displayed as selected.
[0086] 4. Item movement processing in the backpack: After selecting an item, you can move it by touching and dragging it. Monitor the touch position on the touch layer, determine the position offset of the move based on the touch start position and the current touch position, and synchronize the position offset to the item instance in real time to achieve the drag effect of the item. When the player stops touching, calculate the grid coordinate with the closest Euclidean distance based on the current position of the item, adsorb the item on the grid, and update the grid state matrix of the backpack.
[0087] 5. Item rotation processing in the backpack: When rotating, first rotate the item shape matrix to determine whether the rotated shape matrix exceeds the backpack range. If it exceeds, first perform a position offset to prevent it from exceeding the range after display. Then rotate the item UI control and update the backpack's grid status matrix.
[0088] 6. Processing of removing items from the backpack: Delete the item instance and UI control from the interface, update the grid state matrix of the backpack, and broadcast to adjacent items to update the status display of adjacent items.
[0089] 7. Processing of adding items to the backpack: traverse the backpack's grid state matrix, find the grid where no items are placed, calculate the grid coordinate list required to put the item into the grid according to the shape matrix of the item, and determine whether the corresponding grid in the grid coordinate list has no item placed. If not, it can be put in directly. If not, try to rotate the shape matrix and recalculate. If it still cannot be put in after rotating all angles, continue to traverse the grid state matrix. After traversal and item rotation, if the position where the item can be put is found, put the item in and update the backpack grid state matrix and broadcast to adjacent items to update the status, otherwise it will be prompted that it cannot be put in.
[0090] The above method is specifically implemented through the following steps:
[0091] Step 1: Define the grid unit. The grid unit is represented by a square with a side length of GRID_SIZE and is displayed by a picture control.
[0092] Step 2 builds a grid backpack without any objects. Taking grid cells as units, set the number of columns in the backpack to COL_NUM, the number of rows to ROW_NUM, and the size of the interval between grids to GRID_GAP. Then the width of the backpack's layer container bagWidth is (ROW_NUM-1)×(GRID_SIZE+GRID_GAP)+GRID_SIZE, and the height of the backpack's layer container bagHeight is (COL_NUM–1)×(GRID_SIZE+GRID_GAP)+GRID_SIZE. The grid state matrix of the backpack is represented as bagGrids, the pixel granularity position of the grid cell in the backpack is represented as (gridX, gridY), and the grid coordinates are represented as (x, y). Starting from the lower left corner of the backpack layer container, add grid cells in a loop, and set the query value of the grid cell coordinate in the grid state matrix as the index to -1, indicating that there is no item.
[0093] Step 3: Add the touch layer of the backpack. The size and position of the touch layer are consistent with those of the backpack layer container, so the width is bagWidth and the height is bagHeight. And define the event responses of touch start, end, cancel and move of the touch layer.
[0094] Step 4: For the touch start event of the backpack touch layer, record the touch start position TouchBeginPos, and execute step 17 according to TouchBeginPos to obtain the item number of the touch position. If the item number is consistent with the item number currently selected, set hittingSelectedItem to true, indicating that the item has started to be moved, otherwise it is recorded as false.
[0095] Step 5: For the touch end event of the backpack touch layer, the touch end position is recorded as TouchEndPos. If the value of hittingSelectedItem is true, it is considered that the dragging of the item is ended, and step 19 is executed to adsorb the item to the appropriate grid, and step 8 is executed to update the grid state matrix. If hittingSelectedItem is false, it is considered that the item is being selected, and S201 is executed to obtain the selected item number. If the number is not -1, it is considered that the item with the corresponding item number is selected, and the corresponding item control is set to the selected state.
[0096] In step 6, for the touch cancel event of the touch layer, the position when the touch is canceled is recorded as TouchEndPos. If the value of hittingSelectedItem is true, it is regarded as the end of the dragging of the item, and step 19 is executed to adsorb the item to the appropriate grid, and step 8 is executed to update the grid state matrix.
[0097] In step 7, for the touch movement event of the touch layer, the current touch position is recorded as TouchingPos. If the value of hittingSelectedItem is true, step 18 is executed to synchronize the moving position of the object in real time in each frame.
[0098] Step 8: For the moved items, input the grid coordinates and shape matrix of the items before moving, execute step 18 to obtain, traverse the grid placeholder list, and set the value of the backpack grid state corresponding to each grid coordinate to -1; input the grid coordinates and shape matrix of the items after moving, execute step 20 to obtain, traverse the grid placeholder list, and set the value of the backpack grid state corresponding to each grid coordinate to the item number iNum.
[0099] Step 9 loads the items already in the backpack into the backpack. According to the list of item data already in the backpack, loop through the data in the list to obtain the data of each item. The item data contains information such as item type iType, item number iNum, icon, grid coordinates (x, y) in the backpack, rotation direction rotation, etc. Execute step 10 to instantiate the item control according to the item data. For each item in the backpack, execute step 20 to obtain its grid placeholder list holderList. Each item in the list is a grid coordinate, indicating that the item occupies a grid position in the backpack. Traverse holderList, let each corresponding grid coordinate be marked as (x_i, y_i), and record the value of the backpack state matrix bagGrids[x_i][y_i] as iNum.
[0100] Step 10 instantiates an item control in the backpack. Instantiate the item control according to the data of the item. The item data includes the item type iType, item number iNum, icon, coordinates (x, y) in the backpack, rotation direction rotation and other information. According to the mapping of the item type iType, obtain the shape representation matrix (gwidth, gheight, emptyGrid) of the item type, execute step 21 to calculate the position of the item UI display control in the backpack according to the coordinates (x, y), gwidth, gheight and rotation direction rotation, create the UI control and display it at this position.
[0101] Step 11 implements the rotation of items in the backpack. First, swap the width and height of the shape matrix of the item, and calculate whether the item exceeds the backpack range after rotation based on the grid position of the item and the swapped width and height. If it exceeds, perform position limit correction, then execute step 21 to calculate the position of the item after rotation, rotate the UI control of the item and place it in the new position, and update the new grid coordinates of the item and execute step 13.
[0102] Step 12 calculates the list of adjacent items in the backpack. Given that the grid coordinates of the item are (x, y), the item number is iNum, and the shape representation matrix is (gwidth, gheight, emptyGrid), traverse the matrix with the lower left corner coordinates (x-1, y-1), width gwidth+1, and height gheight+1. For each grid (i, j) in the matrix, if bagGrids[i][j] is not -1 or iNum, determine the states of the four grids bagGrids[i-1][j], bagGrids[i+1][j], bagGrids[i][j-1], and bagGrids[i][j+1]. If the value of one of the four states is iNum, then the item on the bagGrids[i][j] grid is considered to be adjacent to item iNum; if bagGrids[i][j] is -1 or iNum, skip it directly.
[0103] Step 13 updates the grid state of the item to the backpack state matrix. For item iNum, execute step 20 to obtain the grid placeholder list of the item, traverse the grid coordinates (i, j) in the grid placeholder list, and set bagGrids[i][j] to iNUM.
[0104] Step 14: Put a new item into the backpack. Traverse the backpack's grid state matrix bagGrids, and for the grid (x, y) with a grid state value of -1, execute step 15. If step 15 successfully puts the item in, then the process ends. Otherwise, continue traversing the grid state matrix until the entire matrix is traversed.
[0105] Step 15 executes step 20 to obtain the grid coordinate list required to put the item into the grid, and traverses the grid state bagGrids[i][j] corresponding to the coordinate (i, j) in the grid coordinate list. If all the corresponding grid states are -1, execute step 10 to put the item in, and execute step 13 to update the state; if there is a grid state bagGrids[i][j] whose value is not -1, try to rotate the shape matrix of the item and re-execute this step until all rotation angles are executed.
[0106] Step 16 deletes the items in the backpack. Execute step 20 to obtain the grid coordinate list required to put the items into the grid, set the value of the grid state matrix position corresponding to the grid coordinate in the grid coordinate list to -1, and then remove the item control instance.
[0107] Step 17: Selection judgment processing method for touched items in the backpack. The input parameters are known to be the touch position (tx, ty), which is mapped to the grid coordinates (x, y), where x = tx / (GRID_SIZE+GRID_GAP), y = ty / (GRID_SIZE+GRID_GAP), and the value of the backpack state matrix bagGrids[x][y] is queried as bState. If bState is -1, it means that no item is touched, otherwise bState is the iNum of the touched item.
[0108] Step 18: Processing method when the item is touched and dragged. The input parameters are known to be the touch start position TouchBeginPos and the current touch position TouchingPos. At the same time, the original grid coordinates of the item are known to be (x, y). Calculate the horizontal position distX = TouchingPos.x-TouchBeginPos.x and the vertical offset position distY = TouchingPos.y-TouchBeginPos.y where the item should be offset. Specifically, the position representation (tx, ty) of the item can be calculated based on the grid coordinates (x, y). Let the current position where the item should be moved to be (cx, cy), then cx = tx + distX, cy = ty + distY. When the item position is (cx, cy), if the edge of the item is still in the backpack, the item control position is set directly. If the edge of the item exceeds the edge range of the backpack, the value of (cx, cy) is corrected to limit the edge of the item within the backpack.
[0109] Step 19: The processing method for automatically adsorbing the item to the grid when the dragging is finished. It is known that the position of the item when it finishes moving is (tx, ty). Let x be the result of tx dividing (GRID_SIZE+GRID_GAP), let y be the result of ty dividing (GRID_SIZE+GRID_GAP), traverse the grid unit list [(x, y), (x+1, y), (x, y+1), (x+1, y+1)], calculate the position distance between each grid unit and (tx, ty), use the grid coordinates of the nearest grid unit as the grid coordinates of the item, execute step 21 to calculate the position of the item in the backpack, and set the item control to be displayed at that position.
[0110] Step 20 obtains the grid placeholder list of the item. Given the grid coordinates (x, y) of the item and the shape matrix (gwidth, gheight, emptyGrid) of the item, directly traverse the matrix with (x, y) as the lower left corner coordinate, gwidth as the width, and gheight as the height, and obtain the coordinate representation (x_i, y_i) of each grid in the matrix. If (x_i, y_i) is not in the list emptyGrid, then add (x_i, y_i) to the grid placeholder list, otherwise skip it directly.
[0111] Step 21 calculates the position of the item control in the backpack. Given the grid coordinates (x, y) of the item and the shape matrix (gwidth, gheight, emptyGrid) of the item, the item control uses the center as the anchor point, and (tx, ty) is the position of the item in the backpack. It can be calculated that tx = (x + gwidth / 2) * (GRID_SIZE + GRID_GAP), ty = (x + gheight / 2) * (GRID_SIZE + GRID_GAP).
[0112] The above method solves the problem of the restricted shape of items in the grid backpack system for storing multi-shaped items. At the same time, the method also includes feasible implementation methods for functions such as placing, selecting, rotating, moving and adjacent item judgment of items when the shape of the items is not limited to a rectangle, enriching the expression form of the game UI grid backpack and providing more possibilities for the gameplay design of the grid backpack.
[0113] For the above method embodiments, see Fig.10 A virtual item storage device in a game is shown, which provides a graphical user interface through a terminal device; the graphical user interface displays a preset virtual storage space; the virtual storage space includes a plurality of adjacent unit subspaces; the unit subspaces have corresponding state parameters; the state parameters are used to indicate whether the unit subspace is occupied by a virtual item; the device includes:
[0114] The shape parameter determination module 1002 is used to determine the shape parameter of the first virtual item in response to the storage triggering event for the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces;
[0115] A target subspace determination module 1004 is used to determine a target subspace among the plurality of unit subspaces based on a shape parameter of the first virtual object and state parameters of the plurality of unit subspaces;
[0116] The item storage module 1006 is configured to store the first virtual item in the target subspace and display the first virtual item in a display area of the target subspace in the graphical user interface.
[0117] The above-mentioned virtual item storage device in a game determines the shape parameters of the first virtual item in response to a storage trigger event for the first virtual item; the shape parameters are used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative positions between the first unit subspaces; based on the shape parameters of the first virtual item and the state parameters of the multiple unit subspaces, determine the target subspace among the multiple unit subspaces; store the first virtual item in the target subspace, and display the first virtual item in the display area of the target subspace in the graphical user interface. In this method, the virtual item has shape parameters, and virtual items of various shapes can be defined by the shape parameters. By matching the shape parameters of the virtual item with the unit subspace in the virtual storage space, virtual items of various shapes can be stored, which enriches the expression form of the items in the virtual storage space and improves the game experience of the players.
[0118] The shape of the first virtual object is represented by a shape matrix; the shape parameters include the number of rows and columns of the shape matrix, and non-shape elements in the shape matrix; wherein each element in the shape matrix corresponds to a unit subspace; the relative positions between the elements are used to indicate the relative positions between the corresponding unit subspaces; the unit subspace corresponding to the non-shape element is not occupied when the first virtual object is stored.
[0119] The first unit subspaces corresponding to the first virtual item include a plurality of first unit subspaces; the shape parameter is used to indicate: the relative position between the first unit subspaces; the step of determining a target subspace among the plurality of unit subspaces based on the shape parameter of the first virtual item and the state parameters of the plurality of unit subspaces includes: determining at least one to-be-occupied subspace based on the storage state of the unit subspaces; the to-be-occupied subspace is not occupied; determining a current subspace from at least one to-be-occupied subspace; determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item based on the relative position between the first unit subspaces and the current subspace; if the state parameter of any candidate unit subspace among the plurality of adjacent first candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a first unmatched space; determining the current subspace from the to-be-occupied subspaces except the first unmatched space; and continuing to perform the step of determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item until the state parameters of the plurality of adjacent first candidate unit subspaces indicate that the plurality of adjacent first candidate unit subspaces are not occupied, determining the plurality of adjacent first candidate unit subspaces as the target subspace, or until at least one to-be-occupied subspace is a first unmatched space.
[0120] When at least one of the subspaces to be occupied is a first unmatched space, the method further includes: updating the relative positions between the multiple first unit subspaces corresponding to the first virtual item based on a preset rotation parameter; determining a current subspace from at least one subspace to be occupied; determining multiple adjacent second candidate unit subspaces corresponding to the first virtual item based on the updated relative positions between the first unit subspaces and the current subspace; if the state parameter of any candidate unit subspace among the multiple adjacent second candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a second unmatched space; determining the current subspace from the subspaces to be occupied except the second unmatched space; and continuing to perform the step of determining multiple adjacent second candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent second candidate unit subspaces indicate that the multiple adjacent second candidate unit subspaces are not occupied, and determining the multiple adjacent second candidate unit subspaces as target subspaces, or until at least one of the subspaces to be occupied is a second unmatched space.
[0121] The step of storing the first virtual item in the target subspace includes: storing the first virtual item in the target subspace; updating the parameter value of the state parameter of the target subspace to a preset value corresponding to the first virtual item; the preset value is used to represent the first virtual item.
[0122] In the above-mentioned graphical user interface, there is a touch layer control above the display area of the virtual storage space; the touch layer control is displayed transparently and covers the display area; the touch layer control is used to monitor touch events.
[0123] The above method also includes: in response to a first touch operation acting on the display area of the virtual storage space, determining a selected subspace in the virtual storage space based on the contact point position of the first touch operation; and determining a selected virtual item based on the state parameters of the selected subspace.
[0124] The parameter value of the state parameter of the above-mentioned unit subspace is a preset value corresponding to the virtual item occupying the unit subspace, or is a specified value; the preset value is used to represent the virtual item occupying the unit subspace; the preset value is different from the specified value; based on the state parameter of the selected subspace, the step of determining the selected virtual item includes: if the parameter value of the state parameter of the selected subspace is the specified value, determining that the selected virtual item is empty; if the parameter value of the state parameter of the selected subspace is different from the specified value, determining the selected virtual item based on the parameter value of the state parameter.
[0125] The item identifier of the selected virtual item is displayed in a display area of at least one unit subspace occupied by the selected virtual item; the method further includes: in response to a sliding operation on the item identifier of the selected virtual item, controlling the item identifier of the selected virtual item to move following the position of the touch point; in response to the end of the sliding operation, updating the unit subspace occupied by the selected virtual item, and displaying the item identifier of the selected virtual item in the display area of the updated unit subspace.
[0126] The step of updating the unit subspace occupied by the selected virtual item in response to the end of the sliding operation includes: determining a second unit subspace closest to the selected virtual item based on the current position of the item identifier of the selected virtual item in response to the end of the sliding operation; and updating the unit subspace occupied by the selected virtual item based on the shape parameters of the selected virtual item and the second unit subspace.
[0127] The above method also includes: for the rotation trigger operation of the selected virtual item, based on the shape parameters of the selected virtual item and the rotation parameters corresponding to the rotation trigger operation, determining whether the selected virtual item after rotation exceeds the virtual storage space; if so, updating the unit subspace occupied by the selected virtual item; based on the updated unit subspace and the rotation parameters corresponding to the rotation trigger operation, determining the unit subspace corresponding to the rotated selected virtual item; and storing the rotated selected virtual item in the determined unit subspace.
[0128] The above method further includes: performing a deletion operation on the selected virtual item to remove the selected virtual item from the virtual storage space.
[0129] The first virtual item and the second virtual item are associated with each other; after storing the first virtual item in the target subspace, the method further includes: in response to the second virtual item being stored in the virtual storage space and the unit subspace occupied by the second virtual item being adjacent to at least part of the target subspace, adding a designated mark at a designated position of the item mark of the first virtual item and / or the second virtual item displayed in the display area of the virtual storage space.
[0130] The method further includes: in response to the unit subspace occupied by the second virtual item being not adjacent to any unit subspace in the target subspace, or the first virtual item being moved out of the virtual storage space, canceling the display of the designated mark.
[0131] The above-mentioned virtual storage space includes a two-dimensional virtual space, and / or a three-dimensional virtual space.
[0132] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the virtual item storage method in the above game, for example:
[0133] In response to a storage trigger event for a first virtual item, a shape parameter of the first virtual item is determined; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces; based on the shape parameter of the first virtual item and state parameters of the plurality of unit subspaces, a target subspace among the plurality of unit subspaces is determined; the first virtual item is stored in the target subspace, and the first virtual item is displayed in a display area of the target subspace in a graphical user interface.
[0134] In the above method, the virtual items have shape parameters, and virtual items of various shapes can be defined through the shape parameters. By matching the shape parameters of the virtual items with the unit subspaces in the virtual storage space, virtual items of various shapes can be stored, enriching the expression of items in the virtual storage space and improving the player's gaming experience.
[0135] Optionally, the shape of the first virtual object is represented by a shape matrix; the shape parameters include the number of rows and columns of the shape matrix, and non-shape elements in the shape matrix; wherein each element in the shape matrix corresponds to a unit subspace; the relative positions between the elements are used to indicate the relative positions between the corresponding unit subspaces; the unit subspace corresponding to the non-shape element is not occupied when the first virtual object is stored.
[0136] Optionally, the first unit subspaces corresponding to the first virtual item include a plurality of first unit subspaces; the shape parameter is used to indicate: the relative position between the first unit subspaces; the step of determining a target subspace among the plurality of unit subspaces based on the shape parameter of the first virtual item and the state parameters of the plurality of unit subspaces includes: determining at least one to-be-occupied subspace based on the storage state of the unit subspaces; the to-be-occupied subspace is not occupied; determining a current subspace from at least one to-be-occupied subspace; determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item based on the relative position between the first unit subspaces and the current subspace; if the state parameter of any candidate unit subspace among the plurality of adjacent first candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a first unmatched space; determining the current subspace from the to-be-occupied subspaces except the first unmatched space; and continuing to perform the step of determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item until the state parameters of the plurality of adjacent first candidate unit subspaces indicate that the plurality of adjacent first candidate unit subspaces are not occupied, determining the plurality of adjacent first candidate unit subspaces as the target subspace, or until at least one to-be-occupied subspace is a first unmatched space.
[0137] Optionally, when at least one of the subspaces to be occupied is a first unmatched space, the method further includes: updating the relative positions between the multiple first unit subspaces corresponding to the first virtual item based on a preset rotation parameter; determining the current subspace from at least one subspace to be occupied; determining multiple adjacent second candidate unit subspaces corresponding to the first virtual item based on the updated relative positions between the first unit subspaces and the current subspace; if the state parameter of any of the multiple adjacent second candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as the second unmatched space; determining the current subspace from the subspaces to be occupied except the second unmatched space; and continuing to execute the step of determining the multiple adjacent second candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent second candidate unit subspaces indicate that the multiple adjacent second candidate unit subspaces are not occupied, and determining the multiple adjacent second candidate unit subspaces as the target subspace, or until at least one of the subspaces to be occupied is a second unmatched space.
[0138] Optionally, the step of storing the first virtual item in the target subspace includes: storing the first virtual item in the target subspace; updating the parameter value of the state parameter of the target subspace to a preset value corresponding to the first virtual item; the preset value is used to represent the first virtual item.
[0139] Optionally, a touch layer control is provided above the display area of the virtual storage space in the graphical user interface; the touch layer control is displayed transparently, covering the display area; and the touch layer control is used to monitor touch events.
[0140] Optionally, the method further includes: in response to a first touch operation acting on a display area of the virtual storage space, determining a selected subspace in the virtual storage space based on a contact point position of the first touch operation; and determining a selected virtual item based on a state parameter of the selected subspace.
[0141] Optionally, the parameter value of the state parameter of the above-mentioned unit subspace is a preset value corresponding to the virtual item occupying the unit subspace, or is a specified value; the preset value is used to represent the virtual item occupying the unit subspace; the preset value is different from the specified value; based on the state parameter of the selected subspace, the step of determining the selected virtual item includes: if the parameter value of the state parameter of the selected subspace is the specified value, determining that the selected virtual item is empty; if the parameter value of the state parameter of the selected subspace is different from the specified value, determining the selected virtual item based on the parameter value of the state parameter.
[0142] Optionally, the item identifier of the selected virtual item is displayed in a display area of at least one unit subspace occupied by the selected virtual item; the method further includes: in response to a sliding operation acting on the item identifier of the selected virtual item, controlling the item identifier of the selected virtual item to move following the contact point position; in response to the end of the sliding operation, updating the unit subspace occupied by the selected virtual item, and displaying the item identifier of the selected virtual item in the display area of the updated unit subspace.
[0143] Optionally, the step of updating the unit subspace occupied by the selected virtual item in response to the completion of the sliding operation includes: determining, in response to the completion of the sliding operation, a second unit subspace that is closest to the selected virtual item based on the current position of the item identifier of the selected virtual item; and updating the unit subspace occupied by the selected virtual item based on the shape parameters of the selected virtual item and the second unit subspace.
[0144] Optionally, the above method also includes: for the rotation trigger operation of the selected virtual item, based on the shape parameters of the selected virtual item and the rotation parameters corresponding to the rotation trigger operation, determining whether the selected virtual item after rotation exceeds the virtual storage space; if so, updating the unit subspace occupied by the selected virtual item; based on the updated unit subspace and the rotation parameters corresponding to the rotation trigger operation, determining the unit subspace corresponding to the rotated selected virtual item; and storing the rotated selected virtual item in the determined unit subspace.
[0145] Optionally, the method further includes: performing a deletion operation on the selected virtual item to remove the selected virtual item from the virtual storage space.
[0146] Optionally, the first virtual item and the second virtual item are associated with each other; after storing the first virtual item in the target subspace, the method further includes: in response to the second virtual item being stored in the virtual storage space, and the unit subspace occupied by the second virtual item being adjacent to at least part of the target subspace, adding a designated logo at a designated position of the item logo of the first virtual item and / or the second virtual item in the display area of the virtual storage space.
[0147] Optionally, the method further includes: in response to the unit subspace occupied by the second virtual item being not adjacent to any unit subspace in the target subspace, or the first virtual item being moved out of the virtual storage space, canceling the display of the designated mark.
[0148] Optionally, the above virtual storage space includes a two-dimensional virtual space, and / or a three-dimensional virtual space.
[0149] See also Fig.11 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the virtual item storage method in the above-mentioned game.
[0150] Further, Fig.11 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .
[0151] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0152] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.
[0153] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the virtual item storage method in the above game.
[0154] The embodiments of the present disclosure provide a method, device and electronic device for storing virtual items in a game, including a computer-readable storage medium storing program code, wherein the program code includes instructions that can be used to execute the methods described in the above method embodiments, for example:
[0155] In response to a storage trigger event for a first virtual item, a shape parameter of the first virtual item is determined; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative position between the first unit subspaces; based on the shape parameter of the first virtual item and state parameters of the plurality of unit subspaces, a target subspace among the plurality of unit subspaces is determined; the first virtual item is stored in the target subspace, and the first virtual item is displayed in a display area of the target subspace in a graphical user interface.
[0156] In the above method, the virtual items have shape parameters, and virtual items of various shapes can be defined through the shape parameters. By matching the shape parameters of the virtual items with the unit subspaces in the virtual storage space, virtual items of various shapes can be stored, enriching the expression of items in the virtual storage space and improving the player's gaming experience.
[0157] Optionally, the shape of the first virtual object is represented by a shape matrix; the shape parameters include the number of rows and columns of the shape matrix, and non-shape elements in the shape matrix; wherein each element in the shape matrix corresponds to a unit subspace; the relative positions between the elements are used to indicate the relative positions between the corresponding unit subspaces; the unit subspace corresponding to the non-shape element is not occupied when the first virtual object is stored.
[0158] Optionally, the first unit subspaces corresponding to the first virtual item include a plurality of first unit subspaces; the shape parameter is used to indicate: the relative position between the first unit subspaces; the step of determining a target subspace among the plurality of unit subspaces based on the shape parameter of the first virtual item and the state parameters of the plurality of unit subspaces includes: determining at least one to-be-occupied subspace based on the storage state of the unit subspaces; the to-be-occupied subspace is not occupied; determining a current subspace from at least one to-be-occupied subspace; determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item based on the relative position between the first unit subspaces and the current subspace; if the state parameter of any candidate unit subspace among the plurality of adjacent first candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a first unmatched space; determining the current subspace from the to-be-occupied subspaces except the first unmatched space; and continuing to perform the step of determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item until the state parameters of the plurality of adjacent first candidate unit subspaces indicate that the plurality of adjacent first candidate unit subspaces are not occupied, determining the plurality of adjacent first candidate unit subspaces as the target subspace, or until at least one to-be-occupied subspace is a first unmatched space.
[0159] Optionally, when at least one of the subspaces to be occupied is a first unmatched space, the method further includes: updating the relative positions between the multiple first unit subspaces corresponding to the first virtual item based on a preset rotation parameter; determining the current subspace from at least one subspace to be occupied; determining multiple adjacent second candidate unit subspaces corresponding to the first virtual item based on the updated relative positions between the first unit subspaces and the current subspace; if the state parameter of any of the multiple adjacent second candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as the second unmatched space; determining the current subspace from the subspaces to be occupied except the second unmatched space; and continuing to execute the step of determining the multiple adjacent second candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent second candidate unit subspaces indicate that the multiple adjacent second candidate unit subspaces are not occupied, and determining the multiple adjacent second candidate unit subspaces as the target subspace, or until at least one of the subspaces to be occupied is a second unmatched space.
[0160] Optionally, the step of storing the first virtual item in the target subspace includes: storing the first virtual item in the target subspace; updating the parameter value of the state parameter of the target subspace to a preset value corresponding to the first virtual item; the preset value is used to represent the first virtual item.
[0161] Optionally, a touch layer control is provided above the display area of the virtual storage space in the graphical user interface; the touch layer control is displayed transparently, covering the display area; and the touch layer control is used to monitor touch events.
[0162] Optionally, the method further includes: in response to a first touch operation acting on a display area of the virtual storage space, determining a selected subspace in the virtual storage space based on a contact point position of the first touch operation; and determining a selected virtual item based on a state parameter of the selected subspace.
[0163] Optionally, the parameter value of the state parameter of the above-mentioned unit subspace is a preset value corresponding to the virtual item occupying the unit subspace, or is a specified value; the preset value is used to represent the virtual item occupying the unit subspace; the preset value is different from the specified value; based on the state parameter of the selected subspace, the step of determining the selected virtual item includes: if the parameter value of the state parameter of the selected subspace is the specified value, determining that the selected virtual item is empty; if the parameter value of the state parameter of the selected subspace is different from the specified value, determining the selected virtual item based on the parameter value of the state parameter.
[0164] Optionally, the item identifier of the selected virtual item is displayed in a display area of at least one unit subspace occupied by the selected virtual item; the method further includes: in response to a sliding operation acting on the item identifier of the selected virtual item, controlling the item identifier of the selected virtual item to move following the contact point position; in response to the end of the sliding operation, updating the unit subspace occupied by the selected virtual item, and displaying the item identifier of the selected virtual item in the display area of the updated unit subspace.
[0165] Optionally, the step of updating the unit subspace occupied by the selected virtual item in response to the completion of the sliding operation includes: determining, in response to the completion of the sliding operation, a second unit subspace that is closest to the selected virtual item based on the current position of the item identifier of the selected virtual item; and updating the unit subspace occupied by the selected virtual item based on the shape parameters of the selected virtual item and the second unit subspace.
[0166] Optionally, the above method also includes: for the rotation trigger operation of the selected virtual item, based on the shape parameters of the selected virtual item and the rotation parameters corresponding to the rotation trigger operation, determining whether the selected virtual item after rotation exceeds the virtual storage space; if so, updating the unit subspace occupied by the selected virtual item; based on the updated unit subspace and the rotation parameters corresponding to the rotation trigger operation, determining the unit subspace corresponding to the rotated selected virtual item; and storing the rotated selected virtual item in the determined unit subspace.
[0167] Optionally, the method further includes: performing a deletion operation on the selected virtual item to remove the selected virtual item from the virtual storage space.
[0168] Optionally, the first virtual item and the second virtual item are associated with each other; after storing the first virtual item in the target subspace, the method further includes: in response to the second virtual item being stored in the virtual storage space, and the unit subspace occupied by the second virtual item being adjacent to at least part of the target subspace, adding a designated logo at a designated position of the item logo of the first virtual item and / or the second virtual item in the display area of the virtual storage space.
[0169] Optionally, the method further includes: in response to the unit subspace occupied by the second virtual item being not adjacent to any unit subspace in the target subspace, or the first virtual item being moved out of the virtual storage space, canceling the display of the designated mark.
[0170] Optionally, the above virtual storage space includes a two-dimensional virtual space, and / or a three-dimensional virtual space.
[0171] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0172] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0173] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0174] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0175] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, those skilled in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for storing virtual items in a game, characterized in that: Providing a graphical user interface through a terminal device; the graphical user interface displays a preset virtual storage space; the virtual storage space includes a plurality of adjacent unit subspaces; The unit subspace has corresponding state parameters; The state parameter is used to indicate whether the unit subspace is occupied by a virtual item; the method comprises: In response to a storage triggering event for a first virtual item, determining a shape parameter of the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative positions between the first unit subspaces; determining a target subspace among the plurality of unit subspaces based on a shape parameter of the first virtual item and state parameters of the plurality of unit subspaces; The first virtual item is stored in the target subspace, and the first virtual item is displayed in a display area of the target subspace in the graphical user interface.
2. The method according to claim 1, characterized in that The shape of the first virtual item is represented by a shape matrix; the shape parameters include the number of rows and columns of the shape matrix, and non-shape elements in the shape matrix; Each element in the shape matrix corresponds to a unit subspace; the relative positions between the elements are used to indicate the relative positions between the corresponding unit subspaces; and the unit subspace corresponding to the non-shape element is not occupied when the first virtual item is stored.
3. The method according to claim 1, characterized in that The first unit subspaces corresponding to the first virtual item include a plurality of first unit subspaces; the shape parameter is used to indicate: relative positions between the first unit subspaces; The step of determining a target subspace in the plurality of unit subspaces based on the shape parameter of the first virtual item and the state parameters of the plurality of unit subspaces comprises: Determining at least one subspace to be occupied based on the storage state of the unit subspace; the subspace to be occupied is not occupied; Determining a current subspace from the at least one subspace to be occupied; Determining a plurality of adjacent first candidate unit subspaces corresponding to the first virtual item based on the relative positions between the first unit subspaces and the current subspace; If the state parameter of any candidate unit subspace among the plurality of adjacent first candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a first unmatched space; Determine a current subspace from the subspaces to be occupied except the first unmatched space; Continue to execute the step of determining multiple adjacent first candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent first candidate unit subspaces indicate that the multiple adjacent first candidate unit subspaces are not occupied, and determine the multiple adjacent first candidate unit subspaces as target subspaces, or until at least one of the subspaces to be occupied is all first unmatched spaces.
4. The method according to claim 3, characterized in that When the at least one to-be-occupied subspace is a first unmatched space, the method further includes: Based on a preset rotation parameter, updating relative positions between a plurality of first unit subspaces corresponding to the first virtual object; Determining a current subspace from the at least one subspace to be occupied; Determining a plurality of adjacent second candidate unit subspaces corresponding to the first virtual item based on the updated relative positions between the first unit subspaces and the current subspace; If the state parameter of any candidate unit subspace among the plurality of adjacent second candidate unit subspaces indicates that the candidate unit subspace is occupied, determining the current subspace as a second unmatched space; Determine a current subspace from the subspaces to be occupied except the second unmatched space; Continue to execute the step of determining multiple adjacent second candidate unit subspaces corresponding to the first virtual item until the state parameters of the multiple adjacent second candidate unit subspaces indicate that the multiple adjacent second candidate unit subspaces are not occupied, and determine the multiple adjacent second candidate unit subspaces as target subspaces, or until at least one of the subspaces to be occupied is a second unmatched space.
5. The method according to claim 1, characterized in that The step of storing the first virtual item in the target subspace includes: storing the first virtual item in the target subspace; The parameter value of the state parameter of the target subspace is updated to a preset value corresponding to the first virtual item; the preset value is used to represent the first virtual item.
6. The method according to claim 1, characterized in that A touch layer control is provided above the display area of the virtual storage space in the graphical user interface; the touch layer control is displayed transparently and covers the display area; and the touch layer control is used to monitor touch events.
7. The method according to claim 1, characterized in that The method further comprises: In response to a first touch operation applied to a display area of the virtual storage space, determining a selected subspace in the virtual storage space based on a touch point position of the first touch operation; A selected virtual item is determined based on the state parameter of the selected subspace.
8. The method according to claim 7, characterized in that The parameter value of the state parameter of the unit subspace is a preset value corresponding to the virtual item occupying the unit subspace, or a specified value; the preset value is used to represent the virtual item occupying the unit subspace; The preset value is different from the specified value; The step of determining the selected virtual item based on the state parameter of the selected subspace includes: If the parameter value of the state parameter of the selected subspace is the specified value, determining that the selected virtual item is empty; If the parameter value of the state parameter of the selected subspace is different from the specified value, the selected virtual item is determined based on the parameter value of the state parameter.
9. The method according to claim 7, characterized in that: The item identifier of the selected virtual item is displayed in a display area of at least one unit subspace occupied by the selected virtual item; The method further comprises: In response to a sliding operation on the item identifier of the selected virtual item, controlling the item identifier of the selected virtual item to move along with the touch point position; In response to the end of the sliding operation, the unit subspace occupied by the selected virtual item is updated, and the item identifier of the selected virtual item is displayed in a display area of the updated unit subspace.
10. The method according to claim 9, characterized in that In response to the end of the sliding operation, the step of updating the unit subspace occupied by the selected virtual item includes: In response to the end of the sliding operation, determining a second unit subspace closest to the selected virtual item based on a current position of the item identifier of the selected virtual item; The unit subspace occupied by the selected virtual object is updated based on the shape parameter of the selected virtual object and the second unit subspace.
11. The method according to claim 7, characterized in that The method further comprises: For the rotation triggering operation of the selected virtual item, determining whether the selected virtual item after rotation exceeds the virtual storage space based on the shape parameter of the selected virtual item and the rotation parameter corresponding to the rotation triggering operation; If yes, updating the unit subspace occupied by the selected virtual item; Determining the unit subspace corresponding to the rotated selected virtual object based on the updated unit subspace and the rotation parameter corresponding to the rotation trigger operation; The rotated selected virtual item is stored in the determined unit subspace.
12. The method according to claim 7, characterized in that The method further comprises: For the deletion operation of the selected virtual item, the selected virtual item is removed from the virtual storage space.
13. The method according to claim 1, characterized in that The first virtual item and the second virtual item are associated with each other; After storing the first virtual item in the target subspace, the method further includes: In response to the second virtual item being stored in the virtual storage space and the unit subspace occupied by the second virtual item being adjacent to at least a portion of the target subspace, a designated identifier is added at a designated position of the item identifiers of the first virtual item and / or the second virtual item displayed in a display area of the virtual storage space.
14. The method according to claim 13, characterized in that The method further comprises: In response to the unit subspace occupied by the second virtual item being not adjacent to any unit subspace in the target subspace, or the first virtual item being moved out of the virtual storage space, the designated mark is undisplayed.
15. The method according to claim 1, characterized in that The virtual storage space includes a two-dimensional virtual space and / or a three-dimensional virtual space.
16. A virtual item storage device in a game, characterized in that: Providing a graphical user interface through a terminal device; the graphical user interface displays a preset virtual storage space; the virtual storage space includes a plurality of adjacent unit subspaces; The unit subspace has corresponding state parameters; The state parameter is used to indicate whether the unit subspace is occupied by a virtual item; the device comprises: a shape parameter determination module, configured to determine a shape parameter of the first virtual item in response to a storage triggering event for the first virtual item; the shape parameter is used to indicate: the number of adjacent first unit subspaces required to be occupied when storing the virtual item, and / or the relative positions between the first unit subspaces; a target subspace determination module, configured to determine a target subspace among the plurality of unit subspaces based on a shape parameter of the first virtual item and state parameters of the plurality of unit subspaces; The item storage module is configured to store the first virtual item in the target subspace, and display the first virtual item in a display area of the target subspace in the graphical user interface.
17. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for storing virtual items in a game as described in any one of claims 1 to 15.
18. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for storing virtual items in a game as described in any one of claims 1-15.