An engine is a specific set of systems that are designed to simplify the most commonly used game functions. It provides better game portability. A well-designed engine can easily be ported to another library or even to another platform. You can write it yourself, but only with some knowledge of programming.
Instructions
Step 1
Choose which game you want to create so that it is interesting and popular. To do this, study the market (even if you are making a game that is not for sale, study the market anyway - it is always nice when your creation is in demand).
Step 2
Don't try to make a game with very realistic graphics and complete freedom of action. State the requirements. Maybe it will be simplicity, requirements for the number of characters, performance or plot features.
Step 3
Create a hierarchy of functions using a top-down approach. At some point, you will no longer be able to continue with the top-down architecture, but not because you have done everything. It's just that the intricacies of the implementation will give you their own rules, so continue creating the hierarchy in a bottom-up way, i.e. proceed from the peculiarities of the API and adjust the interface of a higher level.
Step 4
Start designing. Higher functions consist of calling lower ones (i.e. they are practically implemented at the stage of creating a hierarchy). Design the playback of the lowest functions in pseudocode. Don't write C pseudocode in Russian only. It should be at least 2 times shorter and descriptively embody the algorithm, answer the question not “how”, but “what” and should allow you to focus on the most important things. Create tests for the lower functions and try to prove the correctness of the program.
Step 5
Start the coding step. Implement the lower functions and tests and get a working program. Use pseudocode for comments and stick to some specific style of formatting. It is recommended to do public planning, because outsiders will help you identify flaws and mistakes that you yourself did not notice. Thus, you will significantly reduce your own work time and improve the output.