A Guide On API (Sort of) Theory (WIP)

This guide shows you how to have clean code that is easy to change.

This concept classifies devices into a few different categories.

Functional Devices

These devices affect the player. Some examples are like team switchers or respawners.

Computational Devices

These devices do not affect the player. Some examples are triggers or counters.

The Theory

Keep in mind that this only matters when your devices get very complicated. So this theory states that device systems are comprised of systems of computational devices. The logic in the computational devices then triggers a functional device that affects the player. Functional devices should never do any computation.

It also states that the game should never directly tell the functional devices to do something. Like a player’s action should never DIRECTLY trigger something affecting the player. With better maps, there is almost always something that does some computations and then affects the player based on those.

Systems of computational devices should never affect the player (other than maybe scoring). These use logic gates and other things to return a value. This value is then interpreted (inside the computational device system still) and broadcast on a channel that triggers another computational system or just a functional device.

This makes it so that multiple different systems can do the same thing without using multiple of the same exact device. This also makes it easier to add, let’s say, an ingame lobby, or deactivating a system at will.


ok I hope this gets finished because I want to know and understand this because it looks important


Cool Guide!

This is a good guide. Maybe those systems can make some concepts easier.

Nice Theory!

“it’s just a theory, a game theory…”