HK1199574B - Method and system for moving character in online game - Google Patents
Method and system for moving character in online game Download PDFInfo
- Publication number
- HK1199574B HK1199574B HK14113128.2A HK14113128A HK1199574B HK 1199574 B HK1199574 B HK 1199574B HK 14113128 A HK14113128 A HK 14113128A HK 1199574 B HK1199574 B HK 1199574B
- Authority
- HK
- Hong Kong
- Prior art keywords
- grid
- client
- character
- movement
- specified
- Prior art date
Links
Description
技术领域Technical Field
本发明属于在线游戏领域,尤其涉及一种在线游戏中的人物移动方法和系统。The present invention belongs to the field of online games, and in particular relates to a method and system for moving characters in online games.
背景技术Background Art
目前,互联网提供了共享的网页资料外,还能提供在线游戏,如大型多人在线游戏(Massively)Multiplayer Online Game,MMOG),还包括网页游戏。通常,在线游戏为了缓解用户的疲劳而诞生,用户在工作疲惫时仅需花费短时间即可完成在线游戏的客户端下载和安装,进行在线的多人游戏。The internet not only provides shared web content but also online games, such as massively multiplayer online games (MMOGs) and web browser games. Online games are often created to alleviate user fatigue. When users are exhausted from work, they can simply download and install the game client and play online multiplayer games in a short amount of time.
对于现有的由服务器和多个客户端组成的游戏系统,在线游戏的客户端和服务器仅支持较少数据的交互以实现一些简单操作,如:控制游戏人物释放技能和控制游戏人物移动。对于现有在线游戏提供的游戏地图,该游戏地图上的网格可支持多个游戏人物在上面,即游戏人物重叠在同一网格上;进而,对于需要移动游戏人物到达目的网格时,直接建立为到达该目的网格所需最短距离的路径,通过该路径直接穿透该路径上的游戏人物到达目的网格,没有体现游戏人物之间的间隔,不具真实感。Existing gaming systems, comprised of a server and multiple clients, support only minimal data exchange between the client and server to implement simple operations, such as controlling character skills and movement. In existing online games, the grids on the game map can support multiple characters, meaning that characters overlap on the same grid. Furthermore, to reach a target grid, a path is created that takes the shortest distance to that grid, and the characters on that path are then passed through directly to reach the target grid. This lacks realistic spacing between characters and lacks realism.
发明内容Summary of the Invention
本发明的目的在于提供一种在线游戏中的人物移动方法和系统,以解决基于现有在线游戏提供的游戏地图建立的路径,经过该路径时会穿过游戏人物的问题。The object of the present invention is to provide a method and system for moving characters in an online game, so as to solve the problem that a path established based on a game map provided by an existing online game may pass through a game character when passing through the path.
一方面,本发明提供一种在线游戏中的人物移动方法,应用于由服务器和至少两个客户端组成的人物移动系统,所述在线游戏中的人物移动方法包括:In one aspect, the present invention provides a method for moving a character in an online game, which is applied to a character movement system consisting of a server and at least two clients. The method for moving a character in an online game includes:
第一客户端接收针对指定人物的移动指令,所述移动指令包括目的网格,所述客户端包括所述第一客户端;A first client receives a movement instruction for a designated character, the movement instruction including a destination grid, and the client includes the first client;
所述第一客户端获取包括已标记的动态阻挡网格的游戏地图,所述已标记的动态阻挡网格为存在游戏人物的动态阻挡网格;The first client obtains a game map including marked dynamic blocking grids, where the marked dynamic blocking grids are dynamic blocking grids where game characters exist;
所述第一客户端建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径,生成包括所述指定人物和所述最优路径的移动信息,向所述服务器发送所述移动信息;The first client establishes an optimal path from the current starting grid where the designated person is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grids, generates movement information including the designated person and the optimal path, and sends the movement information to the server;
所述服务器接收所述第一客户端发送的移动信息,向除所述第一客户端以外的所有客户端群发所述移动信息。The server receives the movement information sent by the first client, and sends the movement information to all clients except the first client in a group.
一方面,本发明提供一种在线游戏中的人物移动系统,包括服务器,还包括至少两个客户端;所述客户端包括第一客户端;In one aspect, the present invention provides a character movement system in an online game, comprising a server and at least two clients; the clients comprising a first client;
所述第一客户端,用于接收针对指定人物的移动指令,所述移动指令包括目的网格;The first client is configured to receive a movement instruction for a designated character, wherein the movement instruction includes a destination grid;
所述第一客户端,还用于获取包括已标记的动态阻挡网格的游戏地图,所述已标记的动态阻挡网格为存在游戏人物的动态阻挡网格;The first client is further configured to obtain a game map including marked dynamic blocking grids, wherein the marked dynamic blocking grids are dynamic blocking grids in which game characters exist;
所述第一客户端,还用于建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径,生成包括所述指定人物和所述最优路径的移动信息,向所述服务器发送所述移动信息;The first client is further configured to establish an optimal path from the current starting grid where the designated person is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grids, generate movement information including the designated person and the optimal path, and send the movement information to the server;
所述服务器,用于接收所述第一客户端发送的移动信息,向除所述第一客户端以外的所有客户端群发所述移动信息。The server is configured to receive the mobile information sent by the first client, and group-send the mobile information to all clients except the first client.
本发明的有益效果:基于现有在线游戏提供的游戏地图,增添动态阻挡网格;如果该动态阻挡网格上存在一个游戏人物,则对该动态阻挡网格进行标记;进而在建立从当前起始网格到目的网格的最优路径时会避开该已标记的动态阻挡网格,进而在控制指定人物沿最优路径移动时,会呈现两个游戏人物擦肩而过的场景,而不是指定人物穿过另一游戏人物的场景,更具真实体验。The beneficial effects of the present invention are as follows: based on the game map provided by the existing online game, a dynamic blocking grid is added; if a game character exists on the dynamic blocking grid, the dynamic blocking grid is marked; and then, when establishing the optimal path from the current starting grid to the destination grid, the marked dynamic blocking grid is avoided. Then, when controlling the designated character to move along the optimal path, a scene of two game characters passing by each other is presented, rather than a scene of the designated character passing through another game character, which provides a more realistic experience.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
图1是本发明实施例提供的在线游戏中的人物移动方法的第一种交互流程图;FIG1 is a first interactive flow chart of a method for moving a character in an online game provided by an embodiment of the present invention;
图2是本发明实施例提供的在线游戏中的人物移动方法的第二种交互流程图;FIG2 is a second interactive flow chart of a method for moving a character in an online game provided by an embodiment of the present invention;
图3是本发明实施例提供的在线游戏中的人物移动方法的第三种交互流程图;3 is a third interactive flow chart of a method for moving a character in an online game provided by an embodiment of the present invention;
图4是本发明实施例提供的在线游戏中的人物移动方法的第三种交互流程图;FIG4 is a third interactive flow chart of a method for moving a character in an online game provided by an embodiment of the present invention;
图5是本发明实施例提供的在线游戏中的人物移动系统的的系统架构图;5 is a system architecture diagram of a character movement system in an online game provided by an embodiment of the present invention;
图6是本发明实施例提供的包括有第一客户端的在线游戏中的人物移动系统的系统架构图;6 is a system architecture diagram of a character movement system in an online game including a first client provided by an embodiment of the present invention;
图7是本发明实施例提供的包括有第三客户端的在线游戏中的人物移动系统的系统架构图。FIG7 is a system architecture diagram of a character movement system in an online game including a third client provided by an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In order to illustrate the technical solutions of the present invention, the following description is given by way of specific examples.
在本发明实施例中,基于在线游戏提供的游戏地图是由网格组成的。其中,对于在游戏地图中划分网格的方式不作限定,和对从游戏地图中划分出的不同网格的大小也不作限定。需说明的是,本发明实施例所述的在线游戏至少包括MMOG和网页游戏。其中,MMOG为多人同时在线游戏,在安装客户端之后,每个游戏玩家可通过客户端登录服务器,实现多人同时在线游戏。其中,对于网页游戏,预先通过添加挂件或插件等安装客户端的方式在浏览器中安装客户端后,游戏文件可通过浏览器提供的客户端直接登录服务器,实现多人同时在线游戏。In an embodiment of the present invention, a game map provided based on an online game is composed of grids. There is no limitation on the manner in which the grids are divided in the game map, and there is no limitation on the sizes of the different grids divided from the game map. It should be noted that the online games described in the embodiment of the present invention include at least MMOGs and web games. MMOGs are multiplayer online games. After installing the client, each game player can log in to the server through the client to achieve multiplayer online games. For web games, after installing the client in the browser in advance by adding a widget or plug-in, the game files can directly log in to the server through the client provided by the browser to achieve multiplayer online games.
本发明实施例提供的在线游戏中的人物移动方法,应用于由服务器和至少两个客户端组成的人物移动系统(即由服务器和至少两个客户端组成的游戏系统)。所述客户端包括第一客户端和第二客户端;其中,第二客户端代表:除所述第一客户端以外的所有客户端。所述客户端还包括第三客户端,其中第三客户端可以为第一客户端,或者为第二客户端包括的任一客户端;第三客户端为:向服务器发送包含有控制第三游戏人物移动的错误路径的移动信息的客户端;所述第三游戏人物为:由第三客户端通过错误路径控制的游戏人物。需强调的是,为了节省服务器与每个客户端交互的数据量,在客户端中的游戏地图或游戏人物所在网格等数据未出错的情况下,每个客户端和服务器大都在针对需移动的游戏人物而生成的移动信息进行数据交互。该移动信息包括指定人物、所述当前起始网格、所述最优路径、起始移动时间和移动速度;因此,每个客户端与服务器交互的移动信息的数据量也较小。An embodiment of the present invention provides a method for moving characters in an online game, which is applied to a character movement system consisting of a server and at least two clients (i.e., a game system consisting of a server and at least two clients). The clients include a first client and a second client; the second client represents all clients other than the first client. The clients also include a third client, which can be the first client or any client included in the second client. The third client is a client that sends movement information containing an incorrect path for controlling the movement of a third game character to the server; the third game character is a game character controlled by the third client via the incorrect path. It should be emphasized that to conserve the amount of data exchanged between the server and each client, if the client's game map or the grid where the game character resides is correct, each client and the server primarily exchange data based on the movement information generated for the game character to be moved. This movement information includes the designated character, the current starting grid, the optimal path, the starting movement time, and the movement speed. Therefore, the amount of movement information exchanged between each client and the server is relatively small.
图1示出了本发明实施例提供的在线游戏中的人物移动方法的第一种交互流程,为了便于描述,仅示出了与本发明实施例相关的部分。本发明实施例提供的所述在线游戏中的人物移动方法包括:FIG1 shows a first interactive process of a method for moving a character in an online game provided by an embodiment of the present invention. For ease of description, only the parts related to the embodiment of the present invention are shown. The method for moving a character in an online game provided by an embodiment of the present invention includes:
S1,第一客户端接收针对指定人物的移动指令,所述移动指令包括目的网格,所述客户端包括所述第一客户端。在本发明实施例中,游戏人物包括指定人物;如果第一客户端可控制的游戏人物为一个或多个时,所述指定人物为第一客户端当前控制的游戏人物。S1. A first client receives a movement instruction for a designated character, the movement instruction including a destination grid, and the client includes the first client. In this embodiment of the present invention, the game character includes the designated character; if the first client can control one or more game characters, the designated character is the game character currently controlled by the first client.
需说明的是,对于控制指定人物移动的移动指令,可以由游戏玩家通过鼠标或键盘触发。如果游戏玩家控制鼠标点击了游戏地图上的某个动态阻挡网格或某个无阻挡网格,将点击的该个网格作为目的网格。另外,当游戏玩家通过键盘控制指定人物沿指定方向(上、下、左或右)移动时,如果在沿指定方向上与指定人物当前所在的网格相邻的网格为动态阻挡网格或无阻挡网格,则将与指定人物当前所在的网格相邻的网格作为目的网格。It should be noted that the movement commands for controlling the movement of a designated character can be triggered by the game player using the mouse or keyboard. If the game player controls the mouse to click on a dynamic blocking grid or an unblocked grid on the game map, the clicked grid will be used as the destination grid. In addition, when the game player controls the designated character to move in a specified direction (up, down, left, or right) using the keyboard, if the grid adjacent to the grid currently located by the designated character in the specified direction is a dynamic blocking grid or an unblocked grid, the grid adjacent to the grid currently located by the designated character will be used as the destination grid.
对于控制指定人物移动的该移动指令,也可以由游戏挂件触发,该游戏挂件包含有由程序员预先编程设定的、用于控制游戏人物的代码文件,当然该游戏挂件包含有控制指定人物移动的代码文件。这样,需控制指定人物依次移动到的每个目的网格也由游戏挂件包含的代码文件设定。The movement command for controlling the movement of a designated character can also be triggered by a game widget, which contains a code file pre-programmed by a programmer for controlling the game character. Of course, the game widget also contains the code file for controlling the movement of the designated character. Thus, each target grid to which the designated character is directed is also defined by the code file contained in the game widget.
另外,由于第一客户端已记录了指定人物在游戏地图中当前所在的网格(即为当前起始网格);从而,第一客户端可从移动指令中提取出预将指定人物移动到的目的网格,即可划出从该当前起始网格到该目的网格的最优路径。通过该最优路径,可将指定人物从当前起始网格移动到目的网格。Furthermore, since the first client has recorded the grid where the designated character is currently located in the game map (i.e., the current starting grid), the first client can extract the target grid to which the designated character is to be moved from the movement instruction and thus draw an optimal path from the current starting grid to the target grid. Using this optimal path, the designated character can be moved from the current starting grid to the target grid.
S2,所述第一客户端获取包括已标记的动态阻挡网格的游戏地图,所述已标记的动态阻挡网格为存在游戏人物的动态阻挡网格。S2: The first client obtains a game map including marked dynamic blocking grids, where the marked dynamic blocking grids are dynamic blocking grids where game characters exist.
值得说明的是,相对于现有在线游戏提供的游戏地图,本发明实施例提供的游戏地图包含有动态阻挡网格。该动态阻挡网格具有以下特征:如果该动态阻挡网格上已存在一个游戏人物,其它游戏人物则不能移动到该动态阻挡网格上。It is worth noting that, compared to the game maps provided by existing online games, the game map provided by the embodiment of the present invention includes a dynamic blocking grid. The dynamic blocking grid has the following characteristics: if a game character is already on the dynamic blocking grid, other game characters cannot move to the dynamic blocking grid.
在本发明实施例中,在动态阻挡网格上不存在游戏人物时,服务器不会对该动态阻挡网格进行标记,将未标记的该动态阻挡网格作为所述未标记的动态阻挡网格。当有游戏人物移动到动态阻挡网格上时,服务器会将该动态阻挡网格进行标记,得到所述已标记的动态阻挡网格;当游戏人物移出该动态阻挡网格时,服务器会取消对该动态阻挡网格的标记,该动态阻挡网格重新变为所述未标记的动态阻挡网格。In this embodiment of the present invention, when no game character exists on a dynamic blocking grid, the server does not mark the dynamic blocking grid, and the unmarked dynamic blocking grid is referred to as the unmarked dynamic blocking grid. When a game character moves onto a dynamic blocking grid, the server marks the dynamic blocking grid, making it the marked dynamic blocking grid. When the game character moves out of the dynamic blocking grid, the server unmarks the dynamic blocking grid, and the dynamic blocking grid becomes the unmarked dynamic blocking grid again.
S3,所述第一客户端建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径,生成包括所述指定人物和所述最优路径的移动信息,向所述服务器发送所述移动信息。S3, the first client establishes an optimal path from the current starting grid where the designated person is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grid, generates movement information including the designated person and the optimal path, and sends the movement information to the server.
需说明的是,由于游戏地图是由网格组成的,进而生成的最优路径也是由依次按照当前起始网格、依次经过的网格和目的网格组成的。这样,可通过最优路径包括的依次经过的网格控制指定人物移动。值得说明的是,由于在一个动态阻挡网格上面,只能允许存在一个游戏人物;步骤S3在确定从当前起始网格到达目的网格的最短路径(最优路径)时,会绕开所述已标记的动态阻挡网格,该最优路径不会包含所述已标记的动态阻挡网格;即,对于根据现有技术(基于不存在动态阻挡网格的游戏地图)确定的最短路径,如果在本发明实施例中根据现有技术确定的该最短路径包含有所述已标记的动态阻挡网格,则根据本发明实施例确定的最优路径会从所述已标记的动态阻挡网格的一个或多个相邻网格经过。这样,当指定人物沿绕开所述已标记的动态阻挡网格的最优路径移动时,会呈现出两个游戏人物擦身而过的游戏画面。进而,通过在整个游戏地图上设置一个或多个动态阻挡网格,在设置有动态阻挡网格的位置可呈现至少一个游戏人物擦身而过的游戏画面。It should be noted that since the game map is composed of grids, the optimal path generated is also composed of the current starting grid, the grids passed through in sequence, and the destination grid. Thus, the movement of a designated character can be controlled by the grids passed through in the optimal path. It is worth noting that since only one game character can reside on a dynamic blocking grid, when determining the shortest path (optimal path) from the current starting grid to the destination grid in step S3, the marked dynamic blocking grids are bypassed, and the optimal path does not include the marked dynamic blocking grids. That is, for a shortest path determined according to the prior art (based on a game map without dynamic blocking grids), if the shortest path determined according to the prior art in an embodiment of the present invention includes the marked dynamic blocking grid, the optimal path determined according to the embodiment of the present invention will pass through one or more adjacent grids of the marked dynamic blocking grid. Thus, when the designated character moves along the optimal path that bypasses the marked dynamic blocking grids, a game scene of two game characters passing each other appears. Furthermore, by setting one or more dynamic blocking grids across the entire game map, a game scene of at least one game character passing each other can be displayed at locations where dynamic blocking grids are located.
由于是多人同时在线游戏,因此需要每个客户端与服务器均同步控制指定人物按照最优路径移动。进而,所以在游戏玩家在控制第一客户端的指定人物移动时,第一客户端每建立一条最优路径,均会生成对应的移动信息并将该移动信息发送给服务器。Since this is a multiplayer online game, each client and server must synchronize control of the designated character to move along the optimal path. Therefore, when a game player controls the designated character of the first client, each time the first client establishes an optimal path, it generates corresponding movement information and sends it to the server.
S4,所述服务器接收所述第一客户端发送的移动信息,向除所述第一客户端以外的所有客户端群发所述移动信息。S4: The server receives the movement information sent by the first client, and sends the movement information to all clients except the first client.
具体在步骤S4中,服务器在接收到由所述第一客户端发送的移动信息时,检测该移动信息是否符合规定,尤其需要检测:所述移动信息指定的最优路径是否经过了游戏地图中的所述已标记的动态阻挡网格。如果该移动信息符合规定,则服务器将所述移动信息发送至每个第二客户端。Specifically, in step S4, upon receiving the movement information sent by the first client, the server checks whether the movement information complies with regulations, and in particular checks whether the optimal path specified by the movement information passes through the marked dynamic blocking grid in the game map. If the movement information complies with regulations, the server sends the movement information to each second client.
从而,第一客户端直接根据建立的最优路径控制指定人物移动的同时,除所述第一客户端以外的每个客户端均会根据服务器下发的所述最优路径控制指定人物移动,实现每个客户端控制指定人物按照所述移动信息指定的最优路径同步移动。Thus, while the first client directly controls the movement of the designated person according to the established optimal path, each client except the first client will control the movement of the designated person according to the optimal path sent by the server, so that each client controls the designated person to move synchronously according to the optimal path specified by the movement information.
在本发明一实施例中,图2示出了本发明实施例提供的在线游戏中的人物移动方法的第二种交互流程,为了便于描述,仅示出了与本发明实施例相关的部分。在在线游戏中的人物移动方法的第一种交互流程的基础上,所述第一客户端生成包括所述指定人物和所述最优路径的移动信息这一步骤之前,所述在线游戏中的人物移动方法还包括:In one embodiment of the present invention, FIG2 illustrates a second interactive process of the method for moving a character in an online game provided by an embodiment of the present invention. For ease of description, only the portion relevant to the embodiment of the present invention is shown. Based on the first interactive process of the method for moving a character in an online game, before the first client generates movement information including the designated character and the optimal path, the method for moving a character in an online game further includes:
所述第一客户端在建立所述最优路径之后,生成包括所述指定人物、所述最优路径、起始移动时间和移动速度的移动信息;After establishing the optimal path, the first client generates movement information including the designated person, the optimal path, the starting movement time, and the movement speed;
所述在线游戏中的人物移动方法还包括:S5,所述在线游戏中的人物移动方法还包括:所述第一客户端根据生成的移动信息控制所述指定人物移动。The method for moving a character in an online game further includes: S5 , the method for moving a character in an online game further includes: the first client controls the movement of the designated character according to the generated movement information.
具体地,为提高游戏的真实体验,一旦接收到用于控制指定人物移动的移动指令,该移动指令会立即触发到目的网格的最优路径的生成。并且,待生成该最优路径之后,立即确定移动信息,以通过该移动信息直接控制指定人物移动,而不会等到服务器检测该移动信息是否符合规定之后,由服务器重新下发该移动信息给第一客户端,以触发第一客户端开始控制指定人物沿最优路径移动。这样,对于第一视角的客户端(第一客户端),能够完成体验到指定人物的连续移动。值得说明的是,待生成该最优路径之后,会根据所述指定人物、所述最优路径、起始移动时间和移动速度生成移动信息。这样,通过该起始移动时间,保证每个客户端控制的指定人物在每个时刻均同步地处于同一网格。通过移动速度更加精确地保证同步控制;需说明的是,在每次发送的移动信息中,移动速度是可重新设定的,使得在不同次数生成的不同移动信息控制指定人物时,能够按照不同移动速度控制该指定人物移动,更具真实感。Specifically, to enhance the realistic gaming experience, once a movement instruction for controlling the movement of a designated character is received, the instruction immediately triggers the generation of an optimal path to the destination grid. Furthermore, after the optimal path is generated, movement information is immediately determined, allowing the designated character's movement to be directly controlled using this information. This eliminates the need for the server to verify that the movement information complies with regulations and then re-issue the information to the first client to trigger the first client to begin controlling the designated character along the optimal path. This allows the first-person perspective client (the first client) to experience the continuous movement of the designated character. It is worth noting that after the optimal path is generated, movement information is generated based on the designated character, the optimal path, the starting movement time, and the movement speed. This starting movement time ensures that the designated character controlled by each client remains synchronously in the same grid at all times. The movement speed further precisely ensures synchronized control. It should be noted that the movement speed is reconfigurable in each transmitted movement information, allowing the designated character to be controlled at different speeds when controlled by different movement information generated at different times, enhancing the sense of realism.
值得说明的是,服务器存储了每个游戏人物在每个时刻所在的网格,并且每个客户端控制的游戏人物所在的网格必须以服务器记录的该游戏人物所在的网格为准。It is worth noting that the server stores the grid where each game character is located at each moment, and the grid where the game character controlled by each client is located must be based on the grid where the game character is located recorded by the server.
进而在本实施例中,具体在第一客户端控制指定人物移动的过程中,待第一客户端将移动信息上传服务器之后,如果服务器检测到该移动信息不符合规定,服务器向第一客户端发送调整指令,通过该调整指令触发第一客户端将指定人物调整到所述服务器记录的所述指定人物所在的网格。当然,在服务器检测到该第一客户端发送的移动信息不符合规定时,服务器不会向除所述第一客户端以外的所有客户端群发该移动信息。Furthermore, in this embodiment, specifically, during the process of a first client controlling the movement of a designated person, after the first client uploads the movement information to the server, if the server detects that the movement information does not conform to regulations, the server sends an adjustment instruction to the first client, triggering the first client to adjust the designated person to the grid where the designated person is located, as recorded by the server. Of course, if the server detects that the movement information sent by the first client does not conform to regulations, the server will not send the movement information to all clients other than the first client.
优选的是,图3示出了本发明实施例提供的在线游戏中的人物移动方法的第三种交互流程,为了便于描述,仅示出了与本发明实施例相关的部分。在线游戏中的人物移动方法的第二种交互流程的基础上,如果服务器检测到第一客户端发送的移动信息符合规定时,所述在线游戏中的人物移动方法还包括:Preferably, FIG3 illustrates a third interactive process of the method for moving a character in an online game provided by an embodiment of the present invention. For ease of description, only the portion relevant to the embodiment of the present invention is illustrated. Based on the second interactive process of the method for moving a character in an online game, if the server detects that the movement information sent by the first client complies with the regulations, the method for moving a character in an online game further includes:
S6,第二客户端在接收到所述服务器发送的移动信息之后,计算当前时间与所述移动信息包括的起始移动时间的时间差,所述第二客户端为:除所述第一客户端以外的所有客户端;S6, after receiving the movement information sent by the server, the second client calculates the time difference between the current time and the start movement time included in the movement information, the second client being: all clients except the first client;
S7,所述第二客户端根据计算出的时间差、所述移动速度和所述当前起始网格,将所述指定人物从所述当前起始网格调整到所述当前时间应在所述最优路径上的网格;S7, the second client adjusts the designated person from the current starting grid to a grid that should be on the optimal path at the current time according to the calculated time difference, the moving speed, and the current starting grid;
S8,所述第二客户端控制所述指定人物从调整的网格开始按照所述移动信息指定的最优路径和按照所述移动信息指定的移动速度移动。S8, the second client controls the designated character to move starting from the adjusted grid according to the optimal path and the moving speed specified by the movement information.
具体在本实施例中,由于在第一客户端通过网络将移动信息发送给服务器、服务器检测移动信息是否符合规定以及服务器向第二客户端发送移动信息的过程会造成时间延迟,因此待每个第二客户端(除所述第一客户端以外的所有客户端)接收到服务器发送的移动信息之后,每个第二客户端均需将当前时间(即计算时间差时的时间)与所述移动信息包括的起始移动时间作差,将作差得到的差值作为时间差。Specifically in this embodiment, since the process of the first client sending the movement information to the server through the network, the server detecting whether the movement information complies with the regulations, and the server sending the movement information to the second client will cause a time delay, after each second client (all clients except the first client) receives the movement information sent by the server, each second client needs to subtract the current time (i.e., the time when the time difference is calculated) from the starting movement time included in the movement information, and use the difference obtained as the time difference.
进而,除所述第一客户端以外的每个客户端都能够根据计算出的时间差、所述移动速度和所述当前起始网格确定在当前时间所述指定人物应该处于的网格;每个第二客户端均将指定人物调整到在当前时间所述指定人物应该处于的网格上。这样,对于每个第二客户端按照移动信息控制指定人物移动的实现方式,具体为:控制所述指定人物从调整的网格(在当前时间所述指定人物应该处于的网格)开始,按照所述移动信息指定的最优路径移动,且在沿该最优路径移动时按照所述移动信息指定的移动速度移动。Furthermore, each client other than the first client can determine the grid that the designated person should be located in at the current time based on the calculated time difference, the movement speed, and the current starting grid; and each second client adjusts the designated person to the grid that the designated person should be located in at the current time. Thus, each second client controls the movement of the designated person according to the movement information by specifically controlling the designated person to move starting from the adjusted grid (the grid that the designated person should be located in at the current time) along the optimal path specified by the movement information, and while moving along the optimal path, moves at the movement speed specified by the movement information.
这样,实现在同一时刻由每个客户端和服务器分别控制的指定人物所在的网格都一样,实现客户端与服务器对指定人物的同步控制和准确控制。In this way, the grids where the designated characters controlled by each client and server at the same time are located are the same, thereby achieving synchronous and accurate control of the designated characters by the client and server.
图4示出了本发明实施例提供的在线游戏中的人物移动方法的第四种交互流程,为了便于描述,仅示出了与本发明实施例相关的部分。FIG4 shows a fourth interactive process of the method for moving a character in an online game provided by an embodiment of the present invention. For ease of description, only the part related to the embodiment of the present invention is shown.
在本发明一实施例中,如图4所示,所述在线游戏中的人物移动方法还包括:In one embodiment of the present invention, as shown in FIG4 , the method for moving a character in an online game further includes:
A1,在所述客户端控制所述指定人物沿所述最优路径移动的过程中,如果所述服务器检测到所述指定人物即将到达的网格已调整为所述已标记的动态阻挡网格,则所述服务器向所述客户端发送停止指令;A1, during the process of the client controlling the designated character to move along the optimal path, if the server detects that the grid that the designated character is about to arrive at has been adjusted to the marked dynamic blocking grid, the server sends a stop instruction to the client;
A2,所述客户端在接收到所述服务器发送的停止指令时,控制所述指定人物停止在所述停止指令指定的网格上,所述停止指令指定的网格为:沿所述最优路径移动时与所述即将到达的网格相邻的上一网格。A2. When the client receives the stop instruction sent by the server, it controls the designated character to stop at the grid specified by the stop instruction. The grid specified by the stop instruction is: the previous grid adjacent to the grid to be reached when moving along the optimal path.
具体地,由于一个客户端可能控制一个或多个游戏人物移动,同时每个客户端都可以同时控制游戏人物移动,这样在同一时间段内,都会存在大量的游戏人物在移动。因此,待每个客户端均具有控制指定人物移动的移动信息之后,在控制指定人物沿最优路径移动的过程中,随着时间的推移,可能有别的游戏人物较先占有优选路径上的某个动态阻挡网格;进而,如果在指定人物沿最优路径移动的过程中,所述指定人物即将到达某个网格时,该指定人物即将到达的网格刚好被别的游戏人物占据,这时每个客户端仍然会控制指定人物继续移动;但与此同时,服务器在检测到该指定人物即将到达的网格刚好被别的游戏人物占据时会生成停止指令,通过该停止指令告诉每个客户端:调整指定人物在当前时间应该处于的网格。Specifically, since a client may control the movement of one or more game characters, and each client can control the movement of game characters simultaneously, a large number of game characters will be moving within the same time period. Therefore, after each client has the movement information for controlling the movement of a specific character, while controlling the specific character to move along the optimal path, as time passes, another game character may occupy a dynamic blocking grid on the optimal path first. Furthermore, if, while the specific character is moving along the optimal path and is about to reach a grid, the grid the specific character is about to reach happens to be occupied by another game character, each client will continue to control the specific character to move. However, at the same time, upon detecting that the grid the specific character is about to reach is occupied by another game character, the server will generate a stop command, which tells each client to adjust the grid the specific character should be in at the current time.
进而在客户端接收到服务器发送的停止指令后,客户端将指定人物调整到所述服务器记录的所述指定人物应该处于的网格,即客户端将指定人物调整到:在所述最优路径上,沿最优路径移动时与所述即将到达的网格相邻的上一网格,该上一网格和即将到达的网格为沿最优路径控制指定人物移动时会依次经过的两个网格。Then, after the client receives the stop instruction sent by the server, the client adjusts the designated character to the grid where the designated character should be located as recorded by the server, that is, the client adjusts the designated character to: on the optimal path, the previous grid adjacent to the grid to be reached when moving along the optimal path, and the previous grid and the grid to be reached are two grids that will be passed in sequence when controlling the movement of the designated character along the optimal path.
在本发明一实施例中,所述第一客户端获取包括有已标记的动态阻挡网格的游戏地图的这一步骤具体为:In one embodiment of the present invention, the step of the first client obtaining the game map including the marked dynamic blocking grid is specifically as follows:
所述第一客户端获取包括有静态阻挡网格、所述动态阻挡网格和无阻挡网格的游戏地图,所述动态阻挡网格还包括未标记的动态阻挡网格,所述未标记的动态阻挡网格为未存在有游戏人物的动态阻挡网格;The first client obtains a game map including static blocking grids, the dynamic blocking grids, and unblocked grids, wherein the dynamic blocking grids further include unmarked dynamic blocking grids, and the unmarked dynamic blocking grids are dynamic blocking grids in which no game characters exist;
所述第一客户端建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径的这一步骤具体为:The step of the first client establishing an optimal path from the current starting grid where the designated character is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grids is specifically as follows:
所述第一客户端建立从所述当前起始网格出发、经过所述游戏地图包含的所述无阻挡网格和/或所述未标记的动态阻挡网格、到达所述目的网格的最优路径。The first client establishes an optimal path starting from the current starting grid, passing through the unobstructed grids and/or the unmarked dynamic blocking grids included in the game map, and reaching the destination grid.
需说明的是,对于游戏地图中的静态阻挡网格,游戏人物是不能移动到该静态阻挡网格上的。通常,使用一个或多个静态阻挡网格设置树木、门、墙等物体。相对地,某些游戏地图还具有无阻挡网格,该无阻挡网格可支持多个游戏人物同时移动到上面;通常,使用一个或多个无阻挡网格设置稻草、浅水等场景。It should be noted that game characters cannot move onto static blocking grids in a game map. Typically, one or more static blocking grids are used to create objects like trees, doors, and walls. Conversely, some game maps also have unobstructed grids that support multiple game characters moving onto simultaneously; typically, one or more unobstructed grids are used to create scenes like straw or shallow water.
进而在本实施例中,第一客户端确定最优路径(当前起始网格与目的网格的距离最短的路径)时,不但会考虑所述已标记的动态阻挡网格(即最优路径不能经过所述已标记的动态阻挡网格),还会考虑静态阻挡网格(即最优路径不能经过所述静态阻挡网格);从而生成的最优路径仅会经过所述无阻挡网格和/或所述未标记的动态阻挡网格。Furthermore, in this embodiment, when the first client determines the optimal path (the path with the shortest distance between the current starting grid and the destination grid), it not only considers the marked dynamic blocking grids (i.e., the optimal path cannot pass through the marked dynamic blocking grids), but also considers static blocking grids (i.e., the optimal path cannot pass through the static blocking grids); thus, the generated optimal path only passes through the unblocked grids and/or the unmarked dynamic blocking grids.
通常,外挂软件等恶意软件在对游戏人物进行操控时会尝试经过静态阻挡网格和/或所述已标记的动态阻挡网格,至此为了防止外挂软件等恶意软件操控游戏人物进行不符合规定的移动,服务器会在接收到第一客户端发送的移动信息时,检测移动信息包括的最优路径是否包含有所述静态阻挡网格和/或所述已标记的动态阻挡网格,如果包含有,则向第一客户端发送调整指令;第一客户端通过该调整指令将指定人物移回服务器所记录的当前起始网格。Typically, plug-in software and other malicious software will attempt to pass through the static blocking grid and/or the marked dynamic blocking grid when manipulating the game character. In order to prevent plug-in software and other malicious software from manipulating the game character to move in a manner that does not comply with regulations, the server will detect whether the optimal path included in the movement information sent by the first client contains the static blocking grid and/or the marked dynamic blocking grid when receiving the movement information sent by the first client. If so, an adjustment instruction will be sent to the first client; the first client will move the specified character back to the current starting grid recorded by the server through the adjustment instruction.
在本发明一优选实施中,所述第一客户端建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径的这一步骤具体为:In a preferred embodiment of the present invention, the step of the first client establishing an optimal path from the current starting grid where the designated character is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grids is specifically as follows:
所述第一客户端根据最近距离算法建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最短路径,将建立的最短路径作为所述最优路径。The first client establishes the shortest path from the current starting grid where the designated character is located to the destination grid specified by the movement instruction according to the shortest distance algorithm, and does not pass through the marked dynamic blocking grid, and uses the established shortest path as the optimal path.
具体地,确定从所述当前起始网格到所述目的网格的最优路径所使用的算法为距离最近算法,通过距离最近算法能够得到从所述当前起始网格到所述目的网格的最短路径。在本实施例中,使用距离最近算法确定从所述当前起始网格到所述目的网格的最优路径时,还需考虑所述已标记的动态阻挡网格;这样,对于通过距离最近算法确定出的最优路径,在保证该确定出的最优路径不会经过所述已标记的动态阻挡网格的基础上,该确定出的最优路径是从所述当前起始网格到所述目的网格的最短路径。Specifically, the algorithm used to determine the optimal path from the current starting grid to the destination grid is a shortest distance algorithm, which can be used to obtain the shortest path from the current starting grid to the destination grid. In this embodiment, when using the shortest distance algorithm to determine the optimal path from the current starting grid to the destination grid, the marked dynamic blocking grids are also considered. Thus, for the optimal path determined by the shortest distance algorithm, the optimal path is the shortest path from the current starting grid to the destination grid, while ensuring that the determined optimal path does not pass through the marked dynamic blocking grids.
在本发明另一实施例中,所述在线游戏中的人物移动方法还包括:In another embodiment of the present invention, the method for moving a character in an online game further includes:
所述服务器在预设时间内预设次数检测到由第三客户端发送的移动信息中包含有控制第三游戏人物移动的错误路径,断开与所述第三客户端的游戏连接,生成将所述第三游戏人物调整到所述服务器记录的所述第三游戏人物所在的网格的位置调整指令,所述客户端包括所述第三客户端,所述错误路径经过所述静态阻挡网格和/或所述已标记的动态阻挡网格;The server detects, within a preset time and a preset number of times, that movement information sent by a third client includes an erroneous path for controlling movement of a third game character, disconnects the game connection with the third client, and generates a position adjustment instruction for adjusting the third game character to a grid where the third game character is located, the client including the third client, and the erroneous path passes through the static blocking grid and/or the marked dynamic blocking grid;
所述服务器向除所述第三客户端以外的所有客户端群发所述位置调整指令,以使得除所述第三客户端以外的客户端将所述第三游戏人物调整到所述服务器记录的网格上。The server collectively sends the position adjustment instruction to all clients except the third client, so that the clients except the third client adjust the third game character to the grid recorded by the server.
在本实施例中,在第三客户端使用外挂软件等恶意软件操控第三游戏人物时,通常第三客户端会发送包含有恶意的错误路径的移动信息给服务器,以期望服务器在检测该移动信息是否符合规定时检测通过。In this embodiment, when the third client uses malware such as plug-in software to control the third game character, the third client usually sends movement information containing malicious error paths to the server, hoping that the server will pass the detection when checking whether the movement information complies with regulations.
但是,服务器会统计在预设时间内接收到每个客户端发送的移动信息,并且会进一步统计哪些客户端发送了包含有错误路径的移动信息。由于游戏人物通常都处于移动状态,所以在某个客户端仅发送预设次数以内的错误路径时,服务器不会判定该客户端使用了外挂软件等恶意软件,而直接将包含有错误路径的移动信息丢弃,并向该包含有错误路径的移动信息的客户端发送调整指令以将该移动信息指定的游戏人物调整回服务器记录的网格(按照该错误路径移动前处于的网格)。However, the server will count the movement information received from each client within a preset time, and will further count which clients have sent movement information containing an incorrect path. Since the game character is usually in a mobile state, if a client only sends an incorrect path within a preset number of times, the server will not determine that the client has used malicious software such as cheat software, but will directly discard the movement information containing the incorrect path and send an adjustment instruction to the client containing the movement information containing the incorrect path to adjust the game character specified by the movement information back to the grid recorded by the server (according to the grid it was in before moving along the incorrect path).
一旦在预设时间内接收到同一客户端发送的包含有错误路径的移动信息的次数达到预设次数,服务器将该客户端作为第三客户端,将包含有错误路径的移动信息所指定的游戏人物作为第三游戏人物,断开与所述第三客户端的游戏连接。同时,服务器生成位置调整指令,向除第三客户端以外的所有客户端发送位置调整指令;除第三客户端以外的每个客户端在接收到该位置调整指令时,将所述第三游戏人物调整到所述服务器记录的所述第三游戏人物所在的网格(按照该错误路径移动前处于的网格)。If the server receives movement information containing an incorrect path from the same client a predetermined number of times within a predetermined time period, it will designate the client as a third client, designate the game character specified by the movement information containing the incorrect path as the third game character, and disconnect the game connection with the third client. Simultaneously, the server generates a position adjustment instruction and sends it to all clients except the third client. Upon receiving the position adjustment instruction, each client except the third client adjusts the third game character to the grid recorded by the server (the grid it was in before the incorrect path movement).
在本发明一优选实施例中,所述第一客户端生成包括所述指定人物、所述最优路径、起始移动时间和移动速度的移动信息的这一步骤具体包括:In a preferred embodiment of the present invention, the step of the first client generating the movement information including the designated person, the optimal path, the starting movement time, and the movement speed specifically includes:
所述第一客户端生成包括所述当前起始网格、所述指定人物、所述最优路径、所述起始移动时间和所述移动速度的移动信息;The first client generates movement information including the current starting grid, the designated person, the optimal path, the starting movement time, and the movement speed;
所述服务器接收所述第一客户端发送的移动信息的步骤之后,所述在线游戏中的人物移动方法还包括:After the step of the server receiving the movement information sent by the first client, the method for moving a character in an online game further includes:
所述服务器检测所述移动信息中记录的所述当前起始网格与所述服务器记录的所述指定人物所在的网格之间是否间隔有所述静态阻挡网格和/或所述已标记的动态阻挡网格;The server detects whether there is a static blocking grid and/or a marked dynamic blocking grid between the current starting grid recorded in the movement information and the grid where the designated person is located recorded by the server;
如果间隔有所述静态阻挡网格和/或所述已标记的动态阻挡网格,则所述服务器生成将所述指定人物调整到所述服务器记录的所述指定人物所在的网格的指定调整指令,向所述客户端群发所述指定调整指令,以使得所有客户端将所述指定人物调整到所述服务器记录的网格上。If there is the static blocking grid and/or the marked dynamic blocking grid in between, the server generates a specified adjustment instruction to adjust the designated character to the grid where the designated character is located as recorded by the server, and sends the specified adjustment instruction to the client in a group so that all clients adjust the designated character to the grid recorded by the server.
在本实施例中,具体在服务器接收到所述第一客户端发送的移动信息之后,在服务器向除所述第一客户端以外的所有客户端群发所述移动信息之前,如果检测到指定人物于起始移动时间在第一客户端所处于的网格与所述服务器记录的该指定人物所在的网格存在差别,并且还检测出所述当前起始网格与所述服务器记录的网格之间存有至少一个所述静态阻挡网格和/或至少一个所述已标记的动态阻挡网格,所述服务器生成用于调整指定人物所在网格的指定调整指令,向客户端群发该指定调整指令。In this embodiment, specifically after the server receives the movement information sent by the first client, before the server mass-sends the movement information to all clients except the first client, if it is detected that the grid where the designated person is located at the first client at the starting movement time is different from the grid where the designated person is located recorded by the server, and it is also detected that there is at least one static blocking grid and/or at least one marked dynamic blocking grid between the current starting grid and the grid recorded by the server, the server generates a designated adjustment instruction for adjusting the grid where the designated person is located, and mass-sends the designated adjustment instruction to the client.
这样,每个客户端均会按照指定调整指令,将所述指定人物调整到所述服务器记录的所述指定人物所在的网格上,以保证每个客户端控制放入指定人物所在的网格与服务器所记录的网格一致,实现客户端和服务器对游戏人物的同步控制。In this way, each client will adjust the designated character to the grid where the designated character is located recorded by the server according to the specified adjustment instructions, so as to ensure that the grid where the designated character is placed by each client is consistent with the grid recorded by the server, thereby realizing synchronous control of the game character by the client and the server.
更优选的是,所述服务器接收所述第一客户端发送的移动信息的步骤之后,所述在线游戏中的人物移动方法还包括:More preferably, after the step of the server receiving the movement information sent by the first client, the method for moving a character in an online game further comprises:
所述服务器计算所述移动信息中记录的所述当前起始网格与所述服务器记录的所述指定人物所在的网格之间间隔的网格的个数,判断计算的个数是否大于间隔阈值;The server calculates the number of grids between the current starting grid recorded in the movement information and the grid where the designated person is located, and determines whether the calculated number is greater than an interval threshold;
如果计算的个数大于或等于所述间隔阈值,则所述服务器生成所述指定调整指令,向所述客户端群发所述指定调整指令。If the calculated number is greater than or equal to the interval threshold, the server generates the designated adjustment instruction and sends the designated adjustment instruction to the client in a group.
具体在服务器接收到所述第一客户端发送的移动信息之后,在服务器向除所述第一客户端以外的所有客户端群发所述移动信息之前,如果检测到指定人物于起始移动时间在第一客户端所处于的网格与所述服务器记录的该指定人物所在的网格存在差别,并且还检测出所述当前起始网格与所述服务器记录的网格之间至少存在有间隔阈值的网格,所述服务器生成用于调整指定人物所在网格的指定调整指令,向客户端群发该指定调整指令。Specifically, after the server receives the movement information sent by the first client, before the server mass-sends the movement information to all clients except the first client, if it is detected that the grid where the designated person is located at the first client at the starting movement time is different from the grid where the designated person is located recorded by the server, and it is also detected that there is at least a grid with an interval threshold between the current starting grid and the grid recorded by the server, the server generates a designated adjustment instruction for adjusting the grid where the designated person is located, and mass-sends the designated adjustment instruction to the clients.
这样,每个客户端均会按照指定调整指令,将所述指定人物调整到所述服务器记录的所述指定人物所在的网格上,以保证每个客户端控制指定人物所在的网格与服务器所记录的网格一致,进而保证服务器和客户端分别控制指定人物沿最优路径移动后能够到达同一目的网格,实现客户端和服务器对指定人物的同步控制。In this way, each client will adjust the designated character to the grid where the designated character is located recorded by the server according to the specified adjustment instructions, so as to ensure that the grid where the designated character is controlled by each client is consistent with the grid recorded by the server, thereby ensuring that the server and the client can reach the same destination grid after controlling the designated character to move along the optimal path respectively, thereby realizing the synchronous control of the designated character by the client and the server.
本领域普通技术人员还可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以在存储于一计算机可读取存储介质中,所述的存储介质,包括ROM/RAM、磁盘、光盘等。Those skilled in the art can also understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes ROM/RAM, disk, CD-ROM, etc.
需要说明的是,本发明实施例提供的在线游戏中的人物移动系统与本发明实施例提供的在线游戏中的人物移动方法相互适用。It should be noted that the character movement system in an online game provided by the embodiment of the present invention and the character movement method in an online game provided by the embodiment of the present invention are applicable to each other.
图5示出了本发明实施例提供的在线游戏中的人物移动系统的系统架构,为了便于描述,仅示出了与本发明实施例相关的部分。本实施例提供的在线游戏中的人物移动系统,如图5所示,包括服务器1,还包括至少两个客户端2,即,在线游戏中的人物移动系统为由该服务器1和上述客户端2组成的游戏系统。Figure 5 illustrates the system architecture of a character movement system for an online game according to an embodiment of the present invention. For ease of description, only the portions relevant to the embodiment are shown. The character movement system for an online game according to this embodiment, as shown in Figure 5, includes a server 1 and at least two clients 2. Specifically, the character movement system for an online game is a gaming system comprised of the server 1 and the clients 2.
需说明的是,所述客户端2包括第一客户端21和第二客户端;图6示出了本发明实施例提供的包括有第一客户端21的在线游戏中的人物移动系统的系统架构,为了便于描述,仅示出了与本发明实施例相关的部分。It should be noted that the client 2 includes a first client 21 and a second client; Figure 6 shows the system architecture of the character movement system in an online game provided by an embodiment of the present invention including the first client 21. For ease of description, only the parts related to the embodiment of the present invention are shown.
所述第一客户端21,用于接收针对指定人物的移动指令,所述移动指令包括目的网格;The first client 21 is configured to receive a movement instruction for a designated character, wherein the movement instruction includes a destination grid;
所述第一客户端21,还用于获取包括已标记的动态阻挡网格的游戏地图,所述已标记的动态阻挡网格为存在游戏人物的动态阻挡网格;The first client 21 is further configured to obtain a game map including marked dynamic blocking grids, wherein the marked dynamic blocking grids are dynamic blocking grids in which game characters exist;
所述第一客户端21,还用于建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最优路径,生成包括所述指定人物和所述最优路径的移动信息,向所述服务器1发送所述移动信息;The first client 21 is further configured to establish an optimal path from the current starting grid where the designated person is located to the destination grid specified by the movement instruction without passing through the marked dynamic blocking grids, generate movement information including the designated person and the optimal path, and send the movement information to the server 1;
所述服务器1,用于接收所述第一客户端21发送的移动信息,向除所述第一客户端21以外的所有客户端2群发所述移动信息。The server 1 is configured to receive the mobile information sent by the first client 21 and group-send the mobile information to all clients 2 except the first client 21 .
在本发明一实施例中,所述第一客户端21,还具体用于获取包括有静态阻挡网格、所述动态阻挡网格和无阻挡网格的游戏地图,所述动态阻挡网格还包括未标记的动态阻挡网格,所述未标记的动态阻挡网格为未存在有游戏人物的动态阻挡网格;In one embodiment of the present invention, the first client 21 is further configured to obtain a game map comprising static blocking grids, the dynamic blocking grids, and unblocked grids, wherein the dynamic blocking grids further comprise unmarked dynamic blocking grids, wherein the unmarked dynamic blocking grids are dynamic blocking grids in which no game characters exist;
所述第一客户端21,还具体用于建立从所述当前起始网格出发、经过所述游戏地图包含的所述无阻挡网格和/或所述未标记的动态阻挡网格、到达所述目的网格的最优路径。The first client 21 is further specifically configured to establish an optimal path starting from the current starting grid, passing through the unobstructed grids and/or the unmarked dynamic blocking grids included in the game map, and reaching the destination grid.
在本发明一实施例中,所述客户端2包括第三客户端22;图7示出了本发明实施例提供的包括有第三客户端22的在线游戏中的人物移动系统的系统架构,为了便于描述,仅示出了与本发明实施例相关的部分。In one embodiment of the present invention, the client 2 includes a third client 22; Figure 7 shows the system architecture of the character movement system in the online game provided by the embodiment of the present invention including the third client 22. For ease of description, only the part related to the embodiment of the present invention is shown.
所述服务器1,还用于在预设时间内预设次数检测到由所述第三客户端22发送的移动信息中包含有控制第三游戏人物移动的错误路径,断开与所述第三客户端22的游戏连接,生成将所述第三游戏人物调整到所述服务器1记录的所述第三游戏人物所在的网格的位置调整指令,所述错误路径经过所述静态阻挡网格和/或所述已标记的动态阻挡网格,还用于向除所述第三客户端22以外的所有客户端2群发所述位置调整指令,以使得除所述第三客户端22以外的客户端2将所述第三游戏人物调整到所述服务器1记录的网格上。The server 1 is further configured to detect a wrong path for controlling the movement of a third game character in the movement information sent by the third client 22 a preset number of times within a preset time, disconnect the game connection with the third client 22, and generate a position adjustment instruction for adjusting the third game character to the grid where the third game character is located recorded by the server 1, wherein the wrong path passes through the static blocking grid and/or the marked dynamic blocking grid. The server 1 is further configured to group-send the position adjustment instruction to all clients 2 except the third client 22, so that the clients 2 except the third client 22 adjust the third game character to the grid recorded by the server 1.
在本发明一实施例中,所述第一客户端21,还用于根据最近距离算法建立从所述指定人物所在的当前起始网格到所述移动指令指定的目的网格的、且不经过所述已标记的动态阻挡网格的最短路径,将建立的最短路径作为所述最优路径。In one embodiment of the present invention, the first client 21 is further used to establish the shortest path from the current starting grid where the specified person is located to the destination grid specified by the movement instruction based on the shortest distance algorithm, and does not pass through the marked dynamic blocking grid, and uses the established shortest path as the optimal path.
在本发明一实施例中,所述第一客户端21,还用于在建立所述最优路径之后,生成包括所述指定人物、所述最优路径、起始移动时间和移动速度的移动信息,根据生成的移动信息控制所述指定人物移动。In one embodiment of the present invention, the first client 21 is further configured to generate movement information including the designated person, the optimal path, the starting movement time, and the movement speed after establishing the optimal path, and control the movement of the designated person according to the generated movement information.
在本发明一实施例中,所述客户端2还包括第二客户端,所述第二客户端为:除所述第一客户端21以外的所有客户端2;In one embodiment of the present invention, the client 2 further includes a second client, and the second client is: all clients 2 except the first client 21;
所述第二客户端,用于在接收到所述服务器1发送的移动信息之后,计算当前时间与所述移动信息包括的起始移动时间的时间差;The second client is configured to calculate, after receiving the movement information sent by the server 1, a time difference between the current time and the start movement time included in the movement information;
所述第二客户端,还用于根据计算出的时间差、所述移动速度和所述当前起始网格,将所述指定人物从所述当前起始网格调整到所述当前时间应在所述最优路径上的网格;The second client is further configured to adjust the designated person from the current starting grid to a grid that should be on the optimal path at the current time based on the calculated time difference, the moving speed, and the current starting grid;
所述第二客户端,还用于控制所述指定人物从调整的网格开始按照所述移动信息指定的最优路径和按照所述移动信息指定的移动速度移动。The second client is further configured to control the designated character to move starting from the adjusted grid along the optimal path and at the moving speed specified by the movement information.
在本发明一实施例中,所述第一客户端21,还具体用于生成包括所述当前起始网格、所述指定人物、所述最优路径、所述起始移动时间和所述移动速度的移动信息;In one embodiment of the present invention, the first client 21 is further configured to generate movement information including the current starting grid, the designated person, the optimal path, the starting movement time, and the movement speed;
所述服务器1,还用于检测所述移动信息中记录的所述当前起始网格与所述服务器1记录的所述指定人物所在的网格之间是否间隔有所述静态阻挡网格和/或所述已标记的动态阻挡网格,如果间隔有所述静态阻挡网格和/或所述已标记的动态阻挡网格,则生成将所述指定人物调整到所述服务器1记录的所述指定人物所在的网格的指定调整指令,向所述客户端2群发所述指定调整指令,以使得所有客户端2将所述指定人物调整到所述服务器1记录的网格上。The server 1 is further configured to detect whether there is a static blocking grid and/or a marked dynamic blocking grid between the current starting grid recorded in the movement information and the grid where the designated person is located recorded by the server 1. If there is a static blocking grid and/or a marked dynamic blocking grid, a designated adjustment instruction is generated to adjust the designated person to the grid where the designated person is located recorded by the server 1, and the designated adjustment instruction is sent to the client 2 in a group so that all the client 2 adjust the designated person to the grid recorded by the server 1.
在本发明一实施例中,所述服务器1,还用于计算所述移动信息中记录的所述当前起始网格与所述服务器1记录的所述指定人物所在的网格之间间隔的网格的个数,判断计算的个数是否大于间隔阈值,如果计算的个数大于或等于所述间隔阈值,则生成所述指定调整指令,向所述客户端2群发所述指定调整指令。In one embodiment of the present invention, the server 1 is further used to calculate the number of grids between the current starting grid recorded in the movement information and the grid where the designated person is located recorded by the server 1, and determine whether the calculated number is greater than the interval threshold. If the calculated number is greater than or equal to the interval threshold, the designated adjustment instruction is generated and the designated adjustment instruction is sent to the client 2 in a group.
在本发明一实施例中,所述服务器1,还用于在所述客户端2控制所述指定人物沿所述最优路径移动的过程中,如果检测到所述指定人物即将到达的网格已调整为所述已标记的动态阻挡网格,则向所述客户端2发送停止指令;In one embodiment of the present invention, the server 1 is further configured to, during the process in which the client 2 controls the movement of the designated person along the optimal path, send a stop instruction to the client 2 if it is detected that the grid that the designated person is about to arrive at has been adjusted to the marked dynamic blocking grid;
所述客户端2,还用于在接收到所述服务器1发送的停止指令时,控制所述指定人物停止在所述停止指令指定的网格上,所述停止指令指定的网格为:沿所述最优路径移动时与所述即将到达的网格相邻的上一网格。The client 2 is further configured to control the designated character to stop at the grid specified by the stop instruction upon receiving the stop instruction sent by the server 1, wherein the grid specified by the stop instruction is the previous grid adjacent to the grid to be reached when moving along the optimal path.
以上内容是结合具体的优选实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。对于本发明所属技术领域的普通技术人员来说,在不脱离本发明构思的前提下做出若干等同替代或明显变型,而且性能或用途相同,都应当视为属于本发明由所提交的权利要求书确定的专利保护范围。The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art to which the present invention relates, any equivalent substitutions or obvious modifications that do not depart from the concept of the present invention and have the same performance or use should be deemed to fall within the scope of patent protection of the present invention as determined by the submitted claims.
Claims (18)
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410216094.6A CN103957224B (en) | 2014-05-21 | 2014-05-21 | Personage's moving method and system in a kind of game on line |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK1199574A1 HK1199574A1 (en) | 2015-07-03 |
| HK1199574B true HK1199574B (en) | 2020-07-31 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10556180B2 (en) | Method and system of moving character in online game | |
| US11266913B2 (en) | Method and apparatus for synchronously displaying game content and storage medium | |
| CN112156455B (en) | Game display method and device, electronic equipment and storage medium | |
| US10773168B2 (en) | Temporary game control by user simulation following loss of active control | |
| US11050823B2 (en) | Method, apparatus, and system for playing scene animation | |
| JP6904952B2 (en) | How to determine the motion trajectory and user equipment | |
| CN107998654B (en) | Acceleration adjustment method and device, storage medium, and electronic device | |
| US10702771B2 (en) | Multi-user game system with character-based generation of projection view | |
| US20210322864A1 (en) | In-Game Display Control Method and Apparatus, Storage Medium, Processor, and Terminal | |
| KR101707639B1 (en) | Methods and apparatus for hiding latency in network multiplayer games | |
| US11786827B2 (en) | Map switching method and apparatus, storage medium, and device | |
| JP2022517560A (en) | Target control methods and devices, electronic devices and computer programs | |
| CN114344902B (en) | Virtual object interaction method and device, electronic equipment and storage medium | |
| CN112870701A (en) | Control method and device of virtual role | |
| JP2007075607A (en) | Guard condition system | |
| HK1199574B (en) | Method and system for moving character in online game | |
| Shi et al. | Dead reckoning using play patterns in a simple 2D multiplayer online game | |
| CN108415749B (en) | Display processing method, medium, device and computing equipment | |
| JP7752310B2 (en) | Program, information processing method and information processing device | |
| KR101540461B1 (en) | Simulation method and system using senario | |
| KR20140086258A (en) | Apparatus and method of helping online gmae users to cast skill by cooperative play | |
| JP2025043093A (en) | PROGRAM, INFORMATION PROCESSING APPARATUS, AND INFORMATION PROCESSING METHOD | |
| CN116943156A (en) | Method, device, equipment and storage medium for processing signals in game | |
| CN113750539A (en) | Game detection method and device, electronic equipment and computer-readable storage medium | |
| KR20150006917A (en) | Simulation method and system for real-time broadcasting |