-
Notifications
You must be signed in to change notification settings - Fork 25
Improve LimbPath.cpp - rewrite ReportProgress, etc #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Improve LimbPath.cpp - rewrite ReportProgress, etc #250
Conversation
The rewrite checks all path segments from the current one to the last and finds the best one to continue from, instead of fixating on just the one. This helps in cases where feet might be yanked along the path by excessive horizontal acceleration and removes quite a bunch of stumbling. Also fix Vector/Matrix division, making it the proper inverse of multiplication and applicable to const matrix.
HeliumAnt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Just some minor performance nitpicks and comment syntax.
|
Sorry, GitHub mobile is shit and won't let me comment on specific lines, says an unknown error occurred. So two thoughts:
|
Happens to me too sometimes, especially when loading the page from an email for some reason; the fix seems to be to reload the page
Just to be clear, by "outbound" and "inbound" to do you mean collision-disabled and collision-enabled segments? I think I made the code not check the former because I figured that landing slightly too hard or carrying too much weight would periodically cause the code to focus both legs to those collision-disabled segments, promptly causing a torso landing. I should experiment I guess.
Yeah, I think I want to investigate if I can just avoid doing the dumb thing altogether. I wonder if I could make both by-mut-ref and by-const-ref versions of the operators lol |
I was originally talking about the early-out check in the code finding the closest segment. Once the next segment is further away than the current one, we immediately exit out and claim we've found the closest. This is very unreliable- depends on the order of the walkpath (for some given walkpaths, it could always return the furthest point!), but even for typical ones that involve a loop we could find a bad point 50% of the time. With that said, we could experiment to find both collision enabled and disabled segments. Given we'd expect the walkpaths to be 180 degrees out of phase for both legs, though, in theory it would be best to actively force one leg to the collision-enabled-segments and the other to the disabled segments, at least when actively walking. If the situation is that both feet are genuinely misplaced, maybe thats where we'd expect to see a genuine trip (and maybe we could trigger prone or something to make it feel more physically proper). But perhaps that's too aggressive here. |
Ooh, yeah. I think I was just being too overly concerned with performance while making an assumption that seemed true from my observation of brain robot's walk path. There's not really that many segments and it could probably be allowed to iterate through all just fine lol
To note, I wrote the code to always pick some segment other than the current target to look at, and code that advances to the next segment if the target threshold is reached, together with that, basically guarantees that the non-colliding segments will all be went through anyway. Hmm, I think a fair solution might be to skip collision-disabled segments iff the current segment is collision-enabled? |
|
Yep, sounds reasonable. I think it ultimately depends on how it looks in-game, but in theory that sounds good. |
The rewrite checks all path segments from the current one to the last and finds the best one to continue from, instead of fixating on just the one. This helps in cases where feet might be yanked along the path by excessive horizontal acceleration, or when the player switches look direction while moving. Removes random stumbling too, mostly.
This doesn't perfectly fix everything ever, but it definitely makes it better I think. It's now more feasible to spam the jetpack and literally drag feet on the ground when the character's baggage is too heavy lol
Also fix Vector/Matrix division, making it the proper inverse of multiplication and applicable to a const Matrix. Figuring out why the math did not math definitely made me pull a hair or two lmao
Played a round of Bunker Breach with this patch and everything appears fine. Going over the scene wrap border break anything either.
Old behavior:
tmp.QFDPoB5KdD.mp4
New behavior:
tmp.hxQOb0nHw7.mp4