Commit Graph

11 Commits

Author SHA1 Message Date
clang-format-bot ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
ζeh Matt d7de17a1ac
Add a comment explaining the pick of the prng 2022-03-22 17:09:36 +02:00
ζeh Matt f8f3bb2421
Use std::minstd_rand and split serialization from save/load 2022-03-21 17:49:42 +02:00
ζeh Matt 151770ccf1
Separate global vs world rng functions and use custom prng 2022-03-21 17:49:42 +02:00
ζeh Matt d83a381f79
Refactor and rename some things around Misc::Rng 2022-03-06 17:28:28 +02:00
jvoisin 5840279f16 Use `default` instead of empty constructors/destructors
See https://pvs-studio.com/en/docs/warnings/v832/ for details
2021-06-24 00:26:15 +02:00
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.
2021-03-20 14:47:54 +01:00
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
2020-10-13 17:46:32 +02:00
elsid 33f6fb258d
Option to set specific random seed for random number generator 2019-02-26 09:36:34 +03:00
Capostrophic 48467814d4 Improve random number generation 2018-04-19 15:55:26 +03:00
scrawl 8c810e3620 Move rng to components 2015-04-22 17:58:55 +02:00