WO2018157375A1 - 游戏地图的物体绘制方法及装置 - Google Patents

游戏地图的物体绘制方法及装置 Download PDF

Info

Publication number
WO2018157375A1
WO2018157375A1 PCT/CN2017/075556 CN2017075556W WO2018157375A1 WO 2018157375 A1 WO2018157375 A1 WO 2018157375A1 CN 2017075556 W CN2017075556 W CN 2017075556W WO 2018157375 A1 WO2018157375 A1 WO 2018157375A1
Authority
WO
WIPO (PCT)
Prior art keywords
size
basic information
screen
user
viewport
Prior art date
Application number
PCT/CN2017/075556
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 PCT/CN2017/075556 priority Critical patent/WO2018157375A1/zh
Publication of WO2018157375A1 publication Critical patent/WO2018157375A1/zh

Links

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/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/5378Controlling 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 displaying an additional top view, e.g. radar screens or maps
    • 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

Definitions

  • the embodiment of the invention belongs to the field of screen display, and in particular relates to an object drawing method and device for a game map.
  • the existing game map drawing method it is common to draw the objects on the map once, and then display the drawn objects according to the objects that the viewport (which can be understood as a lens) can present. Since the existing method has drawn all the objects before displaying the object, it takes too much time to draw all the objects, so the time for displaying the objects is too slow, the jamming phenomenon is serious, and the user experience is low.
  • the embodiment of the invention provides an object drawing method and device for a game map, which aims to solve the problem that the number of objects drawn by the existing method is too large, and the display object is too slow.
  • the embodiment of the present invention is implemented by the method for drawing an object of a game map, and the method includes:
  • the object is not drawn when the object is outside the viewport.
  • Another object of the present invention is to provide an object drawing device for a game map, the device comprising:
  • a basic information acquiring unit of the object configured to acquire a size of the screen and basic information of the object of the game map, where the basic information of the object includes position information of the object and a size of the object;
  • the out-of-port object determining unit is configured to determine, according to the size of the screen and the basic information of the object of the game map, whether the object is outside the viewport;
  • the object does not draw a unit for rendering the object when the object is outside the viewport.
  • the number of objects to be drawn is reduced, thereby speeding up the display speed of the object and improving the user's good experience.
  • FIG. 1 is a flowchart of a method for drawing an object of a game map according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of another method for drawing an object of a game map according to a second embodiment of the present invention
  • FIG. 3 is a schematic diagram showing the result of drawing a map by using the existing method according to the second embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing the result of drawing the same object as the drawing of FIG. 3 by using the object drawing method of the game map according to the embodiment of the present invention
  • FIG. 5 is a structural diagram of an object drawing apparatus for a game map according to a third embodiment of the present invention.
  • the size of the screen and the basic information of the object of the game map are acquired, and the basic information of the object includes the position information of the object and the size of the object, and is determined according to the size of the screen and the basic information of the object of the game map. Whether the object is outside the viewport, and the object is not drawn when the object is outside the viewport.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 1 is a flowchart of a method for drawing an object of a game map according to a first embodiment of the present invention, which is described in detail as follows:
  • Step S11 acquiring the size of the screen and the basic information of the object of the game map, the basic information of the object including the position information of the object and the size of the object.
  • the position information of the object is the coordinate position information of the object on the game map.
  • Step S12 determining whether the object is outside the viewport according to the size of the screen and the basic information of the object of the game map.
  • the viewport in this step can be understood as a lens, and objects in the viewport can be seen by the user.
  • the scene of the game is a street. There are bustling pedestrians on the street.
  • the viewport of the game cannot display the entire street at one time. You need to switch the viewport or move the viewport to display other parts. Some pedestrians are in the viewport, and some pedestrians are outside the viewport. The user can see the pedestrians in the game viewport.
  • the determining, according to the size of the screen and the basic information of the object of the game map, whether the object is outside the viewport specifically includes:
  • step S13 the object is not drawn when the object is outside the viewport.
  • the engine does not draw an object outside the viewport, since there is no need to draw an object outside the viewport, thereby reducing the number of objects to be drawn, thereby speeding up the display speed of the object and improving the user. Good experience.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 2 is a flowchart of another method for drawing an object of a game map according to a second embodiment of the present invention.
  • step S21 is added to the first embodiment, which is described in detail as follows:
  • step S21 the forward direction of the user is obtained.
  • the user's heading direction can be determined by determining the heading direction of the cursor.
  • the user's heading direction is determined according to the heading direction of the hidden cursor.
  • Step S22 Acquire basic information of the size of the screen and the object of the game map within the preset range of the center point of the user's forward direction.
  • the center point of the user's forward direction may be set as the center point of the current picture obtained after the forward motion has been performed.
  • the preset range may be set to include a range of objects outside the screen, that is, the object of the game map within the preset range of the center point of the user's heading direction includes the object displayed on the screen, and includes Some objects that are not displayed outside the screen, so that when the user advances to the current screen, since the basic information of the object of the current picture has been acquired in advance, it is determined in advance whether the object of the current picture is outside the viewport, thereby further speeding up the drawing of the object. speed.
  • the basic information about the size of the screen and the object of the game map within the preset range of the user's forward direction includes:
  • A1 Determine whether the distance between the center point of the current forward direction of the user and the center point of the user in the previous forward direction exceeds a preset distance threshold. Since the basic information of the object of the game map is obtained, it is still necessary to occupy a certain resource when the object is outside the viewport. Therefore, in order to avoid the basic information of the object of the game map when the screen is not moved much, the resource needs to be determined. Basic information about the object of the game map.
  • Step S23 determining whether the object is outside the viewport according to the size of the screen and the basic information of the object of the game map.
  • step S24 the object is not drawn when the object is outside the viewport.
  • the object when the object is outside the viewport, the object is set to be in an invisible state, and when the engine determines that the object is in an invisible state, the object is not drawn.
  • the object is drawn while the object is completely within the viewport and when the object portion is within the viewport.
  • the object when the object is completely in the viewport and when the object portion is in the viewport, the object is set to a visible state, and the engine draws the object when it is determined that the object is in a visible state. Since the object is drawn only when the object is in a visible state, the number of objects to be drawn is reduced, thereby greatly increasing the drawing speed of the object.
  • the local map size is 3096*2400
  • the number of objects is 1000
  • the screen size (viewport size) is: 1280*800
  • the image size of the object is: 480* 320
  • the display drawing interval is 0.021 s.
  • the drawing interval becomes 0.006 s, which greatly improves the drawing speed of the object and shortens the drawing interval.
  • the size of the sequence numbers of the foregoing processes does not mean the order of execution sequence, and the execution order of each process should be determined by its function and internal logic, and should not be implemented in the embodiment of the present invention. Form any limit.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • FIG. 5 is a structural diagram of an object drawing apparatus for a game map according to a third embodiment of the present invention.
  • the object drawing apparatus of the game map may include communicating with one or more core networks via a radio access network RAN.
  • User equipment which may be a mobile phone (or "cellular" phone), a computer with a mobile device, etc., for example, the user device may also be a portable, pocket, handheld, computer built-in or in-vehicle mobile device They exchange voice and/or data with the wireless access network.
  • the mobile device can include a smartphone, a tablet, a personal digital assistant PDA, a point-of-sale POS, or an on-board computer. For the convenience of description, only parts related to the embodiment of the present invention are shown.
  • the object drawing device of the game map includes an object basic information acquiring unit 51, an out-of-view object determining unit 52, and an object non-drawing unit 53. among them:
  • the basic information acquiring unit 51 of the object is configured to acquire the size of the screen and the basic information of the object of the game map, and the basic information of the object includes the position information of the object and the size of the object.
  • the position information of the object is the coordinate position information of the object on the game map.
  • the out-of-port object determining unit 52 is configured to determine whether the object is outside the viewport according to the size of the screen and the basic information of the object of the game map.
  • the out-of-view object determining unit 52 includes:
  • a numerical calculation module for calculating values of the following formula: (x+0.5*w), (x-0.5*w), (y+0.5*h), and (y-0.5*h), where the position of the object
  • the information is (x, y)
  • the size of the object is (w, h)
  • the size of the screen is (screenW, screenH).
  • the out-of-port determination module is configured to determine that the object is outside the viewport when x+0.5*w ⁇ 0 and x-0.5*w>screenW and y+0.5*h ⁇ 0 and y-0.5*h>screenH.
  • the object does not draw a unit 53 for not drawing the object when the object is outside the viewport.
  • the object when the object is outside the viewport, the object is set to be in an invisible state, and when the engine determines that the object is in an invisible state, the object is not drawn. Since there is no need to draw objects outside the viewport, the number of objects to be drawn is reduced, thereby speeding up the display speed of the object and improving the user's good experience.
  • the object drawing device of the game map includes:
  • the forward direction obtaining unit is configured to acquire a forward direction of the user.
  • the heading direction of the user can be determined by determining the heading direction of the cursor.
  • the user's heading direction is determined according to the heading direction of the hidden cursor.
  • the basic information acquiring unit of the object is specifically configured to acquire the basic information of the size of the screen and the object of the game map within the preset range of the center point of the user's forward direction.
  • the center point of the user's forward direction may be set as the center point of the current picture obtained after the forward motion has been performed.
  • the basic information acquiring unit 51 of the object includes:
  • the two adjacent screen moving distance determining modules are configured to determine whether the distance between the center point of the current forward direction of the user and the center point of the user in the previous forward direction exceeds a preset distance threshold. Since the basic information of the object of the game map is obtained, it is still necessary to occupy a certain resource when the object is outside the viewport. Therefore, in order to avoid the basic information of the object of the game map when the screen is not moved much, the resource needs to be determined. Basic information about the object of the game map.
  • the operation module is configured to acquire the size of the screen and the user's forward direction within the preset range when the distance between the center point of the current forward direction of the user and the center point of the user's last forward direction exceeds a preset distance threshold.
  • the object drawing device of the game map includes:
  • An object drawing unit for drawing the object when the object is completely within the viewport and when the object portion is within the viewport. Specifically, when the object is completely in the viewport and when the object portion is in the viewport, the object is set to be in a visible state, and the engine draws the object when it is determined that the object is in a visible state. Since the object is drawn only when the object is in a visible state, the number of objects to be drawn is reduced, thereby greatly increasing the drawing speed of the object.
  • the number of objects to be drawn is reduced, thereby speeding up the display speed of the object and improving the user's good experience.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Physics & Mathematics (AREA)
  • Optics & Photonics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种游戏地图的物体绘制方法及装置,该方法包括:获取屏幕的尺寸以及游戏地图的物体的基本信息,物体的基本信息包括物体的位置信息和物体的尺寸;根据屏幕的尺寸以及游戏地图的物体的基本信息判断物体是否在视口外;物体在视口外时,不绘制该物体。

Description

游戏地图的物体绘制方法及装置 技术领域
本发明实施例属于画面显示领域,尤其涉及一种游戏地图的物体绘制方法及装置。
背景技术
网络游戏经常会有各种场景,每个场景都有对应的地图。在地图中可能有大量(比如超过1000)的物体(可能是怪物,也可能是花花草草),为了能够正确显示地图上的物体,需要对这些物体进行绘图和逻辑处理。其中,绘图和处理逻辑所消耗的时间比大约为10:1,当物体非常多的时候,绘图占用的时间也会非常多,而当绘图和处理逻辑所占用的时间之和大于游戏的绘图间隔时间(比如为人眼能反应的最大间隔时间1/60秒,超过这个间隔时间,人眼就能分辨出卡顿的情况)时游戏就会发生卡顿现象。
现有的游戏地图绘制方法中,通常是将地图上的物体都绘制一遍,再根据视口(可理解为镜头)能够呈现的物体显示已绘制的物体。由于现有方法在显示物体前已绘制了所有的物体,而绘制所有物体耗费了过多的时间,因此导致显示物体的时间过慢,卡顿现象严重,用户体验较低。
技术问题
本发明实施例提供了一种游戏地图的物体绘制方法及装置,旨在解决现有方法绘制物体的数量过多,导致显示物体过慢的问题。
技术解决方案
本发明实施例是这样实现的,一种游戏地图的物体绘制方法,所述方法包括:
获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸;
根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外;
在所述物体在视口外时,不绘制所述物体。
本发明实施例的另一目的在于提供一种游戏地图的物体绘制装置,所述装置包括:
物体的基本信息获取单元,用于获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸;
视口外物体判断单元,用于根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外;
物体不绘制单元,用于在所述物体在视口外时,不绘制所述物体。
有益效果
在本发明实施例中,由于无需绘制视口外的物体,因此减少了需绘制的物体的数量,从而加快了物体的显示速度,提高了用户的良好体验。
附图说明
图1是本发明第一实施例提供的一种游戏地图的物体绘制方法的流程图;
图2是本发明第二实施例提供的另一种游戏地图的物体绘制方法的流程图;
图3是本发明第二实施例提供的采用现有方法绘制一地图的结果示意图;
图4是本发明第二实施例提供的采用本发明实施例的游戏地图的物体绘制方法绘制与图3同样地图的结果示意图;
图5是本发明第三实施例提供的一种游戏地图的物体绘制装置的结构图。
本发明的实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例中,获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸,根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外,在所述物体在视口外时,不绘制所述物体。
为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。
实施例一:
图1示出了本发明第一实施例提供的一种游戏地图的物体绘制方法的流程图,详述如下:
步骤S11,获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸。
该步骤中,物体的位置信息为物体在游戏地图上的坐标位置信息。
步骤S12,根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外。
该步骤中的视口可理解为镜头,视口内的物体可被用户看到。以一个大街为例,游戏的场景是一条大街,大街上有熙熙攘攘的行人,游戏的视口不能将整个大街一次性显示出来,需要通过切换视口或者移动视口才能显示其它部分。有些行人在视口里面、有些行人在视口的外面,用户可看到游戏视口内的行人。
其中,所述根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外,具体包括:
计算下列式子的值:(x+0.5*w)、(x-0.5*w)、(y+0.5*h)以及(y-0.5*h),其中,物体的位置信息为(x,y),物体的尺寸为(w,h),屏幕的尺寸为(screenW,screenH);
在x+0.5*w<0且x-0.5*w>screenW且y+0.5*h<0且y-0.5*h>screenH时,判断物体在视口外。在cocos2d-x中物体的位置是以中心点为准的,假设物体的位置是(x,y),物体的尺寸为(w,h),屏幕的尺寸为(screenW,ScreenH)。当x+0.5*w<0且x-0.5w>screenW且y+0.5*h<0且y-0.5*h>screenH,则判定物体在视口外;进一步地,当x-0.5*w>0且x+0.5w<screenW且y-0.5*h>0且y+0.5*h<screenH,则判定物体完全在视口内;其它情况则判定物体部分在视口内。
步骤S13,在所述物体在视口外时,不绘制所述物体。
该步骤中,当判断出物体在视口外时,引擎不绘制视口外的物体,由于无需绘制视口外的物体,因此减少了需绘制的物体的数量,从而加快了物体的显示速度,提高了用户的良好体验。
实施例二:
图2示出了本发明第二实施例提供的另一种游戏地图的物体绘制方法的流程图,本实施例中,在实施例一的基础上增加步骤S21,详述如下:
步骤S21,获取用户的前进方向。
该步骤中,可通过确定光标的前进方向确定用户的前进方向。当然,若在游戏中没显示光标,则根据隐藏的光标的前进方向确定用户的前进方向。
步骤S22,获取屏幕的尺寸以及用户前进方向的中心点预设范围内游戏地图的物体的基本信息。
该步骤中,用户前进方向的中心点可以设置为已执行前进动作后得到的当前画面的中心点。为了能够提前判断出物体是否在视口外,预设范围可设置为包括屏幕外的物体的范围,即用户前进方向的中心点预设范围内的游戏地图的物体包括屏幕内显示的物体,也包括部分屏幕外还没显示的物体,这样,当用户前进到当前画面时,由于已提前获取该当前画面的物体的基本信息,提前判断该当前画面的物体是否在视口外,因此进一步加快绘制物体的速度。
其中,所述获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息,具体包括:
A1、判断用户当前前进方向的中心点与用户上一次前进方向的中心点的距离是否超过预设的距离阈值。由于获取游戏地图的物体的基本信息,判断物体是否在视口外仍需要占用一定的资源,因此,为了避免在画面移动不大的情况下获取游戏地图的物体的基本信息,节省资源,需要判断何时获取游戏地图的物体的基本信息。
A2、在用户当前前进方向的中心点与用户上一次前进方向的中心点的距离超过预设的距离阈值时,获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息。
步骤S23,根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外。
步骤S24,在所述物体在视口外时,不绘制所述物体。
具体地,在所述物体在视口外时,设置所述物体为不可见状态,引擎在判断出物体为不可见状态时,不绘制所述物体。
可选地,在所述物体完全在视口内以及在所述物体部分在视口内时,绘制所述物体。
该步骤中,在所述物体完全在视口内以及在所述物体部分在视口内时,设置所述物体为可见状态,引擎在判断出物体为可见状态时,绘制所述物体。由于只在物体为可见状态时,才绘制所述物体,因此,减少了需绘制的物体的数量,从而极大提高了物体的绘制速度。
如图3、图4所示,当地图大小为3096*2400,物体数量为1000,屏幕尺寸(视口大小)为:1280*800,物体的图片尺寸为:480* 320,若使用原有的方法,根据图3左下角的调试信息,可知显示绘图间隔为0.021s。但采用本发明实施提供的方法后,如图4左下角所示,绘图间隔变为0.006s,极大提高了物体的绘制速度,缩短了绘制间隔。
应理解,在本发明实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
实施例三:
图5示出了本发明第三实施例提供的一种游戏地图的物体绘制装置的结构图,该游戏地图的物体绘制装置可以包括经无线接入网RAN与一个或多个核心网进行通信的用户设备,该用户设备可以是移动电话(或称为“蜂窝”电话)、具有移动设备的计算机等,例如,用户设备还可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语音和/或数据。又例如,该移动设备可以包括智能手机、平板电脑、个人数字助理PDA、销售终端POS或车载电脑等。为了便于说明,仅示出了与本发明实施例相关的部分。
该游戏地图的物体绘制装置包括:物体的基本信息获取单元51、视口外物体判断单元52、物体不绘制单元53。其中:
物体的基本信息获取单元51,用于获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸。
其中,物体的位置信息为物体在游戏地图上的坐标位置信息。
视口外物体判断单元52,用于根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外。
其中,所述视口外物体判断单元52包括:
数值计算模块,用于计算下列式子的值:(x+0.5*w)、(x-0.5*w)、(y+0.5*h)以及(y-0.5*h),其中,物体的位置信息为(x,y),物体的尺寸为(w,h),屏幕的尺寸为(screenW,screenH)。
视口外判定模块,用于在x+0.5*w<0且x-0.5*w>screenW且y+0.5*h<0且y-0.5*h>screenH时,判定物体在视口外。
进一步地,当x-0.5*w>0且x+0.5w<screenW且y-0.5*h>0且y+0.5*h<screenH,则判定物体完全在视口内;其它情况则判定物体部分在视口内。
物体不绘制单元53,用于在所述物体在视口外时,不绘制所述物体。
具体地,在所述物体在视口外时,设置所述物体为不可见状态,引擎在判断出物体为不可见状态时,不绘制所述物体。由于无需绘制视口外的物体,因此减少了需绘制的物体的数量,从而加快了物体的显示速度,提高了用户的良好体验。
可选地,所述游戏地图的物体绘制装置包括:
前进方向获取单元,用于获取用户的前进方向。具体地,可通过确定光标的前进方向确定用户的前进方向。当然,若在游戏中没显示光标,则根据隐藏的光标的前进方向确定用户的前进方向。
此时,所述物体的基本信息获取单元具体用于获取屏幕的尺寸以及用户前进方向的中心点预设范围内游戏地图的物体的基本信息。其中,用户前进方向的中心点可以设置为已执行前进动作后得到的当前画面的中心点。
进一步地,所述物体的基本信息获取单元51包括:
相邻两次画面移动距离判断模块,用于判断用户当前前进方向的中心点与用户上一次前进方向的中心点的距离是否超过预设的距离阈值。由于获取游戏地图的物体的基本信息,判断物体是否在视口外仍需要占用一定的资源,因此,为了避免在画面移动不大的情况下获取游戏地图的物体的基本信息,节省资源,需要判断何时获取游戏地图的物体的基本信息。
距离超出阈值时操作模块,用于在用户当前前进方向的中心点与用户上一次前进方向的中心点的距离超过预设的距离阈值时,获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息。
可选地,所述游戏地图的物体绘制装置包括:
物体绘制单元,用于在所述物体完全在视口内以及在所述物体部分在视口内时,绘制所述物体。具体地,在所述物体完全在视口内以及在所述物体部分在视口内时,设置所述物体为可见状态,引擎在判断出物体为可见状态时,绘制所述物体。由于只在物体为可见状态时,才绘制所述物体,因此,减少了需绘制的物体的数量,从而极大提高了物体的绘制速度。
本发明实施例中,由于无需绘制视口外的物体,因此减少了需绘制的物体的数量,从而加快了物体的显示速度,提高了用户的良好体验。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。

Claims (10)

  1. 一种游戏地图的物体绘制方法,其特征在于,所述方法包括:
    获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸;
    根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外;
    在所述物体在视口外时,不绘制所述物体。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外,具体包括:
    计算下列式子的值:(x+0.5*w)、(x-0.5*w)、(y+0.5*h)以及(y-0.5*h),其中,物体的位置信息为(x,y),物体的尺寸为(w,h),屏幕的尺寸为(screenW,screenH);
    在x+0.5*w<0且x-0.5*w>screenW且y+0.5*h<0且y-0.5*h>screenH时,判定物体在视口外。
  3. 根据权利要求1所述的方法,其特征在于,在所述获取屏幕的尺寸以及游戏地图的物体的基本信息之前,包括:
    获取用户的前进方向;
    所述获取屏幕的尺寸以及游戏地图的物体的基本信息具体包括:
    获取屏幕的尺寸以及用户前进方向的中心点预设范围内游戏地图的物体的基本信息。
  4. 根据权利要求3所述的方法,其特征在于,所述获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息,具体包括:
    判断用户当前前进方向的中心点与用户上一次前进方向的中心点的距离是否超过预设的距离阈值;
    在用户当前前进方向的中心点与用户上一次前进方向的中心点的距离超过预设的距离阈值时,获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,在所述物体完全在视口内以及在所述物体部分在视口内时,绘制所述物体。
  6. 一种游戏地图的物体绘制装置,其特征在于,所述装置包括:
    物体的基本信息获取单元,用于获取屏幕的尺寸以及游戏地图的物体的基本信息,所述物体的基本信息包括物体的位置信息和物体的尺寸;
    视口外物体判断单元,用于根据所述屏幕的尺寸以及游戏地图的物体的基本信息判断所述物体是否在视口外;
    物体不绘制单元,用于在所述物体在视口外时,不绘制所述物体。
  7. 根据权利要求6所述的装置,其特征在于,所述视口外物体判断单元包括:
    数值计算模块,用于计算下列式子的值:(x+0.5*w)、(x-0.5*w)、(y+0.5*h)以及(y-0.5*h),其中,物体的位置信息为(x,y),物体的尺寸为(w,h),屏幕的尺寸为(screenW,screenH);
    视口外判定模块,用于在x+0.5*w<0且x-0.5*w>screenW且y+0.5*h<0且y-0.5*h>screenH时,判定物体在视口外。
  8. 根据权利要求6所述的装置,其特征在于,所述装置包括:
    前进方向获取单元,用于获取用户的前进方向;
    所述物体的基本信息获取单元具体用于获取屏幕的尺寸以及用户前进方向的中心点预设范围内游戏地图的物体的基本信息。
  9. 根据权利要求8所述的装置,其特征在于,所述物体的基本信息获取单元包括:
    相邻两次画面移动距离判断模块,用于判断用户当前前进方向的中心点与用户上一次前进方向的中心点的距离是否超过预设的距离阈值;
    距离超出阈值时操作模块,用于在用户当前前进方向的中心点与用户上一次前进方向的中心点的距离超过预设的距离阈值时,获取屏幕的尺寸以及用户的前进方向预设范围内游戏地图的物体的基本信息。
  10. 根据权利要求6至9任一项所述的装置,其特征在于,所述装置包括:
    物体绘制单元,用于在所述物体完全在视口内以及在所述物体部分在视口内时,绘制所述物体。
PCT/CN2017/075556 2017-03-03 2017-03-03 游戏地图的物体绘制方法及装置 WO2018157375A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/075556 WO2018157375A1 (zh) 2017-03-03 2017-03-03 游戏地图的物体绘制方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/075556 WO2018157375A1 (zh) 2017-03-03 2017-03-03 游戏地图的物体绘制方法及装置

Publications (1)

Publication Number Publication Date
WO2018157375A1 true WO2018157375A1 (zh) 2018-09-07

Family

ID=63369809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075556 WO2018157375A1 (zh) 2017-03-03 2017-03-03 游戏地图的物体绘制方法及装置

Country Status (1)

Country Link
WO (1) WO2018157375A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022056393A1 (en) 2020-09-11 2022-03-17 Riot Games, Inc Selective indication of off-screen object presence

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889127A (zh) * 2006-07-26 2007-01-03 北京金山数字娱乐科技有限公司 一种在3d游戏中获得物体显示色的方法
CN104102488A (zh) * 2014-07-18 2014-10-15 无锡梵天信息技术股份有限公司 一种基于多线程并行化的3d引擎系统
US20150035830A1 (en) * 2010-12-24 2015-02-05 Xiaopeng Zhang Method for real-time and realistic rendering of complex scenes on internet
CN105817031A (zh) * 2016-03-16 2016-08-03 小天才科技有限公司 游戏地图的物体绘制方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1889127A (zh) * 2006-07-26 2007-01-03 北京金山数字娱乐科技有限公司 一种在3d游戏中获得物体显示色的方法
US20150035830A1 (en) * 2010-12-24 2015-02-05 Xiaopeng Zhang Method for real-time and realistic rendering of complex scenes on internet
CN104102488A (zh) * 2014-07-18 2014-10-15 无锡梵天信息技术股份有限公司 一种基于多线程并行化的3d引擎系统
CN105817031A (zh) * 2016-03-16 2016-08-03 小天才科技有限公司 游戏地图的物体绘制方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022056393A1 (en) 2020-09-11 2022-03-17 Riot Games, Inc Selective indication of off-screen object presence
EP4192592A4 (en) * 2020-09-11 2024-01-17 Riot Games Inc. SELECTIVE DISPLAY OF THE PRESENCE OF AN OBJECT OFF-SCREEN
US12029980B2 (en) 2020-09-11 2024-07-09 Riot Games, Inc. Selective indication of off-screen object presence

Similar Documents

Publication Publication Date Title
CN107390972B (zh) 一种终端录屏方法、装置及计算机可读存储介质
WO2016072714A1 (en) Electronic device and method for providing filter in electronic device
WO2021093583A1 (zh) 视频流处理方法、装置、终端设备及计算机可读存储介质
WO2015182964A1 (en) Electronic device with foldable display and method of operating the same
EP3092572A1 (en) Method and apparatus for screen sharing
WO2016017855A1 (en) Wearable device and method of controlling therefor
EP3105919A1 (en) Photographing method of an electronic device and the electronic device thereof
WO2021139372A1 (zh) 图像的处理方法、装置、可读介质和电子设备
EP3042236A1 (en) Head mount display device and method for controlling the same
WO2022166765A1 (zh) 图像处理方法、移动终端及存储介质
WO2018161889A1 (zh) 一种获取排队信息的方法、装置及计算机可读存储介质
WO2016006728A1 (ko) 화상을 이용해 3차원 정보를 처리하는 전자 장치 및 방법
WO2016072678A1 (en) User terminal device and method for controlling user terminal device thereof
WO2021190387A1 (zh) 检测结果输出的方法、电子设备及介质
CN111062323B (zh) 人脸图像传输方法、数值转移方法、装置及电子设备
CN109739602A (zh) 一种移动终端壁纸设置方法及装置、移动终端及存储介质
WO2016039532A1 (en) Method of controlling display of electronic device and electronic device thereof
WO2020102977A1 (zh) 图像处理方法及相关产品
JP2014225108A (ja) 画像処理装置、画像処理方法およびプログラム
WO2018157375A1 (zh) 游戏地图的物体绘制方法及装置
WO2015102451A1 (en) Image processing method and electronic device implementing the same
WO2012034469A1 (zh) 基于手势的人机交互方法及系统、计算机存储介质
WO2024139279A1 (zh) 访问控制列表规则配置方法、装置、电子设备及存储介质
CN113176869A (zh) 一种投屏音频时延控制方法、设备及计算机可读存储介质
WO2016074248A1 (zh) 基于人脸识别的验证使用方法及装置

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: 17899029

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17899029

Country of ref document: EP

Kind code of ref document: A1