If I invent a game, then program it into a computer game, and then apply for a patent, what should I do and how much will it cost?

According to the relevant provisions of the patent law: intellectual activity rules do not grant patents.

A game you invented belongs to the rules of intellectual activities and does not solve technical problems in real life.

As for the programmed computer games, according to the patent examination guide,

Provisions on the examination of applications for patents for inventions involving computer programs.

If your patent application involves only one algorithm or mathematical calculation rule,

Or the program itself, or the rules and methods of the game, etc. In essence, the claim only relates to the rules and methods of intellectual activities and does not belong to the object of patent protection.

No patent right can be granted.

It is suggested that computer software should be registered to protect its intellectual achievements in the form of software copyright. Software registration won't cost a few dollars.