[BUG] Strange Idle RPM behavior
boot2big opened this issue ยท 20 comments
Try setting the engine idle rpm to 1 or -1, and you'll see what I mean. (Make sure that if you're using devmode to set idle rpm to 1/-1, that you take out the engine after importing the json and put it back in, otherwise the stall RPM won't update. Not a bug in itself as you don't normally use devmode in the middle of gameplay, and it works fine if you put a "fresh" (freshly placed, not freshly made) engine in)
For example, setting the idle rpm to 1 makes the engine gain hours VERY fucking quickly. As in, you'll rev it and watch as it goes from 200, to 300, to 400, to 600, and it finally putters out at 800.
Setting the idle rpm to -1 will do the same, but negatively. So you'll watch it go to -800 hours and beyond.
tl;dr: negative idle rpm makes engine lose hours, very low idle rpm makes engine die very quickly
P.S: Another weird but unrelated behavior is that idle rpm seems to be inaccurate by anywhere between a couple RPM, to a few hundred RPM. (at 200, the engine idles at 250~ (technically 249) rpm, at 2000 the engine idles at 2499, at 20000 the engine idles at 24999, etc)
Not a major issue, but figured I'd mention it.
P.P.S: I was bored, and was trying to make my electric motors more realistic by not actually idling, or requiring a crank. (-1 idle rpm makes it instantly start if the magnetos are on, along with the disabled automatic starter)
I didn't check the hours on this ticket. I just checked the idle setpoint. Does that at least work properly, or is this an hours issue and RPM issue?
Still seems to be a problem as leaving an engine with really low idle RPM in gear (although admittedly -1 idle rpm, but still closest to having proper electric engine function) will cause progressive damage to it, but putting it in neutral seems to mitigate this.
Any possible source and/or remedies? It wouldn't be convenient for one to shift their electric motor into "neutral" every time they stop at a redlight
EDIT: Constant damage seems to occur no matter what rpm the motor is at, only while it's on and in gear.
Tried running this fix (V20.0.3 beta 2) and it doesn't seem to work (may have downloaded the wrong source before compiling)
However, I noticed another bug where...
You sure? I'm 100% sure that the negative idle doesn't have this issue anymore. As to the beta, is there a reason you didn't wanna use the one I pinged you with? Cause that one should have been the good source code, and have that other fix.
Just tried V20.0.3 Beta 3, still occurs?
Here's my json for reference...
EDIT: Partially fixed actually, hour rate calms down when in gear and at a high rpm, but idling in gear still seems to kill it.
Try putting it in gear?
"isAutomatic": true, "disableAutomaticStarter": true, "shiftSpeed": 1, "revResistance": 2, "idleRPM": -1, "maxRPM": 11000, "maxSafeRPM": 13000, "fuelConsumption": 0.35, "gearRatios": [ -2.5, 0.0, 2.5, 1.0 ], "fuelType": "electric", "superchargerFuelConsumption": -0.075, "superchargerEfficiency": -3.0
`
(V20.0.3 B3)
Latest code on the master branch should fix this. Note that I made a few changes. In your case, you want to set the start RPM, stallRPM, an idleRPM all to 0. Don't use negative numbers, as it confuses the physics something fierce. I tweaked the code to start you if you are at your start RPM, but to not stall you unless you go below your stallRPM, so electric motors insta-start now.
Just compiled the master branch and tried this, it doesn't seem to work due to the LC substituting 0s for auto generated numbers, which is one of the two reasons I was using negative numbers (that, and to idle at 0 rpm without consuming fuel or pushing the car forward in gear, because the motor isn't actually "running")
JSON before dev-mode (not parsed by anything in MTS)
Interesting note is that it WILL work if you set them to 0 in the mts_dev and import it.
edit: devmoded in, it works perfectly! its just the issue that it doesn't properly load in now, should've specified
So, looking at this I'm not seeing a good way except with negatives, but I KNOW that'll screw up physics. Got any ideas on this? My initial thought would be to just not LC startRPM anymore and if it's zero don't LC those other variables. Sure it'll hit some existing engines, but they'll still work. Though option B might be to add a check for one of those being negative and if so, set it to 0 but not do LCs on the others cause MTS know it's a negative variable value?
That, or use "zero" or a symbol?
Negative to 0 makes more sense imo, only used negatives for false 0 anyways
So, the reason you get lots of hours is because you're running the engine too fast before it's had a chance to warm up. I can remove that code if need-be, as I can see it confusing most players. Not sure.
As to the idle speed, I can confirm that. will fix.
I mean, maybe see if it can be tweaked to not absolutely murder engines if they idle under 100 rpm, if possible? Otherwise I suppose just remove it, or nerf it to be really low temperatures? (Sub zero, perhaps?)