14.1 C
New York
Thursday, May 29, 2025

Software program engineering: Widespread strategies to limit person motion and stop different objects from appearing in video games


I’m an online and cell software programmer. In comparison with the supply code of net and cell functions, I have never seen a lot recreation programming supply code.

In net functions, all components are basically static (?) and solely the logic of the pressed buttons is executed. If a button press triggers a community request, a loading indicator (spin) is exhibited to keep away from person interplay and the community request is waited by way of a callback.

On this approach, patterns referred to as callback hell and async/await are used to attend for different processes, show loading indicators to dam person enter, and make sure that conflicting operations are usually not executed concurrently.

Nonetheless, in recreation growth, I not often see examples of callback or asynchronous/wait use. Video games function in a recreation loop the place the replace technique for all objects is known as each body. To attain related habits to net functions, it might be essential to cease calling refresh and disable person enter.

Associated:
What’s the distinction between set_process and flag administration?

For instance, within the following Japanese article, the code makes use of an enum to manage state:
https://2dgames.jp/godot4-memory/

Article supply code:
https://github.com/syun77/gd_memory

With this strategy, one would find yourself with an enormous enum and a single recreation object managing it (Recreation Grasp? / Recreation Controller?), resulting in what I name “fats enum hell”.

This contradicts the ideas of “Divide and conquer” and “Small is gorgeous” (Unix philosophy). What patterns are generally utilized in recreation growth to deal with such conditions?


In video games, ready for community communication just isn’t as frequent as in net functions. As an alternative, frequent issues contain ready for victory animations (Results), ready for a card to be turned over, and so on.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles