CN112954020A - Game control method, device, electronic equipment and computer-readable storage medium - Google Patents

Game control method, device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN112954020A
CN112954020A CN202110121058.1A CN202110121058A CN112954020A CN 112954020 A CN112954020 A CN 112954020A CN 202110121058 A CN202110121058 A CN 202110121058A CN 112954020 A CN112954020 A CN 112954020A
Authority
CN
China
Prior art keywords
game
cloud
input
input event
game engine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110121058.1A
Other languages
Chinese (zh)
Other versions
CN112954020B (en
Inventor
陶鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110121058.1A priority Critical patent/CN112954020B/en
Publication of CN112954020A publication Critical patent/CN112954020A/en
Application granted granted Critical
Publication of CN112954020B publication Critical patent/CN112954020B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)
  • Selective Calling Equipment (AREA)

Abstract

The embodiment of the invention provides a game control method, a game control device, electronic equipment and a computer readable storage medium. Wherein, the game control method comprises the following steps: receiving an operation instruction sent by a remote terminal through the cloud input plug-in; converting the operating instruction into an input event recognizable to the game engine by using the cloud input plug-in; sending the input event to the game engine to trigger a game response according to the main cycle frequency of the game engine. Different game versions do not need to be developed for different remote terminals, the cloud game environment is flexibly adapted to run, zero invasion is realized in terms of the codes of the game, and the game development cost is reduced.

Description

Game control method, device, electronic equipment and computer-readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a game control method, a game control device, electronic equipment and a computer-readable storage medium.
Background
The cloud game has solved the hardware requirement of game operation to the equipment used by the user, and more users can obtain more game experiences.
However, for developers, the same game needs to develop not only a version that runs independently on a device used by a user, but also a version that can adapt to a cloud environment, which undoubtedly increases the game development cost and reduces the access willingness of game developers.
Disclosure of Invention
In view of the above, the present invention provides a game control method, an apparatus, an electronic device and a computer-readable storage medium.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, the present invention provides a game control method applied to a cloud server, where the cloud server is in communication connection with a remote terminal, a game engine and a cloud input plug-in are run in the cloud server, and the game control method includes: receiving an operation instruction sent by a remote terminal through the cloud input plug-in; converting the operating instruction into an input event recognizable to a game engine by using the cloud input plug-in; sending the input event to the game engine to trigger a game response according to the main cycle frequency of the game engine.
Compared with the prior art, the game control method provided by the embodiment receives and converts the operation instruction sent by the remote terminal by using the cloud input plug-in, and gets through the data interaction barrier between the game engine and the remote terminal, so that a game developer does not need to change the game version particularly aiming at the cloud game environment to adapt to the cloud game environment to run, and the game control method has zero invasion in terms of the code of the game. Unnecessary labor force is saved, and game development cost is reduced.
In an alternative embodiment, the step of sending the input event to the game engine according to a main cycle frequency of the game engine comprises: writing the input event into a cache region through the cloud input plug-in; monitoring a pace notification issued by the game engine according to the corresponding main cycle frequency; and under the condition of intercepting the pace notification, the input event is taken out of a buffer area by utilizing the cloud input plug-in module and is sent to the game engine.
Understandably, the game engine and the cloud input plug-in are different in corresponding thread, and operation crash may occur due to different operation frequencies in the data transmission process of the game engine and the cloud input plug-in.
The game control method provided by the embodiment avoids the problem of operation breakdown caused by inconsistent data communication paces among different threads in the use process of the cloud input plug-in by caching the input event and matching with the pace notification issued by the interception game engine.
In an alternative embodiment, the cloud input plugin includes a write thread and a read thread; the step of writing the input event into a cache area through the cloud input plugin comprises: writing the input event into a cache region by using the write-in thread under the condition that the write-in thread acquires a synchronous lock; the step of fetching the input event from the cache using the cloud input plugin comprises: fetching the input event from a cache with the read thread if the read thread senses the cadence notification and acquires the synchronization lock.
The embodiment avoids the conflict between the writing thread and the reading thread by using the synchronous lock, and ensures the reliable operation of the cloud input plug-in.
In an alternative embodiment, the game control method comprises the steps of: capturing the generated game picture data and audio data under the condition of triggering game response; and sending the captured game picture data and audio data to the remote terminal.
In a second aspect, the present invention provides a game control method, applied to a remote terminal, where the remote terminal is in communication connection with a cloud server, and a game engine and a cloud input plug-in are run in the cloud server, where the game control method includes: sensing the operation of a user and generating a corresponding operation instruction; sending the operation instruction to the cloud input plugin in the cloud server so that the cloud input plugin converts the operation instruction into an input event which can be identified by a game engine, and sending the input event to the game engine according to the main cycle frequency of the game engine to trigger game response; receiving response data fed back by the cloud server; the response data is game picture data and audio data generated after the game response is triggered.
In a third aspect, the present invention provides a game control apparatus applied to a cloud server, where the cloud server is in communication connection with a remote terminal, a game engine and a cloud input plug-in are operated in the cloud server, and the game control apparatus includes: the first receiving module is used for receiving an operation instruction sent by a remote terminal through the cloud input plug-in; the conversion module is used for converting the operation instruction into an input event which can be recognized by a game engine by utilizing the cloud input plug-in; and the first sending module is used for sending the input event to the game engine according to the main cycle frequency of the game engine so as to trigger game response.
In an alternative embodiment, the first transmitting module comprises: the writing sub-module is used for writing the input event into a cache region through the cloud input plug-in; the monitoring submodule is used for monitoring the pace notification issued by the game engine according to the corresponding main cycle frequency; and the reading sub-module is used for taking the input event out of the cache region by using the cloud input plug-in module and sending the input event to the game engine under the condition of intercepting the pace notification.
In a fourth aspect, the present invention provides a game control apparatus applied to a remote terminal, where the remote terminal is in communication connection with a cloud server, a game engine and a cloud input plug-in are run in the cloud server, and the game control apparatus includes: the generating module is used for sensing the operation of a user and generating a corresponding operation instruction;
the second sending module is used for sending the operating instruction to the cloud input plugin in the cloud server so that the cloud input plugin converts the operating instruction into an input event which can be identified by a game engine, and sends the input event to the game engine according to the main cycle frequency of the game engine to trigger game response;
the second receiving module is used for receiving response data fed back by the cloud server; the response data is game picture data and audio data generated after the game response is triggered.
In a fifth aspect, the present invention provides an electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement the method of any one of the preceding embodiments.
In a sixth aspect, the invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of the preceding embodiments.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 conceptually illustrates an operation example diagram of a conventional game.
Figure 2 conceptually illustrates an example graph of the operation of a cloud game.
Fig. 3 is a diagram illustrating an example application scenario provided by an embodiment of the present invention.
Fig. 4 is a flowchart illustrating steps of a game control method applied to a cloud server according to an embodiment of the present invention.
Fig. 5 shows a flowchart of sub-steps of step S103 according to an embodiment of the present invention.
Fig. 6 conceptually illustrates a sub-step implementation of step S103 shown in fig. 5.
FIG. 7a conceptually illustrates an exemplary diagram of a write thread and a read thread requesting a synchronized lock.
FIG. 7b conceptually illustrates an exemplary diagram of a write thread getting a synchronization lock.
FIG. 7c conceptually illustrates an example diagram of a read thread getting a synchronized lock.
Fig. 8 is a schematic diagram illustrating a game control device applied to a cloud server according to an embodiment of the present invention.
Fig. 9 is a flowchart illustrating steps of a game control method applied to a remote terminal according to an embodiment of the present invention.
Fig. 10 is a schematic diagram of a game control device applied to a remote terminal according to an embodiment of the present invention.
Fig. 11 shows a schematic diagram of an electronic device provided by an embodiment of the invention.
Icon: 100-an electronic device; 110-a memory; 120-a processor; 130-a communication module; 300-a game control device; 301-a first receiving module, 302-a converting module; 303-a first sending module; 400-a game control device; 401-a generation module; 402-a second sending module; 403-second receiving module.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Conventional games are very dependent on the control terminal being manipulated by the player. As shown in fig. 1, generally, the control terminal needs to download data packages required for game operation, such as a game installation package, a game client, and the like, from a game server. After the traditional game is installed in the control terminal, the game engine, scene picture and audio data in the control terminal are controlled. The game engine can drive all the logics involved in the running of the transmission game, and the logics can be, but are not limited to, human-computer interaction logic, scene conversion triggering logic and audio data playing triggering logic. In the running process of the traditional game, a player operates the control terminal, generates an operation instruction which can be identified by the traditional game according to the man-machine interaction logic, and determines a game scene picture to be rendered and audio data to be played by using the operation instruction in combination with the scene conversion triggering logic and the audio data playing triggering logic. And the control terminal renders the game scene picture and plays the audio data.
Obviously, the conventional game needs to occupy a large amount of system resources of the control terminal during the running period of the control terminal, such as system memory, CPU resources, GPU resources, and the like. Obviously, the use and running effect of the game are directly influenced by the quality of the hardware environment of the control terminal. For example, when the memory of the control terminal is insufficient, a problem that the game cannot be installed may occur. For another example, in the case of a shortage of GPU resources of the control terminal, a problem of game screen stuttering may occur. For another example, in the case of shortage of CPU resources of the control terminal, a problem of game jamming may occur.
As the quality of a conventional game is improved, the more system resources are occupied by the game, the higher the requirement on the hardware environment which can be provided by the control device is, and the game playing cost of the player is increased.
Aiming at the defects of the traditional game, the cloud game is produced by chance. As shown in fig. 2, the data packets required for game execution only need to be installed in the cloud server. The hardware environment required for game execution is provided by the cloud server. The cloud server is provided with a game engine, scene pictures and audio data. When the control terminal requests the cloud server to play a specified game, the cloud server creates a game instance corresponding to the specified game. Therefore, after the player can operate the control terminal to generate an operation instruction, the operation instruction is sent to the cloud server, the operation instruction is directly processed by the game engine in the cloud server, the game scene picture and the played audio data required to be presented by the game at the moment are determined according to the processing result of the game engine, and the determined game scene picture and the audio data required to be played are fed back to the control terminal used by the user, so that the control terminal only needs to render the game scene picture and play the audio data.
Therefore, the dependence of game running on the hardware condition of the control terminal is solved, more players can participate in the game, and high-quality game experience is obtained.
However, for game developers, on one hand, due to the diversity of control terminals, the same traditional game often needs to be developed into multiple versions, such as Windows, iOS, Android, and the like. On the other hand, game developers need to develop a game version which is directly installed on the control terminal, and also need to develop a game version which is adapted to the cloud server. Undoubtedly increase a great deal of development cost and reduce the access willingness of game developers.
In order to solve the above problem, embodiments of the present invention provide a game control method, device and computer-readable storage medium.
The game control method and device provided by the embodiment of the invention can be applied to the scene shown in FIG. 3. The plurality of remote terminals can access the cloud server through a network, and the cloud server can be in communication connection with the game server and the account database. Therefore, the cloud server can acquire the data packet required by game running from the game server and assist the user in logging in the game.
The remote terminal may be an intelligent terminal operated by a player. The remote terminal may include a mobile phone, a wearable device, a smart mobile device, a virtual reality device, an augmented reality device, a game console, or the like, and may also be a tablet computer, a laptop computer, a computer, or the like.
The cloud server may be, but is not limited to, a standalone server, a distributed deployment of computers, and the like. It is to be understood that the server is not limited to a physical server, and may also be a virtual machine on the physical server, a virtual machine built on a cloud platform, or the like, which can provide the same function as the server or the virtual machine.
When any remote terminal responds to the operation of a user and applies for playing a specified game to the cloud server, the cloud server identifies player information (including various account numbers, passwords and the like capable of playing games) associated with the remote terminal in a mode of inquiring the account database.
If the playable game comprises the specified game and the game account number and the password exist, a game instance corresponding to the specified game is created, the game is logged in according to the game account number and the password, the game progress is obtained, the scene picture and the audio data corresponding to the game progress are captured and then sent to the remote terminal, and therefore the remote terminal can render the obtained scene picture corresponding to the game progress and play the corresponding audio data.
If the playable game comprises the specified game but the game account number and the password do not exist, creating a game instance corresponding to the specified game, sending a login interface of the specified game to the remote terminal, and rendering by the remote terminal.
And if the playable games do not comprise the specified games, feeding back the registration interface of the specified games to the remote terminal for rendering. And creates a game instance of the specified game after the remote terminal completes registration.
In either case, after the game instance is created, a cloud input plugin can be configured for the game instance. And establishing data interaction between the remote terminal and the game instance in the cloud server through the cloud input plug-in.
Referring to fig. 4, fig. 4 shows a game control method according to an embodiment of the present invention. The game control method may be applied to a cloud server, and as shown in fig. 4, the game control method may include the following steps:
and S101, receiving an operation instruction sent by the remote terminal through the cloud input plug-in.
The operation instruction is generated by the remote terminal sensing the operation of the player. For example, the operation command may be a movement command for controlling the movement of a game character by a player operating a direction key of the remote terminal. For another example, the operation instruction may be a click operation of the target object by the player operating the selection space of the remote terminal.
The cloud input plug-in is essentially a program code serving for a game engine, and an operation process is correspondingly created in a cloud server in the operation process of the cloud input plug-in, and the operation process can be composed of a plurality of threads with different functions.
The game engine described above may be understood as a kernel that drives the running of the game. The game developer can develop the game according to the selected development engine, so as to obtain the game engine of the developed game. For example, the development engine may be a ghost 4 engine, UNITY, GODOT.
The cloud server is provided with a communication interface for communicating with the remote terminal. The process corresponding to the cloud input plug-in includes an instruction receiving thread, and the instruction receiving thread can monitor whether the corresponding communication interface receives an operation instruction sent by the remote terminal.
Thus, in some embodiments, the operation instruction is obtained in the event that the instruction receiving thread senses that the communication interface receives the operation instruction sent by the remote terminal.
And step S102, converting the operation instruction into an input event which can be recognized by a game engine by utilizing the cloud input plug-in.
The process corresponding to the cloud input plug-in may further include a conversion thread for data conversion. In other words, the cloud input plugin can implement conversion of an operation instruction into an input event recognizable by a game engine.
It will be appreciated that even though the operation instructions having the same meaning are generated by different types of remote terminals, the movement instructions created by the handset of the android system and the movement instructions created by the handset of the IOS system are different and the same, for example.
In the related art, different game versions can be developed only for different types of remote terminals. In addition, different versions of the game are installed on the cloud server, and the game still needs to be changed. Such a workload is very large.
In the embodiment of the invention, the cloud input plug-in can be directly utilized to convert different types of operation instructions into the input events which can be recognized by the game engine, so that the development of corresponding versions of games for different types of remote terminals is avoided, and the development workload is reduced.
In some embodiments, after the instruction receiving thread receives the operation instruction, the instruction receiving thread forwards the operation instruction to the conversion thread, the conversion thread identifies the type of the remote terminal generating the operation instruction, and the operation instruction is converted into the input event according to the conversion relationship between the type of the remote terminal and the data recognizable by the game engine.
Step S103, according to the main cycle frequency of the game engine, the input event is sent to the game engine to trigger game response.
The main cycle frequency may be a data processing frequency of a process corresponding to the game engine. In some embodiments, it may be an input event passively received by the game engine sent by the cloud input plugin. Of course, since the processes corresponding to the game engine and the cloud input plug-in are different, and the data processing steps (i.e., the data processing frequencies) of different processes are also different, if the cloud input plug-in delivers the input event to the game engine according to the data processing frequency corresponding to the cloud input plug-in, the game engine may be crashed. Therefore, in the embodiment of the invention, the cloud input plug-in push input events also need to be pushed according to the main cycle frequency of the game engine.
In some embodiments, as shown in fig. 5, the step S103 may include the following sub-steps:
and a substep S103-1, writing the input event into a cache region through the cloud input plug-in.
In some embodiments, the cloud input plugin further includes a write thread, and the write thread writes the input event into the cache area after receiving the input event converted by the conversion thread, so as to avoid data loss caused by long-time failure of sending the input event to the game engine.
And a substep S103-2 of intercepting the pace notification issued by the game engine according to the corresponding main cycle frequency.
In some embodiments, the game engine may send notifications to the outside world in each cycle interval according to its own main cycle frequency. The process of the cloud input plug-in also comprises a listening thread which is used for listening the pace notification sent out by the game engine.
And a substep S103-3, taking the input event out of the buffer by using the cloud input plug-in unit and sending the input event to the game engine under the condition of intercepting the pace notification.
In some embodiments, the cloud input plug-in further includes a read thread, and after the listening thread listens for the pace notification, the existing input event in the cache is read out and sent to the game engine. Therefore, the problem of inconsistent pace of data communication among different processes is ensured, and the crash of a game engine is avoided.
For example, as shown in fig. 6, after the conversion thread converts the operation instruction into the input event, the input event is written into the buffer area in a first-in first-out manner, and arranged at the end of the existing input event in the buffer area. After the listening thread listens the pace notification issued by the game engine, the reading thread reads the input events stored in the cache region in sequence and pushes the input events to the game engine.
However, since the writing and reading of incoming events in the buffer is done by two different threads, data collisions are avoided.
In some embodiments, referring to fig. 7a, 7b, and 7c, the sub-step S103-1 may be writing the input event to the cache by the write thread if the write thread acquires the synchronization lock. The sub-step S103-3 may be to use the read thread to fetch the input event from the buffer if the read thread senses that the snoop thread is notified of the cadence and acquires the synchronization lock.
The synchronous lock represents the use right of the cache region, and the synchronous lock can only be given to one thread at the same time, so that the cache region can only be processed by one thread at the same time. And under the condition that different threads request synchronous locks, the synchronous locks are sequentially used for all the threads according to the principle of first-come first-obtained. For example, the write thread requests to acquire the synchronous lock before the read thread, the synchronous lock is firstly used by the write thread, and the synchronous lock is then used by the read thread after the write thread releases the synchronous lock.
The trigger condition for the write thread to request acquisition of the synchronization lock may be acquisition of an input event from the conversion thread. The trigger condition for the read thread to request acquisition of the synchronization lock may be that the listening thread is notified of the cadence.
In some embodiments, the game control method comprises the steps of:
(1) and under the condition of triggering game response, capturing the generated game picture data and audio data.
It will be appreciated that different input events or combinations of different input events may trigger different responses of the game. Different game responses may accompany changes in game screens, playback of audio data. For example, the input event represents that the game character is operated to move, and the displacement result is that the game character moves to the side of a brook, the game picture is gradually changed into a picture with the brook, and meanwhile, the sound of the brook flowing is generated.
In some embodiments, it may be game screen data and audio data that the crawling game engine receives an input event until a response to the input event is completed.
(2) And sending the captured game picture data and audio data to a remote terminal.
In some embodiments, the captured game picture data and audio data are sent to the remote terminal through the video and audio push component.
In order to perform the corresponding steps in the above embodiments and various possible manners, an implementation manner of the game control device 300 is given below. Further, referring to fig. 8, fig. 8 is a functional block diagram of a game control apparatus 300 according to an embodiment of the present invention, where the game control apparatus 300 is applied to a cloud server. It should be noted that the basic principle and the generated technical effects of the game control device 300 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and corresponding contents in the above embodiments may be referred to. The game control device 300 includes: a first receiving module 301, a converting module 302 and a first sending module 303.
The first receiving module 301 is configured to receive an operation instruction sent by a remote terminal through the cloud input plug-in.
In some embodiments, the above step S101 may be performed by the first receiving module 301.
A conversion module 302, configured to convert the operation instruction into an input event recognizable by the game engine by using a cloud input plugin.
In some embodiments, the above step S102 may be performed by the conversion module 302.
A first sending module 303, configured to send the input event to the game engine according to a main cycle frequency of the game engine to trigger a game response.
In some embodiments, the above step S103 may be performed by the first sending module 303.
In some embodiments, the first sending module 303 includes:
and the writing sub-module is used for writing the input event into a cache region through the cloud input plug-in.
And the interception submodule is used for intercepting the pace notification issued by the game engine according to the corresponding main cycle frequency.
And the reading sub-module is used for taking the input event out of the cache region by using the cloud input plug-in module and sending the input event to the game engine under the condition of intercepting the pace notification.
Referring to fig. 9, fig. 9 shows a game control method according to an embodiment of the present invention. The game control method may be applied to a remote terminal, and as shown in fig. 9, the game control method may include the steps of:
step S201 senses the operation of the user and generates a corresponding operation instruction.
In some embodiments, the operation triggered by the player can be sensed through a hardware control key on the remote terminal, and a corresponding operation instruction is generated according to a mapping relation between the operation and the operation instruction which is established in advance. The operation triggered by the player can also be sensed through a software control key displayed on the remote terminal, and a corresponding operation instruction is generated according to the mapping relation between the operation and the operation instruction which is established in advance.
Step S202, sending the operation instruction to a cloud input plug-in the cloud server.
In some embodiments, the operating instructions are converted to input events recognizable to a game engine by a cloud input plugin, and the input events are sent to the game engine according to the main cycle frequency of the game engine to trigger game responses. The principle of the method can refer to the game control method applied to the cloud server, and is not described herein again.
Step S203, receiving response data fed back by the cloud server.
In some embodiments, the response data is game image data and audio data generated after the game response is triggered.
In order to perform the corresponding steps in the above-described embodiments and various possible manners, an implementation manner of the game control device 400 is given below. Further, referring to fig. 10, fig. 10 is a functional block diagram of a game control apparatus 400 according to an embodiment of the present invention, wherein the game control apparatus 400 is applied to a remote terminal. It should be noted that the basic principle and the generated technical effects of the game control device 400 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and corresponding contents in the above embodiments may be referred to. The game control device 400 includes: a generating module 401, a second transmitting module 402 and a second receiving module 403.
The generating module 401 is configured to sense an operation of a user and generate a corresponding operation instruction.
In some embodiments, the step S201 described above may be performed by the generation module 401.
A second sending module 402, configured to send the operation instruction to the cloud input plugin in the cloud server.
In some embodiments, the step S202 may be performed by the second sending module 402.
A second receiving module 403, configured to receive response data fed back by the cloud server; the response data is game picture data and audio data generated after the game response is triggered.
In some embodiments, the step S203 may be performed by the second receiving module 403.
Fig. 11 is a block diagram of an electronic device 100 according to an embodiment of the present invention. The electronic device 100 may be a device to which the game control method and apparatus are applied, that is, in some embodiments, the electronic device 100 may refer to a cloud server. In other embodiments, the electronic device 100 may refer to a remote terminal.
As shown in fig. 11, the electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120 and the communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The memory 110 is used to store programs or data. The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 120 is used to read/write data or programs stored in the memory 110 and perform corresponding functions.
The communication module 130 is configured to establish a communication connection between the electronic device 100 and another communication terminal through the network, and to transmit and receive data through the network.
It should be understood that the structure shown in fig. 11 is only a schematic structural diagram of the electronic device 100, and the electronic device 100 may also include more or fewer components than those shown in fig. 11, or have a different configuration than that shown in fig. 11. The components shown in fig. 11 may be implemented in hardware, software, or a combination thereof.
Alternatively, the modules may be stored in the memory 110 shown in fig. 11 in the form of software or Firmware (Firmware) or be fixed in an Operating System (OS) of the electronic device 100, and may be executed by the processor 120 in fig. 11. Meanwhile, data, codes of programs, and the like required to execute the above-described modules may be stored in the memory 110.
In summary, embodiments of the present invention provide a game control method, an apparatus, an electronic device, and a computer-readable storage medium. Wherein, the game control method comprises the following steps: receiving an operation instruction sent by a remote terminal through the cloud input plug-in; converting the operating instruction into an input event recognizable to the game engine by using the cloud input plug-in; sending the input event to the game engine to trigger a game response according to the main cycle frequency of the game engine. The data interaction barrier between the game engine and the remote terminal is opened, a game developer does not need to change the game version particularly aiming at the cloud game environment so as to adapt to the operation in the cloud game environment, and zero invasion is realized in terms of the code of the game. Unnecessary labor force is saved, and game development cost is reduced.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A game control method is applied to a cloud server, the cloud server is in communication connection with a remote terminal, a game engine and a cloud input plug-in are operated in the cloud server, and the game control method comprises the following steps:
receiving an operation instruction sent by a remote terminal through the cloud input plug-in;
converting the operating instruction into an input event recognizable to the game engine by using the cloud input plug-in;
sending the input event to the game engine to trigger a game response according to the main cycle frequency of the game engine.
2. The game control method of claim 1, wherein the step of sending the input event to the game engine according to a main cycle frequency of the game engine comprises:
writing the input event into a cache region through the cloud input plug-in;
monitoring a pace notification issued by the game engine according to the corresponding main cycle frequency;
and under the condition of intercepting the pace notification, the input event is taken out of a buffer area by utilizing the cloud input plug-in module and is sent to the game engine.
3. The game control method according to claim 2, wherein the cloud input plug-in includes a write thread and a read thread;
the step of writing the input event into a cache area through the cloud input plugin comprises: writing the input event into a cache region by using the write-in thread under the condition that the write-in thread acquires a synchronous lock;
the step of fetching the input event from the cache using the cloud input plugin comprises:
fetching the input event from a cache with the read thread if the read thread senses the cadence notification and acquires the synchronization lock.
4. The game control method according to claim 1, characterized in that the step of the game control method comprises:
capturing the generated game picture data and audio data under the condition of triggering game response;
and sending the captured game picture data and audio data to the remote terminal.
5. A game control method is applied to a remote terminal, the remote terminal is in communication connection with a cloud server, a game engine and a cloud input plug-in are operated in the cloud server, and the game control method comprises the following steps:
sensing the operation of a user and generating a corresponding operation instruction;
sending the operation instruction to the cloud input plugin in the cloud server so that the cloud input plugin converts the operation instruction into an input event which can be identified by the game engine, and sending the input event to the game engine according to the main cycle frequency of the game engine to trigger game response;
receiving response data fed back by the cloud server; the response data is game picture data and audio data generated after the game response is triggered.
6. A game control device is applied to a cloud server, the cloud server is in communication connection with a remote terminal, a game engine and a cloud input plug-in are operated in the cloud server, and the game control device comprises:
the first receiving module is used for receiving an operation instruction sent by a remote terminal through the cloud input plug-in;
the conversion module is used for converting the operation instruction into an input event which can be recognized by a game engine by utilizing the cloud input plug-in;
and the first sending module is used for sending the input event to the game engine according to the main cycle frequency of the game engine so as to trigger game response.
7. The game control apparatus of claim 6, wherein the first transmission module comprises:
the writing sub-module is used for writing the input event into a cache region through the cloud input plug-in;
the monitoring submodule is used for monitoring the pace notification issued by the game engine according to the corresponding main cycle frequency;
and the reading sub-module is used for taking the input event out of the cache region by using the cloud input plug-in module and sending the input event to the game engine under the condition of intercepting the pace notification.
8. A game control device is applied to a remote terminal, the remote terminal is in communication connection with a cloud server, a game engine and a cloud input plug-in are operated in the cloud server, and the game control device comprises:
the generating module is used for sensing the operation of a user and generating a corresponding operation instruction;
the second sending module is used for sending the operating instruction to the cloud input plugin in the cloud server so that the cloud input plugin converts the operating instruction into an input event which can be identified by a game engine, and sends the input event to the game engine according to the main cycle frequency of the game engine to trigger game response;
the second receiving module is used for receiving response data fed back by the cloud server; the response data is game picture data and audio data generated after the game response is triggered.
9. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to perform the method of any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202110121058.1A 2021-01-28 2021-01-28 Game control method, device, electronic equipment and computer-readable storage medium Active CN112954020B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110121058.1A CN112954020B (en) 2021-01-28 2021-01-28 Game control method, device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110121058.1A CN112954020B (en) 2021-01-28 2021-01-28 Game control method, device, electronic equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN112954020A true CN112954020A (en) 2021-06-11
CN112954020B CN112954020B (en) 2022-09-06

Family

ID=76238968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110121058.1A Active CN112954020B (en) 2021-01-28 2021-01-28 Game control method, device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN112954020B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140157246A1 (en) * 2012-12-04 2014-06-05 Zynga Inc. Building cross-platform asynchronous games
CN105354040A (en) * 2015-12-10 2016-02-24 网易(杭州)网络有限公司 Method, device and terminal for twin-engine game built-in toolbar
CN106095666A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus
CN109152955A (en) * 2015-12-30 2019-01-04 索尼互动娱乐美国有限责任公司 User in cloud game saves data management
CN111214828A (en) * 2020-01-03 2020-06-02 北京小米移动软件有限公司 Game running method, device, equipment, medium and cloud game platform
CN111803940A (en) * 2020-01-14 2020-10-23 厦门雅基软件有限公司 Game processing method and device, electronic equipment and computer-readable storage medium
CN111803928A (en) * 2020-06-09 2020-10-23 厦门雅基软件有限公司 Running method and device of cloud game service and computer readable storage medium
CN112206513A (en) * 2020-09-17 2021-01-12 江苏视博云信息技术有限公司 Control method, information interaction method, device and system of cloud game

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140157246A1 (en) * 2012-12-04 2014-06-05 Zynga Inc. Building cross-platform asynchronous games
CN105354040A (en) * 2015-12-10 2016-02-24 网易(杭州)网络有限公司 Method, device and terminal for twin-engine game built-in toolbar
CN109152955A (en) * 2015-12-30 2019-01-04 索尼互动娱乐美国有限责任公司 User in cloud game saves data management
CN106095666A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus
CN111214828A (en) * 2020-01-03 2020-06-02 北京小米移动软件有限公司 Game running method, device, equipment, medium and cloud game platform
CN111803940A (en) * 2020-01-14 2020-10-23 厦门雅基软件有限公司 Game processing method and device, electronic equipment and computer-readable storage medium
CN111803928A (en) * 2020-06-09 2020-10-23 厦门雅基软件有限公司 Running method and device of cloud game service and computer readable storage medium
CN112206513A (en) * 2020-09-17 2021-01-12 江苏视博云信息技术有限公司 Control method, information interaction method, device and system of cloud game

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李紫阳: "基于Android平台的视频客户端的设计与实现", 《中国优秀硕士学位论文全文数据库》 *

Also Published As

Publication number Publication date
CN112954020B (en) 2022-09-06

Similar Documents

Publication Publication Date Title
US10348795B2 (en) Interactive control management for a live interactive video game stream
US9454282B2 (en) Sending application input commands over a network
US8903897B2 (en) System and method for providing interactive content to non-native application environments
JP6469313B2 (en) Information processing method, terminal, and computer storage medium
CN103618701A (en) Method and browser for performing webgame interaction
US20230285854A1 (en) Live video-based interaction method and apparatus, device and storage medium
CN111901695B (en) Video content interception method, device and equipment and computer storage medium
CN115065684B (en) Data processing method, apparatus, device and medium
CN112911320A (en) Live broadcast method and device, computer equipment and storage medium
CN112354176A (en) Cloud game implementation method, cloud game implementation device, storage medium and electronic equipment
CN103618766A (en) Method and webgame interaction server for performing webgame interaction
JP2023513915A (en) Screen update method, apparatus, computer device and computer program
CN111918098A (en) Video processing method and device, electronic equipment, server and storage medium
CN114584821B (en) Video processing method and device
CN112738633A (en) Video playing method, device, equipment and readable storage medium
CN113868575A (en) Webpage same-screen method and system
CN112954020B (en) Game control method, device, electronic equipment and computer-readable storage medium
CN113556568A (en) Cloud application program operation method, system, device and storage medium
CN116842205A (en) Game playback method, device and storage medium
CN111921204B (en) Control method, device, equipment and storage medium of cloud application program
CN111104183B (en) Application program running method and device, electronic equipment and storage medium
CN114344918A (en) Data recording method, device, equipment, medium and product based on virtual scene
CN113342350A (en) Software platform capable of recording, playing and running codes in real time based on B/S architecture
CN113730923A (en) Anchor input operation sharing and displaying method and device based on live game
CN112584237A (en) Image erasing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant