CN102214263B - Game scene management method - Google Patents

Game scene management method Download PDF

Info

Publication number
CN102214263B
CN102214263B CN201010143735.1A CN201010143735A CN102214263B CN 102214263 B CN102214263 B CN 102214263B CN 201010143735 A CN201010143735 A CN 201010143735A CN 102214263 B CN102214263 B CN 102214263B
Authority
CN
China
Prior art keywords
leaf node
reference count
game
node
game engine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201010143735.1A
Other languages
Chinese (zh)
Other versions
CN102214263A (en
Inventor
梁久祯
许多
袁旭东
朱波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WUXI KELIDESI TECHNOLOGY CO.,LTD.
Original Assignee
WUXI KELIDESI TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WUXI KELIDESI TECHNOLOGY CO LTD filed Critical WUXI KELIDESI TECHNOLOGY CO LTD
Priority to CN201010143735.1A priority Critical patent/CN102214263B/en
Publication of CN102214263A publication Critical patent/CN102214263A/en
Application granted granted Critical
Publication of CN102214263B publication Critical patent/CN102214263B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a game scene management method for managing a scene graph in a game engine. The scene graph comprises a plurality of group nodes and leaf nodes which have parent-child relations, wherein parts of leaf nodes comprise reference counts. The method comprises the following steps that: when the game engine traverses the scene graph to reference one of the leaf nodes which comprise the reference counts for the first time, the game engine loads the leaf node to a memory space, obtains an address pointer and initializes the reference count of the leaf node; when the game engine references the leaf node once again, the game engine references the leaf node by the address pointer and increases the reference count of the leaf node; when the game engine finishes one-time reference of the leaf node and reduces the reference count of the leaf node; and when the reference count of the leaf node is smaller than an initial value of the reference count, the game engine releases the memory space occupied by the leaf node.

Description

Game scene management method
[technical field]
The present invention relates to game engine field, particularly about game scene management method.
[background technology]
Game is requisite entertainment selection in people's daily life, the almost behind of every a game now, there is a game engine matching, game engine is being controlled various resources in game, and modern game engine comprises substantially: image engine, sound engine, physical engine, control engine, artificial intelligence or game logic etc.
Described image engine is used for drawing concrete scene of game, and wherein scene of game refers to the game picture that display shows.Fig. 1 shows an easy game scene 100 of the prior art.Please refer to shown in Fig. 1, described scene of game 100 comprises LCD TV 102, TV box 104, cabinet for TV 106, desk 108, book 110, the first cup 112, the second cup 114 and room 116.Described image engine, in the time drawing scene of game, adopts scene graph to carry out the contextual data that organization and administration are relevant conventionally.Described scene graph adopts a kind of tree data structure top-down, layering to carry out organizing scenario data.The top of scene graph tree structure is a root node, extend to group node or leaf node downwards from root node, from group node extend to downwards leaf node or the group node of one deck, the group node of every layer can extend the group node of leaf node or lower one deck downwards, and described leaf node is positioned at the bottommost of scene graph tree structure, the pass of each node other nodes extended with it is set membership, each node stores contextual data, such as geometric model, rendering state, dimensional orientation etc., wherein the data message in father node can have influence on its child node.
While drawing described scene of game 100 specific to image engine, its scene graph that can adopt please refer to the scene Figure 200 shown in Fig. 2.Described scene Figure 200 comprises root node 202, home theater node 204, LCD TV node 206, cabinet for TV node 208, TV box node 210, desk node 212, this child node 214, the first cup node 216, the second cup node 218 and room node 220.Wherein home theater node 204 is group nodes, LCD TV node 206, cabinet for TV node 208 are child nodes of home theater node 204, wherein LCD TV node 206 is leaf node, cabinet for TV node 208 is group node, TV box 210 is child nodes of cabinet for TV node 208, and TV and 210 is also leaf node; Desk node 212 is group nodes, and this child node 214, the first cup node 216 and the second cup node 218 are that desk node 212 is leaf node the child node as desk node 212.A group node can have one or more leaf nodes, and leaf node is positioned at the bottommost of scene graph.The information such as the logical relation of the group node in scene graph, dimensional orientation, rendering state can affect its child node, such as desk node 212 is moved, the child node (such as this child node 214, the first cup node 216 and the second cup node 218) that it also can affect it is moved.Room node 220 in described scene Figure 200 may be also group node in practice, also has other leaf nodes such as wall.In actual scene graph, scene graph has comprised that polytype node, to carry out various user functions, forms colourful game.For example, start node can arrange its child node can with or unavailable; Level of detail node according to the observation person's distance calls different child nodes; Transform node can change the coordinate transform state of child node solid.OO scene graph provides this species diversity by the mechanism of inheriting, and all node classes have a total base class, derives separately the method that realizes specific function simultaneously.
In the time that game need to be drawn scene, adopt certain traversal mode (such as upgrading traversal, selection traversal and the traversal etc. of drawing) traversal scene graph just can draw out the scene needing.But in concrete scene, may encounter identical or similar scenario objects needs to build, and this same or similar scenario objects can be any node, and we are taking the geological information of same or similar object as example.For instance, the first cup 112 shown in Fig. 1 and the second cup 114, suppose that the first cup 112 is the same with the geological information of the second cup 114, only have dimensional orientation different with rendering state, for example in game, the first cup 112 is that a tank cola, the second cup 114 are tank Sprites, only need on identical cup solid, stick different pictures and just can realize.
Fig. 3 shows the management method that realizes identical or similar scenario objects in prior art.Please refer to Fig. 3, adopt a leaf node 302 to store the geological information of cup in scene graph, group node 304 and 306 is stored respectively dimensional orientation and the rendering state of the first cup 112 and the second cup 114, and such benefit is to have realized sharing of data.Actual while playing up scene after game running, game engine need to travel through scene graph, and the data of the each node traversing are loaded in internal memory, the geological information that comprises a cup in the data about the first cup 112 that produce in internal memory, in internal memory, produce about the geological information that also comprises a cup in the data of the second cup 114, just need to distribute more internal memory for this game so obviously.In the time that in game, identical and similar scenario objects is more, such as some big games may exist tens of even hundreds of wild strange or similar trees of the same type etc. in a scene, it is more serious that above-mentioned implementation has just greatly increased complexity and the internal memory waste of scene of game figure.In addition,, in memory management, complicated adduction relationship will cause internal memory to discharge the problems such as wrong and pointer mistake.
Therefore, be necessary to propose a kind of scheme more preferably and solve the problems referred to above.
[summary of the invention]
The object of this part is to summarize some aspects of embodiments of the invention and briefly introduces some preferred embodiments.In this part and the application's specification digest and denomination of invention, may do a little simplification or omit to avoid the making object of this part, specification digest and denomination of invention fuzzy, and this simplification or omit and can not be used for limiting the scope of the invention.
One object of the present invention is to provide a kind of game scene management method, realizes the management of identical or similar scenario objects by adding reference count mechanism.
In order to reach object of the present invention, the invention provides a kind of game scene management method, manage for the scene graph to game engine, described scene graph comprises some group node and leaf nodes with set membership, part leaf node includes reference count, and described method comprises:
In the time that described game engine travels through described scene graph and quotes for the first time a leaf node that comprises reference count, game engine is loaded into memory headroom by described leaf node and obtains an address pointer, the reference count of leaf node described in initialization; In the time that described game engine is quoted described leaf node again, described game engine is quoted described leaf node by described address pointer, and increases the reference count of described leaf node; When described game engine is complete to once quoting of described leaf node, and reduce the reference count of described leaf node; With in the time that the reference count of described leaf node is less than its initialization value, described game engine discharges the memory headroom that described leaf node occupies.
Further, described leaf node is used for storing the data that can supply multiplexing game object.
Further, the three-dimensional model that the data of described game object are object.
Further, described leaf node can be realized by vertexbuffer class.
Further, there is the group node of set membership to be used for storage space orientation and rendering state with described leaf node.
Further, described in described initialization, the reference count of leaf node refers to that the reference count of leaf node is 1 described in initialization.
Further, the reference count of the described leaf node of described increase refers to the reference count of described leaf node is added to 1.
Further, the reference count of the described leaf node of described minimizing refers to the reference count of described leaf node is subtracted to 1.
Further, when the described reference count when described leaf node is less than its initialization value, refer in the time that the reference count of described leaf node equals 0.
Compared with prior art, the game scene management method in the present invention, by for leaf node adds reference count, is realized the management of identical or similar scenario objects with this, thereby can be improved memory usage.The similar object comprising in scene of game is more, and effect of the present invention is more obvious.
[brief description of the drawings]
In conjunction with reference to accompanying drawing and ensuing detailed description, the present invention will be easier to understand, wherein structure member corresponding to same Reference numeral, wherein:
Fig. 1 shows a scene of game of the prior art;
Fig. 2 shows Fig. 1 of the prior art and illustrates the scene graph of scene of game;
Fig. 3 shows the management method that realizes identical or similar scenario objects in prior art;
Fig. 4 shows game scene management method in the present invention method flow diagram in one embodiment;
Fig. 5 shows game scene management method in the present invention application schematic diagram in one embodiment; With
Fig. 6 shows the scene of game that comprises similar scenario objects that utilizes the present invention to realize.
[embodiment]
Detailed description of the present invention is mainly carried out the running of direct or indirect simulation technical solution of the present invention by program, step, logical block, process or other symbolistic descriptions.For the thorough the present invention that understands, a lot of specific detail in ensuing description, are stated.And in the time there is no these specific detail, the present invention may still can realize.Under those of skill in the art uses these descriptions herein and states the work essence of effectively introducing them to the others skilled in the art in affiliated field.In other words, be the object of the present invention of avoiding confusion, because the method for knowing, program, composition and circuit are readily appreciated that, therefore they are not described in detail.
Alleged " embodiment " or " embodiment " refers to special characteristic, structure or the characteristic that can be contained at least one implementation of the present invention herein.Different local in this manual " in one embodiment " that occur not all refer to same embodiment, neither be independent or the embodiment mutually exclusive with other embodiment optionally.In addition, represent sequence of modules in method, process flow diagram or the functional block diagram of one or more embodiment and revocablely refer to any particular order, not also being construed as limiting the invention.
Game scene management method of the present invention can utilize computing machine to realize and become a scene graph system in conjunction with relative program, be positioned at the scene management position of whole game engine, by identical or similar scenario objects needs or other reasons causes reusable leaf node to add reference count mechanism to realizing in scene graph.Realize in data sharing, reduced the object of scene of game figure complexity, raising memory management efficiency.
In the specific implementation, in scene graph, first the relevant data of identical or similar scenario objects is designed to the leaf node with reference count.In one embodiment, described leaf node can be realized by vertexbuffer class.Fig. 4 shows a kind of game scene management method 400 of the present invention method flow diagram in one embodiment.Please refer to Fig. 4, described method 400 comprises the steps.
Step 402, in the time that described game engine travels through described scene graph and quotes for the first time a leaf node that comprises reference count, game engine is loaded into memory headroom by described leaf node and obtains an address pointer, and the reference count of leaf node is 1 described in initialization;
Step 404, in the time that described game engine is quoted described leaf node again, described game engine is quoted described leaf node by described address pointer, and the reference count of described leaf node is added to 1;
Step 406, when described game engine is complete to once quoting of described leaf node, and subtracts 1 by the reference count of described leaf node;
Step 408, in the time that the reference count of described leaf node equals 0, described game engine discharges the memory headroom that described leaf node occupies.
Fig. 5 shows the application schematic diagram in the embodiment of scene management method of a kind of game engine of the present invention.Please refer to Fig. 5, adopt implementation of the present invention to be at the first cup 112 shown in Fig. 1 and the second cup 114: scene graph adopts a leaf node 502 to store the geological information of cup, group node 504 and 506 is stored respectively dimensional orientation and the rendering state of the first cup 112 and the second cup 114, in the time building leaf node 502, just add reference count simultaneously, in the time that game engine need to show described scene 100, while traversing first cup 112 this paths, will in internal memory, create the storage space of leaf node 502, and reference count is initialized as to 1; When traversing second cup 506 this paths, will quote the leaf node 502 in internal memory by pointer, and reference count is made as to 2; When scene of game switches or when relevant cup Event triggered (such as cup is crushed etc.), the first cup 112 or the second cup 114 need to not occur in scene of game, game engine just reduces the reference count of respective numbers, in the time that reference count is 0, game engine will discharge the memory headroom of described leaf node.
Fig. 6 shows the scene of game that comprises similar scenario objects that utilizes the present invention to realize, and wherein said scene 600 comprises first cutter 622 and the second cutter 624 in the first personage 620 and first personage's 620 hands; In the second personage 640 and second personage's 640 hands the 3rd cutter 642 and the 4th cutter 644.Wherein first cutter 622 and second cutter 624 are black; The 3rd is that black and white is alternate cutter 642 and the 4th cutter 644.Due to first cutter 622, second cutter 624, the 3rd cutter 642 is all the same the geological information of cutter 644 with the 4th, so we can store the geological information of described cutter and add reference count with a leaf node, first cutter 622, second cutter 624, the 3rd are all stored respectively relevant locus and rendering state as group node cutter 642 and the 4th using cutter 644, then quote the geological information of the cutter of described leaf node storage and just can realize the shared data of the shared internal memory of four cuttves, greatly reduced internal memory occupation rate.In the time that the similar scenario objects in a game is more, make effect in this way more obvious.
Above-mentioned explanation has fully disclosed the specific embodiment of the present invention.It is pointed out that and be familiar with the scope that any change that person skilled in art does the specific embodiment of the present invention does not all depart from claims of the present invention.Correspondingly, the scope of claim of the present invention is also not limited only to described embodiment.

Claims (6)

1. a game scene management method, manages for the scene graph to game engine, and described scene graph comprises some group node and leaf nodes with set membership, and part leaf node includes reference count, it is characterized in that, it comprises:
In the time that described game engine travels through described scene graph and quotes for the first time a leaf node that comprises reference count, game engine is loaded into memory headroom by described leaf node and obtains an address pointer, the reference count of leaf node described in initialization;
In the time that described game engine is quoted described leaf node again, described game engine is quoted described leaf node by described address pointer, and increases the reference count of described leaf node;
When described game engine is complete to once quoting of described leaf node, reduce the reference count of described leaf node; With
In the time that the reference count of described leaf node is less than its initialization value, described game engine discharges the memory headroom that described leaf node occupies,
Described leaf node is used for storage can be for the data of multiplexing game object, and the three-dimensional model that the data of described game object are object has the group node of set membership to be used for storage space orientation and rendering state with described leaf node.
2. game scene management method according to claim 1, is characterized in that: described leaf node vertexbuffer class realizes.
3. game scene management method according to claim 1, is characterized in that: described in described initialization, the reference count of leaf node refers to that the reference count of leaf node is 1 described in initialization.
4. game scene management method according to claim 1, is characterized in that: the reference count of the described leaf node of described increase refers to the reference count of described leaf node is added to 1.
5. game scene management method according to claim 1, is characterized in that: the reference count of the described leaf node of described minimizing refers to the reference count of described leaf node is subtracted to 1.
6. game scene management method according to claim 1, is characterized in that: the described reference count when described leaf node refers in the time that the reference count of described leaf node equals 0 while being less than its initialization value.
CN201010143735.1A 2010-04-12 2010-04-12 Game scene management method Expired - Fee Related CN102214263B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010143735.1A CN102214263B (en) 2010-04-12 2010-04-12 Game scene management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010143735.1A CN102214263B (en) 2010-04-12 2010-04-12 Game scene management method

Publications (2)

Publication Number Publication Date
CN102214263A CN102214263A (en) 2011-10-12
CN102214263B true CN102214263B (en) 2014-12-10

Family

ID=44745569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010143735.1A Expired - Fee Related CN102214263B (en) 2010-04-12 2010-04-12 Game scene management method

Country Status (1)

Country Link
CN (1) CN102214263B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104991775B (en) * 2015-07-03 2019-02-12 北京奇虎科技有限公司 A kind of game acceleration method and device
CN105184847B (en) * 2015-10-16 2017-12-12 上海恺英网络科技有限公司 The rendering intent of 3D game rendering engines
CN106708623B (en) * 2016-11-23 2021-04-27 腾讯科技(深圳)有限公司 Object resource processing method, device and system
FR3065098A1 (en) 2017-04-05 2018-10-12 Stmicroelectronics (Rousset) Sas METHOD FOR REAL TIME DETECTION OF A SCENE BY AN APPARATUS, FOR EXAMPLE A WIRELESS COMMUNICATION APPARATUS, AND CORRESPONDING APPARATUS
CN107115673B (en) * 2017-04-27 2018-07-06 腾讯科技(深圳)有限公司 A kind of behavior of Behavior-based control tree performs method and apparatus
CN109901908A (en) * 2017-12-11 2019-06-18 中国移动通信集团山西有限公司 Destroy method, apparatus, equipment and the medium of docker container
CN113391865B (en) * 2021-06-10 2024-03-05 广州繁星互娱信息科技有限公司 Scenario chatting method, scenario chatting device, terminal, server and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710607A (en) * 2005-07-08 2005-12-21 北京航空航天大学 3-D scene organization method facing to virtual reality 3-D picture engine
CN101046755A (en) * 2006-03-28 2007-10-03 郭明南 System and method of computer automatic memory management
CN101226470A (en) * 2007-01-18 2008-07-23 环达电脑(上海)有限公司 Picture resource management method for embedded system interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710607A (en) * 2005-07-08 2005-12-21 北京航空航天大学 3-D scene organization method facing to virtual reality 3-D picture engine
CN101046755A (en) * 2006-03-28 2007-10-03 郭明南 System and method of computer automatic memory management
CN101226470A (en) * 2007-01-18 2008-07-23 环达电脑(上海)有限公司 Picture resource management method for embedded system interface

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
程菊明等.虚拟场景的管理及其在OSG中的应用.《微计算机信息》.2008,第24卷(第2-3期),第280-281,294页. *
虚拟场景的管理及其在OSG中的应用;程菊明等;《微计算机信息》;20080229;第24卷(第2-3期);第280-281,294页 *

Also Published As

Publication number Publication date
CN102214263A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
CN102214263B (en) Game scene management method
CN103093499B (en) A kind of city three-dimensional model data method for organizing being applicable to Internet Transmission
CN102921171B (en) Intelligence MID, TV, game server, multi-screen games system and method
CN104063240B (en) A kind of map-indication method and device
CN106973309A (en) A kind of barrage generation method and device
WO2012161102A1 (en) Rendering control apparatus, control method thereof, recording medium, rendering server, and rendering system
CN103197979B (en) Method and device for realizing data interaction access among processes
CN106796514A (en) For the system and method for fully configurable real-time processing
Peres et al. The media effect in Axelrod's model explained
US20220274021A1 (en) Display method and apparatus for virtual scene, storage medium, and electronic device
CN110935169B (en) Control method of virtual object, information display method, device, equipment and medium
CN102254098A (en) Distributed system and method for developing, deploying and operating games
CN105631923A (en) Rendering method and device
US10719985B2 (en) Model object building method, server, and system
CN111135579A (en) Game software interaction method and device, terminal equipment and storage medium
CN103019725A (en) Interface logic control method based on 3D (three-dimensional) model
CN111228813A (en) Virtual object control method, device, equipment and storage medium
CN102193806A (en) Method and device for updating animation
CN113617033B (en) Virtual character selection method, device, terminal and storage medium
CN103294826B (en) The display packing of a kind of virtual three-dimensional scene and system
CN114307150B (en) Method, device, equipment, medium and program product for interaction between virtual objects
CN113082705B (en) Game scene switching method, game scene switching device, computer equipment and storage medium
CN113713381B (en) Object management method, device, equipment, storage medium and system
CN114130022A (en) Method, apparatus, device, medium, and program product for displaying screen of virtual scene
KR101500873B1 (en) Apparatus and method for crossbreeding character in game

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: WUXI GUANGXIN CARTOON MOVIE TECHNOLOGY SERVICE COM

Free format text: FORMER OWNER: WUXI KELI DESI TECHNOLOGY CO., LTD.

Effective date: 20120216

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 214125 WUXI, JIANGSU PROVINCE TO: 214101 WUXI, JIANGSU PROVINCE

TA01 Transfer of patent application right

Effective date of registration: 20120216

Address after: 214101, No. 69 middle Ting Road, Ting Ting Street, Xishan District, Jiangsu, Wuxi

Applicant after: WUXI KELIDESI TECHNOLOGY CO.,LTD.

Address before: Jinxi road Binhu District 214125 Jiangsu city of Wuxi province No. 100

Applicant before: Wuxi Kelidesi Technology Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141210

Termination date: 20170412