Open rustyfausak opened 8 years ago
Oh gosh I never pushed all that code hey. Boop pushed!
That magic number came from taking a random vehicle in a random replay, looking at the positions between two random frames, and seeing what scaling factor would work to make the velocities make sense.
But I never found a good scaling factor that worked in all cases, so I abandoned it (it's commented out). So instead, I manually interpolate between rigid body states.
Yeah I see that you're doing interp by just a percentage between two frame positions. But that doesn't really work for collisions since if things collide between two frames it wouldn't pick it up.
I found that the linear velocity is most likely being scaled by RBSTATE_LINVELSCALE
, which looks like it defaults to 10
( https://wiki.beyondunreal.com/UE3:Actor_structs_(UDK) and http://www.codekisk.com/unreal/ut3/scriptref/engine/actor.html ).
I get more reasonable results by dividing the velocity by 100. It seems mostly linear:
The colors should correspond to different players. I'm not sure what the four lines mean..
Hey I'm not sure how to converse with you on this, but this seems to be an OK place. I know this repo doesn't have your latest replay viewer.
Your
actor.js
( http://bunkmonkey.com:97/angular/app/Actor.js ) has the magic number0.111399
used for linear velocity scaling on lines 207-209. Any insight as to how you arrived there?I've been looking into tweening between frames in order to get more accurate collision data. In order to do this I need to be able to use that linear velocity. In my noodling I've found that the maximum distance a player travels between frames is around 300 units. So that would imply a maximum linear velocity of around ~10000. But the linear velocity replication is frequently above that, commonly in ranges above 10000. We know the default map is around 10000 units long, and it takes a player about 4 seconds to travel that distance at max boosted speed. So that's a max speed of 2500 units/sec, which is about 83 units/frame. Which is still way higher than 300 units/frame but there could be other factors at play for speeds like that.
Anyways I just wanted to open a discussion with you since I don't really know anyone else who is working / has worked on this stuff for Rocket League.