Game play generation and running method and device, electronic equipment and storage medium

文档序号:1176229 发布日期:2020-09-22 浏览:18次 中文

阅读说明:本技术 游戏的剧本生成及运行方法、装置、电子设备和存储介质 (Game play generation and running method and device, electronic equipment and storage medium ) 是由 任明星 于 2020-06-12 设计创作,主要内容包括:本申请提供了一种游戏的剧本生成及运行方法、装置、电子设备和存储介质。涉及计算机技术领域,用于解决现有技术中剧本生成效率低的问题。本申请中,生成的剧本中包括目标控件的图像特征,并由图像特征作为目标控件的业务逻辑的触发条件。在运行剧本时可通过图像特征的匹配操作来检测目标控件的位置。无论用户终端设备的分辨率为多少,都可以通过目标控件的位置,执行关于该目标控件的业务逻辑。因此,无需对同一游戏的每个分辨率分别执行重复的演示操作来生成不同的剧本,能够简化用户操作提高剧本的生成效率。(The application provides a method and a device for generating and running a script of a game, an electronic device and a storage medium. Relate to computer technical field for solve the problem that script generation is inefficient among the prior art. In the application, the generated scenario includes the image characteristics of the target control, and the image characteristics are used as the trigger conditions of the business logic of the target control. The position of the target control can be detected through the matching operation of the image characteristics when the script is run. No matter the resolution of the user terminal equipment is, the business logic related to the target control can be executed through the position of the target control. Therefore, it is not necessary to perform repeated presentation operations for each resolution of the same game to generate different scenarios, and it is possible to simplify user operations and improve generation efficiency of scenarios.)

1. A scenario generation method of a game, the scenario being generated according to a demonstration operation on a plurality of target game pages in the game, comprising:

for any target game page, responding to demonstration operation of a target control in the target game page, and identifying image features of the target control from the target game page;

in the scenario, the image feature is associated as a trigger condition for business logic related to the target control.

2. The method of claim 1, wherein the identifying the image feature of the target control from the target game page comprises:

taking the operation position of the demonstration operation on the target game page as a reference, and acquiring the target area from the target game page according to the position information of the target area and the size information of the target area, which are associated with the business logic;

and identifying a template image of the target control from the target area as the image feature.

3. The method of claim 2, wherein the identifying the template image of the target control from the target region comprises:

performing edge detection on the target area to acquire edge contour information in the target area;

identifying at least one convex hull from the edge contour information;

respectively fitting out the circumscribed polygon of each convex hull;

and matching the template image of the target control according to the fitted external polygon.

4. The method of claim 3, wherein matching the template image of the target control according to the fitted circumscribed polygon comprises:

respectively obtaining template characteristics of each circumscribed polygon, wherein the template characteristics comprise one or a combination of the size of each circumscribed polygon and image characteristics in each circumscribed polygon;

determining a target circumscribed polygon meeting a preset condition according to the obtained template characteristics;

and intercepting the image content in the target circumscribed polygon from the target game page as the template image.

5. The method of claim 3, wherein prior to said separately fitting out the bounding polygon for each convex hull, the method further comprises:

and filtering out the convex hull meeting the filtering condition, wherein the filtering condition is that the operation position of the demonstration operation is positioned outside the convex hull.

6. A scenario running method of a game, the scenario being generated according to a demonstration operation on a plurality of target game pages in the game, wherein, for any target game page, an image feature of a target control in the target game page is included in the scenario, and the image feature is a trigger condition of business logic related to the target control, the method comprising:

when the game is run to any one target game page, acquiring the image characteristics of a target control in the target game page according to the scenario;

matching the image features in the target game page;

and if the image characteristics are matched in the target game page, executing business logic related to the target control.

7. The method of claim 6, wherein executing business logic associated with the target control if the image feature is matched in the target game page comprises:

determining the position of the target control according to the position matched with the image characteristics in the target game page;

generating a control operation event aiming at the target control according to the position of the target control;

and executing the game operation corresponding to the control operation event.

8. The method according to claim 6, wherein for any one of the target game pages, the scenario further includes position information of a target area and size information of the target area, and the performing matching operation on the image features in the target game page includes:

intercepting the target area from the target game page according to the position information of the target area and the size information of the target area;

and performing matching operation on the image characteristics in the target area.

9. The method of any of claims 6-8, wherein the image feature is a template image of the target control.

10. A scenario generation apparatus of a game, the scenario being generated according to a demonstration operation on a plurality of target game pages in the game, comprising:

the image feature extraction module is used for responding to demonstration operation of a target control in any target game page and identifying the image feature of the target control from the target game page;

and the association module is used for associating the image characteristics as the trigger conditions of the business logic related to the target control in the script.

11. A scenario running device of a game, wherein the scenario is generated according to a demonstration operation on a plurality of target game pages in the game, and for any target game page, an image feature of a target control in the target game page is included in the scenario, and the image feature is a trigger condition of business logic related to the target control, the device comprising:

the image characteristic acquisition module is used for acquiring the image characteristics of the target control in the target game page according to the script when the game runs to any target game page;

the matching module is used for performing matching operation on the image characteristics in the target game page;

and the execution module is used for executing the business logic related to the target control if the image characteristics are matched in the target game page.

12. An electronic device, comprising:

at least one processor, and

a memory communicatively coupled to the at least one processor;

wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the method of any one of claims 1-9 by executing the instructions stored by the memory.

13. A storage medium, characterized in that the storage medium stores a computer program which, when run on a computer, causes the computer to perform the method according to any one of claims 1-9.

33页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种业务处理方法、装置、设备及计算机存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类