Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -81,6 +81,9 @@ silhouettes = true showsky = true +; Whether or not the remaining graphics items are selected randomly +graphics.randomselection = true + novbo = false ; Disable hardware cursors Index: binaries/data/mods/public/gui/options/options.json =================================================================== --- binaries/data/mods/public/gui/options/options.json +++ binaries/data/mods/public/gui/options/options.json @@ -198,6 +198,12 @@ }, { "type": "boolean", + "label": "Random entity appearance", + "tooltip": "Randomize the appearance of entities. Disabling gives a slight performance boost. Works best in a new game.", + "config": "graphics.randomselection" + }, + { + "type": "boolean", "label": "Particles", "tooltip": "Enable particles.", "config": "particles", Index: source/graphics/ObjectBase.cpp =================================================================== --- source/graphics/ObjectBase.cpp +++ source/graphics/ObjectBase.cpp @@ -26,6 +26,7 @@ #include "ps/XML/Xeromyces.h" #include "ps/Filesystem.h" #include "ps/CLogger.h" +#include "ps/ConfigDB.h" #include "lib/timer.h" #include "maths/MathUtil.h" @@ -553,8 +554,12 @@ bool allZero = (totalFreq == 0); if (allZero) totalFreq = (int)grp->size(); - // Choose a random number in the interval [0..totalFreq) - int randNum = boost::random::uniform_int_distribution(0, totalFreq-1)(rng); + bool randomSelection; + CFG_GET_VAL("graphics.randomselection", randomSelection); + + // Choose a random number in the interval [0..totalFreq). + // If the config sets no randomSelection, fix a number, so we get the same selection always. + int randNum = randomSelection ? boost::random::uniform_int_distribution(0, totalFreq-1)(rng) : 0; // and use that to choose one of the variants for (size_t i = 0; i < grp->size(); ++i)