minolin / acplugins

R&D about the upcoming server plugin infrastrucure of Assetto Corsa, driving simulator by Kunos simulazioni
Apache License 2.0
19 stars 4 forks source link

small issues probably caused by merge problems #25

Closed flitzi closed 9 years ago

flitzi commented 9 years ago

I've noticed some small issues that are probably caused by the merge Problems you had.

flitzi commented 9 years ago

Oh and btw. I've seen you wanted to rename DriverInfo.Position Generally those possibly breaking changes should be communicated (like you did) but for the next two weeks feel free to change everything so it is the best solution, not thinking about compatibility or breaking changes. I will then adapt my stuff to the changes when I'm back.

minolin commented 9 years ago

What didn't you like about the original condition?

No1.: Using only a max value like 277m/s would trigger if you have a regular car (maybe some fancy mod like the blue falcon) that is very fast. No:2 Additionally it's a very very evident situation that your new velocity is absolutly zero

So my first idea was that we use if (speed < MaxSpeed && (vel.X != 0 || vel.Z != 0)) as you suggested. But then you won't detect teleports that warp you less then 277meters, which is possible if you roll out from your lap after the finish line and warp to the pit (or grid on a near-instant session ransition).

I see your point of a crash, but didn't manage to detect warping in a handful of tests. But yes, I see there is probably a lot car/driver/barrier situations where this is possible. Maybe we could take the splinepos/tracklength into consideration and restrict the porting destination to "somewhere near 0 or 1"

The new OnCarUpdate(DriverInfo driverInfo) is not called by the PluginManager. The DriverInfo.CurrentDistanceToClosestCar is not set.

Uh what? :( Both should be used in the bulk update... I'm afraid then I eventually annihilated almost all of my code. Will have a look now.

minolin commented 9 years ago

True.. My work inside the PluginManager disapeared.. NOOOeees ^^

Edit: And I deployed the overwritten binaries to the server in a last step, without checking them.. No decompilable sources available. Sigh.

flitzi commented 9 years ago

this can be handy sometimes: http://www.ocpsoft.org/tutorials/git/use-reflog-and-cherry-pick-to-restore-lost-commits/

Yes, the "warp to pits" condition could be improved, spline positions could help, but to make it work with vallelunga club you would probably need quite some margin. Hopefully Kunos will output some info soon so we don't have to solve it with this kind of workarounds. I'll leave the playing field to you for the next two weeks :)

flitzi commented 9 years ago

inspired by your idea, how about the following for warp detection:

if (speed - Math.Max(lastVelKmh, velKmh) < 150) -> no warp

no warp detected, if the computed speed is not much bigger than the maximum of last vel and the current vel. Perhaps the 150 can even reduced more.