WO2019148992A1 - 游戏场景中虚拟资源的处理方法及装置 - Google Patents

游戏场景中虚拟资源的处理方法及装置 Download PDF

Info

Publication number
WO2019148992A1
WO2019148992A1 PCT/CN2018/122379 CN2018122379W WO2019148992A1 WO 2019148992 A1 WO2019148992 A1 WO 2019148992A1 CN 2018122379 W CN2018122379 W CN 2018122379W WO 2019148992 A1 WO2019148992 A1 WO 2019148992A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual resource
area
virtual
information
game
Prior art date
Application number
PCT/CN2018/122379
Other languages
English (en)
French (fr)
Inventor
吴川北
杜志荣
郑庆鑫
陈佳桢
Original Assignee
网易(杭州)网络有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 网易(杭州)网络有限公司 filed Critical 网易(杭州)网络有限公司
Priority to US16/756,844 priority Critical patent/US11224814B2/en
Priority to JP2020528376A priority patent/JP7067848B2/ja
Publication of WO2019148992A1 publication Critical patent/WO2019148992A1/zh

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/58Controlling game characters or game objects based on the game progress by computing conditions of game characters, e.g. stamina, strength, motivation or energy level
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • A63F13/5372Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen for tagging characters, objects or locations in the game scene, e.g. displaying a circle under the character controlled by the player
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • A63F13/69Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor by enabling or updating specific game elements, e.g. unlocking hidden features, items, levels or versions
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/355Performing operations on behalf of clients with restricted processing capabilities, e.g. servers transform changing game scene into an encoded video stream for transmitting to a mobile phone or a thin client
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • A63F13/426Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving on-screen location information, e.g. screen coordinates of an area at which the player is aiming with a light gun
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5526Game data structure
    • A63F2300/5533Game data structure using program state or machine event data, e.g. server keeps track of the state of multiple players on in a multiple player game

Definitions

  • the present invention relates to the field of game technologies, and in particular, to a method and an apparatus for processing virtual resources in a game scenario.
  • a method for processing a virtual resource in a game scenario comprising:
  • a method for processing a virtual resource in a game scenario comprising:
  • a processing apparatus for virtual resources in a game scenario comprising:
  • a first determining module configured to determine an area where the virtual object is located according to a current location of the virtual object in a game scene
  • a second determining module configured to receive an identifier of the virtual resource to be removed, and determine the virtual resource to be removed according to the identifier of the virtual resource to be removed;
  • a first update module configured to delete the virtual resource to be removed from the area of the game scenario, and generate regional virtual resource state information corresponding to the area;
  • a first sending module configured to send the regional virtual resource state information to a client corresponding to the virtual object, so that the client controls the virtual resource corresponding to the regional virtual resource state information according to the regional virtual resource state information Rendering display.
  • a processing apparatus for virtual resources in a game scenario comprising:
  • a third determining module configured to determine, according to the teardown event, a virtual resource from the plurality of virtual resources in the game scenario as a virtual resource to be demolished according to the teardown event in response to the teardown event of the virtual resource in the game scenario ;
  • a second sending module configured to send the identifier of the virtual resource to be removed to the server
  • a first receiving module configured to receive area virtual resource status information that is fed back by the server, where the area virtual resource status information is determined by the server according to the current position of the virtual object in the game scene.
  • Virtual resource status information ;
  • a second update module configured to update a state of the virtual resource in the area according to the area virtual resource state information, and display the virtual resource corresponding to the area virtual resource state information according to the updated state of the virtual resource .
  • a game system comprising: a server, a client; wherein
  • the server includes: a first processor;
  • a first memory configured to store the first executable instruction of the first processor
  • the first processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the first executable instruction
  • the client includes: a second processor
  • a second memory configured to store a second executable instruction of the second processor
  • the second processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the second executable instruction.
  • an electronic device including:
  • a memory for storing executable instructions of the processor
  • the processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the executable instruction.
  • an electronic device including:
  • a memory for storing executable instructions of the processor
  • the processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the executable instruction.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of processing virtual resources in a game scenario as described above.
  • an electronic device including:
  • a memory for storing executable instructions of the processor
  • the processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the executable instruction.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of processing virtual resources in a game scenario as described above.
  • a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method of processing virtual resources in a game scenario as described above.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the game is updated in units of areas.
  • the state of virtual resources in the scene which effectively reduces resource consumption and can greatly reduce the pressure of data processing.
  • FIG. 1 is a flowchart of a method for processing a virtual resource in one game scenario according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a virtual resource three-dimensional reconstruction mapping relationship in one of the exemplary embodiments of the present disclosure
  • FIG. 3 is a schematic diagram of a virtual resource status index table in one of the exemplary embodiments of the present disclosure
  • FIG. 4 is a flowchart of a method for processing virtual resources in one game scenario according to an embodiment of the present disclosure
  • FIG. 5 is a flowchart of a method for processing virtual resources in one game scenario according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a processing device of a virtual resource in one game scenario according to an embodiment of the present disclosure
  • FIG. 7 is a structural diagram of a processing device for virtual resources in one game scenario according to an embodiment of the present disclosure.
  • FIG. 8 is a structural diagram of one of the game systems according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of one storage medium according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of one of the storage media according to an embodiment of the present disclosure.
  • trigger events disclosed in this specification may be preset, and different trigger events may trigger execution of different functions.
  • the embodiment of the present disclosure provides a method for processing a virtual resource in a game scenario.
  • the execution entity of the method is a server, and the server may be any server device such as one or more computers, servers, and clusters.
  • 1 is a flow chart of a method for processing virtual resources in a game scene according to an embodiment of the present invention. As shown in FIG. 1, in the embodiment, the method includes the following steps:
  • Step S110 determining an area where the virtual object is located according to a current position of the virtual object in the game scene
  • Step S120 Receive an identifier of the virtual resource to be removed, and determine the virtual resource to be removed according to the identifier of the virtual resource to be removed.
  • Step S130 deleting the virtual resource to be removed from the area of the game scenario, and generating regional virtual resource state information corresponding to the area;
  • step S140 the area virtual resource status information is sent to the client corresponding to the virtual object, so that the client controls the rendering display of the virtual resource corresponding to the area virtual resource status information according to the area virtual resource status information.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the game scene may be square or other shapes (for example, a circle or the like).
  • the game scene can include ground, mountains, rocks, flowers, grass, trees, buildings, and the like.
  • the game scene includes at least one virtual resource
  • the virtual resource may be a construction object built in the game scene, such as a house, a horizontal plane, a vertical plane, a slope, a table, a chair, a street lamp, and the like.
  • the virtual resource can be presented through the graphical user interface of the client, and the presented content can include all of the virtual resources or a part of the virtual resources.
  • the game scene includes at least one virtual object, which can be presented through a graphical user interface of the client, and the presented content may include all of the virtual object or a part of the virtual object.
  • the content presented by the graphical user interface may include all of the virtual objects; for example, in the first-person perspective game, the content presented by the graphical user interface may include portions/parts of the virtual object.
  • the virtual object may be a virtual object of the enemy camp, or may be a virtual object of the own camp.
  • the virtual object may perform corresponding actions in the game scene in response to the user's operation. For example, the user may control the virtual object to go and run in the game scene.
  • the present invention is not limited herein, and the like, the smashing, the smashing, the attacking, the shooting, and the like.
  • step S110 an area in which the virtual object is located is determined according to a current location of the virtual object in the game scene.
  • the server monitors the current position of the virtual object in the game scene in real time.
  • the virtual object can change the moving direction of the virtual object according to the touch operation of the user on the client in the game scene, thereby performing free movement, thereby causing virtual The position of the object changes in the game scene.
  • the area in which the virtual object is located is determined according to the current position of the virtual object in the game scene.
  • the area may be a circular range area in the game scene centered on the position where the virtual object is located, with a preset distance as a radius, or an arbitrary shape area including the current position where the virtual object is located, and may also be
  • the game scene is divided into a plurality of regions in advance, and the preset region to which the current location belongs is determined according to the current position of the virtual object in the game scene.
  • the game scene is divided into multiple areas, and each of the areas is respectively provided with an area version number, where the area version number is used to identify current status information of the virtual resources in the area.
  • the game scene is divided into a plurality of regions, which are logical game scene regions, and the division of the region may be invisible to the player or visible to the player, and the region is used for the game scene and the game scene.
  • the model in the area is managed regionally. Thereby effectively reducing resource consumption and greatly reducing data processing pressure.
  • the server In order to characterize the old and new state of the virtual resource status information in each area, the server maintains a regional version number for each area.
  • the version number of the area may be a positive natural integer.
  • the version number of the area may be iteratively changed according to a preset rule.
  • the manner of iterating the version number may be: The area version number is incremented by 1, the area version number is decremented by 1, or a unique identifier is added to the area version number, and so on. Therefore, the old and new state of the virtual resource status information in the area is identified by the version number of the area.
  • the area version number of the area Z is 2, and when the status of the virtual resource in the area Z is changed, the area version number of the area Z is iterated to 3, and the area version number of the area Z is 3 corresponding to the area virtual resource status.
  • the information is current state information of the virtual resources in the area Z.
  • step S110 the following steps are further included:
  • Step S1101 determining whether the virtual object is entering the area for the first time
  • Step S1102 If it is the first time to enter the area, save the current area version number of the area as the virtual object area version information, and send the area virtual resource status information corresponding to the current area version number of the area to the The client corresponding to the virtual object;
  • Step S1103 If not entering the area for the first time, acquiring virtual object area version information corresponding to the virtual object;
  • Step S1104 Match the virtual object area version information with the current area version number of the area;
  • step S1105 if the virtual object area version information is different from the current area version number of the area, the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object.
  • the server maintains a zone version number for each zone. At the same time, it maintains the zone version information of the zone it passes through.
  • the server sends the zone to the zone.
  • the version number is saved as the virtual object area version information, and the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object, so that the client loads according to the virtual resource status information of the area.
  • Virtual resources within the area When the virtual object enters the area again, the virtual object area version information of the area corresponding to the virtual object is obtained, and the virtual object area version information is matched with the current area version number of the area.
  • the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object, so that the client updates the local cache related information according to the area virtual resource status information and/or loads the area.
  • the server maintains an area version number 2 for the area Z.
  • the server saves the current area version number 2 of the area Z as the area Z corresponding to the role a.
  • the area version information, and the area virtual resource status information corresponding to the area version number 2 of the area Z is sent to the client a corresponding to the role a.
  • the current area version number of the area Z becomes 3.
  • the virtual object area version information of the area Z corresponding to the role a is obtained as 2 If the virtual object area version information is different from the current area version number of the area Z, the server sends the area virtual resource status information corresponding to the current area version number 3 of the area Z to the client a corresponding to the role a.
  • the server maintains an area version number for each area, and also maintains the area version information of the area through which the virtual object passes when the virtual object first enters an area.
  • the server saves the current area version number of the area as the virtual object area version information, and determines whether the current area version number of the area is consistent with the initial area version number. If not, the current area version number of the area is corresponding.
  • the area virtual resource status information is sent to the client corresponding to the virtual object, so that the client loads the virtual resource in the area according to the area virtual resource status information.
  • the virtual object area version information of the area corresponding to the virtual object is obtained, and the virtual object area version information is matched with the current area version number of the area.
  • the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object, so that the client updates the local cache related information according to the area virtual resource status information and/or loads the area.
  • the initial zone version number assigned by the server to zone Z is 1, and the current zone version number 2 of zone Z.
  • role a manipulated by client a
  • the server will present the zone Z.
  • the area version number 2 is saved as the area version information of the area Z corresponding to the role a. If the current area version number of the area Z is different from the initial area version number, the area virtual resource status information corresponding to the area version number 2 of the area Z is Send to client a corresponding to role a.
  • the current area version number of the area Z becomes 3.
  • the virtual object area version information of the area Z corresponding to the role a is obtained as 2 If the virtual object area version information is different from the current area version number of the area Z, the server sends the area virtual resource status information corresponding to the current area version number 3 of the area Z to the client a corresponding to the role a.
  • the area version number is set to realize the synchronization of the virtual resource state information in the area and the regional management of the model in the game scenario, so as to prevent the virtual object from repeatedly entering a certain area, so that the corresponding client continuously refreshes the state, effectively reducing
  • the resource consumption can greatly reduce the data processing pressure and improve the data synchronization efficiency.
  • step S120 the identifier of the virtual resource to be removed is received, and the virtual resource to be removed is determined according to the identifier of the virtual resource to be removed.
  • the virtual resources in the game scenario are assigned a unique identifier, such as a global ID, a serial number, etc., after the server receives the identifier of the virtual resource to be removed sent by the client, the local query is obtained and obtained according to the identifier. Identify the corresponding virtual resource.
  • a name to ID mapping table is maintained on the client side, the table stores the names of all virtual resources in the game scene and the ID assigned to the virtual resource, and the name and ID are given in the table.
  • the mapping relationship when the client detects the removal event, obtains the name of the virtual resource to be removed according to the removal event, and obtains the ID corresponding to the virtual resource from the name to the ID mapping table according to the name of the virtual resource.
  • the client sends the ID of the virtual resource to the server. After receiving the virtual resource ID sent by the client, the server locally queries and obtains the virtual resource corresponding to the ID according to the virtual resource ID.
  • the global ID is mainly used for client-side and server-side communication. This is because when a virtual resource is used to communicate with a unique name in the scene, the name is usually very long, which wastes player traffic, so a 4-byte integer is used to uniquely identify the virtual resource. Communicate.
  • the server when the game is running, sends an initialization message to the client, and assigns a unique global ID to all virtual resources in the game scenario.
  • the client receives the initialization information, An entity object is created for all virtual resources to manage each virtual resource.
  • the client also acquires all the virtual resources that have been loaded, and binds these virtual resources to the corresponding entities. This enables the entity to control the virtual resources.
  • the specific virtual resource information is replaced by the ID, and the efficiency of data transmission can be effectively improved.
  • step S130 the virtual resource to be removed is deleted from the area of the game scenario, and the regional virtual resource state information corresponding to the area is generated.
  • the server maintains the state information of all the virtual resources existing in the game scenario.
  • the virtual resource to be removed may be directly deleted from the region determined by the current location of the virtual object in the game scenario.
  • the virtual resource to be removed is deleted from the region determined by the current location of the virtual object in the game scenario, and the regional virtual resource state corresponding to the region is generated.
  • the regional virtual resource status information may be current status information including all virtual resources in the corresponding area, including: whether it is removed, the material of the virtual resource, the remaining blood volume, and the like; or, the regional virtual resource status information may be included
  • the current state information of all the virtual resources in the corresponding area including: the material of the virtual resource, the remaining blood volume, and the like; or, the regional virtual resource state information may be current state information including the virtual resource in the corresponding area.
  • the virtual resource A, B, C, and D exist in the area determined by the current location of the virtual object (set to the area Z).
  • the virtual resource is deleted.
  • the virtual resource is deleted from the area Z of the game scene, that is, the deleted area Z currently has virtual resources B, C, and D.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may be The following contents are included: virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may include the following content: virtual resource A: has been removed.
  • the method before the deleting the virtual resource to be removed from the area of the game scenario, the method further includes: detecting that the virtual resource to be removed meets a preset condition.
  • the preset condition may be preset by the developer according to the actual situation.
  • the virtual resource to be removed is deleted from the area of the game scenario. For example, when it is detected that the current remaining blood volume of the virtual resource to be removed is 0, the virtual resource to be removed is deleted from the area of the game scenario; for example, when detecting that the virtual resource to be removed is in a specific attack mode (When the virtual object is in the direct demolition mode or the virtual resource to be removed is attacked by the dismantled weapon), the virtual resource to be removed is deleted from the area of the game scenario, and the like.
  • the virtual resources A, B, C, and D exist in the area determined by the current location of the virtual object (set to area Z), such as: virtual resource A: normal, remaining blood volume 60%; virtual resource B: normal The remaining blood volume is 100%; the virtual resource C, the remaining blood volume is 100%: normal; the virtual resource D, the remaining blood volume is 100%.
  • virtual resource A normal, remaining blood volume 60%
  • virtual resource B normal The remaining blood volume is 100%
  • the virtual resource C the remaining blood volume is 100%: normal
  • the virtual resource D the remaining blood volume is 100%.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal, residual blood volume 100%; virtual resource C, remaining blood volume 100%: normal ; virtual resource D, the remaining blood volume is 100%; or, the information may include the following contents: virtual resource B: normal, residual blood volume 100%; virtual resource C, remaining blood volume 100%: normal; virtual resource D, residual blood The amount is 100%; or, the information may include the following content: virtual resource A: has been removed.
  • the virtual resources A, B, C, and D exist in the area determined by the current location of the virtual object (set to the area Z), and the virtual resource to be removed is determined to be the virtual resource.
  • the virtual resource to be removed is determined to be the virtual resource.
  • the virtual resource when it is detected that the virtual resource A is attacked by the dismantled weapon (taro, hammer, etc.), or when the virtual object is detected in the direct demolition mode, the virtual resource is deleted from the zone Z of the game scene, that is, the deleted zone Z
  • the virtual resources B, C, and D There are currently virtual resources B, C, and D.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may be The following contents are included: virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may include the following content: virtual resource A: has been removed.
  • the method before the generating the regional virtual resource state information corresponding to the area, the method further includes the following steps:
  • Step S1301 Determine an adjacent virtual resource that has an adjacent relationship with the virtual resource to be removed.
  • Step S1302 Obtain an adjacency relationship list of the adjacent virtual resources, and delete the to-be-removed virtual resource from the adjacency relationship list.
  • Step S1303 determining, according to the adjacency relationship list, whether the adjacent virtual resource is in communication with the ground. If the adjacent virtual resource is incapable of communicating with the ground, the adjacent virtual resource is from the game scene. Deleted in the area.
  • the adjacent virtual resource that is adjacent to the virtual resource to be removed may be directly adjacent to the virtual resource to be removed, or may be indirectly adjacent to the virtual resource to be removed. That is, the adjacent relationship includes a direct neighbor relationship and an indirect neighbor relationship.
  • a direct neighbor relationship means that two virtual resources have a common edge, or one side of one virtual resource is connected to the surface of another virtual resource, or one point of one virtual resource is connected to the surface of another virtual resource.
  • the virtual resource A is a horizontal plane
  • the virtual resource B is also a horizontal plane.
  • the virtual resource A and the virtual resource B are juxtaposed together and the sides of the two horizontal planes are attached together, the two horizontal planes are considered to be directly adjacent;
  • the virtual resource C is a vertical surface.
  • the virtual resource A and the virtual area are considered to be virtual.
  • Resource C is directly adjacent.
  • Indirect adjacency relationship means that two virtual resources have the same virtual resource with direct relationship.
  • virtual resource A is a horizontal plane
  • virtual resource B is also a horizontal plane
  • virtual resource D exists between virtual resource A and virtual resource B ( If the two sides of the virtual resource D are directly adjacent to the virtual resource A and the virtual resource B, respectively, it is considered that there is an indirect neighbor relationship between the virtual resource A and the virtual resource B.
  • the server maintains a list of adjacency relationships for each virtual resource in the game scenario.
  • the adjacency relationship list records the neighboring virtual resource identifiers currently associated with the virtual resources corresponding to each virtual resource in real time.
  • the neighboring virtual resource of the virtual resource is determined, and the adjacency relationship list of the adjacent virtual resource is obtained, and the virtual resource to be removed is deleted from the adjacency relationship list.
  • the virtual resource A is adjacent to the virtual resource B, and the virtual resource B is adjacent to the virtual resource C and the virtual resource D.
  • the adjacent virtual resource of the virtual resource A is determined to be virtual.
  • the resource B obtains the adjacency list of the virtual resource B, and the list information includes: virtual resource A, virtual resource C, and virtual resource D.
  • the virtual resource A is deleted from the adjacency list.
  • the adjacency list of the virtual resource B includes: a virtual resource C and a virtual resource D.
  • the neighboring virtual resources of each virtual resource can be quickly obtained without detecting each time, which improves the efficiency of data processing.
  • the server starts an initialization terminal that is only used for data export.
  • the initialization terminal loads the latest scene resource, creates a camera, and traverses the game scene using the camera.
  • the collision body of each virtual resource is obtained.
  • One implementation manner is: using the collision body to perform collision detection, thereby obtaining adjacent virtual resources of each virtual resource, and establishing an adjacency relationship of each virtual resource. List.
  • Another implementation manner is: if the virtual resources are spliced with each other or a small gap is left, the collision detection will fail, and there is no direct contact between the model and the model due to the error of the construction model. These adjacent collision bodies are not detected.
  • the position of the collision body, the size of the collision body, and the world rotation matrix are first obtained.
  • a box collision body is newly created at the position of the original collision body, and the collision body is enlarged.
  • Set the value for example, 1.1 times the original collision body or expand the original collision body by 5.5 cm.
  • Use this newly created collision body to perform collision detection, and obtain all other collision bodies that collide with the collision body, and collide according to these.
  • the other collision bodies determine corresponding virtual resource identifiers, thereby obtaining neighboring virtual resources of each virtual resource, and establishing a neighbor relationship list of each virtual resource.
  • the adjacency relationship list corresponding to each virtual resource includes a grounding information identifier (for example, the identifier is 1, indicating that the virtual resource is connected to the ground, and the identifier is 0, indicating that the virtual resource cannot be
  • a grounding information identifier for example, the identifier is 1, indicating that the virtual resource is connected to the ground, and the identifier is 0, indicating that the virtual resource cannot be
  • the virtual resource A is adjacent to the virtual resource B, and the virtual resource B is adjacent to the virtual resource C and the virtual resource D.
  • the virtual resource D is adjacent to the virtual resource E, and only the virtual resource E is connected to the ground.
  • the neighboring virtual resource of the virtual resource A is determined as the virtual resource B, and the adjacency relationship list of the virtual resource B is obtained.
  • the list information includes: virtual resource A, virtual resource C, virtual Resource D, the grounding information is identified as 1 (since virtual resource D can be connected to the ground via virtual resource E).
  • the virtual resource A is deleted from the adjacency list.
  • the adjacency list of the virtual resource B includes: virtual resource C, virtual resource D, and the ground information identifier is 1.
  • the ground information is identified as 1 by the ground information identification in the adjacency list of the virtual resource B. That is, the virtual resource B can be connected to the ground through the virtual resource D. Therefore, the virtual resource B is not removed.
  • the virtual resource A is adjacent to the virtual resource B, and the virtual resource B is adjacent to the virtual resource C and the virtual resource D.
  • the virtual resource D is adjacent to the virtual resource E, and no virtual resource is connected to the ground.
  • the neighboring virtual resource of the virtual resource A is determined as the virtual resource B, and the adjacency relationship list of the virtual resource B is obtained.
  • the list information includes: virtual resource A, virtual resource C, virtual Resource D, the grounding information is identified as 0.
  • the virtual resource A is deleted from the adjacency list.
  • the adjacency list of the virtual resource B includes: virtual resource C, virtual resource D, and the ground information identifier is 0.
  • the ground information identifier in the adjacency list of the virtual resource B By determining the ground information identifier in the adjacency list of the virtual resource B, the ground information is identified as 0, that is, the virtual resource B cannot be connected to the ground, and therefore, the adjacent virtual resource B is from the game scenario. Deleting the area, and determining the neighboring virtual resource B as the virtual resource to be removed, determining that the adjacent virtual resource of the virtual resource B is the virtual resource E, obtaining the adjacency list of the virtual resource E, and repeating the above steps until the traversal is completed. All adjacent virtual resources.
  • the virtual resource to be removed is automatically determined according to the preset neighbor relationship, which reduces the occupation of the system data processing resource. In this way, the user is removed.
  • the other adjacent virtual resources to be dismantled are removed in order to achieve a more realistic collapse of the real-world buildings to mention the user's gaming experience.
  • the step S130 deletes the to-be-removed virtual resource from the area of the game scenario, and generates regional virtual resource state information corresponding to the area, where the method further includes the following steps:
  • Step S1304 deleting the virtual resource to be removed from the area of the game scene
  • step S1305 the area version number corresponding to the area is iterated and determined as the current area version number of the area.
  • Step S1306 updating the regional virtual resource status information.
  • the server After the server removes the virtual resource to be removed from the area of the game scenario, the virtual resource state in the area changes, so the server verifies the area version number corresponding to the area and determines the current status of the area.
  • the area version number, and the area virtual resource status information corresponding to the area is updated.
  • the method for iterating the area version number may be: adding the area version number, adding 1 to the area version number, or adding a unique version to the area version number. logo and more.
  • the server sends the regional virtual resource status information to the client corresponding to all the virtual objects in the area, so that the client corresponding to all the virtual objects in the area is updated and displayed.
  • the state of the virtual resource in the area, and the client corresponding to all the virtual objects outside the area does not update the state of the virtual resource in the area, but when the virtual object outside the area enters the area, the virtual The virtual object area version information of the object is asynchronously updated with the matching of the current area version number of the area.
  • the initial zone version number assigned by the server to the zone Z is 1, and the current zone version number 2 of the zone Z.
  • the area virtual resource status information corresponding to version number 2 of the area is: virtual resource A: normal; virtual Resource B: Normal; Virtual Resource C: Normal; Virtual Resource D: Normal.
  • the updated area virtual resource status information is: virtual resource A: has been removed; virtual resource B: normal; Virtual resource C: normal; virtual resource D: normal; or updated regional virtual resource status information: virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or updated regional virtual resource status information: virtual resource A: It has been removed.
  • the server sends the regional virtual resource status information to the clients a, b, and c corresponding to all the roles a, b, and c in the area Z, so that the clients corresponding to all the roles in the area Z are updated and The state of the virtual resource in the area Z is displayed, and the role d is outside the area Z. Therefore, the client d corresponding to the role d does not receive the virtual resource status information of the area or ignores the status information of the virtual resource received in the area. Therefore, the state of the virtual resource in the area Z is not updated or displayed.
  • the server saves the current area version number 3 of the area Z as the area version information of the area Z corresponding to the role d.
  • the area virtual resource status information corresponding to the area version number 3 of the area Z is sent to the client d corresponding to the role d, so that the client d is updated. And displaying the state of the virtual resource in the area Z; when the role d is not entering the area Z for the first time, obtaining the virtual object area version information of the area Z corresponding to the role d is 2, because The version of the target area version is different from the current version number of the area Z.
  • the server sends the area virtual resource status information corresponding to the current area version number 3 of the area Z to the client d corresponding to the role d, so that the client End d updates and displays the status of the virtual resources within the zone Z.
  • the area version number is set to realize the synchronization of the virtual resource state information in the area and the regional management of the model in the game scenario.
  • the client in the area is synchronized in real time,
  • the asynchronous synchronization of the clients outside the area effectively reduces resource consumption, and can greatly reduce data processing pressure and improve data synchronization efficiency.
  • step S140 the regional virtual resource state information is sent to the client corresponding to the virtual object, so that the client controls the regional virtual resource state information according to the regional virtual resource state information. Rendering display of the corresponding virtual resource.
  • the server sends the regional virtual resource status information to the client corresponding to the virtual object, so that the client updates the state of the virtual resource in the area according to the regional virtual resource status information, and according to the updated virtual resource.
  • the state rendering shows the virtual resource corresponding to the regional virtual resource state information.
  • the status of the virtual resource in the area Z saved locally by the client a is: virtual resource A: normal; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; server virtual resource status information Sent to the client a, the virtual resource status information of the area is: virtual resource A: has been removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or the virtual resource status information of the area is: virtual resource B: Normal; virtual resource C: normal; virtual resource D: normal; or virtual resource status information of the area: virtual resource A: removed.
  • the client a updates the state of the virtual resource in the area according to the virtual resource state information of the area, that is, the state of the virtual resource A is changed from normal to removed, and the virtual resource A is removed and displayed in the graphical user interface of the client A. Animation.
  • the server sends the regional virtual resource status information to the client corresponding to the virtual object, and the client corresponding to all the virtual objects in the area, so that the client is virtualized according to the area.
  • the resource status information updates the status of the virtual resource in the area, and displays the virtual resource corresponding to the area virtual resource status information according to the updated status of the virtual resource.
  • the virtual resource corresponding to the regional virtual resource state information is displayed according to the updated state of the virtual resource, where the state of the virtual resource is determined by the virtual resource state information, and the virtual resource state information includes The current state of the virtual resource, such as: whether it was removed, the material of the virtual resource, the remaining blood volume, and so on.
  • the virtual resource status information of the virtual resource A is: virtual resource A: normal, the normal state of the virtual resource is rendered and displayed in the graphical user interface of the client; for example, the virtual resource status information of the virtual resource A is: virtual resource A If the virtual resource A does not exist in the current virtual resource status information, the virtual resource is hidden or deleted after the demo animation of the virtual resource is displayed in the graphical user interface of the client; for example, the virtual resource A
  • the virtual resource status information is: virtual resource A: 20% of the remaining blood volume, the virtual resource is rendered and displayed in the graphical user interface of the client, and a display effect such as a crack or a gap is added to the virtual resource.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the method further includes the following steps:
  • Step S150 Establish a virtual resource state index table for the plurality of virtual resources in the game scenario, where the virtual resource state index table includes at least: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource. ;
  • Step S160 Synchronize the virtual resource status index table to the client.
  • step S150 and step S160 may be performed as an initialization step before step S110, or may be performed as a reset step before, after or during any step.
  • the virtual resource state index table is a multi-level indexed storage data structure for storing state information of all virtual resources in the game scenario, wherein the virtual resource state index table includes at least: each The virtual resource identifier corresponding to the virtual resource and the virtual resource state information of each virtual resource.
  • the virtual resource state index table is synchronized to the client, so that the client can quickly locate the virtual resource, and the server can also use the virtual resource state index table established by itself or maintain the state information of multiple virtual resources existing in the game scenario. .
  • the game scenario includes a composite model composed of at least two virtual resources, where the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify The virtual resources that make up the composite model.
  • the multiple virtual resources in the game scene can be spliced together to form a composite model.
  • a composite model For example, two horizontal virtual resources and four vertical virtual resources can be spliced together to form a house (synthetic model).
  • the use is performed.
  • a 32-bit integer is used as the ID, and the lower 12 bits of the integer are used as the index of the submodel of the composite model, and the remaining 24 bits are used as the index of the independent model/synthesis model.
  • 12bit is used as the index of the submodel because the largest composite model in the game scene already has several hundred submodels, and 12bit can represent 4096 numbers, which is enough for current use and reserved for future larger synthetic models. There is enough space.
  • the high position can represent up to 2 19th power, and the independent model/synthesis model in the game scene is only tens of thousands.
  • an offset of 1 is added for this, so that when the index of the sub-model is 0, it indicates that the virtual resource is an independent model.
  • the IDs of the two horizontal virtual resources are:
  • the IDs of the four vertical virtual resources are:
  • the ID of an independent horizontal virtual resource is:
  • the virtual resource can be quickly identified as an independent model or a sub-model of the composite model. For example, when the low-order information is 0000 0000 0000, the virtual resource is identified as an independent model, and when the low-order information is 0000 0000 When there is a numerical offset such as 0001, the virtual resource is identified as a composite model.
  • all the sub-models of the composite model can be quickly identified, for example, when the virtual resource ID with the high-order information of 0000 0000 0000 0001 belongs to a sub-model of a composite model.
  • the convenience of the client to access the structure of the data storage is improved, so that the client can quickly locate which virtual resources are in the area when synchronizing the virtual resource state information of a certain area.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward direction. Beveled.
  • the virtual resource state index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the newly created virtual resource (ie, generated and generated in the game screen) is triggered by the player's construction instruction, and the construction instruction includes at least the space type of the virtual resource (ie, the newly created resource) that the player intends to build, and may also include the material of the newly created resource. Attributes (such as wood, concrete, bricks, etc.) and quantities.
  • the existing virtual resource is a virtual resource initially set by the game developer in the game scenario.
  • the shape of the existing virtual resource may be the same as or different from the shape of the newly created virtual resource.
  • the shape information of the newly created virtual resource includes: a horizontal plane and a vertical plane.
  • the shape information of the existing virtual resource includes: a horizontal plane, a vertical plane, a pillar, and an irregular type.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometry or the geometric body cross section, in the game scene.
  • Said region consists of at least one of said geometries.
  • the space of the game scene is divided into a plurality of geometric pieces that are spliced together.
  • the geometry may be a rectangular parallelepiped, a cube, a parallelepiped, a honeycomb body, etc. It can be understood that the geometric bodies can be spliced together to form a space for the entire game scene. It should be noted that the geometry into which the space of the game scene is divided is a logical space, for example, a range of spaces in which the x, y, and z coordinates are in the range of 0 to 50.
  • the area divided in the game scene is a two-dimensional area divided on the x, z axis (horizontal direction), each divided area is composed of at least one of the described geometrical bodies, and the divided area is usually an integer multiple of the geometrical body.
  • the geometry itself is a three-dimensional region, and each of the divided regions described herein is composed of at least one of the geometric bodies, that is, regardless of the y-axis (vertical direction), and is determined by the x and z axes.
  • each divided area is composed of at least one of said geometries.
  • the geometry is a rectangular parallelepiped of the same length and width.
  • the coordinate system XYZ is established in the space of the game scene, which is a horizontal direction XZ coordinate and a vertical upward coordinate Y, respectively.
  • the length, width and height of the cuboid can be determined by the developer. Arbitrarily set according to the actual situation.
  • the surface of each geometry and the section inside the geometry can be used to build new virtual resources.
  • the original building components (already virtual resources) in the game scene are also Pre-placed according to the surface of the geometry and the internal section.
  • the newly created virtual resource has the same placement rules as the existing virtual resource, it is easier to match the existing virtual resource when generating the newly created virtual resource, which also greatly reduces the calculation amount and improves the running efficiency of the game.
  • the shape information of the virtual resource may be: a horizontal plane, a vertical plane, an upward slope, a downward slope, that is, a geometric position relative to the rectangular parallelepiped, may be constructed along a vertical plane of the rectangular parallelepiped, constructed along a horizontal plane of the rectangular parallelepiped, along the inner slope of the rectangular parallelepiped Built in the face.
  • the vertical plane that is, the four planes in the cuboid perpendicular to the plane of the game scene
  • the horizontal plane is two planes parallel to the plane of the game scene in the cuboid
  • the inner slope surface is a diagonal section in the rectangular body (the The plane of the diagonal section passes through the two sides of the cuboid horizontal plane and intersects the two perpendicular faces of the cuboid).
  • the virtual resource built along the vertical plane of the rectangular parallelepiped is a vertical wall
  • the virtual resource built along the horizontal parallelepiped is a horizontal wall
  • the virtual resource constructed along the inner slope of the rectangular parallelepiped is upward. Or a downward slope.
  • the game scene is geometrically normalized, so that the newly created virtual resources and the existing virtual resources in the game scene can be aligned and spliced to enhance the beauty of the screen; at the same time, the virtual resources are prevented from being constructed during the construction of the game scene.
  • Physical collision detection can effectively reduce system overhead and improve the smooth running of the game.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometry and the virtual resource.
  • the server obtains the ID of all virtual resources, the model information of the virtual resource from the game scene file (the virtual resource may be a sub-model in the composite model, or an independent model), world coordinate information, and rotation information.
  • the gim file of the synthetic model in the game scene is parsed, and each sub-model in the synthetic model is obtained to rotate, scale, and position information in the local coordinate system of the synthetic model, and the gim file path of each sub-model is obtained. Parse the gim file of the submodel and obtain the bounding box information of each submodel.
  • the virtual resources in the game scene are reconstructed in three dimensions, the geometry of each virtual resource is determined, and the mapping relationship between the virtual resources and the geometry is established.
  • the purpose of 3D reconstruction is to provide information for the gridded construction of virtual resources, to determine where in the game scene can build virtual resources, and where to build virtual resources.
  • FIG. 2 is a schematic diagram of a virtual resource three-dimensional reconstruction mapping relationship in one exemplary embodiment of the present disclosure.
  • the sub-model of the composite model may be mapped into the following types:
  • the composite model on the right side of FIG. 2 is obtained, and the coordinates of the synthetic model in FIG. 2 in the geometry are (x, y, z).
  • the abstracted synthetic model is used to describe the original building as shown in the following table:
  • the mapping relationship between the virtual resource and the geometry is established, so that when the virtual object is built or disassembled in the game scene, the virtual resource type index table can be used to determine the virtual resource type existing in each geometry, and the determination can be The location where the construction is performed can also quickly index the geometry of the virtual resource according to the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the area index information corresponding to each virtual resource is used to identify the mapping relationship between each virtual resource and the area. It is beneficial to improve the convenience of the client to access the structure of the data storage, so that the client can quickly determine the area where the virtual resource is to be removed, or can quickly locate the virtual resource status information of an area. What are the virtual resources in the area.
  • the foregoing embodiment is beneficial to improving the convenience of the client to access the structure of the data storage, so that the client can quickly locate the virtual resources in the area when synchronizing the virtual resource state information of a certain area, and further Quickly determine the geometry, classification information, shape information, etc. of the virtual resource; at the same time, through the virtual resource state index table, it is not necessary to load the entire game scene into the memory, and only need to have the geometry of the virtual resource in the area Loaded into memory. This greatly saves memory consumption.
  • the virtual resource state index table adopts an index storage manner
  • FIG. 3 is a schematic diagram of a virtual resource state index table in one exemplary embodiment of the present disclosure, as shown in FIG.
  • the index is a region index
  • the secondary index is a geometry index
  • the third level index is a virtual resource classification information index
  • the fourth level index is a virtual resource shape information index.
  • the step S130 deletes the to-be-removed virtual resource from the area of the game scenario, and generates regional virtual resource state information corresponding to the area, where the method further includes the following steps:
  • Step S1307 Obtain virtual resource state information in the area from the virtual resource state index table according to the area.
  • step S1308 the virtual resource to be removed is deleted from the area of the game scenario, and the virtual resource state information in the area is updated, and the regional virtual resource state information corresponding to the area is generated.
  • the server can maintain the state information of the virtual resources existing in the game scenario by using the virtual resource state index table established by itself. After determining the area where the virtual object is located according to the current position of the virtual object in the game scene, reading the locally maintained area from the virtual resource status index table, and indexing the area from the virtual resource status index table according to the area Virtual resource status information. After the virtual resource to be removed is deleted, the virtual resource status index table is updated in real time, and only the virtual resource status information in which the status change occurs may be updated, or all virtual resource status information in the area may be updated together to ensure The virtual resource state index table can correctly reflect the latest state of each virtual resource in the game scenario, and at the same time, generate the regional virtual resource state information corresponding to the region according to the latest virtual resource state index table.
  • the server uses the area index to quickly update and generate virtual resource status information of the corresponding area, improve information processing efficiency, and effectively reduce resource consumption.
  • the embodiment of the present disclosure further provides a method for processing a virtual resource in a game scenario.
  • the execution body of the method is a client, and the client may be any client device such as a computer, a mobile phone, a tablet computer, a mobile terminal, or an electronic device.
  • FIG. 4 is a flowchart of a method for processing virtual resources in one game scenario according to an embodiment of the present disclosure. As shown in FIG. 4, in the embodiment, the method includes the following steps:
  • Step S210 in response to the removal event of the virtual resource in the game scenario, determining, according to the removal event, a virtual resource from the plurality of virtual resources in the game scenario as a virtual resource to be removed;
  • Step S220 sending the identifier of the virtual resource to be removed to the server
  • Step S230 Receive regional virtual resource state information that is fed back by the server, where the regional virtual resource state information is that the server determines the virtual resource state in the region where the virtual object is located according to the current location of the virtual object in the game scenario. information;
  • Step S240 Update the state of the virtual resource in the area according to the area virtual resource state information, and display and display the virtual resource corresponding to the area virtual resource state information according to the updated state of the virtual resource.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the graphical user interface is obtained by executing a software application on a processor of the client device and rendering on the display of the client device, the content displayed by the graphical user interface at least partially including Part or all of the game scene, the game scene including at least one virtual object.
  • the content presented by the graphical user interface may include all of the game scene or a part of the game scene.
  • the local content of the game scene is displayed on the graphical user interface of the mobile terminal during the game.
  • the game scene can be square or other shapes (eg, round, etc.).
  • the game scene can include ground, mountains, rocks, flowers, grass, trees, buildings, and the like.
  • the game scene includes at least one virtual resource
  • the virtual resource may be a construction object built in the game scene, such as a house, a horizontal plane, a vertical plane, a slope, a table, a chair, a street lamp, and the like.
  • the virtual resources may be presented through a graphical user interface, and the presented content may include all of the virtual resources or may be part of the virtual resources.
  • the game scene includes at least one virtual object, which may be presented through a graphical user interface, and the presented content may include all of the virtual object or a part of the virtual object.
  • the content presented by the graphical user interface may include all of the virtual objects; for example, in the first-person perspective game, the content presented by the graphical user interface may include portions/parts of the virtual object.
  • the virtual object may be a virtual object of the enemy camp, or may be a virtual object of the own camp.
  • the virtual object may perform corresponding actions in the game scene in response to the user's operation. For example, the user may control the virtual object to go and run in the game scene.
  • the present invention is not limited herein, and the like, the smashing, the smashing, the attacking, the shooting, and the like.
  • step S210 in response to the removal event of the virtual resource in the game scenario, determining, according to the teardown event, a virtual resource from the plurality of virtual resources in the game scenario is The virtual resources to be removed.
  • the removal event of the virtual resource in the game scenario may be triggered by detecting a touch operation of a specific trigger control provided in the user graphical interface; or may be triggered according to a preset interaction condition, for example, a user's pressing , shaking, voice input, special gestures, etc.; can also be triggered by detecting whether the virtual resources in the game scene are attacked. For example, when the virtual resource A is detected to be collided by bullets or props, the dismantling event is triggered. The remaining blood volume of the virtual resource in the game scene is detected to be 0.
  • the attack is triggered by detecting whether the virtual resource in the game scene is attacked, wherein the attack may be multiple attacks from the same virtual object or different virtual objects, so the virtual resource may be set to be triggered every time the attack is attacked.
  • the dismantling event can also be set to trigger the dismantling event when the virtual resource is attacked by the first, preset, and specific attacks of each different virtual object.
  • the triggering is performed by detecting that the remaining blood volume of the virtual resource in the game scene is 0, wherein the virtual resource has an initial blood amount of a preset value, and when attacked, a certain amount of blood is lost according to the attack type.
  • the teardown event is triggered when detecting that the remaining blood volume of the virtual resource in the game scene is zero.
  • Determining, according to the demolition event, a virtual resource from the plurality of virtual resources in the game scenario as a virtual resource to be removed For example, when the virtual resource A is detected to be collided by the bullet or the prop, the demolition event is triggered, the virtual resource A is determined as the virtual resource to be removed, and the identifier of the virtual resource A is obtained.
  • a name to ID mapping table is maintained on the client side, the table stores the names of all virtual resources in the game scene and the ID assigned to the virtual resource, and the name and ID are given in the table.
  • the mapping relationship when the client detects the removal event, obtains the name of the virtual resource to be removed according to the removal event, and obtains the ID corresponding to the virtual resource from the name to the ID mapping table according to the name of the virtual resource.
  • the ID of the virtual resource is mainly used for communication between the client and the server. This is because when the virtual resource is used to communicate with the unique name in the scene, the name is usually very long and the player traffic is wasted, so a 4-byte integer unique identifier is used. Virtual resources communicate.
  • the step of responding to the removal event of the virtual resource in the game scenario comprises: associating a physical button of the client with a teardown instruction, when the mobile terminal detects that the physical key is pressed
  • the virtual object is controlled, the virtual resources in the game scene are removed.
  • the virtual object is controlled to be removed by a preset audio command.
  • step S220 the identifier of the virtual resource to be removed is sent to the server.
  • the client sends the identifier of the virtual resource to the server.
  • the server After receiving the virtual resource identifier sent by the client, the server queries and obtains the virtual resource corresponding to the identifier according to the virtual resource identifier.
  • the sending of the identifier of the to-be-deleted virtual resource to the server may be sent by using a wired or wireless manner.
  • the communication protocol used is a prior art and is not described here.
  • step S230 the regional virtual resource state information fed back by the server is received, where the regional virtual resource state information is determined by the server according to the current location of the virtual object in the game scenario. Virtual resource status information in the area;
  • the server determines an area in which the virtual object is located according to a current location of the virtual object in the game scene.
  • the area may be a circular range area in the game scene centered on the position where the virtual object is located, with a preset distance as a radius, or an arbitrary shape area including the current position where the virtual object is located, and may also be
  • the game scene is divided into a plurality of regions in advance, and the preset region to which the current location belongs is determined according to the current position of the virtual object in the game scene.
  • the server maintains the state information of all the virtual resources that exist in the game scenario.
  • the virtual resource to be removed may be directly determined from the game scenario according to the current location of the virtual object.
  • the virtual resource to be removed is deleted from the area determined by the current location of the virtual object in the game scene, and the area is generated.
  • Corresponding regional virtual resource state information where the regional virtual resource state information may be current state information including all virtual resources in the corresponding region, including: whether it is removed, the material of the virtual resource, the remaining blood volume, and the like; or, the area virtual
  • the resource state information may be current state information including all virtual resources in the corresponding area, including: a material of the virtual resource, a residual blood volume, and the like; or, the regional virtual resource state information may be a virtual resource including a state change in the corresponding area.
  • the client receives the foregoing regional virtual resource status information fed back by the server.
  • the virtual resources A, B, C, and D exist in the area determined by the current location of the virtual object (set to the area Z).
  • the virtual resource to be removed is the virtual resource A
  • the virtual resource is taken from the game scene.
  • the area Z is deleted, that is, the deleted area Z currently has virtual resources B, C, and D.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may be The following information is included: virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may include the following content: virtual resource A: has been removed; the client receives the above-mentioned regional virtual resource status fed back by the server information.
  • the server when the server detects that the virtual resource resource to be removed meets a preset condition, the server deletes the virtual resource to be deleted from the area of the game scenario.
  • the preset condition may be preset by the developer according to the actual situation.
  • the virtual resource to be removed is deleted from the area of the game scene. .
  • the server detects that the current remaining blood volume of the virtual resource to be removed is 0, the virtual resource to be removed is deleted from the area of the game scenario; for example, when the server detects the virtual resource to be removed.
  • the specific attack mode such as when the virtual object is in the direct demolition mode or the virtual resource to be removed is attacked by the dismantled weapon
  • the virtual resource to be removed is deleted from the area of the game scenario, and the like.
  • the virtual resources A, B, C, and D exist in the area determined by the current location of the virtual object (set to area Z), such as: virtual resource A: normal, remaining blood volume 60%; virtual resource B: normal The remaining blood volume is 100%; the virtual resource C, the remaining blood volume is 100%: normal; the virtual resource D, the remaining blood volume is 100%.
  • virtual resource A normal, remaining blood volume 60%
  • virtual resource B normal The remaining blood volume is 100%
  • the virtual resource C the remaining blood volume is 100%: normal
  • the virtual resource D the remaining blood volume is 100%.
  • the virtual resource to be removed is the virtual resource A
  • the back zone Z currently has virtual resources B, C, and D.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal, residual blood volume 100%; virtual resource C, remaining blood volume 100%: normal ; virtual resource D, the remaining blood volume is 100%; or, the information may include the following contents: virtual resource B: normal, residual blood volume 100%; virtual resource C, remaining blood volume 100%: normal; virtual resource D, residual blood
  • the quantity may be 100%; or, the information may include the following content: the virtual resource A: has been removed; the client receives the above-mentioned regional virtual resource status information fed back by the server.
  • the virtual resources A, B, C, and D exist in the area determined by the current location of the virtual object (set to the area Z), and the virtual resource to be removed is determined to be the virtual resource.
  • the virtual resource to be removed is determined to be the virtual resource.
  • the virtual resource when it is detected that the virtual resource A is attacked by the dismantled weapon (taro, hammer, etc.), or when the virtual object is detected in the direct demolition mode, the virtual resource is deleted from the zone Z of the game scene, that is, the deleted zone Z
  • the virtual resources B, C, and D There are currently virtual resources B, C, and D.
  • the area virtual resource status information corresponding to the area Z is generated, and the information may include the following contents: virtual resource A: removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal, or the information may be The following information is included: virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the information may include the following content: virtual resource A: has been removed; the client receives the above-mentioned regional virtual resource status fed back by the server information.
  • step S240 the state of the virtual resource in the area is updated according to the area virtual resource status information, and the area virtual resource status information is displayed according to the updated state of the virtual resource. Corresponding virtual resources.
  • the client updates the state of the virtual resource in the area according to the area virtual resource state information, and displays the virtual state corresponding to the area virtual resource state information according to the updated state of the virtual resource on the graphical user interface of the client.
  • the resource wherein the client saves the state information of the virtual resource in the area, or saves the state information of all the virtual resources in the game scene, and the format and data structure of the stored information can be arbitrarily set as needed.
  • the client updates the state information of the locally saved virtual resource according to the received regional virtual resource state information, thereby completing the update of the state of the virtual resource in the region.
  • the status of the virtual resource in the area Z saved locally by the client a is: virtual resource A: normal; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; server virtual resource status information Sent to the client a, the virtual resource status information of the area is: virtual resource A: has been removed; virtual resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the virtual resource status information of the area is: virtual Resource B: normal; virtual resource C: normal; virtual resource D: normal; or, the virtual resource status information of the area is: virtual resource A: has been removed; client a updates the virtual area in the area according to the virtual resource status information of the area
  • the state of the resource that is, the state of the virtual resource A is changed from normal to removed, and the dismantling animation showing the virtual resource A is rendered in the graphical user interface of the client A.
  • the virtual resource corresponding to the regional virtual resource state information is displayed according to the updated state of the virtual resource, where the state of the virtual resource is determined by the virtual resource state information, and the virtual resource state information includes The current state of the virtual resource, such as: whether it was removed, the material of the virtual resource, the remaining blood volume, and so on.
  • the virtual resource status information of the virtual resource A is: virtual resource A: normal, the normal state of the virtual resource is rendered and displayed in the graphical user interface of the client; for example, the virtual resource status information of the virtual resource A is: virtual resource A : After being dismantled, the virtual resource is hidden or deleted after the demolishing animation of the virtual resource is displayed in the graphical user interface of the client; for example, the virtual resource status information of the virtual resource A is: virtual resource A: residual blood volume 20 %, the virtual resource is rendered and displayed in the graphical user interface of the client, and a display effect such as a crack or a gap is added to the virtual resource.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • step S240 further includes the following steps:
  • Step S2401 Update the state of the virtual resource to be removed and the adjacent virtual resource of the virtual resource to be removed in the area according to the regional virtual resource state information, and according to the updated state of the virtual resource in the area Rendering displays virtual resources within the area.
  • the area virtual resource status information that is received by the server is included in the status information of the virtual resource to be removed, and the method further includes status information of the adjacent virtual resource to be removed adjacent to the virtual resource to be removed.
  • the server determines an adjacent virtual resource that has an adjacent relationship with the virtual resource to be removed, acquires a neighbor relationship list of the adjacent virtual resource, and deletes the virtual resource to be removed from the adjacency relationship list. Determining, according to the adjacency relationship list, whether the adjacent virtual resource is in communication with the ground, and if the adjacent virtual resource is incapable of communicating with the ground, using the adjacent virtual resource from the area of the game scene The deletion is performed, and the regional virtual resource state information is generated according to the current state of the virtual resource in the area.
  • the adjacent virtual resource that is adjacent to the virtual resource to be removed may be directly adjacent to the virtual resource to be removed, or may be indirectly adjacent to the virtual resource to be removed. That is, the adjacent relationship includes a direct neighbor relationship and an indirect neighbor relationship.
  • a direct neighbor relationship means that two virtual resources have a common edge, or one side of one virtual resource is connected to the surface of another virtual resource, or one point of one virtual resource is connected to the surface of another virtual resource.
  • the virtual resource A is a horizontal plane
  • the virtual resource B is also a horizontal plane.
  • the virtual resource A and the virtual resource B are juxtaposed together and the sides of the two horizontal planes are attached together, the two horizontal planes are considered to be directly adjacent;
  • the virtual resource C is a vertical surface.
  • the virtual resource A and the virtual area are considered to be virtual.
  • Resource C is directly adjacent.
  • Indirect adjacency relationship means that two virtual resources have the same virtual resource with direct relationship.
  • virtual resource A is a horizontal plane
  • virtual resource B is also a horizontal plane
  • virtual resource D exists between virtual resource A and virtual resource B ( If the two sides of the virtual resource D are directly adjacent to the virtual resource A and the virtual resource B, respectively, it is considered that there is an indirect neighbor relationship between the virtual resource A and the virtual resource B.
  • the server maintains a list of adjacency relationships for each virtual resource in the game scenario.
  • the adjacency relationship list records the neighboring virtual resource identifiers currently associated with the virtual resources corresponding to each virtual resource in real time.
  • the neighboring virtual resource of the virtual resource is determined, and the adjacency relationship list of the adjacent virtual resource is obtained, and the virtual resource to be removed is deleted from the adjacency relationship list.
  • the client updates the state of the virtual resource in the area according to the area virtual resource state information, and displays the virtual state corresponding to the area virtual resource state information according to the updated state of the virtual resource on the graphical user interface of the client. Resources.
  • the virtual resource to be removed is automatically determined according to the preset neighbor relationship, which reduces the occupation of the system data processing resource. In this way, the user is removed.
  • the other adjacent virtual resources to be dismantled are removed in order to achieve a more realistic collapse of the real-world buildings to mention the user's gaming experience.
  • step S210 the method further includes the following steps, in response to the removal event of the virtual resource in the game scenario:
  • Step S250 acquiring a current location of the virtual object in the game scenario, and acquiring a virtual resource state index table from the local;
  • Step S260 rendering a virtual resource that loads the game scene according to a current location of the virtual object in the game scene and the virtual resource state index table.
  • the moving direction of the virtual object in the game scene can be changed, thereby controlling the virtual object to move freely in the game scene, thereby causing the virtual object to change position in the game scene.
  • Obtaining the current location of the virtual object in the game scene may be obtaining coordinates of the virtual object in the game scene, or other values capable of characterizing the position of the virtual object in the game scene.
  • a mobile controller is provided in the graphical user interface, and the virtual object is configured to move in the first game scenario according to a touch operation received by the mobile controller.
  • the mobile controller may be, for example, a virtual joystick, a direction control virtual button, etc., which is not specifically limited in this exemplary embodiment.
  • the touch operation applied to the mobile controller is detected, and the virtual object is controlled to move in the game scene according to the movement of the touch point of the touch operation.
  • the mobile controller is a virtual joystick that controls the virtual object to move in the game scene according to the touch operation received by the virtual joystick.
  • the mobile controller is a virtual cross key/virtual direction key (D-PAD), and the virtual object is controlled to move in the game scene according to the touch operation received by the virtual cross key.
  • D-PAD virtual cross key/virtual direction key
  • the virtual resource state index table is a multi-level indexed storage data structure for storing state information of all virtual resources in the game scene.
  • the client receives the virtual resources in the game scene from the server.
  • the corresponding virtual resource status index table is stored locally.
  • the client obtains the virtual resource status index table locally.
  • the virtual resource loading the game scene is rendered according to the current location of the virtual object in the game scene and the virtual resource state index table.
  • the virtual resource loading the entire game scenario may be rendered, or may be based on the current location of the virtual object in the game scenario. Rendering loads virtual resources within a partial area of the game scene.
  • the virtual resource state index table can improve the convenience of the client to access the structure of the data storage, so that the client can quickly index the state information of each building model through the index table, improve information processing efficiency, and effectively reduce resource consumption.
  • the virtual resource state index table further includes: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource.
  • the client can quickly locate the virtual resources in the area and quickly obtain the status information of the corresponding virtual resources according to the virtual resource identifier.
  • the game scenario includes a composite model composed of at least two virtual resources, where the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify The virtual resources that make up the composite model.
  • the multiple virtual resources in the game scene can be spliced together to form a composite model.
  • a composite model For example, two horizontal virtual resources and four vertical virtual resources can be spliced together to form a house (synthetic model).
  • the use is performed.
  • a 32-bit integer is used as the ID, and the lower 12 bits of the integer are used as the index of the submodel of the composite model, and the remaining 24 bits are used as the index of the independent model/synthesis model.
  • 12bit is used as the index of the submodel because the largest composite model in the game scene already has several hundred submodels, and 12bit can represent 4096 numbers, which is enough for current use and reserved for future larger synthetic models. There is enough space.
  • the high position can represent up to 2 19th power, and the independent model/synthesis model in the game scene is only tens of thousands.
  • an offset of 1 is added for this, so that when the index of the sub-model is 0, it indicates that the virtual resource is an independent model.
  • the IDs of the two horizontal virtual resources are:
  • the IDs of the four vertical virtual resources are:
  • the ID of an independent horizontal virtual resource is:
  • the virtual resource can be quickly identified as an independent model or a sub-model of the composite model. For example, when the low-order information is 0000 0000 0000, the virtual resource is identified as an independent model, and when the low-order information is 0000 0000 When there is a numerical offset such as 0001, the virtual resource is identified as a composite model. At the same time, according to the high-order information of the virtual resource ID, all the sub-models of the composite model can be quickly identified. For example, when the high-order information is 0000 0000 0000 0001, the virtual resource ID belongs to a sub-model of a composite model.
  • the convenience of the client to access the structure of the data storage is improved, so that the client can quickly locate which virtual resources are in the area when synchronizing the virtual resource state information of a certain area.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward direction. Beveled.
  • the virtual resource state index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the newly created virtual resource (ie, generated and generated in the game screen) is triggered by the player's construction instruction, and the construction instruction includes at least the space type of the virtual resource (ie, the newly created resource) that the player intends to build, and may also include the material of the newly created resource. Attributes (such as wood, concrete, bricks, etc.) and quantities.
  • the existing virtual resource is a virtual resource initially set by the game developer in the game scenario.
  • the shape of the existing virtual resource may be the same as or different from the shape of the newly created virtual resource.
  • the shape information of the newly created virtual resource includes: a horizontal plane and a vertical plane.
  • the shape information of the existing virtual resource includes: a horizontal plane, a vertical plane, a pillar, and an irregular type.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometry or the geometric body cross section, in the game scene.
  • Said region consists of at least one of said geometries.
  • the space of the game scene is divided into a plurality of geometric pieces that are spliced together.
  • the geometry may be a rectangular parallelepiped, a cube, a parallelepiped, a honeycomb body, etc. It can be understood that the geometric bodies can be spliced together to form a space for the entire game scene. It should be noted that the geometry into which the space of the game scene is divided is a logical space, for example, a range of spaces in which the x, y, and z coordinates are in the range of 0 to 50.
  • the area divided in the game scene is a two-dimensional area divided on the x, z axis (horizontal direction), each divided area is composed of at least one of the described geometrical bodies, and the divided area is usually an integer multiple of the geometrical body.
  • the geometry itself is a three-dimensional region, and each of the divided regions described herein is composed of at least one of the geometric bodies, that is, regardless of the y-axis (vertical direction), and is determined by the x and z axes.
  • each divided area is composed of at least one of said geometries.
  • the geometry is a rectangular parallelepiped of the same length and width.
  • the coordinate system XYZ is established in the space of the game scene, which is a horizontal direction XZ coordinate and a vertical upward coordinate Y, respectively.
  • the length, width and height of the cuboid can be determined by the developer. Arbitrarily set according to the actual situation.
  • the surface of each geometry and the section inside the geometry can be used to build new virtual resources.
  • the original building components (already virtual resources) in the game scene are also Pre-placed according to the surface of the geometry and the internal section.
  • the newly created virtual resource has the same placement rules as the existing virtual resource, it is easier to match the existing virtual resource when generating the newly created virtual resource, which also greatly reduces the calculation amount and improves the running efficiency of the game.
  • the shape information of the virtual resource may be: a horizontal plane, a vertical plane, an upward slope, a downward slope, that is, a geometric position relative to the rectangular parallelepiped, may be constructed along a vertical plane of the rectangular parallelepiped, constructed along a horizontal plane of the rectangular parallelepiped, along the inner slope of the rectangular parallelepiped Built in the face.
  • the vertical plane that is, the four planes in the cuboid perpendicular to the plane of the game scene
  • the horizontal plane is two planes parallel to the plane of the game scene in the cuboid
  • the inner slope surface is a diagonal section in the rectangular body (the The plane of the diagonal section passes through the two sides of the cuboid horizontal plane and intersects the two perpendicular faces of the cuboid).
  • the virtual resource built along the vertical plane of the rectangular parallelepiped is a vertical wall
  • the virtual resource built along the horizontal parallelepiped is a horizontal wall
  • the virtual resource constructed along the inner slope of the rectangular parallelepiped is upward. Or a downward slope.
  • the game scene is geometrically normalized, so that the newly created virtual resources and the existing virtual resources in the game scene can be aligned and spliced to enhance the beauty of the screen; at the same time, the virtual resources are prevented from being constructed during the construction of the game scene.
  • Physical collision detection can effectively reduce system overhead and improve the smooth running of the game.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometry and the virtual resource.
  • the composite model on the right side in FIG. 2 (the virtual resource is a sub-model of the composite model) has coordinates (x, y, z) in the geometry, and the resource state is
  • the geometry index information in the index table is shown in the following table:
  • the geometry index information in the resource status index table it can be determined that the geometry (x, y, z) includes the virtual resources oD, oAED, CoDG, oABC; the geometry (x+1, y, z) includes the virtual resources AE, ABFE.
  • the geometry (x, y+1, z) includes the virtual resources DEFG, DEFGLM; the geometry (x, y, z+1) includes the virtual resources CG, BCGF; the geometry (x+1, y, z+1) Includes virtual resources BF.
  • the geometric coordinates of each virtual resource can also be quickly determined, thereby establishing a mapping relationship between the virtual resource and the geometry.
  • the virtual resource state index table may be used to determine the virtual resource type existing in each geometry, determine the location where the construction can be performed, or the virtual resource may be quickly indexed according to the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the area index information corresponding to each virtual resource is used to identify the mapping relationship between each virtual resource and the area. It is beneficial to improve the convenience of the client to access the structure of the data storage, so that the client can quickly determine the area where the virtual resource is to be removed, or can quickly locate the virtual resource status information of an area. What are the virtual resources in the area.
  • the foregoing embodiment is beneficial to improving the convenience of the client to access the structure of the data storage, so that the client can quickly locate the virtual resources in the area when synchronizing the virtual resource state information of a certain area, and further Quickly determine the geometry, classification information, shape information, etc. of the virtual resource; at the same time, through the virtual resource state index table, it is not necessary to load the entire game scene into the memory, and only need to have the geometry of the virtual resource in the area Loaded into memory. This greatly saves memory consumption.
  • the virtual resource state index table adopts an index storage manner
  • FIG. 3 is a schematic diagram of a virtual resource state index table in one exemplary embodiment of the present disclosure, as shown in FIG.
  • the index is a region index
  • the secondary index is a geometry index
  • the third level index is a virtual resource classification information index
  • the fourth level index is a virtual resource shape information index.
  • the virtual resource state index table used by the client caches the state information of the virtual resource.
  • the state is stored in the data structure of the virtual resource state index table.
  • the status of the virtual resources can be read directly from the cache, and the state of the virtual resource is represented using a special effect or UI. Caching of virtual resource status can greatly reduce the client's traffic consumption for virtual resource status updates.
  • the game scene is divided into four regions, namely, regions W, X, Y, and Z; each region contains six geometric bodies, which are respectively geometric bodies 1-6, 7-12, and 13-18. 19-24; each geometry contains two types of classification information: existing virtual resources and new virtual resources; existing virtual resources contain five types of shape information, namely: horizontal plane, west facing vertical plane, south facing Vertical surface, irregular type, column; new virtual resource includes 4 types of shape information: water level, vertical plane, up slope, down slope; each type of shape information in the existing virtual resource includes: virtual resource ID, maximum Blood volume, current blood volume; the type of shape information in the newly created virtual resource includes: virtual resource ID, maximum blood volume, current blood volume, material ID, and entity object.
  • the information of the virtual resource A in the virtual resource state index table is: global ID1, maximum blood volume 100, current blood volume 100, water level, existing virtual resource, geometry 3, region Z; virtual resource B is in virtual resource state.
  • the information in the index table is: global ID2, maximum blood volume 100, current blood volume 100, 2 (wood ID), entity object 2, vertical plane, new virtual resource, geometry 4, area Z.
  • the client When the client receives the regional virtual resource status information corresponding to the area Z fed back by the server, it is learned that the virtual resource A in the area Z is removed according to the received area virtual resource status information, and the blood quantity of the virtual resource 2 will be 40. %, the virtual resource status index table is updated according to the regional virtual resource status information, that is, the virtual resource A is deleted from the virtual resource status index table, and the status information of the virtual resource B is updated to: global ID2, maximum blood volume 100, current Blood volume 40, 2 (wood ID), physical object 2, vertical surface, new virtual resource, geometry 4, area Z.
  • step S260 the virtual resource of the game scenario is loaded according to the current location of the virtual object in the game scenario and the virtual resource state index table, and the method further includes the following steps:
  • Step S2601 determining an area where the virtual object is located according to a current position of the virtual object in the game scene
  • Step S2602 Obtain virtual resource state information in the area according to the virtual resource state index table.
  • Step S2603 Render virtual resources in the area where the game scene is loaded according to the virtual resource state information in the area.
  • the area in which the virtual object is located is determined according to the current position of the virtual object in the game scene.
  • the area may be a circular range area in the game scene centered on the position where the virtual object is located, with a preset distance as a radius, or an arbitrary shape area including the current position where the virtual object is located, and may also be
  • the game scene is divided into a plurality of regions in advance, and the preset region to which the current location belongs is determined according to the current position of the virtual object in the game scene. Indexing the virtual resource state index table according to the region in which the virtual object is located, acquiring all virtual resource state information in the region, and rendering the region in the region in which the game scenario is loaded according to all virtual resource state information in the region Virtual resources.
  • the virtual resource of the loaded area is rendered according to the virtual resource state index table and the current location of the virtual object, thereby avoiding loading all models of the game scene, thereby effectively reducing resource consumption.
  • the game scene is divided into four regions, namely, regions W, X, Y, and Z; each region contains six geometric bodies, respectively, geometric bodies 1-6, 7-12, 13- 18, 19-24; each geometry also contains two types of classification information, namely: existing virtual resources, new virtual resources; existing virtual resources contain five types of shape information, respectively: horizontal, west-facing, vertical The south vertical plane, the irregular type, the pillar; the new virtual resource includes four types of shape information, namely: horizontal plane, vertical plane, upward slope, downward slope; each type of shape information in the existing virtual resource includes: virtual resource ID, Maximum blood volume, current blood volume; the type of shape information in the newly created virtual resource includes: virtual resource ID, maximum blood volume, current blood volume, material ID, and entity object.
  • the virtual object is assumed to be in the region Z;
  • the information of the virtual resource A in the virtual resource state index table is: global ID1, maximum blood volume 100, current blood volume 100, horizontal plane, existing virtual resource, geometry 3, region Z;
  • virtual The information of the resource B in the virtual resource status index table is: global ID2, maximum blood volume 100, current blood volume 100, 2 (wood ID), entity object 2, vertical plane, new virtual resource, geometry 4, area Z.
  • the client obtains the virtual resource status information in the area Z according to the locally stored virtual resource status index table, that is, the status information of the virtual resources A and B in the virtual resource status index table, according to the status information in the graphical user interface of the client.
  • the virtual resources A, B in the area Z loaded with the game scene are rendered.
  • step S240 the state of the virtual resource in the area is updated according to the area virtual resource status information, and the area virtual resource status information is displayed according to the updated state of the virtual resource.
  • the method further includes the following steps:
  • Step S2402 Update the local virtual resource state index table according to the regional virtual resource state information.
  • Step S2403 The virtual resource is displayed according to the updated virtual resource state index table.
  • the client updates the local virtual resource state index table according to the regional virtual resource state information, and renders the virtual resource according to the updated virtual resource state index table on the graphical user interface of the client.
  • the virtual resource status index table in the area Z saved locally by client a is:
  • Virtual resource A current blood volume 100, area Z;
  • Virtual resource B current blood volume 100, area Z;
  • Virtual resource C current blood volume 100, area Z;
  • Virtual resource D current blood volume 100, area Z;
  • the client a receives the regional virtual resource status information sent by the server, where the virtual resource status information is: virtual resource A: has been removed; virtual resource B: current blood volume 100; virtual resource C: current blood volume 100; virtual resource D: current blood quantity 100; or, the area virtual resource status information is: virtual resource B: current blood volume 100; virtual resource C: current blood volume 100; virtual resource D: current blood volume 100, or, the area virtual resource
  • the status information is: virtual resource A: has been removed.
  • the client a updates the virtual resource status index table according to the virtual resource status information of the area, and obtains the updated virtual resource status index table as follows:
  • Virtual resource A has been removed, zone Z;
  • Virtual resource B current blood volume 100, area Z;
  • Virtual resource C current blood volume 100, area Z;
  • Virtual resource D current blood volume 100, area Z;
  • a dismantling animation showing the virtual resource A is rendered on the graphical user interface of the client a according to the updated virtual resource state index table.
  • Virtual resource B current blood volume 100, area Z;
  • Virtual resource C current blood volume 100, area Z;
  • Virtual resource D current blood volume 100, area Z;
  • the dismantling animation of the virtual resource A is displayed on the graphical user interface of the client a according to the updated virtual resource state index table.
  • the state of the virtual resource in the game scene is updated in units of regions through the virtual resource state index table, thereby effectively reducing resource consumption and greatly reducing the pressure of data processing.
  • FIG. 5 is a flowchart of a method for processing virtual resources in one game scenario according to an embodiment of the present disclosure. As shown in FIG. 5, in the embodiment, the method includes the following steps:
  • Step S310 the server performs regional state synchronization to the client.
  • the server maintains a version number for each region in the game scene. This version number will change iteratively every time the state of the model (virtual resource) changes within the region. At the same time, the server also maintains the version number of the area through which the game character passes for each game character (virtual object).
  • the latest state (area virtual resource status information) of the area is synchronized to the player. If the game character returns to an area that has passed by, the server compares the version number of the area maintained for the game character with the version number of the area. If it is inconsistent, the server will update the status of the area. (Regional virtual resource status information) is synchronized to the client corresponding to the game character. The client caches the status of these synchronizations each time it is synchronized.
  • step S320 the virtual object launches an attack on the model in the game scene.
  • the game character disassembles the model (virtual object) in the game scene
  • the model in the scene is hit with a weapon
  • the id of the hit model is uploaded to the server.
  • step S330 the state of the attacked model is updated.
  • the server will calculate the damage caused to the model according to the weapon used by the game character, and obtain the material of the model from the data table generated for the server, and the blood volume configured for the model, when the damage to the model is certain When the amount of blood is reduced, the material of the corresponding material will be dropped.
  • the server will synchronize the current blood status of the model to the clients corresponding to all game characters in the area. When the model's blood volume will be 0, the server will synchronize the model's teardown information (area virtual resource state information) to the clients corresponding to all game characters in the zone.
  • the server also removes the model from the build grid (geometry in the game scene), which updates the information about the build grid.
  • the server will also remove the model from the adjacency relationship of the model's adjacency model.
  • the server will also determine whether the model adjacent to the model can connect to the ground. If not, it will not The associated model connected to the ground is deleted.
  • the server caches the model whose state has changed, and at the same time modifies the version number of the corresponding region.
  • step S340 the state of displaying the attacked model is cached and rendered.
  • the client After receiving the state synchronization information (area virtual resource state information) of the attacked model, the client first caches the state synchronization information, and then performs special effects in the client, including smoke, sparks, vibration, cracks, and blood. Articles, etc.
  • the model is also deleted from the virtual resource state index table of the client, so that when the client constructs the virtual resource in the game scenario, it can judge whether the same location of the removed virtual resource can be constructed, and the adjacent of the model. Can the area be built?
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • FIG. 6 is a schematic diagram of a processing device of a virtual resource in one game scenario according to an embodiment of the present disclosure. As shown in FIG. 6, the device includes:
  • a first determining module configured to determine an area where the virtual object is located according to a current location of the virtual object in a game scene
  • a second determining module configured to receive an identifier of the virtual resource to be removed, and determine the virtual resource to be removed according to the identifier of the virtual resource to be removed;
  • a first update module configured to delete the virtual resource to be removed from the area of the game scenario, and generate regional virtual resource state information corresponding to the area;
  • a first sending module configured to send the regional virtual resource state information to a client corresponding to the virtual object, so that the client controls the virtual resource corresponding to the regional virtual resource state information according to the regional virtual resource state information Rendering display.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • each module unit in the foregoing embodiment has been described in detail in the processing method of the virtual resource in the corresponding game scenario.
  • the processing device of the virtual resource in the game scenario further includes other unit modules and information. The processing method corresponds, so it will not be described here.
  • FIG. 7 is a structural diagram of a processing device of a virtual resource in one game scenario according to an embodiment of the present disclosure. As shown in FIG. 7, the device includes:
  • a third determining module configured to determine, according to the teardown event, a virtual resource from the plurality of virtual resources in the game scenario as a virtual resource to be demolished according to the teardown event in response to the teardown event of the virtual resource in the game scenario ;
  • a second sending module configured to send the identifier of the virtual resource to be removed to the server
  • a first receiving module configured to receive area virtual resource status information that is fed back by the server, where the area virtual resource status information is determined by the server according to the current position of the virtual object in the game scene.
  • Virtual resource status information ;
  • a second update module configured to update a state of the virtual resource in the area according to the area virtual resource state information, and display the virtual resource corresponding to the area virtual resource state information according to the updated state of the virtual resource .
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • each module unit in the foregoing embodiment has been described in detail in the processing method of the virtual resource in the corresponding game scenario.
  • the processing device of the virtual resource in the game scenario further includes other unit modules and information. The processing method corresponds, so it will not be described here.
  • modules or units of equipment for action execution are mentioned in the detailed description above, such division is not mandatory. Indeed, in accordance with embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one of the modules or units described above may be further divided into multiple modules or units.
  • FIG. 8 is a composition diagram of one of the game systems according to an embodiment of the present disclosure. As shown in FIG. 8, the game system includes: a server 801 and a client 802;
  • the server includes: a first processor;
  • a first memory configured to store the first executable instruction of the first processor
  • the first processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the first executable instruction
  • the client includes: a second processor
  • a second memory configured to store a second executable instruction of the second processor
  • the second processor is configured to execute the processing method of the virtual resource in the game scenario described above by executing the second executable instruction.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the embodiment of the present invention only describes a game system having a server and a client as an example.
  • the game system may have one or more clients, and the number of each client may be based on The actual application to configure.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 910 of this embodiment includes a memory 911 and a processor 912. Wherein, the memory 911 and the processor 912 can be connected by a bus;
  • a memory 911 configured to store executable instructions of the processor
  • processor is configured to implement the following steps by executing the executable instruction:
  • the method before the deleting the to-be-removed virtual resource from the area of the game scenario, the method further includes:
  • the virtual resource to be removed is detected to meet a preset condition.
  • the method before the generating the regional virtual resource state information corresponding to the area, the method further includes:
  • the game scenario is divided into a plurality of regions, and each of the regions is respectively configured with an area version number, where the region version number is used to identify current state information of the virtual resource in the region, where the After the current position of the virtual object in the game scene determines the area in which the virtual object is located, the method further includes:
  • the current area version number of the area is saved as the virtual object area version information, and the area virtual resource status information corresponding to the current area version number of the area is sent to the virtual object.
  • the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object.
  • the method further includes:
  • the method further includes:
  • the virtual resource state index table includes at least: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource;
  • the game scenario includes a composite model consisting of at least two virtual resources, wherein the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify the composition.
  • the virtual resource of the model is used to identify the composition.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward slope.
  • the virtual resource status index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometric body or the geometric internal cross section, the area in the game scene.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometric body and the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the deleting the virtual resource to be removed from the area of the game scenario, and generating the regional virtual resource state information corresponding to the area including:
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • FIG. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 1010 of the present embodiment includes a memory 1011 and a processor 1012.
  • the memory 1011 and the processor 1012 can be connected by a bus;
  • a memory 1011 configured to store executable instructions of the processor
  • processor is configured to implement the following steps by executing the executable instruction:
  • the status of the virtual resource in the area is updated according to the area virtual resource status information, and the virtual resource corresponding to the area virtual resource status information is displayed according to the updated state of the virtual resource.
  • the method further includes:
  • the method further includes:
  • the virtual resource loading the game scene is rendered according to the current location of the virtual object in the game scene and the virtual resource state index table.
  • the rendering according to the current location of the virtual object in the game scenario and the virtual resource state index table, the virtual resource that loads the game scenario, including:
  • the status of the virtual resource in the area is updated according to the area virtual resource status information, and the virtual resource corresponding to the area virtual resource status information is displayed according to the updated state of the virtual resource.
  • the method further includes:
  • the virtual resource state index table further includes: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource.
  • the game scenario includes a composite model consisting of at least two virtual resources, wherein the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify the composition.
  • the virtual resource of the model is used to identify the composition.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward slope.
  • the virtual resource status index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometric body or the geometric internal cross section, the area in the game scene.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometric body and the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the electronic device may further comprise one or more processors, and memory resources represented by the memory for storing instructions executable by the processing component, such as an application.
  • An application stored in the memory may include one or more modules each corresponding to a set of instructions.
  • the processing component is configured to execute instructions to perform the information processing method described above.
  • the electronic device can also include: a power component configured to perform power management of the executing electronic device; a wired or wireless network interface configured to connect the electronic device to the network; and an input/output (I/O) interface.
  • the electronic device can operate based on an operating system stored in the memory, such as Android, iOS, Windows, Mac OS X, Unix, Linux, FreeBSD or the like.
  • FIG. 11 is a schematic structural diagram of one of the storage media according to an embodiment of the present disclosure. As shown in FIG. 11, a program product 1100 according to an embodiment of the present invention is described, on which is stored a computer program that, when executed by a processor, implements the following steps:
  • the method before the deleting the to-be-removed virtual resource from the area of the game scenario, the method further includes:
  • the virtual resource to be removed is detected to meet a preset condition.
  • the method before the generating the regional virtual resource state information corresponding to the area, the method further includes:
  • the game scenario is divided into a plurality of regions, and each of the regions is respectively configured with an area version number, where the region version number is used to identify current state information of the virtual resource in the region, where the After the current position of the virtual object in the game scene determines the area in which the virtual object is located, the method further includes:
  • the current area version number of the area is saved as the virtual object area version information, and the area virtual resource status information corresponding to the current area version number of the area is sent to the virtual object.
  • the area virtual resource status information corresponding to the current area version number of the area is sent to the client corresponding to the virtual object.
  • the method further includes:
  • the method further includes:
  • the virtual resource state index table includes at least: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource;
  • the game scenario includes a composite model consisting of at least two virtual resources, wherein the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify the composition.
  • the virtual resource of the model is used to identify the composition.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward slope.
  • the virtual resource status index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometric body or the geometric internal cross section, the area in the game scene.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometric body and the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the deleting the virtual resource to be removed from the area of the game scenario, and generating the regional virtual resource state information corresponding to the area including:
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the computer readable storage medium can include a data signal that is propagated in the baseband or as part of a carrier, carrying readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer readable storage medium can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Program code embodied in a computer readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, radio frequency, etc., or any suitable combination of the foregoing.
  • FIG. 12 is a schematic structural diagram of one of the storage media according to an embodiment of the present disclosure. As shown in FIG. 12, a program product 1200 in accordance with an embodiment of the present invention is described having stored thereon a computer program that, when executed by a processor, implements the following steps:
  • the status of the virtual resource in the area is updated according to the area virtual resource status information, and the virtual resource corresponding to the area virtual resource status information is displayed according to the updated state of the virtual resource.
  • the method further includes:
  • the method further includes:
  • the virtual resource loading the game scene is rendered according to the current location of the virtual object in the game scene and the virtual resource state index table.
  • the rendering according to the current location of the virtual object in the game scenario and the virtual resource state index table, the virtual resource that loads the game scenario, including:
  • the status of the virtual resource in the area is updated according to the area virtual resource status information, and the virtual resource corresponding to the area virtual resource status information is displayed according to the updated state of the virtual resource.
  • the method further includes:
  • the virtual resource state index table further includes: a virtual resource identifier corresponding to each virtual resource and virtual resource state information of each virtual resource.
  • the game scenario includes a composite model consisting of at least two virtual resources, wherein the high-order information in the virtual resource identifier is used to identify a composite model, and the low-order information in the identifier is used to identify the composition.
  • the virtual resource of the model is used to identify the composition.
  • the virtual resource state index table further includes virtual resource shape information corresponding to each virtual resource, where the virtual resource shape information is one of: a horizontal plane, a vertical plane, an upward slope, and a downward slope.
  • the virtual resource status index table further includes: virtual resource classification information corresponding to each virtual resource, where the virtual resource classification information is one of: an existing virtual resource, and a newly created virtual resource.
  • the space of the game scene is divided into a plurality of mutually spliced geometries, and the virtual resources are built on a surface of the geometric body or the geometric internal cross section, the area in the game scene.
  • the virtual resource state index table further includes: geometric body index information corresponding to each virtual resource, where the geometric body index information is used to identify a mapping relationship between the geometric body and the virtual resource.
  • the virtual resource status index table further includes: area index information corresponding to each virtual resource, where the area index information is used to identify a mapping relationship between the area and the virtual resource.
  • the area where the virtual object is located is determined according to the current position of the virtual object in the game scene, the corresponding virtual resource is loaded in the game scene according to the range of the area, and the virtual resource in the game scene is updated in units of the area.
  • the state which effectively reduces resource consumption, and can greatly reduce the pressure on data processing.
  • the computer readable storage medium can include a data signal that is propagated in the baseband or as part of a carrier, carrying readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer readable storage medium can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • Program code embodied in a computer readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, radio frequency, etc., or any suitable combination of the foregoing.
  • the technical solution according to the embodiment of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network.
  • a non-volatile storage medium which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a number of instructions are included to cause a computing device (which may be a personal computer, server, electronic device, or network device, etc.) to perform a method in accordance with an embodiment of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Optics & Photonics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种游戏场景中虚拟资源的处理方法及装置,该方法包括:根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。

Description

游戏场景中虚拟资源的处理方法及装置
本申请要求于2018年01月30日提交中国专利局、申请号为201810092813.6、发明名称“游戏场景中虚拟资源的处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明公开涉及游戏技术领域,尤其涉及一种游戏场景中虚拟资源的处理方法及装置。
背景技术
在互联网的浪潮下,硬件和软件技术的不断发展和演进,促进了智能设备和软件的出现。与此同时,涌现出大量的、不同题材的游戏,以满足用户的需求。
在终端运行的游戏应用目前存在多种不同的题材与玩法类型,将多种不同的玩法相结合从而提高游戏的可玩性是目前本领域的发展方向。例如:将射击类型游戏与建造类型游戏相结合、将策略类型游戏与跑酷类型游戏相结合等等。
对于将射击类型游戏与建造类型游戏相结合的游戏类型来说,复杂的游戏玩法对运算能力有限的终端来说往往不能实现或受到极大的局限,如游戏中的建造玩法,由于游戏场景中存在海量的可拆卸可建造的模型,所有的模型所占内存会非常大,内存比较小的终端可能承受不了。即便内存够用,如此多琐碎的细分模型,在数据处理与图形渲染方面也会给终端造成很大压力。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本发明公开的目的在于提供一种游戏场景中虚拟资源的方法及装置,进而至少在一定程度上克服由于相关技术的限制和缺陷而导致的一个或者多个问题。
根据本公开的一个方面,提供一种游戏场景中虚拟资源的处理方法,所述方法包括:
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
根据本公开的另一个方面,提供一种游戏场景中虚拟资源的处理方法,所述方法包括:
响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
将所述待拆除虚拟资源的标识发送至服务端;
接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
根据本公开的另一个方面,提供一种游戏场景中虚拟资源的处理装置,所述装置包括:
第一确定模块,用于根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
第二确定模块,用于接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
第一更新模块,用于将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
第一发送模块,用于将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
根据本公开的另一个方面,提供一种游戏场景中虚拟资源的处理装置,所述装置包括:
第三确定模块,用于响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
第二发送模块,用于将所述待拆除虚拟资源的标识发送至服务端;
第一接收模块,用于接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
第二更新模块,用于根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信 息对应的虚拟资源。
根据本公开的另一个方面,提供一种游戏系统,所述系统包括:服务端、客户端;其中,
服务端包括:第一处理器;
第一存储器,用于存储所述第一处理器的第一可执行指令;
其中,所述第一处理器配置为经由执行所述第一可执行指令来执行上述的游戏场景中虚拟资源的处理方法;
客户端包括:第二处理器;
第二存储器,用于存储所述第二处理器的第二可执行指令;
其中,所述第二处理器配置为经由执行所述第二可执行指令来执行上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种电子设备,包括:
处理器;以及
存储器,用于存储所述处理器的可执行指令;
其中,所述处理器配置为经由执行所述可执行指令来执行上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种电子设备,包括:
处理器;以及
存储器,用于存储所述处理器的可执行指令;
其中,所述处理器配置为经由执行所述可执行指令来执行上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种电子设备,包括:
处理器;以及
存储器,用于存储所述处理器的可执行指令;
其中,所述处理器配置为经由执行所述可执行指令来执行上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的游戏场景中虚拟资源的处理方法。
根据本公开的另一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的游戏场景中虚拟资源的处理方法。
通过本公开其中之一实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大 大降低数据处理的压力。
附图说明
通过参照附图来详细描述其示例性实施例,本公开的上述和其它特征及优点将变得更加明显。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:
图1为本公开实施例的其中一种游戏场景中虚拟资源的处理方法的流程图;
图2是本公开其中之一示例性实施例中的虚拟资源三维重建映射关系的示意图;
图3是本公开其中之一示例性实施例中的虚拟资源状态索引表的示意图;
图4为本公开实施例的其中一种游戏场景中虚拟资源的处理方法的流程图;
图5为本公开实施例的其中一种游戏场景中虚拟资源的处理方法的流程图;
图6为本公开实施例的其中一种游戏场景中虚拟资源的处理装置的组成图;
图7为本公开实施例的其中一种游戏场景中虚拟资源的处理装置的组成图;
图8为本公开实施例的其中一种游戏系统的组成图;
图9为本公开实施例的其中一种电子设备的结构示意图;
图10为本公开实施例的其中一种电子设备的结构示意图;
图11为本公开实施例的其中一种存储介质的结构示意图;
图12为本公开实施例的其中一种存储介质的结构示意图。
具体实施方式
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设 备固有的其它步骤或单元。
还需要说明的是,本说明书中所公开的各种触发事件可以预先设置,不同的触发事件可以触发执行不同的功能。
本公开实施例提供了一种游戏场景中虚拟资源的处理方法,该方法的执行主体为服务端,该服务端可以是一台或多台的计算机、服务器、集群等任意服务端设备。图1是根据本发明实施例的一种游戏场景中虚拟资源的处理方法的流程图。如图1所示,在本实施例中该方法包括步骤如下:
步骤S110,根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
步骤S120,接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
步骤S130,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
步骤S140,将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
下面,将对本示例性实施例中游戏场景中虚拟资源的处理方法的各步骤作进一步地说明。
在本示例性实施例中,游戏场景可以是方形,也可以是其它形状(比如,圆形等)。游戏场景中可以包含地面、山、石、花、草、树、建筑等。
游戏场景中包括至少一个虚拟资源,虚拟资源可以是建造于游戏场景中的建造物,如房屋、水平面、垂直面、斜面、桌子、椅子、路灯等虚拟物体。虚拟资源可以通过客户端的图形用户界面所呈现,所呈现的内容可以包含虚拟资源的全部,也可以是虚拟资源的局部。
游戏场景中包括至少一虚拟对象,可以通过客户端的图形用户界面所呈现,所呈现的内容可以包含虚拟对象的全部,也可以是虚拟对象的局部。比如,在第三人称视角游戏中,图形用户界面所呈现的内容可以包含虚拟对象的全部;又比如,在第一人称视角游戏中,图形用户界面所呈现的内容可以包含虚拟对象的部分/局部。
虚拟对象可以是敌方阵营的虚拟对象,也可以是己方阵营的虚拟对象,虚拟对象可以响应用户的操作在游戏场景实施相应的行为,例如,用户可以控制虚拟对象在游戏场景中进行走、跑、蹲、趴、攻击、射击等动作,本发明在此不作限制。
在可选的实施方式中,步骤S110,根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域。
其中,服务端实时监测虚拟对象在游戏场景中的当前位置,该虚拟对象在游戏场景中可以根据用户在客户端上的触控操作改变虚拟对象的移动方向,从而进行自由的移动,故引起虚拟对象在游戏场景中位置发生改变。
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域。其中,该区域可以是游戏场景中以虚拟对象所处的位置为中心,以预设距离为半径的圆形范围区域,也可以是包含虚拟对象所处的当前位置的任意形状的区域,还可以是预先将游戏场景划分为多个区域,根据虚拟对象在游戏场景中的当前位置确定该当前位置所属于的预设区域。
在可选的实施方式中,所述游戏场景被划分为多个区域,各个所述区域分别设置有一区域版本号,所述区域版本号用于标识所述区域内的虚拟资源的当前状态信息。
需要说明的是,游戏场景被划分为多个区域,该区域为逻辑上的游戏场景区域,该区域的划分可以对玩家不可见、也可以对玩家可见,该区域用于将游戏场景及游戏场景中的模型进行区域化管理。从而有效减少了资源消耗,并可以大大降低数据处理压力。
为了表征每个区域内的虚拟资源状态信息的新旧,服务端为每个区域维护一区域版本号。该区域版本号可以为正自然整数,当每个区域内的虚拟资源状态发生变化时,该区域版本号可以按照预设规则进行迭代变化,其中,对区域版本号进行迭代的方式可以是:对区域版本号加1、对区域版本号减1、或对区域版本号添加唯一标识等等。从而通过该区域版本号识别出该区域内的虚拟资源状态信息的新旧。例如:区域Z的区域版本号为2,当该区域Z内的虚拟资源状态发生变更时,该区域Z的区域版本号迭代为3,该区域Z的区域版本号为3对应的区域虚拟资源状态信息为该区域Z内的虚拟资源的当前状态信息。
在可选的实施方式中,步骤S110之后还包括以下步骤:
步骤S1101,判断所述虚拟对象是否为首次进入所述区域;
步骤S1102,如果是首次进入所述区域,则将所述区域的当前区域版本号保存为虚拟对象区域版本信息,并将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端;
步骤S1103,如果不是首次进入所述区域,则获取所述虚拟对象对应的虚拟对象区域版本信息;
步骤S1104,将所述虚拟对象区域版本信息与所述区域的当前区域版本号进行匹配;
步骤S1105,如果所述虚拟对象区域版本信息与所述区域的当前区域版本号不 同,则将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端。
服务端为每个区域维护一区域版本号,同时,也会为每个虚拟对象维护其所经过的区域的区域版本信息,当虚拟对象首次进入某一区域时,服务端将该区域的当前区域版本号保存为虚拟对象区域版本信息,并将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端,以使客户端根据该区域虚拟资源状态信息加载该区域内的虚拟资源。当该虚拟对象再次进入所述区域时,则获取该虚拟对象对应的该区域的虚拟对象区域版本信息,将该虚拟对象区域版本信息与该区域的当前区域版本号进行匹配,如果不一致,服务端会将该区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端,以使客户端根据该区域虚拟资源状态信息更新本地缓存的相关信息和/或加载该区域内的虚拟资源。
例如:服务端为区域Z维护一区域版本号2,当角色a(由客户端a进行操控)首次进入区域Z时,服务端将区域Z的当前区域版本号2保存为角色a对应的区域Z的区域版本信息,并将该区域Z的区域版本号2对应的区域虚拟资源状态信息发送至角色a对应的客户端a。当区域Z中的虚拟资源状态发生变化时,该区域Z的当前区域版本号变为3,当角色a再次进入区域Z时,获取该角色a对应的该区域Z的虚拟对象区域版本信息为2,由于该虚拟对象区域版本信息与该区域Z的当前区域版本号不相同,服务端会将该区域Z的当前区域版本号3对应的区域虚拟资源状态信息发送至角色a对应的客户端a。
在可选的实施方式中,服务端为每个区域维护一区域版本号,同时,也会为每个虚拟对象维护其所经过的区域的区域版本信息,当虚拟对象首次进入某一区域时,服务端将该区域的当前区域版本号保存为虚拟对象区域版本信息,并判断该区域的当前区域版本号是否与初始区域版本号相一致,如果不一致,将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端,以使客户端根据该区域虚拟资源状态信息加载该区域内的虚拟资源。当该虚拟对象再次进入所述区域时,则获取该虚拟对象对应的该区域的虚拟对象区域版本信息,将该虚拟对象区域版本信息与该区域的当前区域版本号进行匹配,如果不一致,服务端会将该区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端,以使客户端根据该区域虚拟资源状态信息更新本地缓存的相关信息和/或加载该区域内的虚拟资源。
例如:服务端为区域Z分配的初始区域版本号为1,该区域Z的当前区域版本号2,当角色a(由客户端a进行操控)首次进入区域Z时,服务端将区域Z的当前区域版本号2保存为角色a对应的区域Z的区域版本信息,由于该区域Z的当前区域版本号与初始区域版本号不一致,则将该区域Z的区域版本号2对应的区域虚拟 资源状态信息发送至角色a对应的客户端a。当区域Z中的虚拟资源状态发生变化时,该区域Z的当前区域版本号变为3,当角色a再次进入区域Z时,获取该角色a对应的该区域Z的虚拟对象区域版本信息为2,由于该虚拟对象区域版本信息与该区域Z的当前区域版本号不相同,服务端会将该区域Z的当前区域版本号3对应的区域虚拟资源状态信息发送至角色a对应的客户端a。
通过上述实施方式,设置区域版本号实现区域内虚拟资源状态信息的同步以及对游戏场景中的模型进行区域化管理,避免虚拟对象重复进入某一区域,使得对应的客户端不断刷新状态,有效减少了资源消耗,并可以大大降低数据处理压力,提升数据同步效率。
在可选的实施方式中,步骤S120,接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源。
游戏场景中的虚拟资源都被分配一个唯一性标识,如:全局ID、序列号等,当服务端接收到客户端发送的待拆除虚拟资源的标识后,根据该标识在本地查询并获取到该标识对应的虚拟资源。
在可选的实施方式中,在客户端侧维护一名字到ID映射表,该表存储了游戏场景中所有虚拟资源的名字以及为该虚拟资源分配的ID,并且该表中给出名字与ID的映射关系,当在客户端检测到拆除事件时,根据该拆除事件获取到待拆除虚拟资源的名字,并根据该虚拟资源的名字从名字到ID映射表中获取到该虚拟资源对应的ID,客户端将该虚拟资源的ID发送至服务端。服务端接收到客户端发送的虚拟资源ID后,根据该虚拟资源ID在本地查询并获取到该ID对应的虚拟资源。
全局ID主要用于客户端和服务端通信,这样做是因为使用虚拟资源在场景中的唯一名字通信时,名字通常非常长,会浪费玩家流量,因此使用一个4字节的整数唯一标识虚拟资源进行通信。
在可选的实施方式中,当游戏运行时,服务端会向客户端下发一条初始化信息,为游戏场景中的所有虚拟资源分配一个唯一的全局ID,客户端收到这条初始化信息时,会为所有的虚拟资源创建一个实体对象,用于管理每一个虚拟资源。同时客户端还会获取所有已经加载的虚拟资源,将这些虚拟资源绑定到对应的实体上。这样就实现实体对虚拟资源的控制。
通过上述实施方式,以ID代替具体的虚拟资源信息,可以有效提升数据传输的效率。
在可选的实施方式中,步骤S130,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息。
服务端维护有游戏场景中所存在的全部虚拟资源的状态信息,确定待拆除虚拟资源后,可以直接将该待拆除虚拟资源从游戏场景中根据虚拟对象的当前位置所确定的区域中删除,也可以当检测到所述待拆除虚拟资源满足预设条件时,再将该待 拆除虚拟资源从游戏场景中根据虚拟对象的当前位置所确定的区域中删除,并生成该区域对应的区域虚拟资源状态信息,其中,区域虚拟资源状态信息可以是包含对应区域内所有虚拟资源的当前状态信息,包括:是否被拆除、虚拟资源的材质、剩余血量等等;或者,区域虚拟资源状态信息可以是包含对应区域内所有虚拟资源的当前状态信息,包括:虚拟资源的材质、剩余血量等等;或者,区域虚拟资源状态信息可以是包含对应区域内发生状态变化的虚拟资源的当前状态信息。
例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,当接收到待拆除虚拟资源的标识并确定待拆除虚拟资源为虚拟资源A时,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源A:已拆除。
在可选的实施方式中,步骤S130,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除之前,所述方法还包括:检测到所述待拆除虚拟资源满足预设条件。
其中,预设条件可以由开发者根据实际情况预先设置,当检测到所述待拆除虚拟资源满足预设条件时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除。例如:检测到待拆除虚拟资源的当前剩余血量为0时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;又例如:当检测到待拆除虚拟资源被特定攻击模式(如虚拟对象处于直接拆除模式下或待拆除虚拟资源被拆除武器攻击时)攻击时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除等。
例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,如:虚拟资源A:正常,剩余血量60%;虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%。当接收到待拆除虚拟资源的标识并确定待拆除虚拟资源为虚拟资源A时,检测虚拟资源A的剩余血量是否为0,当虚拟资源A的剩余血量为0时,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%;或者,该信息可以包括下列内容:虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%;或者,该信息可以包括下列内容:虚拟资源A:已拆除。
又例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,当接收到待拆除虚拟资源的标识并确定待拆除虚拟资源为虚 拟资源A时,检测到虚拟资源A被拆除武器(锄头、锤子等)攻击时,或者,检测到虚拟对象正处于直接拆除模式下,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源A:已拆除。
在可选的实施方式中,步骤S130,生成所述区域对应的区域虚拟资源状态信息之前,所述方法还包括以下步骤:
步骤S1301,确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源;
步骤S1302,获取所述相邻虚拟资源的邻接关系列表,并将所述待拆除虚拟资源从所述邻接关系列表中删除;
步骤S1303,根据所述邻接关系列表判断所述相邻虚拟资源与地面是否相连通,如果所述相邻虚拟资源与地面不能相连通,则将所述相邻虚拟资源从所述游戏场景的所述区域中删除。
确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源,相邻虚拟资源可以与该待拆除虚拟资源直接相邻,也可以与该待拆除虚拟资源间接相邻。即相邻关系包括直接相邻关系和间接相邻关系。直接相邻关系是指两个虚拟资源存在共用边,或者一个虚拟资源的一个面与另一个虚拟资源的表面连接,或者一个虚拟资源的一个点与另一个虚拟资源的表面连接。举例而言,虚拟资源A为水平面,虚拟资源B也为水平面,当虚拟资源A与虚拟资源B并列排放在一起且两个水平面的侧面贴在一起,则认为两个水平面直接相邻;再次举例而言,虚拟资源C为垂直面,当虚拟资源A的侧面与虚拟资源C的正面相贴合共同构成房屋的垂直墙面与地面或垂直墙面与顶面时,则认为虚拟资源A与虚拟资源C直接相邻。间接相邻关系是指两个虚拟资源具有相同的具有直接关系的虚拟资源,举例而言,虚拟资源A为水平面,虚拟资源B也为水平面,虚拟资源A与虚拟资源B中间存在虚拟资源D(水平面),且虚拟资源D的两个侧面分别与虚拟资源A和虚拟资源B直接相邻,则认为虚拟资源A与虚拟资源B之间存在间接相邻关系。
服务端为游戏场景中的每个虚拟资源维护一邻接关系列表,该邻接关系列表中实时记录了每个虚拟资源对应的当前与该虚拟资源具有相邻关系的相邻虚拟资源标识,当游戏场景中的某一虚拟资源被确定为待拆除虚拟资源时,确定该虚拟资源的相邻虚拟资源,并获取相邻虚拟资源的邻接关系列表,并将该待拆除虚拟资源从邻接关系列表中删除。
例如:虚拟资源A与虚拟资源B相邻,虚拟资源B又与虚拟资源C、虚拟资源D相邻,当待拆除虚拟资源确定为虚拟资源A时,确定虚拟资源A的相邻虚拟 资源为虚拟资源B,获取虚拟资源B的邻接关系列表,该列表信息中包含:虚拟资源A,虚拟资源C,虚拟资源D。将虚拟资源A从邻接关系列表中删除,此时,虚拟资源B的邻接关系列表中包含:虚拟资源C,虚拟资源D。
通过对邻接关系列表的查询可以快速获取每个虚拟资源的相邻虚拟资源,而无需每次都进行检测,提升了数据处理的效率。
在可选的实施方式中,服务端在游戏初始化的过程中,会启动一个只用来进行数据导出的初始化终端,这个初始化终端会加载最新的场景资源,并创建相机,使用相机遍历游戏场景中的每个虚拟资源,获取每个虚拟资源的碰撞体,一种实施方式为:使用该碰撞体进行碰撞检测,从而获得每个虚拟资源的相邻虚拟资源,并建立每个虚拟资源的邻接关系列表。另一种实施方式为:如果虚拟资源彼此相互拼接或留有细小的缝隙时,则在进行碰撞检测时会失败,而且由于搭建模型存在误差,导致模型与模型之间并未直接接触,这时检测不到这些相邻的碰撞体。因此在进行碰撞检测之前,首先获取碰撞体的位置、碰撞体的大小,以及世界旋转矩阵,根据这些信息在原来碰撞体的位置新创建了一个盒式碰撞体,同时将将该碰撞体放大预设数值,例如原碰撞体的1.1倍或是将原碰撞体扩大5.5cm等,使用这个新创建的碰撞体进行碰撞检测,获得了所有与该碰撞体发生碰撞的其他碰撞体,根据这些发生碰撞的其他碰撞体确定对应的虚拟资源标识,从而得到每个虚拟资源的相邻虚拟资源,并建立每个虚拟资源的邻接关系列表。
在可选的实施方式中,每个虚拟资源对应的邻接关系列表中包含一个接地信息标识(例如:该标识为1,说明该虚拟资源与地面相连通,该标识为0,说明该虚拟资源不能相连通),通过读取该接地信息标识的值,可以判断待拆除虚拟资源的每个相邻虚拟资源与地面是否相连通,如果该相邻虚拟资源与地面不能相连通,则将该相邻虚拟资源从所述游戏场景的所述区域中删除并将该相邻虚拟资源确定为待拆除虚拟资源,重复执行步骤S1301。
例如:虚拟资源A与虚拟资源B相邻,虚拟资源B又与虚拟资源C、虚拟资源D相邻,虚拟资源D又与虚拟资源E相邻,其中,只有虚拟资源E与地面相连通。当待拆除虚拟资源确定为虚拟资源A时,确定虚拟资源A的相邻虚拟资源为虚拟资源B,获取虚拟资源B的邻接关系列表,该列表信息中包含:虚拟资源A,虚拟资源C,虚拟资源D,接地信息标识为1(由于虚拟资源D可以经过虚拟资源E与地面相连通)。将虚拟资源A从邻接关系列表中删除,此时,虚拟资源B的邻接关系列表中包含:虚拟资源C,虚拟资源D,接地信息标识为1。通过对虚拟资源B的邻接关系列表中接地信息标识的判断,该接地信息标识为1,即该虚拟资源B可以经过虚拟资源D与地面相连通,因此,不对虚拟资源B进行拆除处理。
又例如:虚拟资源A与虚拟资源B相邻,虚拟资源B又与虚拟资源C、虚拟资源D相邻,虚拟资源D又与虚拟资源E相邻,其中,没有虚拟资源与地面相连 通。当待拆除虚拟资源确定为虚拟资源A时,确定虚拟资源A的相邻虚拟资源为虚拟资源B,获取虚拟资源B的邻接关系列表,该列表信息中包含:虚拟资源A,虚拟资源C,虚拟资源D,接地信息标识为0。将虚拟资源A从邻接关系列表中删除,此时,虚拟资源B的邻接关系列表中包含:虚拟资源C,虚拟资源D,接地信息标识为0。通过对虚拟资源B的邻接关系列表中接地信息标识的判断,该接地信息标识为0,即该虚拟资源B与地面不能相连通,因此,将相邻虚拟资源B从所述游戏场景的所述区域中删除,并将该相邻虚拟资源B确定为待拆除虚拟资源,确定虚拟资源B的相邻虚拟资源为虚拟资源E,获取虚拟资源E的邻接关系列表,重复执行上述步骤,直至遍历完所有的相邻虚拟资源为止。
通过上述实施方式,在确定待拆除虚拟资源之后,自动根据预设的相邻关系确定出符合条件的其他待拆除虚拟资源,降低了系统数据处理资源的占用,基于此种方式,使得用户在拆除了待拆除虚拟资源后,联动拆除其他符合条件的待拆除相邻虚拟资源,以实现更符合现实世界建筑物崩塌的效果,以提到用户的游戏体验。
在可选的实施方式中,步骤S130将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,所述方法还包括以下步骤:
步骤S1304,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;
步骤S1305,将所述区域对应的区域版本号进行迭代后确定为所述区域的当前区域版本号;
步骤S1306,更新区域虚拟资源状态信息。
服务端将待拆除虚拟资源从游戏场景的所述区域中删除后,由于该区域内的虚拟资源状态发生了变化,故服务端将该区域对应的区域版本号进行迭代后确定为该区域的当前区域版本号,并更新该区域对应的区域虚拟资源状态信息,其中,对区域版本号进行迭代的方式可以是:对区域版本号加1、对区域版本号减1、或对区域版本号添加唯一标识等等。
在可选的实施方式中,服务端将该区域虚拟资源状态信息发送至处于该区域内的所有虚拟对象对应的客户端,以使处于该区域内的所有虚拟对象对应的客户端更新并显示该区域内的虚拟资源的状态,而处于该区域外的所有虚拟对象对应的客户端并不对该区域内的虚拟资源的状态进行更新,而是当区域外的虚拟对象进入该区域时,通过该虚拟对象的虚拟对象区域版本信息与该区域的当前区域版本号的匹配进行异步更新。
例如:服务端为区域Z分配的初始区域版本号为1,该区域Z的当前区域版本号2,该区域Z内当前存在3个虚拟资源,分别为虚拟资源A、B、C,该区域Z内当前还存在3个角色,分别为角色a、b、c,该区域Z外当前还存在1个角色d,该区域版本号2对应的区域虚拟资源状态信息为:虚拟资源A:正常;虚拟资源B: 正常;虚拟资源C:正常;虚拟资源D:正常。当检测到角色a将区域Z内的虚拟资源A拆除时,该区域Z的当前区域版本号变为3,并更新区域虚拟资源状态信息为:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者更新区域虚拟资源状态信息为:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者更新区域虚拟资源状态信息为:虚拟资源A:已拆除。服务端将该区域虚拟资源状态信息发送至处于该区域Z内的所有角色a、b、c对应的客户端a、b、c,以使处于该区域Z内的所有角色对应的客户端更新并显示该区域Z内的虚拟资源的状态,而角色d由于处于该区域Z外,故角色d对应的客户端d不会接收到该区域虚拟资源状态信息或者忽略接收到该区域虚拟资源状态信息,因此不会更新也不会显示该区域Z内的虚拟资源的状态,当角色d首次进入区域Z时,服务端将区域Z的当前区域版本号3保存为角色d对应的区域Z的区域版本信息,由于该区域Z的当前区域版本号与初始区域版本号不一致,则将该区域Z的区域版本号3对应的区域虚拟资源状态信息发送至角色d对应的客户端d,以使客户端d更新并显示该区域Z内的虚拟资源的状态;当角色d非首次进入区域Z时获取该角色d对应的该区域Z的虚拟对象区域版本信息为2,由于该虚拟对象区域版本信息与该区域Z的当前区域版本号不相同,服务端会将该区域Z的当前区域版本号3对应的区域虚拟资源状态信息发送至角色d对应的客户端d,以使客户端d更新并显示该区域Z内的虚拟资源的状态。
通过上述实施方式,设置区域版本号实现区域内虚拟资源状态信息的同步以及对游戏场景中的模型进行区域化管理,当虚拟资源的状态发生变化时,对区域内的客户端进行实时同步,对区域外的客户端进行异步同步,从而有效减少了资源消耗,并可以大大降低数据处理压力,提升数据同步效率。
在可选的实施方式中,步骤S140,将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
服务端将区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息更新该区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
例如:客户端a本地保存的区域Z内的虚拟资源的状态为:虚拟资源A:正常;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;服务端将区域虚拟资源状态信息发送至客户端a,该区域虚拟资源状态信息为:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者该区域虚拟资源状态信息为:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者该区域虚拟资源状态信息为:虚拟资源A:已拆除。客户端a根据该区域虚拟资源状态信息更新该区域内的虚拟资源的状态,即将虚拟资源A的状态由正常改为已拆 除,并在客户端A的图形用户界面中渲染显示虚拟资源A的拆除动画。
在可选的实施方式中,服务端将区域虚拟资源状态信息发送至虚拟对象对应的客户端,以及处于该区域内的所有虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息更新该区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
在可选的实施方式中,根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,其中,虚拟资源的状态由虚拟资源状态信息决定,虚拟资源状态信息包括虚拟资源的当前状态,如:是否被拆除、虚拟资源的材质、剩余血量等等。
例如:虚拟资源A的虚拟资源状态信息为:虚拟资源A:正常,则在客户端的图形用户界面中渲染显示所述虚拟资源的正常形态;如虚拟资源A的虚拟资源状态信息为:虚拟资源A:已拆除,或者当前的虚拟资源状态信息中不存在虚拟资源A,则在客户端的图形用户界面中渲染显示所述虚拟资源的拆除动画后,将该虚拟资源隐藏或删除;如虚拟资源A的虚拟资源状态信息为:虚拟资源A:剩余血量20%,则在客户端的图形用户界面中渲染显示所述虚拟资源,并在该虚拟资源上添加裂纹、缺口等显示效果。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
在可选的实施方式中,所述方法还包括以下步骤:
步骤S150,对所述游戏场景中的所述多个虚拟资源建立虚拟资源状态索引表,所述虚拟资源状态索引表至少包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息;
步骤S160,将所述虚拟资源状态索引表同步至客户端。
需要说明的是,步骤S150、步骤S160可以作为初始化步骤在步骤S110之前执行,也可以作为重置步骤根据需要设置在任意步骤之前、之后或之中执行。
考虑到客户端对于拆卸数据存储的结构访问的便利性,在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源,由服务端对游戏场景中存在的多个虚拟资源建立虚拟资源状态索引表,虚拟资源状态索引表是一种多层级索引式存储数据结构,用于存储游戏场景中的所有虚拟资源的状态信息,其中,虚拟资源状态索引表至少包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息。将该虚拟资源状态索引表同步至客户端,以供客户端快速定位虚拟资源,服务端也可以使用自己建立的虚拟资源状态索引表或者另行维护对游戏场景中存在的多个虚拟资源的状态信息。
在可选的实施方式中,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
其中,游戏场景中的多个虚拟资源可以相互拼接组成一合成模型,例如:由2个水平面虚拟资源与4个垂直面虚拟资源可以相互拼接组成一个房屋(合成模型)。
在可选的实施方式中,为了识别游戏场景中的虚拟资源是合成模型中的子模型,或者是独立模型,以及获取各个虚拟资源的索引,在为虚拟资源分配全局唯一的ID时,使用了一个32位的整数作为ID,且使用整数的低12bit作为合成模型的子模型的索引,剩余的24bit高位作为独立模型/合成模型的索引。
之所以使用12bit作为子模型的索引,是因为在游戏场景中最大的合成模型已经有几百个子模型,而12bit能够表示4096个数,已经足够当前使用,并为未来更大的合成模型预留了足够的空间。而高位可以表示高达2的19次方个数,而游戏场景中的独立模型/合成模型也才几万个而已。此外,由于子模型在合成模型中的索引从0开始,为此加了1的偏移,这样当子模型的索引为0时,表示该虚拟资源是一个独立模型。
例如:由2个水平面虚拟资源与4个垂直面虚拟资源可以相互拼接组成一个房屋(合成模型),则2个水平面虚拟资源的ID分别为:
0000 0000 0000 0000 0000 0001:0000 0000 0001;
0000 0000 0000 0000 0000 0001:0000 0000 0002;
4个垂直面虚拟资源的ID分别为:
0000 0000 0000 0000 0001:0000 0000 0003;
0000 0000 0000 0000 0001:0000 0000 0004;
0000 0000 0000 0000 0001:0000 0000 0005;
0000 0000 0000 0000 0001:0000 0000 0006;
一个独立水平面虚拟资源的ID为:
0000 0000 0000 0000 0002:0000 0000 0000。
根据虚拟资源ID的低位信息可以快速识别出该虚拟资源是独立的模型还是合成模型的子模型,例如:当低位信息为0000 0000 0000时,标识该虚拟资源为独立模型,当低位信息为0000 0000 0001等存在数值偏移时,标识该虚拟资源为合成模型。同时,根据虚拟资源ID的高位信息,可以快速识别出合成模型的所有的子模型,例如:当高位信息为0000 0000 0000 0000 0001的虚拟资源ID同属于一个合成模型的子模型。
通过上述实施方式,有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
所述新建虚拟资源(即在游戏画面中渲染生成)由玩家的建造指令所触发建造,建造指令中至少包含玩家拟建造的虚拟资源(即新建资源)的空间类型,还可以包含新建资源的材料属性(如木材、混凝土、砖块等)和数量。已有虚拟资源为游戏开发者为游戏场景中初始设置的虚拟资源,已有虚拟资源的形状与新建虚拟资源的形状可以相同也可以不同,例如:新建虚拟资源的形状信息包括:水平面、垂直面、向上斜面、向下斜面;已有虚拟资源的形状信息包括:水平面、垂直面、柱子、不规则类型。
在可选的实施方式中,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成。
游戏场景的空间被划分为多个相互拼接的几何体。其中,几何体可以是长方体、立方体、平行六面体、蜂巢体等,可以理解,几何体之间可以相互拼接,从而形成整个游戏场景的空间。需要说明的是,游戏场景的空间被划分成的几何体是逻辑上的空间,例如:x,y,z坐标均在0~50范围内的一片空间范围。
游戏场景中所划分的区域为在x,z轴上(水平方向)所划分的二维区域,每个所划分的区域由至少一个所述几何体组成,所划分的区域通常是几何体的整数倍。需要说明的是,几何体本身是一个三维区域,此处所述的每个所划分的区域由至少一个所述几何体组成,即不考虑y轴(垂直方向),而在x,z轴所确定的平面内(水平方向)的前提下,每个所划分的区域由至少一个所述几何体组成。
在可选的实施方式中,所述几何体为长宽相同的长方体。在游戏场景的空间建立坐标系XYZ,分别为水平方向XZ坐标,垂直向上坐标Y。空间划分的方式就将空间划分为无限个水平X=5米,Z=5米,垂直向上方向Y=3.5米间距的长方体,需要说明的是,长方体的长宽高分度值可以由开发者根据实际情况任意设置。
在划分为多个相互拼接的几何体的游戏场景空间中,每个几何体的表面以及几何体内部的截面都可以建造新建虚拟资源,同时,游戏场景中的原有建筑的部件(已有虚拟资源)也根据几何体的表面以及内部的截面进行预先放置。
由于新建虚拟资源与已有虚拟资源具有相同的放置规则,在生成新建虚拟资源时更容易与已有虚拟资源进行契合,同样也大大降低了计算量,提高了游戏的运行效率。
以下以将空间划分为多个长宽相同的相互拼接的长方体为例进行描述,需要说明的是,将空间划分为任何形状的可相互拼接的多个几何体都包含在本公开的保护范围之内。
虚拟资源的形状信息可以为:水平面、垂直面、向上斜面、向下斜面,即相对于所述长方体的几何位置,可以是沿长方体的垂直面建造,沿长方体的水平面建造,沿长方体的内坡面建造。所述垂直面即长方体中垂直于游戏场景地平面的四个面,所述水平面即长方体中平行于游戏场景地平面的两个面,所述内坡面即长方体内的对角截面(所述对角截面所在平面经过长方体水平面的两个边,并与长方体的两个垂直面相交)。以虚拟资源的材料属性为砖块为例,沿长方体垂直面建造的虚拟资源为垂直墙,沿长方体水平建造的虚拟资源为水平墙,沿建造位置为长方体的内坡面建造的虚拟资源为向上或向下的斜坡。
通过上述实施方式,将游戏场景归一几何化,使得新建虚拟资源和游戏场景中已有虚拟资源能够对齐拼接,增强画面美感;同时,避免了在游戏场景中进行建造时对虚拟资源之间进行物理碰撞检测,从而可以有效降低系统开销,提升游戏运行的流畅性。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
在游戏的初始化过程中,服务端从游戏场景文件中获取所有虚拟资源的ID、虚拟资源的模型信息(虚拟资源可以是合成模型中的子模型,或者是独立模型)、世界坐标信息、旋转信息等信息;同时,解析游戏场景中的合成模型的gim文件,获取合成模型中的每一个子模型在合成模型的局部坐标系中旋转、缩放、位置信息,获取每一个子模型的gim文件路径,解析子模型的gim文件,获取各个子模型的包围盒信息。
接着对游戏场景中的虚拟资源进行三维重建,确定各个虚拟资源所处的几何体,建立虚拟资源与几何体的映射关系。三维重建的目的是为虚拟资源的网格化建造提供信息,确定出游戏场景中的哪些地方能够建造虚拟资源,哪些地方不能建造虚拟资源等。
图2是本公开其中之一示例性实施例中的虚拟资源三维重建映射关系的示意图,游戏场景中的虚拟资源进行三维重建时,合成模型的子模型可以映射成以下几种类型:
1.垂直面(包括朝西、朝南两种类型)
2.水平面
3.不规则类型(主要是屋顶,楼梯这种子模型)
4.柱子
如图2所示,对图2中左边的建筑物抽象并进行三维重建之后,得到图2右边 的合成模型,设图2中的合成模型在几何体中的坐标为(x,y,z),则使用抽象后的合成模型描述原建筑物如下表所示:
子模型(虚拟资源) 映射类型 几何体坐标
oD 柱子 (x,y,z)
AE 柱子 (x+1,y,z)
BF 柱子 (x+1,y,z+1)
CG 柱子 (x,y,z+1)
oAED 垂直面朝南 (x,y,z)
ABFE 垂直面朝西 (x+1,y,z)
BCGF 垂直面朝南 (x,y,z+1)
CoDG 垂直面朝西 (x,y,z)
oABC 水平面 (x,y,z)
DEFG 水平面 (x,y+1,z)
DEFGLM 不规则类型 (x,y+1,z)
经过上述三维重建之后,建立虚拟资源与几何体的映射关系,从而当虚拟对象在游戏场景中进行建造或拆卸时,可以根据虚拟资源状态索引表判断每个几何体中所存在的虚拟资源类型,确定可以进行建造的位置,也可以根据虚拟资源快速索引值该虚拟资源所处的几何体。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
各个虚拟资源对应的区域索引信息,用于标识每个虚拟资源与所处区域的映射关系。有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端够快速确定待拆除虚拟资源所处的区域,也可以在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源。
通过上述实施方式,有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源,并进一步快速确定该虚拟资源所处的几何体、分类信息、形状信息等信息;同时,通过虚拟资源状态索引表,不需要将整个游戏场景加载进内存,只需对所处区域内的存在虚拟资源的几何体加载进内存。从而大大节省内存的消耗。
在可选的实施方式中,虚拟资源状态索引表采用了索引存储的方式,图3是本公开其中之一示例性实施例中的虚拟资源状态索引表的示意图,如图3所示,一级索引是区域索引,二级索引是几何体索引,三级索引是虚拟资源分类信息索引,四级索引是虚拟资源形状信息索引。当游戏场景中的某个虚拟资源被拆除之后,该虚拟资源在虚拟资源状态索引表中被移除,或将该虚拟资源的状态信息变更为已拆除状 态,通过上述方式,当客户端尝试在该被拆除的虚拟资源的原位置或相邻位置建造新建虚拟资源的时候,就能够及时且快速地从虚拟资源状态索引表中查询到相应的信息。
在可选的实施方式中,步骤S130将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,所述方法还包括以下步骤:
步骤S1307,根据所述区域从虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
步骤S1308,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并更新所述区域内的虚拟资源状态信息,生成所述区域对应的区域虚拟资源状态信息。
服务端可以使用自己建立的虚拟资源状态索引表维护游戏场景中存在的虚拟资源的状态信息。根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域之后,读取本地维护的该区域从虚拟资源状态索引表,并根据该区域从虚拟资源状态索引表中索引该区域内的虚拟资源状态信息。将待拆除的虚拟资源删除后,实时对虚拟资源状态索引表进行更新,可以只对发生状态变化的虚拟资源状态信息进行更新,也可以对该区域内所有虚拟资源状态信息一起进行更新,以保证虚拟资源状态索引表可以正确反映出游戏场景中各个虚拟资源的最新状态,同时,根据最新的虚拟资源状态索引表生成该区域对应的区域虚拟资源状态信息。
通过上述实施方式,服务端使用区域索引可以快速更新并生成对应区域的虚拟资源状态信息,提升信息处理效率,并有效减少资源消耗。
本公开实施例还提供了一种游戏场景中虚拟资源的处理方法,该方法的执行主体为客户端,客户端可以是计算机、手机、平板电脑、移动终端、电子设备等任意客户端设备。图4为本公开实施例的其中一种游戏场景中虚拟资源的处理方法的流程图。如图4所示,在本实施例中该方法包括步骤如下:
步骤S210,响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
步骤S220,将所述待拆除虚拟资源的标识发送至服务端;
步骤S230,接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
步骤S240,根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单 位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
下面,将对本示例性实施例中游戏场景中虚拟资源的处理方法的各步骤作进一步地说明。
在本示例性实施例中,通过在客户端设备的处理器上执行软件应用并在所述客户端设备的显示器上渲染得到图形用户界面,所述图形用户界面所显示的内容至少部分地包含一局部或全部的游戏场景,所述游戏场景中包括至少一虚拟对象。
图形用户界面所呈现的内容可以包含游戏场景的全部,也可以是游戏场景的局部。例如,当游戏场景比较大,在游戏的过程中移动终端的图形用户界面上显示游戏场景的局部内容。游戏场景可以是方形,也可以是其它形状(比如,圆形等)。游戏场景中可以包含地面、山、石、花、草、树、建筑等。
游戏场景中包括至少一个虚拟资源,虚拟资源可以是建造于游戏场景中的建造物,如房屋、水平面、垂直面、斜面、桌子、椅子、路灯等虚拟物体。虚拟资源可以通过图形用户界面所呈现,所呈现的内容可以包含虚拟资源的全部,也可以是虚拟资源的局部。
游戏场景中包括至少一虚拟对象,可以通过图形用户界面所呈现,所呈现的内容可以包含虚拟对象的全部,也可以是虚拟对象的局部。比如,在第三人称视角游戏中,图形用户界面所呈现的内容可以包含虚拟对象的全部;又比如,在第一人称视角游戏中,图形用户界面所呈现的内容可以包含虚拟对象的部分/局部。
虚拟对象可以是敌方阵营的虚拟对象,也可以是己方阵营的虚拟对象,虚拟对象可以响应用户的操作在游戏场景实施相应的行为,例如,用户可以控制虚拟对象在游戏场景中进行走、跑、蹲、趴、攻击、射击等动作,本发明在此不作限制。
在可选的实施方式中,步骤S210,响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源。
对所述游戏场景中的所述虚拟资源的拆除事件可以通过检测用户图形界面中所提供的特定触发控件的触控操作进行触发;也可以根据预先设置的交互条件进行触发,例如:用户的按压、摇晃、声音输入、特殊手势操作等方式;还可以通过检测游戏场景中的虚拟资源是否受到攻击进行触发,例如:当检测到虚拟资源A受到子弹或道具的碰撞时触发拆除事件,还可以通过检测游戏场景中的虚拟资源的剩余血量为0进行触发。
需要说明的是,通过检测游戏场景中的虚拟资源是否受到攻击进行触发,其中攻击可以是来自同一个虚拟对象或不同虚拟对象的多次攻击,故可以设置为虚拟资源每次受到攻击都可以触发拆除事件,也可以设置为虚拟资源受到每个不同虚拟对象的首次、预设次、某一特定次攻击时触发拆除事件。
需要说明的是,通过检测游戏场景中的虚拟资源的剩余血量为0进行触发,其中,虚拟资源具备预设值的初始血量,受到攻击时,根据攻击类型会损失一定数值的血量,当检测游戏场景中的虚拟资源的剩余血量为0进行触发拆除事件。
根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源。例如:当检测到虚拟资源A受到子弹或道具的碰撞时触发拆除事件,将该虚拟资源A确定为待拆除虚拟资源,并获取虚拟资源A的标识。
在可选的实施方式中,在客户端侧维护一名字到ID映射表,该表存储了游戏场景中所有虚拟资源的名字以及为该虚拟资源分配的ID,并且该表中给出名字与ID的映射关系,当在客户端检测到拆除事件时,根据该拆除事件获取到待拆除虚拟资源的名字,并根据该虚拟资源的名字从名字到ID映射表中获取到该虚拟资源对应的ID,虚拟资源的ID主要用于客户端和服务端通信,这样做是因为使用虚拟资源在场景中的唯一名字通信时,名字通常非常长,会浪费玩家流量,因此使用一个4字节的整数唯一标识虚拟资源进行通信。
在可选的实施方式中,响应于对所述游戏场景中的所述虚拟资源的拆除事件的步骤,包括:将客户端的实体按键与拆除指令相关联,当移动终端检测到该实体键被按压时,控制虚拟对象对游戏场景中的虚拟资源进行拆除。在其他实施方式中,通过预设音频指令控制虚拟对象对虚拟资源进行拆除。
在可选的实施方式中,步骤S220,将所述待拆除虚拟资源的标识发送至服务端。
客户端将该虚拟资源的标识发送至服务端。服务端接收到客户端发送的虚拟资源标识后,根据该虚拟资源标识在本地查询并获取到该标识对应的虚拟资源。
其中,将所述待拆除虚拟资源的标识发送至服务端可以通过有线或无线的方式进行发送,所使用的通信协议属于现有技术,此处不再赘述。
在可选的实施方式中,步骤S230,接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
服务端根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域。其中,该区域可以是游戏场景中以虚拟对象所处的位置为中心,以预设距离为半径的圆形范围区域,也可以是包含虚拟对象所处的当前位置的任意形状的区域,还可以是预先将游戏场景划分为多个区域,根据虚拟对象在游戏场景中的当前位置确定该当前位置所属于的预设区域。
服务端维护有游戏场景中所存在的全部虚拟资源的状态信息,待拆除虚拟资源的标识确定待拆除虚拟资源后,可以直接将该待拆除虚拟资源从游戏场景中根据虚拟对象的当前位置所确定的区域中删除,也可以当检测到所述待拆除虚拟资源满足预设条件时,再将该待拆除虚拟资源从游戏场景中根据虚拟对象的当前位置所确定的区域中删除,并生成该区域对应的区域虚拟资源状态信息,其中,区域虚拟资源 状态信息可以是包含对应区域内所有虚拟资源的当前状态信息,包括:是否被拆除、虚拟资源的材质、剩余血量等等;或者,区域虚拟资源状态信息可以是包含对应区域内所有虚拟资源的当前状态信息,包括:虚拟资源的材质、剩余血量等等;或者,区域虚拟资源状态信息可以是包含对应区域内发生状态变化的虚拟资源的当前状态信息。客户端接收服务端反馈的上述区域虚拟资源状态信息。
例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,当确定待拆除虚拟资源为虚拟资源A时,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源A:已拆除;客户端接收服务端反馈的上述区域虚拟资源状态信息。
在可选的实施方式中,服务端检测待拆除虚拟资源资源满足预设条件时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除。其中,预设条件可以由开发者根据实际情况预先设置,当服务端检测到所述待拆除虚拟资源满足预设条件时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除。例如:服务端检测到待拆除虚拟资源的当前剩余血量为0时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;又例如:当服务端检测到待拆除虚拟资源被特定攻击模式(如虚拟对象处于直接拆除模式下或待拆除虚拟资源被拆除武器攻击时)攻击时,将所述待拆除虚拟资源从所述游戏场景的所述区域中删除等。
例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,如:虚拟资源A:正常,剩余血量60%;虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%。当确定待拆除虚拟资源为虚拟资源A时,检测虚拟资源A的剩余血量是否为0,当虚拟资源A的剩余血量为0时,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%;或者,该信息可以包括下列内容:虚拟资源B:正常,剩余血量100%;虚拟资源C,剩余血量100%:正常;虚拟资源D,剩余血量100%;或者,该信息可以包括下列内容:虚拟资源A:已拆除;客户端接收服务端反馈的上述区域虚拟资源状态信息。
又例如:根据虚拟对象的当前位置所确定的区域(设为区域Z)中原先存在虚拟资源A、B、C、D,当接收到待拆除虚拟资源的标识并确定待拆除虚拟资源为虚拟资源A时,检测到虚拟资源A被拆除武器(锄头、锤子等)攻击时,或者,检 测到虚拟对象正处于直接拆除模式下,将虚拟资源从游戏场景的区域Z中删除,即删除后区域Z当前存在虚拟资源B、C、D。同时,生成区域Z对应的区域虚拟资源状态信息,该信息可以包括下列内容:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常,或者,该信息可以包括下列内容:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该信息可以包括下列内容:虚拟资源A:已拆除;客户端接收服务端反馈的上述区域虚拟资源状态信息。
在可选的实施方式中,步骤S240,根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
客户端根据所述区域虚拟资源状态信息更新该区域内的虚拟资源的状态,并在客户端的图形用户界面上根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,其中,客户端保存有该区域内的虚拟资源的状态信息,或者保存有游戏场景中全部的虚拟资源的状态信息,存储信息的格式与数据结构可以根据需要任意设置。客户端根据接收到的所述区域虚拟资源状态信息对本地所保存的虚拟资源的状态信息进行更新,从而完成对该区域内的虚拟资源的状态的更新。
例如:客户端a本地保存的区域Z内的虚拟资源的状态为:虚拟资源A:正常;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;服务端将区域虚拟资源状态信息发送至客户端a,该区域虚拟资源状态信息为:虚拟资源A:已拆除;虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该区域虚拟资源状态信息为:虚拟资源B:正常;虚拟资源C:正常;虚拟资源D:正常;或者,该区域虚拟资源状态信息为:虚拟资源A:已拆除;客户端a根据该区域虚拟资源状态信息更新该区域内的虚拟资源的状态,即将虚拟资源A的状态由正常改为已拆除,并在客户端A的图形用户界面中渲染显示虚拟资源A的拆除动画。
在可选的实施方式中,根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,其中,虚拟资源的状态由虚拟资源状态信息决定,虚拟资源状态信息包括虚拟资源的当前状态,如:是否被拆除、虚拟资源的材质、剩余血量等等。
例如:虚拟资源A的虚拟资源状态信息为:虚拟资源A:正常,则在客户端的图形用户界面中渲染显示所述虚拟资源的正常形态;如虚拟资源A的虚拟资源状态信息为:虚拟资源A:已拆除,则在客户端的图形用户界面中渲染显示所述虚拟资源的拆除动画后,将该虚拟资源隐藏或删除;如虚拟资源A的虚拟资源状态信息为:虚拟资源A:剩余血量20%,则在客户端的图形用户界面中渲染显示所述虚拟资源,并在该虚拟资源上添加裂纹、缺口等显示效果。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所 处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
在可选的实施方式中,步骤S240还包括以下步骤:
步骤S2401,根据所述区域虚拟资源状态信息更新所述区域内的待拆除虚拟资源和所述待拆除虚拟资源的相邻虚拟资源的状态,并根据更新后的所述区域内的虚拟资源的状态渲染显示所述区域内的虚拟资源。
接收服务端反馈的区域虚拟资源状态信息中包含待拆除虚拟资源的状态信息,所述方法还包括与所述待拆除虚拟资源相邻的待拆除相邻虚拟资源的状态信息。其中,服务端确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源;获取所述相邻虚拟资源的邻接关系列表,并将所述待拆除虚拟资源从所述邻接关系列表中删除;根据所述邻接关系列表判断所述相邻虚拟资源与地面是否相连通,如果所述相邻虚拟资源与地面不能相连通,则将所述相邻虚拟资源从所述游戏场景的所述区域中删除,根据所述区域内的虚拟资源的当前状态生成区域虚拟资源状态信息。
确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源,相邻虚拟资源可以与该待拆除虚拟资源直接相邻,也可以与该待拆除虚拟资源间接相邻。即相邻关系包括直接相邻关系和间接相邻关系。直接相邻关系是指两个虚拟资源存在共用边,或者一个虚拟资源的一个面与另一个虚拟资源的表面连接,或者一个虚拟资源的一个点与另一个虚拟资源的表面连接。举例而言,虚拟资源A为水平面,虚拟资源B也为水平面,当虚拟资源A与虚拟资源B并列排放在一起且两个水平面的侧面贴在一起,则认为两个水平面直接相邻;再次举例而言,虚拟资源C为垂直面,当虚拟资源A的侧面与虚拟资源C的正面相贴合共同构成房屋的垂直墙面与地面或垂直墙面与顶面时,则认为虚拟资源A与虚拟资源C直接相邻。间接相邻关系是指两个虚拟资源具有相同的具有直接关系的虚拟资源,举例而言,虚拟资源A为水平面,虚拟资源B也为水平面,虚拟资源A与虚拟资源B中间存在虚拟资源D(水平面),且虚拟资源D的两个侧面分别与虚拟资源A和虚拟资源B直接相邻,则认为虚拟资源A与虚拟资源B之间存在间接相邻关系。
服务端为游戏场景中的每个虚拟资源维护一邻接关系列表,该邻接关系列表中实时记录了每个虚拟资源对应的当前与该虚拟资源具有相邻关系的相邻虚拟资源标识,当游戏场景中的某一虚拟资源被确定为待拆除虚拟资源时,确定该虚拟资源的相邻虚拟资源,并获取相邻虚拟资源的邻接关系列表,并将该待拆除虚拟资源从邻接关系列表中删除。
客户端根据所述区域虚拟资源状态信息更新该区域内的虚拟资源的状态,并在客户端的图形用户界面上根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
通过上述实施方式,在确定待拆除虚拟资源之后,自动根据预设的相邻关系确定出符合条件的其他待拆除虚拟资源,降低了系统数据处理资源的占用,基于此种方式,使得用户在拆除了待拆除虚拟资源后,联动拆除其他符合条件的待拆除相邻虚拟资源,以实现更符合现实世界建筑物崩塌的效果,以提到用户的游戏体验。
在可选的实施方式中,步骤S210,响应于对所述游戏场景中的所述虚拟资源的拆除事件之前,所述方法还包括以下步骤:
步骤S250,获取所述虚拟对象在游戏场景中的当前位置,并从本地获取虚拟资源状态索引表;
步骤S260,根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源。
根据用户在客户端上的触控操作可以改变虚拟对象在游戏场景中的移动方向,从而控制虚拟对象在游戏场景中进行自由的移动,故引起虚拟对象在游戏场景中位置发生改变。获取所述虚拟对象在游戏场景中的当前位置,可以是获取该虚拟对象在游戏场景中的坐标,或其他能够表征虚拟对象在游戏场景中的位置的数值。
在可选的实施方式中,在所述图形用户界面中提供一移动控制器,将所述虚拟对象配置为根据所述移动控制器接收到的触控操作在所述第一游戏场景中进行移动。所述移动控制器可以是诸如虚拟摇杆、方向控制虚拟按键等,本示例性实施例对此不作特殊限定。
具体地,检测作用于所述移动控制器的触控操作,根据该触控操作的触控点的移动控制所述虚拟对象在所述游戏场景中移动。
在可选的实施方式中,移动控制器是一虚拟摇杆,根据虚拟摇杆接收到的触控操作控制虚拟对象在游戏场景中进行移动。
在可选的实施方式中,移动控制器是一虚拟十字键/虚拟方向键(D-PAD),根据虚拟十字键接收到的触控操作控制虚拟对象在游戏场景中进行移动。
虚拟资源状态索引表是一种多层级索引式存储数据结构,用于存储游戏场景中的所有虚拟资源的状态信息,在游戏的初始化过程中,客户端会从服务端接收游戏场景中各个虚拟资源对应的虚拟资源状态索引表,并存储至本地。在游戏进行过程中,客户端从本地获取虚拟资源状态索引表。根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源。
需要说明的是,根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表可以渲染加载全部游戏场景的虚拟资源,也可以根据所述虚拟对象在游戏场景中的当前位置只渲染加载游戏场景部分区域内的虚拟资源。
虚拟资源状态索引表能够提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端通过该索引表可以快速索引到各个建造模型的状态信息,提升信息处理效率,并有效减少资源消耗。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息。客户端在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源,并能根据虚拟资源标识快速获取对应虚拟资源的状态信息。
在可选的实施方式中,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
其中,游戏场景中的多个虚拟资源可以相互拼接组成一合成模型,例如:由2个水平面虚拟资源与4个垂直面虚拟资源可以相互拼接组成一个房屋(合成模型)。
在可选的实施方式中,为了识别游戏场景中的虚拟资源是合成模型中的子模型,或者是独立模型,以及获取各个虚拟资源的索引,在为虚拟资源分配全局唯一的ID时,使用了一个32位的整数作为ID,且使用整数的低12bit作为合成模型的子模型的索引,剩余的24bit高位作为独立模型/合成模型的索引。
之所以使用12bit作为子模型的索引,是因为在游戏场景中最大的合成模型已经有几百个子模型,而12bit能够表示4096个数,已经足够当前使用,并为未来更大的合成模型预留了足够的空间。而高位可以表示高达2的19次方个数,而游戏场景中的独立模型/合成模型也才几万个而已。此外,由于子模型在合成模型中的索引从0开始,为此加了1的偏移,这样当子模型的索引为0时,表示该虚拟资源是一个独立模型。
例如:由2个水平面虚拟资源与4个垂直面虚拟资源可以相互拼接组成一个房屋(合成模型),则2个水平面虚拟资源的ID分别为:
0000 0000 0000 0000 0000 0001:0000 0000 0001;
0000 0000 0000 0000 0000 0001:0000 0000 0002;
4个垂直面虚拟资源的ID分别为:
0000 0000 0000 0000 0001:0000 0000 0003;
0000 0000 0000 0000 0001:0000 0000 0004;
0000 0000 0000 0000 0001:0000 0000 0005;
0000 0000 0000 0000 0001:0000 0000 0006;
一个独立水平面虚拟资源的ID为:
0000 0000 0000 0000 0002:0000 0000 0000。
根据虚拟资源ID的低位信息可以快速识别出该虚拟资源是独立的模型还是合成模型的子模型,例如:当低位信息为0000 0000 0000时,标识该虚拟资源为独立模型,当低位信息为0000 0000 0001等存在数值偏移时,标识该虚拟资源为合成模型。同时,根据虚拟资源ID的高位信息,可以快速识别出合成模型的所有的子模型,例如:当高位信息为0000 0000 0000 0000 0001的虚拟资源ID同属于一个合成模型 的子模型。
通过上述实施方式,有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
所述新建虚拟资源(即在游戏画面中渲染生成)由玩家的建造指令所触发建造,建造指令中至少包含玩家拟建造的虚拟资源(即新建资源)的空间类型,还可以包含新建资源的材料属性(如木材、混凝土、砖块等)和数量。已有虚拟资源为游戏开发者为游戏场景中初始设置的虚拟资源,已有虚拟资源的形状与新建虚拟资源的形状可以相同也可以不同,例如:新建虚拟资源的形状信息包括:水平面、垂直面、向上斜面、向下斜面;已有虚拟资源的形状信息包括:水平面、垂直面、柱子、不规则类型。
在可选的实施方式中,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成。
游戏场景的空间被划分为多个相互拼接的几何体。其中,几何体可以是长方体、立方体、平行六面体、蜂巢体等,可以理解,几何体之间可以相互拼接,从而形成整个游戏场景的空间。需要说明的是,游戏场景的空间被划分成的几何体是逻辑上的空间,例如:x,y,z坐标均在0~50范围内的一片空间范围。
游戏场景中所划分的区域为在x,z轴上(水平方向)所划分的二维区域,每个所划分的区域由至少一个所述几何体组成,所划分的区域通常是几何体的整数倍。需要说明的是,几何体本身是一个三维区域,此处所述的每个所划分的区域由至少一个所述几何体组成,即不考虑y轴(垂直方向),而在x,z轴所确定的平面内(水平方向)的前提下,每个所划分的区域由至少一个所述几何体组成。
在可选的实施方式中,所述几何体为长宽相同的长方体。在游戏场景的空间建立坐标系XYZ,分别为水平方向XZ坐标,垂直向上坐标Y。空间划分的方式就将空间划分为无限个水平X=5米,Z=5米,垂直向上方向Y=3.5米间距的长方体,需要说明的是,长方体的长宽高分度值可以由开发者根据实际情况任意设置。
在划分为多个相互拼接的几何体的游戏场景空间中,每个几何体的表面以及几何体内部的截面都可以建造新建虚拟资源,同时,游戏场景中的原有建筑的部件(已 有虚拟资源)也根据几何体的表面以及内部的截面进行预先放置。
由于新建虚拟资源与已有虚拟资源具有相同的放置规则,在生成新建虚拟资源时更容易与已有虚拟资源进行契合,同样也大大降低了计算量,提高了游戏的运行效率。
以下以将空间划分为多个长宽相同的相互拼接的长方体为例进行描述,需要说明的是,将空间划分为任何形状的可相互拼接的多个几何体都包含在本公开的保护范围之内。
虚拟资源的形状信息可以为:水平面、垂直面、向上斜面、向下斜面,即相对于所述长方体的几何位置,可以是沿长方体的垂直面建造,沿长方体的水平面建造,沿长方体的内坡面建造。所述垂直面即长方体中垂直于游戏场景地平面的四个面,所述水平面即长方体中平行于游戏场景地平面的两个面,所述内坡面即长方体内的对角截面(所述对角截面所在平面经过长方体水平面的两个边,并与长方体的两个垂直面相交)。以虚拟资源的材料属性为砖块为例,沿长方体垂直面建造的虚拟资源为垂直墙,沿长方体水平建造的虚拟资源为水平墙,沿建造位置为长方体的内坡面建造的虚拟资源为向上或向下的斜坡。
通过上述实施方式,将游戏场景归一几何化,使得新建虚拟资源和游戏场景中已有虚拟资源能够对齐拼接,增强画面美感;同时,避免了在游戏场景中进行建造时对虚拟资源之间进行物理碰撞检测,从而可以有效降低系统开销,提升游戏运行的流畅性。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
根据虚拟资源状态索引表中的几何体索引信息,可以快速确定每个虚拟资源所处的几何体,以及每个几何体中所包含的虚拟资源。
在可选的实施方式中,如图2所示,设图2中右边的合成模型(虚拟资源为合成模型的各个子模型)在几何体中的坐标为(x,y,z),则资源状态索引表中的几何体索引信息如下表所示:
子模型(虚拟资源) 映射类型 几何体坐标
oD 柱子 (x,y,z)
AE 柱子 (x+1,y,z)
BF 柱子 (x+1,y,z+1)
CG 柱子 (x,y,z+1)
oAED 垂直面朝南 (x,y,z)
ABFE 垂直面朝西 (x+1,y,z)
BCGF 垂直面朝南 (x,y,z+1)
CoDG 垂直面朝西 (x,y,z)
oABC 水平面 (x,y,z)
DEFG 水平面 (x,y+1,z)
DEFGLM 不规则类型 (x,y+1,z)
根据资源状态索引表中的几何体索引信息可以确定:几何体(x,y,z)中包括虚拟资源oD、oAED、CoDG、oABC;几何体(x+1,y,z)中包括虚拟资源AE、ABFE;几何体(x,y+1,z)中包括虚拟资源DEFG、DEFGLM;几何体(x,y,z+1)中包括虚拟资源CG、BCGF;几何体(x+1,y,z+1)中包括虚拟资源BF。根据资源状态索引表中的几何体索引信息也可以快速确定每个虚拟资源所处的几何体坐标,从而建立虚拟资源与几何体的映射关系。当虚拟对象在游戏场景中进行建造或拆卸时,可以根据虚拟资源状态索引表判断每个几何体中所存在的虚拟资源类型,确定可以进行建造的位置,也可以根据虚拟资源快速索引值该虚拟资源所处的几何体。
在可选的实施方式中,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
各个虚拟资源对应的区域索引信息,用于标识每个虚拟资源与所处区域的映射关系。有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端够快速确定待拆除虚拟资源所处的区域,也可以在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源。
通过上述实施方式,有利于提升客户端对于拆卸数据存储的结构访问的便利性,使得客户端在同步某个区域的虚拟资源状态信息时,能够快速定位到该区域内有哪些虚拟资源,并进一步快速确定该虚拟资源所处的几何体、分类信息、形状信息等信息;同时,通过虚拟资源状态索引表,不需要将整个游戏场景加载进内存,只需对所处区域内的存在虚拟资源的几何体加载进内存。从而大大节省内存的消耗。
在可选的实施方式中,虚拟资源状态索引表采用了索引存储的方式,图3是本公开其中之一示例性实施例中的虚拟资源状态索引表的示意图,如图3所示,一级索引是区域索引,二级索引是几何体索引,三级索引是虚拟资源分类信息索引,四级索引是虚拟资源形状信息索引。当游戏场景中的某个虚拟资源被拆除之后,该虚拟资源在虚拟资源状态索引表中被移除,或将该虚拟资源的状态信息变更为已拆除状态,通过上述方式,当客户端尝试在该被拆除的虚拟资源的原位置或相邻位置建造新建虚拟资源的时候,就能够及时且快速地从虚拟资源状态索引表中查询到相应的信息。
客户端使用的虚拟资源状态索引表中会缓存虚拟资源的状态信息,当虚拟资源的状态发生改变时,就会将该状态存储到虚拟资源状态索引表的数据结构中。当玩家从当前区域离开后再回到这个区域时,就能直接从缓存中读取这些虚拟资源的状态,并使用特效或UI表现该虚拟资源的状态。对于虚拟资源状态的缓存能够很大 程度减少客户端对虚拟资源状态更新的流量消耗。
根据图3举例而言,游戏场景被划分为4个区域,分别为区域W、X、Y、Z;每个区域内包含6个几何体,分别为几何体1-6、7-12、13-18、19-24;每个几何体中又包含2类分类信息,分别为:已有虚拟资源、新建虚拟资源;已有虚拟资源包含5类形状信息,分别为:水平面、朝西垂直面、朝南垂直面、不规则类型、柱子;新建虚拟资源包括4类形状信息,分别为:水平面、垂直面、向上斜坡、向下斜坡;已有虚拟资源中的每类形状信息包含:虚拟资源ID、最大血量、当前血量;新建虚拟资源中的没类形状信息包含:虚拟资源ID、最大血量、当前血量、材质ID、实体对象。
其中,假设虚拟资源A在虚拟资源状态索引表中的信息为:全局ID1、最大血量100、当前血量100、水平面、已有虚拟资源、几何体3、区域Z;虚拟资源B在虚拟资源状态索引表中的信息为:全局ID2、最大血量100、当前血量100、2(木材ID)、实体对象2、垂直面、新建虚拟资源、几何体4、区域Z。
当客户端接收到服务端反馈的区域Z对应的区域虚拟资源状态信息时,根据接收到的区域虚拟资源状态信息获知将区域Z内的虚拟资源A拆除,将虚拟资源2的血量将为40%,则根据区域虚拟资源状态信息更新虚拟资源状态索引表,即:将虚拟资源A从虚拟资源状态索引表中删除,将虚拟资源B的状态信息更新为:全局ID2、最大血量100、当前血量40、2(木材ID)、实体对象2、垂直面、新建虚拟资源、几何体4、区域Z。
在可选的实施方式中,步骤S260,根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源,所述方法还包括以下步骤:
步骤S2601,根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
步骤S2602,根据所述虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
步骤S2603,根据所述区域内的虚拟资源状态信息渲染加载所述游戏场景的所述区域内的虚拟资源。
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域。其中,该区域可以是游戏场景中以虚拟对象所处的位置为中心,以预设距离为半径的圆形范围区域,也可以是包含虚拟对象所处的当前位置的任意形状的区域,还可以是预先将游戏场景划分为多个区域,根据虚拟对象在游戏场景中的当前位置确定该当前位置所属于的预设区域。根据所述虚拟对象所处的区域在虚拟资源状态索引表进行索引,获取该区域内的所有虚拟资源状态信息,根据该区域内的所有虚拟资源状态信息渲染加载所述游戏场景的所述区域内的虚拟资源。
通过上述实施方式,根据虚拟资源状态索引表以及虚拟对象的当前位置渲染加载所处区域的虚拟资源,从而避免加载游戏场景的全部模型,有效降低了资源消耗。
根据图3再次举例而言,游戏场景被划分为4个区域,分别为区域W、X、Y、Z;每个区域内包含6个几何体,分别为几何体1-6、7-12、13-18、19-24;每个几何体中又包含2类分类信息,分别为:已有虚拟资源、新建虚拟资源;已有虚拟资源包含5类形状信息,分别为:水平面、朝西垂直面、朝南垂直面、不规则类型、柱子;新建虚拟资源包括4类形状信息,分别为:水平面、垂直面、向上斜坡、向下斜坡;已有虚拟资源中的每类形状信息包含:虚拟资源ID、最大血量、当前血量;新建虚拟资源中的没类形状信息包含:虚拟资源ID、最大血量、当前血量、材质ID、实体对象。
其中,假设虚拟对象处于区域Z;虚拟资源A在虚拟资源状态索引表中的信息为:全局ID1、最大血量100、当前血量100、水平面、已有虚拟资源、几何体3、区域Z;虚拟资源B在虚拟资源状态索引表中的信息为:全局ID2、最大血量100、当前血量100、2(木材ID)、实体对象2、垂直面、新建虚拟资源、几何体4、区域Z。
客户端根据本地存储的虚拟资源状态索引表获取区域Z内的虚拟资源状态信息,即虚拟资源A、B在虚拟资源状态索引表中的状态信息,根据所述状态信息在客户端的图形用户界面中渲染加载所述游戏场景的区域Z内的虚拟资源A、B。
在可选的实施方式中,步骤S240,根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括以下步骤:
步骤S2402,根据所述区域虚拟资源状态信息更新本地的所述虚拟资源状态索引表;
步骤S2403,根据更新后的所述虚拟资源状态索引表渲染显示所述虚拟资源。
客户端根据所述区域虚拟资源状态信息更新本地的所述虚拟资源状态索引表,并在客户端的图形用户界面上根据更新后的所述虚拟资源状态索引表渲染显示所述虚拟资源。
例如:客户端a本地保存的区域Z内的虚拟资源状态索引表为:
虚拟资源A:当前血量100,区域Z;
虚拟资源B:当前血量100,区域Z;
虚拟资源C:当前血量100,区域Z;
虚拟资源D:当前血量100,区域Z;
客户端a接收到服务端发送的区域虚拟资源状态信息,该区域虚拟资源状态信息为:虚拟资源A:已拆除;虚拟资源B:当前血量100;虚拟资源C:当前血量100;虚拟资源D:当前血量100;或者,该区域虚拟资源状态信息为:虚拟资源B: 当前血量100;虚拟资源C:当前血量100;虚拟资源D:当前血量100,或者,该区域虚拟资源状态信息为:虚拟资源A:已拆除。客户端a根据该区域虚拟资源状态信息更新虚拟资源状态索引表,得到更新后的虚拟资源状态索引表为:
虚拟资源A:已拆除,区域Z;
虚拟资源B:当前血量100,区域Z;
虚拟资源C:当前血量100,区域Z;
虚拟资源D:当前血量100,区域Z;
在客户端a的图形用户界面上根据更新后的所述虚拟资源状态索引表渲染显示虚拟资源A的拆除动画。
或者,得到更新后的虚拟资源状态索引表为:
虚拟资源B:当前血量100,区域Z;
虚拟资源C:当前血量100,区域Z;
虚拟资源D:当前血量100,区域Z;
由于更新后的虚拟资源状态索引表中不存在虚拟资源A,因此在客户端a的图形用户界面上根据更新后的所述虚拟资源状态索引表渲染显示虚拟资源A的拆除动画。
通过上述实施方式,通过虚拟资源状态索引表以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
在一种可选的实施方式中,图5为本公开实施例的其中一种游戏场景中虚拟资源的处理方法的流程图。如图5所示,在本实施例中该方法包括步骤如下:
步骤S310,服务端向客户端进行区域状态同步。
首先服务端会为游戏场景中的每一个区域维护一个版本号,这个版本号会在每次该区域内的模型(虚拟资源)状态发生改变就会发生迭代变化。同时,服务端也会为每个游戏角色(虚拟对象)维护该游戏角色经过的区域的版本号。当游戏角色进入某个未去过的区域的时候,如果这个区域的版本号与初始版本号不一致,则会将该区域的最新状态(区域虚拟资源状态信息)同步给该玩家。如果游戏角色再次回到某个曾经经过的区域,服务端会对比为该游戏角色维护的该区域的版本号,与该区域的版本号是否一致,如果不一致,服务端会将该区域的最新状态(区域虚拟资源状态信息)同步给该游戏角色对应的客户端。每次同步,客户端都会缓存这些同步的状态。
步骤S320,虚拟对象向游戏场景中的模型发起攻击。
游戏角色(虚拟对象)在拆卸游戏场景中的模型(虚拟对象)的时候,如用武器击中了场景中的模型,会向服务端上传这个被击中的模型的id。
步骤S330,更新被攻击模型的状态。
服务端会根据游戏角色使用的武器计算对该模型产生的伤害,并从为服务端生 成的数据表中获取该模型的材质,以及为这类模型配置的血量,当对模型的伤害到一定血量的时候,会掉落相应材质的材料。服务端会将该模型的当前的血量状态同步给在该区域中的所有游戏角色对应的客户端。当模型的血量将为0时,服务端会将该模型的拆除信息(区域虚拟资源状态信息)同步给在该区域中的所有游戏角色对应的客户端。对于该模型在被拆除时,服务端还会将该模型从建造网格(游戏场景中的几何体)中剔除,这样就更新了建造网格的信息。此外服务端还会将该模型从该模型的邻接模型的邻接关系中删除,在删除的时候,服务端还会判定与该模型相邻的模型是否能连通到地面,如果不能,还会将不能连通到地面的相关联的模型一并删除掉。
在与客户端的交互过程中,服务端会缓存状态发生改变的模型,同时修改对应区域的版本号。
步骤S340,缓存并渲染显示被攻击模型的状态。
客户端在收到被攻击模型的状态同步信息(区域虚拟资源状态信息)后,会首先缓存所述状态同步信息,然后再在客户端中进行特效表现,包括烟尘、火花、震动、裂纹、血条等。同时,还会从客户端的虚拟资源状态索引表中删除该模型,这样客户在游戏场景中建造虚拟资源的时候就可以判断被拆除的虚拟资源的相同位置处是否可以建造,以及该模型的相邻区域处能否可以建造。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
本示例性实施例中还公开了一种游戏场景中虚拟资源的处理装置。图6为本公开实施例的其中一种游戏场景中虚拟资源的处理装置的组成图。如图6所示,所述装置包括:
第一确定模块,用于根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
第二确定模块,用于接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
第一更新模块,用于将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
第一发送模块,用于将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单 位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
上述实施例中各模块单元的具体细节已经在对应的游戏场景中虚拟资源的处理方法中进行了详细的描述,此外,可以理解,游戏场景中虚拟资源的处理装置中还包括其他单元模块与信息处理方法相对应,因此此处不再赘述。
本示例性实施例中还公开了一种游戏场景中虚拟资源的处理装置。图7为本公开实施例的其中一种游戏场景中虚拟资源的处理装置的组成图。如图7所示,所述装置包括:
第三确定模块,用于响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
第二发送模块,用于将所述待拆除虚拟资源的标识发送至服务端;
第一接收模块,用于接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
第二更新模块,用于根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
上述实施例中各模块单元的具体细节已经在对应的游戏场景中虚拟资源的处理方法中进行了详细的描述,此外,可以理解,游戏场景中虚拟资源的处理装置中还包括其他单元模块与信息处理方法相对应,因此此处不再赘述。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
本示例性实施例中还公开了一种游戏系统。图8为本公开实施例的其中一种游戏系统的组成图。如图8所示,所述游戏系统包括:服务端801、客户端802;其中,
服务端包括:第一处理器;
第一存储器,用于存储所述第一处理器的第一可执行指令;
其中,所述第一处理器配置为经由执行所述第一可执行指令来执行上述的游戏 场景中虚拟资源的处理方法;
客户端包括:第二处理器;
第二存储器,用于存储所述第二处理器的第二可执行指令;
其中,所述第二处理器配置为经由执行所述第二可执行指令来执行上述的游戏场景中虚拟资源的处理方法。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
需要说明的是,本发明实施例仅以游戏系统具有一个服务端、一个客户端为例进行描述,但在具体实施当中,游戏系统可以有一个或多个客户端,其各个客户端的数量可以根据实际应用来配置。
图9为本公开实施例的其中一种电子设备的结构示意图。如图9所示,本实施例的电子设备910包括:存储器911和处理器912。其中,存储器911和处理器912之间可通过总线连接;
处理器912;以及
存储器911,用于存储所述处理器的可执行指令;
其中,所述处理器配置为经由执行所述可执行指令来实现如下步骤:
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除之前,所述方法还包括:
检测到所述待拆除虚拟资源满足预设条件。
可选地,所述生成所述区域对应的区域虚拟资源状态信息之前,所述方法还包括:
确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源;
获取所述相邻虚拟资源的邻接关系列表,并将所述待拆除虚拟资源从所述邻接关系列表中删除;
根据所述邻接关系列表判断所述相邻虚拟资源与地面是否相连通,如果所述相邻虚拟资源与地面不能相连通,则将所述相邻虚拟资源从所述游戏场景的所述区域中删除。
可选地,所述游戏场景被划分为多个区域,各个所述区域分别设置有一区域版本号,所述区域版本号用于标识所述区域内的虚拟资源的当前状态信息,所述根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域之后,所述方法还包括:
判断所述虚拟对象是否为首次进入所述区域;
如果是首次进入所述区域,则将所述区域的当前区域版本号保存为虚拟对象区域版本信息,并将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端;
如果不是首次进入所述区域,则获取所述虚拟对象对应的虚拟对象区域版本信息;
将所述虚拟对象区域版本信息与所述区域的当前区域版本号进行匹配;
如果所述虚拟对象区域版本信息与所述区域的当前区域版本号不同,则将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,所述方法还包括:
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;
将所述区域对应的区域版本号进行迭代后确定为所述区域的当前区域版本号;
更新区域虚拟资源状态信息。
可选地,所述方法还包括:
对所述游戏场景中的所述多个虚拟资源建立虚拟资源状态索引表,所述虚拟资源状态索引表至少包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息;
将所述虚拟资源状态索引表同步至客户端。
可选地,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
可选地,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,包括:
根据所述区域从虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并更新所述区域内的虚拟资源状态信息,生成所述区域对应的区域虚拟资源状态信息。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
图10为本公开实施例的其中一种电子设备的结构示意图。如图10所示,本实施例的电子设备1010包括:存储器1011和处理器1012。其中,存储器1011和处理器1012之间可通过总线连接;
处理器1012;以及
存储器1011,用于存储所述处理器的可执行指令;
其中,所述处理器配置为经由执行所述可执行指令来实现如下步骤:
响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
将所述待拆除虚拟资源的标识发送至服务端;
接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
可选地,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括:
根据所述区域虚拟资源状态信息更新所述区域内的待拆除虚拟资源和所述待拆 除虚拟资源的相邻虚拟资源的状态,并根据更新后的所述区域内的虚拟资源的状态渲染显示所述区域内的虚拟资源。
可选地,所述响应于对所述游戏场景中的所述虚拟资源的拆除事件之前,所述方法还包括:
获取所述虚拟对象在游戏场景中的当前位置,并从本地获取虚拟资源状态索引表;
根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源。
可选地,所述根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源,包括:
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
根据所述虚拟资源状态索引表获取所述区域内的虚拟资源状态信息,
根据所述区域内的虚拟资源状态信息渲染加载所述游戏场景的所述区域内的虚拟资源。
可选地,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括:
根据所述区域虚拟资源状态信息更新本地的所述虚拟资源状态索引表;
根据更新后的所述虚拟资源状态索引表渲染显示所述虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息。
可选地,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
可选地,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息, 所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
在可选的实施方式中,所述电子设备其进一步可以包括一个或多个处理器,以及由存储器所代表的存储器资源,用于存储可由处理组件执行的指令,例如应用程序。存储器中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件被配置为执行指令,以执行上述的信息处理方法。
该电子设备还可以包括:一个电源组件,电源组件被配置成对执行电子设备进行电源管理;一个有线或无线网络接口,被配置成将电子设备连接到网络;以及一个输入输出(I/O)接口。该电子设备可以操作基于存储在存储器的操作系统,例如Android、iOS、Windows,Mac OS X,Unix,Linux,FreeBSD或类似。
图11为本公开实施例的其中一种存储介质的结构示意图。如图11所示,描述了根据本发明的实施方式的程序产品1100,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除之前,所述方法还包括:
检测到所述待拆除虚拟资源满足预设条件。
可选地,所述生成所述区域对应的区域虚拟资源状态信息之前,所述方法还包括:
确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源;
获取所述相邻虚拟资源的邻接关系列表,并将所述待拆除虚拟资源从所述邻接关系列表中删除;
根据所述邻接关系列表判断所述相邻虚拟资源与地面是否相连通,如果所述相邻虚拟资源与地面不能相连通,则将所述相邻虚拟资源从所述游戏场景的所述区域中删除。
可选地,所述游戏场景被划分为多个区域,各个所述区域分别设置有一区域版本号,所述区域版本号用于标识所述区域内的虚拟资源的当前状态信息,所述根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域之后,所述方法还包括:
判断所述虚拟对象是否为首次进入所述区域;
如果是首次进入所述区域,则将所述区域的当前区域版本号保存为虚拟对象区域版本信息,并将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端;
如果不是首次进入所述区域,则获取所述虚拟对象对应的虚拟对象区域版本信息;
将所述虚拟对象区域版本信息与所述区域的当前区域版本号进行匹配;
如果所述虚拟对象区域版本信息与所述区域的当前区域版本号不同,则将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,所述方法还包括:
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;
将所述区域对应的区域版本号进行迭代后确定为所述区域的当前区域版本号;
更新区域虚拟资源状态信息。
可选地,所述方法还包括:
对所述游戏场景中的所述多个虚拟资源建立虚拟资源状态索引表,所述虚拟资源状态索引表至少包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息;
将所述虚拟资源状态索引表同步至客户端。
可选地,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
可选地,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对 应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
可选地,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,包括:
根据所述区域从虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并更新所述区域内的虚拟资源状态信息,生成所述区域对应的区域虚拟资源状态信息。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读存储介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读存储介质中包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、射频等等,或者上述的任意合适的组合。
图12为本公开实施例的其中一种存储介质的结构示意图。如图12所示,描述了根据本发明的实施方式的程序产品1200,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:
响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
将所述待拆除虚拟资源的标识发送至服务端;
接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
可选地,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括:
根据所述区域虚拟资源状态信息更新所述区域内的待拆除虚拟资源和所述待拆除虚拟资源的相邻虚拟资源的状态,并根据更新后的所述区域内的虚拟资源的状态 渲染显示所述区域内的虚拟资源。
可选地,所述响应于对所述游戏场景中的所述虚拟资源的拆除事件之前,所述方法还包括:
获取所述虚拟对象在游戏场景中的当前位置,并从本地获取虚拟资源状态索引表;
根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源。
可选地,所述根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源,包括:
根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
根据所述虚拟资源状态索引表获取所述区域内的虚拟资源状态信息,
根据所述区域内的虚拟资源状态信息渲染加载所述游戏场景的所述区域内的虚拟资源。
可选地,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括:
根据所述区域虚拟资源状态信息更新本地的所述虚拟资源状态索引表;
根据更新后的所述虚拟资源状态索引表渲染显示所述虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息。
可选地,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
可选地,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
可选地,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
通过上述实施方式,根据虚拟对象在游戏场景中的当前位置确定该虚拟对象所处的区域,根据该区域的范围在游戏场景中加载对应的虚拟资源,并且以区域为单位更新游戏场景中虚拟资源的状态,从而有效减少了资源消耗,并可以大大降低数据处理的压力。
计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读存储介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读存储介质中包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、射频等等,或者上述的任意合适的组合。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本发明实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、电子设备、或者网络设备等)执行根据本发明实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (30)

  1. 一种游戏场景中虚拟资源的处理方法,所述方法包括:
    根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
    接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
    将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
    将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
  2. 根据权利要求1所述的方法,在将所述待拆除虚拟资源从所述游戏场景的所述区域中删除之前,所述方法还包括:
    检测到所述待拆除虚拟资源满足预设条件。
  3. 根据权利要求1所述的方法,在所述生成所述区域对应的区域虚拟资源状态信息之前,所述方法还包括:
    确定与所述待拆除虚拟资源具有相邻关系的相邻虚拟资源;
    获取所述相邻虚拟资源的邻接关系列表,并将所述待拆除虚拟资源从所述邻接关系列表中删除;
    根据所述邻接关系列表判断所述相邻虚拟资源与地面是否相连通,如果所述相邻虚拟资源与地面不能相连通,则将所述相邻虚拟资源从所述游戏场景的所述区域中删除。
  4. 根据权利要求1所述的方法,所述游戏场景被划分为多个区域,各个所述区域分别设置有一区域版本号,所述区域版本号用于标识所述区域内的虚拟资源的当前状态信息,所述根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域之后,所述方法还包括:
    判断所述虚拟对象是否为首次进入所述区域;
    如果是首次进入所述区域,则将所述区域的当前区域版本号保存为虚拟对象区域版本信息,并将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客户端;
    如果不是首次进入所述区域,则获取所述虚拟对象对应的虚拟对象区域版本信息;
    将所述虚拟对象区域版本信息与所述区域的当前区域版本号进行匹配;
    如果所述虚拟对象区域版本信息与所述区域的当前区域版本号不同,则将所述区域的当前区域版本号对应的区域虚拟资源状态信息发送至所述虚拟对象对应的客 户端。
  5. 根据权利要求4所述的方法,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,所述方法还包括:
    将所述待拆除虚拟资源从所述游戏场景的所述区域中删除;
    将所述区域对应的区域版本号进行迭代后确定为所述区域的当前区域版本号;
    更新区域虚拟资源状态信息。
  6. 根据权利要求1所述的方法,所述方法还包括:
    根据所述游戏场景中的多个虚拟资源建立虚拟资源状态索引表,所述虚拟资源状态索引表至少包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息;
    将所述虚拟资源状态索引表同步至客户端。
  7. 根据权利要求6所述的方法,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
  8. 根据权利要求6所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
  9. 根据权利要求6所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
  10. 根据权利要求6所述的方法,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
  11. 根据权利要求6所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
  12. 根据权利要求11所述的方法,所述将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息,包括:
    根据所述区域从虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
    将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并更新所述区域内的虚拟资源状态信息,生成所述区域对应的区域虚拟资源状态信息。
  13. 一种游戏场景中虚拟资源的处理方法,所述方法包括:
    响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所 述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
    将所述待拆除虚拟资源的标识发送至服务端;
    接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
    根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
  14. 根据权利要求13所述的方法,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息虚拟资源,所述方法还包括:
    根据所述区域虚拟资源状态信息更新所述区域内的待拆除虚拟资源和所述待拆除虚拟资源的相邻虚拟资源的状态,并根据更新后的所述区域内的虚拟资源的状态渲染显示所述区域内的虚拟资源。
  15. 根据权利要求13所述的方法,所述响应于对所述游戏场景中的所述虚拟资源的拆除事件之前,所述方法还包括:
    获取所述虚拟对象在游戏场景中的当前位置,并从本地获取虚拟资源状态索引表;
    根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源。
  16. 根据权利要求15所述的方法,所述根据所述虚拟对象在游戏场景中的当前位置和所述虚拟资源状态索引表渲染加载所述游戏场景的虚拟资源,包括:
    根据所述虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
    根据所述虚拟资源状态索引表获取所述区域内的虚拟资源状态信息;
    根据所述区域内的虚拟资源状态信息渲染加载所述游戏场景的所述区域内的虚拟资源。
  17. 根据权利要求16所述的方法,所述根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源,所述方法还包括:
    根据所述区域虚拟资源状态信息更新本地的所述虚拟资源状态索引表;
    根据更新后的所述虚拟资源状态索引表渲染显示所述虚拟资源。
  18. 根据权利要求15所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源标识和各个虚拟资源的虚拟资源状态信息。
  19. 根据权利要求18所述的方法,所述游戏场景中包含由至少两个虚拟资源组成的合成模型,所述虚拟资源标识中的高位信息用于标识合成模型,所述标识中的低位信息用于标识组成所述合成模型的虚拟资源。
  20. 根据权利要求15所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源形状信息,所述虚拟资源形状信息为以下其中之一:水平面、垂直面、向上斜面、向下斜面。
  21. 根据权利要求15所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的虚拟资源分类信息,所述虚拟资源分类信息为以下其中之一:已有虚拟资源、新建虚拟资源。
  22. 根据权利要求15所述的方法,所述游戏场景的空间被划分为多个相互拼接的几何体,所述虚拟资源建造于一个所述几何体的表面或所述几何体内截面之上,所述游戏场景中的所述区域由至少一个所述几何体组成,所述虚拟资源状态索引表还包括:各个虚拟资源对应的几何体索引信息,所述几何体索引信息用于标识几何体与所述虚拟资源的映射关系。
  23. 根据权利要求15所述的方法,所述虚拟资源状态索引表还包括:各个虚拟资源对应的区域索引信息,所述区域索引信息用于标识区域与所述虚拟资源的映射关系。
  24. 一种游戏场景中虚拟资源的处理装置,所述装置包括:
    第一确定模块,用于根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域;
    第二确定模块,用于接收待拆除虚拟资源的标识,根据所述待拆除虚拟资源的标识确定所述待拆除虚拟资源;
    第一更新模块,用于将所述待拆除虚拟资源从所述游戏场景的所述区域中删除,并生成所述区域对应的区域虚拟资源状态信息;
    第一发送模块,用于将所述区域虚拟资源状态信息发送至虚拟对象对应的客户端,以使所述客户端根据所述区域虚拟资源状态信息控制所述区域虚拟资源状态信息对应的虚拟资源的渲染显示。
  25. 一种游戏场景中虚拟资源的处理装置,所述装置包括:
    第三确定模块,用于响应于对所述游戏场景中的所述虚拟资源的拆除事件,根据所述拆除事件从所述游戏场景中的多个虚拟资源中确定一虚拟资源为待拆除虚拟资源;
    第二发送模块,用于将所述待拆除虚拟资源的标识发送至服务端;
    第一接收模块,用于接收所述服务端反馈的区域虚拟资源状态信息,所述区域虚拟资源状态信息为服务端根据虚拟对象在游戏场景中的当前位置确定所述虚拟对象所处的区域内的虚拟资源状态信息;
    第二更新模块,用于根据所述区域虚拟资源状态信息更新所述区域内的虚拟资源的状态,并根据更新后的所述虚拟资源的状态渲染显示所述区域虚拟资源状态信息对应的虚拟资源。
  26. 一种游戏系统,所述系统包括:服务端、客户端;其中,
    服务端包括:第一处理器;
    第一存储器,用于存储所述第一处理器的第一可执行指令;
    其中,所述第一处理器配置为经由执行所述第一可执行指令来执行权利要求1-12任一项所述的游戏场景中虚拟资源的处理方法;
    客户端包括:第二处理器;
    第二存储器,用于存储所述第二处理器的第二可执行指令;
    其中,所述第二处理器配置为经由执行所述第二可执行指令来执行权利要求13-23任一项所述的游戏场景中虚拟资源的处理方法。
  27. 一种电子设备,其特征在于,包括:
    处理器;以及
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1-12任一项所述的游戏场景中虚拟资源的处理方法。
  28. 一种电子设备,其特征在于,包括:
    处理器;以及
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求13-23任一项所述的游戏场景中虚拟资源的处理方法。
  29. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-12任一项所述的游戏场景中虚拟资源的处理方法。
  30. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求13-23任一项所述的游戏场景中虚拟资源的处理方法。
PCT/CN2018/122379 2018-01-30 2018-12-20 游戏场景中虚拟资源的处理方法及装置 WO2019148992A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/756,844 US11224814B2 (en) 2018-01-30 2018-12-20 Processing method and apparatus for virtual resource in game scene
JP2020528376A JP7067848B2 (ja) 2018-01-30 2018-12-20 ゲームシーンにおける仮想リソースの処理方法及び装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810092813.6A CN108434739B (zh) 2018-01-30 2018-01-30 游戏场景中虚拟资源的处理方法及装置
CN201810092813.6 2018-01-30

Publications (1)

Publication Number Publication Date
WO2019148992A1 true WO2019148992A1 (zh) 2019-08-08

Family

ID=63191363

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/122379 WO2019148992A1 (zh) 2018-01-30 2018-12-20 游戏场景中虚拟资源的处理方法及装置

Country Status (4)

Country Link
US (1) US11224814B2 (zh)
JP (1) JP7067848B2 (zh)
CN (1) CN108434739B (zh)
WO (1) WO2019148992A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704129A (zh) * 2019-09-30 2020-01-17 北京金山安全软件有限公司 一种资源的实例化方法、装置、电子设备及存储介质
JP7180021B1 (ja) 2022-03-16 2022-11-29 カバー株式会社 プログラム、仮想空間提供方法、及び仮想空間提供システム

Families Citing this family (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69722781T2 (de) * 1996-12-27 2004-04-29 Dai Nippon Printing Co., Ltd. Verfahren und vorrichtung zum übertragen auf gewölbte flächen
CN108434739B (zh) 2018-01-30 2019-03-19 网易(杭州)网络有限公司 游戏场景中虚拟资源的处理方法及装置
CN109395391A (zh) * 2018-09-07 2019-03-01 北京龙拳风暴科技有限公司 一种游戏信息的自动更新方法及装置
CN109364480A (zh) * 2018-10-26 2019-02-22 杭州电魂网络科技股份有限公司 一种信息同步方法和装置
CN109542573B (zh) * 2018-11-28 2021-12-07 北京龙创悦动网络科技有限公司 一种场景显示方法和装置
CN109876438B (zh) * 2019-02-20 2021-06-18 腾讯科技(深圳)有限公司 用户界面显示方法、装置、设备及存储介质
CN109918463A (zh) * 2019-02-22 2019-06-21 广州多益网络股份有限公司 地图数据处理方法、装置、设备及存储介质
CN110075520B (zh) * 2019-04-24 2020-05-01 苏州亿歌网络科技有限公司 在游戏地图中快捷搜索资源的方法、系统及装置
CN110478898B (zh) * 2019-08-12 2024-03-15 网易(杭州)网络有限公司 游戏中虚拟场景的配置方法及装置、存储介质及电子设备
CN110478901B (zh) * 2019-08-19 2023-09-22 Oppo广东移动通信有限公司 基于增强现实设备的交互方法及系统
CN110639201A (zh) * 2019-09-08 2020-01-03 北京智明星通科技股份有限公司 一种手机游戏的多媒体资源获取方法、装置和移动终端
CN110772790B (zh) * 2019-10-23 2023-02-10 福建天晴在线互动科技有限公司 一种游戏地图刷怪区域重置的方法及其系统
CN110935170B (zh) * 2019-10-29 2023-09-15 广州西山居网络科技有限公司 一种游戏美术资源分布查阅方法及系统
CN110874812B (zh) * 2019-11-15 2024-06-04 网易(杭州)网络有限公司 游戏中的场景图像绘制方法、装置及电子终端
CN111558221B (zh) * 2020-05-13 2021-03-16 腾讯科技(上海)有限公司 虚拟场景的显示方法和装置、存储介质及电子设备
CN111524231B (zh) * 2020-05-20 2024-01-26 网易(杭州)网络有限公司 一种虚拟地形的处理方法及装置、电子设备、存储介质
CN112206529B (zh) * 2020-10-19 2023-01-24 珠海金山数字网络科技有限公司 数据处理方法及装置
CN112328292B (zh) * 2020-10-21 2021-10-15 腾讯科技(深圳)有限公司 虚拟资源的处理方法、装置、存储介质及电子设备
CN112256128A (zh) * 2020-10-22 2021-01-22 武汉科领软件科技有限公司 一种互动效果开发平台
CN112843717B (zh) * 2021-03-12 2024-02-13 网易(杭州)网络有限公司 一种资源分配方法、装置、存储介质及计算机设备
KR102428928B1 (ko) * 2021-03-26 2022-08-04 주식회사 컴투스 게임 엔진을 위한 리소스 관리 방법 및 시스템
CN113398580B (zh) * 2021-06-30 2024-01-09 上海完美时空软件有限公司 游戏场景的生成方法及装置、存储介质、电子装置
CN113398595B (zh) * 2021-06-30 2023-10-13 上海完美时空软件有限公司 场景资源的更新方法及装置、存储介质、电子装置
CN113457125B (zh) * 2021-07-02 2024-02-23 珠海金山数字网络科技有限公司 游戏场景管理方法及系统、计算设备、计算机可读存储介质
CN113599812B (zh) * 2021-08-12 2023-10-20 上海米哈游璃月科技有限公司 一种动画角色显示方法、装置、设备和介质
CN113599813B (zh) * 2021-08-12 2023-10-20 上海米哈游璃月科技有限公司 一种动画角色显示方法、装置、设备和介质
CN113599811B (zh) * 2021-08-12 2023-10-20 上海米哈游璃月科技有限公司 一种动画角色显示方法、装置、设备和介质
CN113599814B (zh) * 2021-08-12 2023-10-24 上海米哈游璃月科技有限公司 一种动画角色显示方法、装置、设备和介质
AU2021240218A1 (en) * 2021-09-14 2023-03-30 Sensetime International Pte. Ltd. Configuration updating method and apparatus, device and storage medium
WO2023041967A1 (en) * 2021-09-14 2023-03-23 Sensetime International Pte. Ltd. Configuration updating method and apparatus, device and storage medium
CN113797546B (zh) * 2021-09-18 2024-02-23 珠海金山数字网络科技有限公司 资源处理方法、装置、计算设备及计算机可读存储介质
CN114494667B (zh) * 2022-02-21 2022-11-04 北京华建云鼎科技股份公司 一种用于添加碰撞盒的数据处理系统和方法
CN116650943A (zh) * 2023-06-08 2023-08-29 广州三七极梦网络技术有限公司 一种游戏资源处理方法、装置、设备及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710585A (zh) * 2004-06-18 2005-12-21 华为技术有限公司 游戏虚拟物品数据处理方法及游戏平台系统和游戏系统
US20090287707A1 (en) * 2008-05-15 2009-11-19 International Business Machines Corporation Method to Manage Inventory Using Degree of Separation Metrics
CN106445588A (zh) * 2016-09-08 2017-02-22 腾讯科技(深圳)有限公司 属性信息的更新方法及装置
CN108434739A (zh) * 2018-01-30 2018-08-24 网易(杭州)网络有限公司 游戏场景中虚拟资源的处理方法及装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020196250A1 (en) * 2001-06-20 2002-12-26 Gateway, Inc. Parts assembly for virtual representation and content creation
KR100452089B1 (ko) 2004-06-23 2004-10-13 엔에이치엔(주) 게임 화면을 갱신하기 위한 오브젝트를 로딩하는 이미지리소스 로딩 시스템 및 이미지 리소스 로딩 방법
US7843471B2 (en) * 2006-03-09 2010-11-30 International Business Machines Corporation Persistent authenticating mechanism to map real world object presence into virtual world object awareness
US8214750B2 (en) * 2007-10-31 2012-07-03 International Business Machines Corporation Collapsing areas of a region in a virtual universe to conserve computing resources
JP5677050B2 (ja) 2010-11-26 2015-02-25 株式会社カプコン ゲームプログラム及びゲーム装置
US10315119B2 (en) * 2011-05-17 2019-06-11 Activision Publishing, Inc. Video game with concurrent processing of game-related physical objects
US9757649B2 (en) * 2011-12-20 2017-09-12 Wikipad, Inc. Game controller with flexible bridge supporting touch screen
CN103593546B (zh) 2012-08-17 2015-03-18 腾讯科技(深圳)有限公司 一种无动态阻挡网络游戏系统及其处理方法
CN103854191A (zh) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 线上应用虚拟资源自动交易方法及装置
CN103854218A (zh) * 2012-12-06 2014-06-11 腾讯科技(深圳)有限公司 线上应用虚拟资源移转方法、装置及系统
JP6099727B1 (ja) 2015-11-27 2017-03-22 株式会社コーエーテクモゲームス ゲームプログラム及び記録媒体
JP6329994B2 (ja) 2016-06-17 2018-05-23 株式会社カプコン ゲームプログラムおよびゲームシステム
JP7145221B2 (ja) * 2017-12-22 2022-09-30 マジック リープ, インコーポレイテッド 稠密3d再構成データのキャッシュおよび更新
US10902684B2 (en) * 2018-05-18 2021-01-26 Microsoft Technology Licensing, Llc Multiple users dynamically editing a scene in a three-dimensional immersive environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710585A (zh) * 2004-06-18 2005-12-21 华为技术有限公司 游戏虚拟物品数据处理方法及游戏平台系统和游戏系统
US20090287707A1 (en) * 2008-05-15 2009-11-19 International Business Machines Corporation Method to Manage Inventory Using Degree of Separation Metrics
CN106445588A (zh) * 2016-09-08 2017-02-22 腾讯科技(深圳)有限公司 属性信息的更新方法及装置
CN108434739A (zh) * 2018-01-30 2018-08-24 网易(杭州)网络有限公司 游戏场景中虚拟资源的处理方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704129A (zh) * 2019-09-30 2020-01-17 北京金山安全软件有限公司 一种资源的实例化方法、装置、电子设备及存储介质
JP7180021B1 (ja) 2022-03-16 2022-11-29 カバー株式会社 プログラム、仮想空間提供方法、及び仮想空間提供システム
WO2023176008A1 (ja) * 2022-03-16 2023-09-21 カバー株式会社 プログラム、仮想空間提供方法、及び仮想空間提供システム
JP2023136017A (ja) * 2022-03-16 2023-09-29 カバー株式会社 プログラム、仮想空間提供方法、及び仮想空間提供システム

Also Published As

Publication number Publication date
US20200368623A1 (en) 2020-11-26
JP7067848B2 (ja) 2022-05-16
CN108434739A (zh) 2018-08-24
CN108434739B (zh) 2019-03-19
US11224814B2 (en) 2022-01-18
JP2021504017A (ja) 2021-02-15

Similar Documents

Publication Publication Date Title
WO2019148992A1 (zh) 游戏场景中虚拟资源的处理方法及装置
WO2019148941A1 (zh) 游戏场景中虚拟资源处理方法、装置、终端和存储介质
US11450061B2 (en) Processing method and apparatus for virtual resource in game scene
US20210106913A1 (en) Processing Method, Rendering Method and Device for Static Component in Game Scene
WO2019149092A1 (zh) 信息处理方法及装置、存储介质、电子设备
US20190275429A1 (en) Information processing method and apparatus and server
WO2019091463A1 (zh) 虚拟环境画面的显示方法和装置
US20230055516A1 (en) Collision data processing method and apparatus, computer device, and storage medium
WO2021227864A1 (zh) 虚拟场景的显示方法和装置、存储介质及电子设备
CN112386911A (zh) 导航网格生成方法、装置、非易失性存储介质及电子装置
KR20080018404A (ko) 게임 제작을 위한 배경 제작 프로그램을 저장한 컴퓨터에서읽을 수 있는 기록매체
CN104922906A (zh) 动作执行方法和装置
KR20190121388A (ko) 객체 이동 방법 및 장치, 저장 매체 및 전자 장치
WO2022257692A1 (zh) 虚拟场景变换方法、装置、设备、存储介质及程序产品
CN108144301B (zh) 虚拟对象信息的显示方法和装置、存储介质、电子装置
CN111617473A (zh) 虚拟攻击道具的显示方法和装置、存储介质和电子设备
CN111097170B (zh) 吸附框的调整方法和装置、存储介质及电子装置
CN114602166A (zh) 一种游戏数据处理方法、装置、计算机设备及存储介质
CN111467808B (zh) 一种游戏实体更新的方法和装置
CN110681151A (zh) 一种用户界面中元素交互的方法以及相关装置
WO2023155513A1 (zh) 虚拟场景的数据处理方法、装置、电子设备、计算机可读存储介质及计算机程序产品
US11909601B1 (en) Implementing a scalable 3D simulation using a distributed 3D keyspace
WO2024131205A1 (zh) 预计算单元格显示方法、预计算单元格生成方法及装置
Li et al. Research on a coal mine virtual system using Unreal Engine
KR20180038840A (ko) 단일 소스 기반의 멀티 디바이스 지원을 위한 소프트웨어 제작 도구의 확장 엔진 제공 방법 및 그 시스템

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18903300

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020528376

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18903300

Country of ref document: EP

Kind code of ref document: A1