How to do it (in simplified steps)
- Setup your game in a VM or docker like system
- Make a website (or application) that will render a stream of video from the cloud game
- Make that website send the player commands to the cloud game
- Manipulate the game according to the player commands
- Repeat 4 until the game session is done
Why you don't want to stream (most games)
Look at reviews of a service called "OnLive" which did this concept almost a decade ago...
In order for the players view to update they need to do something with controls but then that input needs to be sent to the cloud (taking time) that then needs to be processed by the actual game (ok, but every game needs todo that), then the image needs to be compressed and sent to the player (with takes more time)...
Player input -----------------> Process input --------------------> view update
(0ms) (1-30ms) (0ms)
Player input -> Send to cloud -> Process input -> compress & send -> view update
(0ms) (1-1000ms) (1-30ms) (1-1000ms) (1-30ms)
Now if your building a strategy game where almost everything is slow moving and the important game controls stay in the same place you might be able to get away with it since drops in frame rate aren't as noticeable.
Your server might have the worlds best connection to the internet, but what about your players what about the people in places where internet is just terrible (like rural areas or Australia) they have limited upload/download speeds. What happens when your trying to watch a video and can't download it as fast as your watching it? It buffers... you don't want that for your game since it needs to be constantly updating. So you can go and compress the video down to something which uses less bandwidth, this is like reducing the quality of a youtube video so it doesn't have to buffer.
Great! but now the game looks like crap. Certain Ui elements like text will become unreadable and if your game requires keen eyes in order to see enemies which are far away the player likely won't see them. This depends on your game again, maybe you're making something that is extremely easy to see and play at low resolution? like MiniMetro. Alternatively you could build your game around having scalable UI elements and gameplay systems which take into account the current visibility of the player.
So you have your game and it plays perfectly for you and your friends. Someone comes along who has an excellent connection however their packet loss is extremely high resulting in 50% of upload packets being lost. How will your game cope when it only receives half the input data? or only intermittently gets input commands? Are you prepared for a player who is clicking the play button and nothing happens?
There isn't much you can do about this other than letting the player know that your not receiving all of their commands. You might be able to resolve this by connecting them to a different data center but in the end the problem could be with their ISP, Computer, your server, your datacenter infrastructure, etc.
Cloud computing prices
Since your in the cloud your going to need computers. Luckily you have plenty of providers to choose from Azure, AWS, Google Cloud. But the majority of VMs that they have available to rent don't have GPUs! Not even integrated GPUs. In order to render you either have to do it on the CPU (like downloading a picture via dial-up speeds) or pay for a special GPU instance.
GPU VMs come in 2 flavours:
The built-in GPU instances are expensive costing $15.84 per hour which doesn't sound like a lot until you realize that you may need multiple instances and they may be running 24/7. I personally don't know much about remote GPU instances, the GPU is located in a seperate computer and your VM accesses it remotely so I imagine that latency will be even higher for those, but they are a lot cheaper costing $0.05 per hour for the cheapest.
Maybe you don't care about money, know something I don't or have the ability to get a deal with a cloud provider/Nvidia Grid.
There are many more examples of possible problems but ultimately if you think that this doesn't really affect you... go ahead and make the game but study how packets work and look at ALL the edge cases that the designers of TCP have overcome and how every edge case could affect the game/user experience.
Good luck with your game, if it succeeds it may become a case study for the gaming industry on how to stream games.