Commit Graph

11 Commits (master)

Author SHA1 Message Date
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
ζeh Matt d7de17a1ac
Add a comment explaining the pick of the prng 3 years ago
ζeh Matt f8f3bb2421
Use std::minstd_rand and split serialization from save/load 3 years ago
ζeh Matt 151770ccf1
Separate global vs world rng functions and use custom prng 3 years ago
ζeh Matt d83a381f79
Refactor and rename some things around Misc::Rng 3 years ago
jvoisin 5840279f16 Use `default` instead of empty constructors/destructors
See https://pvs-studio.com/en/docs/warnings/v832/ for details
4 years ago
elsid 675c0ab72f
Apply uniform random deviation to AI reaction timer
This allows to distribute AI reaction calls over time.

Before this change actors appearing at the same frame will react in the same
frame over and over because AI reaction period is constant. It creates a
non-uniform CPU usage over frames. If a single frame has too many AI reactions
it may cause stuttering when there are too many actors on a scene for current
system.

Another concern is a synchronization of actions between creatures and NPC.
They start to go or hit at the same frame that is unnatural.
4 years ago
Assumeru 72549651e0
Rework container resolution (#3006)
* Rework container resolution

* add optional argument to getCount

* remove now-redundant changes

* undo worldimp changes

* move save-fixing code to InventoryState

* replace Rng instances with Seeds
4 years ago
elsid 33f6fb258d
Option to set specific random seed for random number generator 6 years ago
Capostrophic 48467814d4 Improve random number generation 7 years ago
scrawl 8c810e3620 Move rng to components 10 years ago