Glossary

Atomic

The Atomic specifier indicates to various Engine systems that a struct should be serialized as a single unit as opposed to multiple units. (The term atomic is used from time to time in software engineering to refer to a transaction that, like an atom, cannot - or rather, should not - be split.) At a high level, serialization is the process of taking complex objects (like structs) and breaking them down into bite-size pieces that can be stored or transmitted. Those bite-size pieces can then be used to recreate complex objects through the reverse process, called deserialization.

Structs are serialized when they are replicated in a multiplayer game, and this is where the Atomic specifier is most useful. By default, the Engine may replicate parts of a struct at different times, especially when the struct is very large. (Example) This can result in awkward replication stutters and other undesirable behavior. By adding the Atomic specifier, you can ensure that all server-side changes to a struct that are intended to behave as a single transaction will propogate as such to clients.

Code

USTRUCT(Atomic)
struct Foo
{
  ...
}
© 2021 Mustafa Moiz.