Increase handyman randomness in queue (#12145)

* Increase randomness when handyman is on queue path

* Add myself to contributors

* Refactor hex variable probabilities

* Add check if queue is connected to a ride

* Update changelog

* Bump network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
Jim 2020-07-08 20:48:08 +02:00 committed by GitHub
parent bf2b8073cb
commit 0248621502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 6 deletions

View File

@ -29,8 +29,8 @@ set(TITLE_SEQUENCE_SHA1 "304d13a126c15bf2c86ff13b81a2f2cc1856ac8d")
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v1.0.15/objects.zip")
set(OBJECTS_SHA1 "dfd5864cf7d0449c0fb280c5c6b902a24816df6c")
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v0.0.14/replays.zip")
set(REPLAYS_SHA1 "5A0198B4337A43199702F5ED6069161C8A735332")
set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v0.0.15/replays.zip")
set(REPLAYS_SHA1 "85EBF6760D39FA37BFDEBAA77992CB55A7C8C301")
option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.")
option(WITH_TESTS "Build tests")

View File

@ -87,6 +87,7 @@ The following people are not part of the development team, but have been contrib
* Chad Ian Anderson (pizza2004) - Added New Game option, bug fixes, misc.
* Peter Ryszkiewicz (pRizz) - Added horizontal grid lines to finance charts.
* Hudson Oliveira (hdpoliveira) - Misc.
* Jim Verheijde (Jimver) - Make handymen less likely to get stuck in queue lines.
## Bug fixes
* (halfbro)

View File

@ -47,6 +47,7 @@
- Fix: RCT1 scenarios have more items in the object list than are present in the park or the research list.
- Improved: [#6530] Allow water and land height changes on park borders.
- Improved: [#11390] Build hash written to screenshot metadata.
- Improved: [#3205] Make handymen less likely to get stuck in ride queues.
- Technical: [#8110] OpenRCT2 now uses a single directory name for title sequences instead of three.
- Technical: [#11517] Windows Vista is supported again (libzip regression in the previous release).
- Technical: The required version of macOS has been increased to 10.14 (Mojave) for plugin support.

View File

@ -48,8 +48,8 @@
<TitleSequencesSha1>304d13a126c15bf2c86ff13b81a2f2cc1856ac8d</TitleSequencesSha1>
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.0.15/objects.zip</ObjectsUrl>
<ObjectsSha1>dfd5864cf7d0449c0fb280c5c6b902a24816df6c</ObjectsSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.14/replays.zip</ReplaysUrl>
<ReplaysSha1>5A0198B4337A43199702F5ED6069161C8A735332</ReplaysSha1>
<ReplaysUrl>https://github.com/OpenRCT2/replays/releases/download/v0.0.15/replays.zip</ReplaysUrl>
<ReplaysSha1>85EBF6760D39FA37BFDEBAA77992CB55A7C8C301</ReplaysSha1>
</PropertyGroup>
<ItemGroup>

View File

@ -32,7 +32,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "20"
#define NETWORK_STREAM_VERSION "21"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;

View File

@ -643,7 +643,12 @@ bool Staff::DoHandymanPathFinding()
bool chooseRandom = true;
if (litterDirection != INVALID_DIRECTION && pathDirections & (1 << litterDirection))
{
if ((scenario_rand() & 0xFFFF) >= 0x1999)
/// Check whether path is a queue path and connected to a ride
bool connectedQueue = (pathElement->IsQueue() && pathElement->GetRideIndex() != RIDE_ID_NULL);
/// When in a queue path make the probability of following litter much lower (10% instead of 90%)
/// as handymen often get stuck when there is litter on a normal path next to a queue they are in
uint32_t chooseRandomProbability = connectedQueue ? 0xE666 : 0x1999;
if ((scenario_rand() & 0xFFFF) >= chooseRandomProbability)
{
chooseRandom = false;
newDirection = litterDirection;