danstevens / openrct2-costinflator Goto Github PK
View Code? Open in Web Editor NEWA plug-in for OpenRCT2 that allows you to increase (or decrease) the cost of various expenses, such as staff wages or ride upkeep
License: MIT License
A plug-in for OpenRCT2 that allows you to increase (or decrease) the cost of various expenses, such as staff wages or ride upkeep
License: MIT License
When the ratings for a tracked ride are in the progress of being calculated, and Ride Running Cost multipler is greater than 1.00, the running cost of the ride grows exponentially.
The cause of this appears to relate to the 'ride.ratings.calculate' hook of the plugin API: When the ratings for a ride are being calculated, the game invokes the 'ride.ratings.calculate' hook periodically. However, the ride's upkeep value is unchanged until after the ratings finished calculating. Since the plugin adjusts the ride upkeep value every time the hook is raised, the plugin can end up multiplying again an already adjusted upkeep value, hence the exponential growth of the value. The log output below demonstrates this behavior. The last two entries show the ride upkeep being applied eventually by the game to their correct values, and so get adjusted correctly by the plugin.
'Setting upkeep of ride 0 to 268 * 2.00 = 536'
'Setting upkeep of ride 0 to 536 * 2.00 = 1072'
'Setting upkeep of ride 0 to 1072 * 2.00 = 2144'
'Setting upkeep of ride 0 to 2144 * 2.00 = 4288'
'Setting upkeep of ride 0 to 4288 * 2.00 = 8576'
'Setting upkeep of ride 0 to 8576 * 2.00 = 17152'
'Setting upkeep of ride 0 to 17152 * 2.00 = 34304'
'Setting upkeep of ride 0 to 266 * 2.00 = 532'
'Setting upkeep of ride 0 to 266 * 2.00 = 532'
This issue can fixed by detecting that the ride ratings are being calculated and skip the recalculation step. Detecting ride ratings are being calculated can be done by checking the current ratings - if a rating metric is being calculated, it is -1 or 0. Therefore, the Ride Running Cost multiplier should only take effect for a ride if all of its rating metrics are greater than 0.
To Reproduce
Expected behavior
The ride running cost should remain unchanged until the ride ratings having finished calculating
Actual behavior
The ride running cost grows exponentially while the ride ratings are being calculated, then returns to the correct value once rating calculations are complete.
Plugin version: 0.1.0
OpenRCT2 version: 0.4.1
As title says, the plugin does not work in multiplayer.
If only one of client/server uses it, it has no effect on the other one.
The readme mentions that staff wages can be changed, which does not seem to be the case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.