Search found 99 matches

by tomweiland
Fri Nov 08, 2019 9:49 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

So then by "a TargetVelocity that is accidentally cancelling out the ViewDirection" you just mean if I'm setting a TargetVelocity manually, it may not align with the ViewDirection that I've set? That would mean it's on my end again...so probably not an easy fix :cry:
by tomweiland
Fri Nov 08, 2019 9:30 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

So it sounds like there's an inconsistency of some sort in how the ViewDirection and TargetVelocity are being set- a constant ViewDirection, or a TargetVelocity that is accidentally cancelling out the ViewDirection, or something along those lines. So does the order in which I set the two affect any...
by tomweiland
Fri Nov 08, 2019 7:28 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Alright so I've added TargetVelocity and TryJump to the states, and the stuttering seems to be gone, however the player now moves along the global axes, instead of his local ones (pressing the forward key causes the player to move in the same direction regardless of which way he is facing). This was...
by tomweiland
Fri Nov 08, 2019 5:32 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Norbo wrote: Fri Nov 08, 2019 1:53 am Is the character state being rewound and replayed properly too? The critical ones would be ViewDirection, TargetVelocity, and TryJump. Other than that, nothing springs to mind.
ViewDirection, yes. TargetVelocity and TryJump, nope. I'll take add that tomorrow and see if it fixes it.
by tomweiland
Fri Nov 08, 2019 1:12 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Good luck! :D Thanks! I actually managed to figure it out. It was of course something really stupid on my part, namely the state storing a reference to some positions instead of a copy, which ended up screwing up my buoyancy calculations. Everything seems to be working great now, except for player ...
by tomweiland
Thu Nov 07, 2019 1:51 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Sounds like the object is asleep- many of the BodyReference's functions are intentionally barebones and do not wake the body up automatically. The XML docs for each should mention whether they do or don't. All the direct reference properties and apply impulse functions do not wake the body up. You ...
by tomweiland
Thu Nov 07, 2019 1:14 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

So I have no idea if this will help, but I've found something very strange. I added a basic cube with my flotation code to the simulation, so it has none of the other player-related stuff, and integrated it with my state system. What I don't understand is that cube falls to the ground (meaning it's ...
by tomweiland
Wed Nov 06, 2019 11:19 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Norbo wrote: Wed Nov 06, 2019 9:44 pm Applying an impulse immediately modifies the velocity, so there's no extra state to clear.
Hmm I see.

So what about the fact that I'm using a constant timestep? Is that good or potentially problematic?
by tomweiland
Wed Nov 06, 2019 7:37 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

I just realized that my code's execution order is like this for each tick: Check if there are unprocessed inputs, if so, set the state to the time of the input and resimulate up to the present Physics timestep Apply impulses for flotation & set input for character constraints Wouldn't this mean ...
by tomweiland
Wed Nov 06, 2019 12:05 am
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Norbo wrote: Tue Nov 05, 2019 11:51 pm Shot in the dark- is the timestep duration passed Simulation.Timestep kept constant?
Yes, whether I'm resimulating a tick or generating a new one, I always pass in the same timestep (0.025, aka 40 ticks per second).
by tomweiland
Tue Nov 05, 2019 11:41 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Constraints do preserve impulses from the previous frame to warm start the next solve, but the expected failure mode there is just slightly worse accuracy. Calling Simulation.Solver.ScaleAccumulatedImpulses(0) would wipe out the cached guesses. I don't expect it to be related, but it's worth trying...
by tomweiland
Tue Nov 05, 2019 10:07 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

So I've implemented states for my server now which get stored for half a second, allowing me to rewind time. However, I'm having issues with applying forces—specifically my buoyancy code is causing issues, although I suspect I messed up somewhere and that's on my end. However, when I turned it off a...
by tomweiland
Wed Oct 30, 2019 9:16 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

Re: "Rewinding" Simulations

Simply caching historical pose/velocity should work fine. It's true that internal cached state will mean that the simulation won't produce bitwise identical results, but since the resimulation 1) is different due to user input anyway and 2) lasts a fraction of a second, determinism shouldn't be a p...
by tomweiland
Wed Oct 30, 2019 8:26 pm
Forum: Questions and Help
Topic: "Rewinding" Simulations
Replies: 27
Views: 21033

"Rewinding" Simulations

So I'm getting into the more complex parts of client-server setups now, and one thing I need to sort out is lag compensation. Most multiplayer games will "roll back" their simulation to the point in time when the input was sent by the player and simulate from there, thereby making correcti...
by tomweiland
Thu Sep 26, 2019 2:38 am
Forum: Questions and Help
Topic: Bepu v2 vs PhysX
Replies: 7
Views: 50504

Re: Bepu v2 vs PhysX

2) Given that unity is running a different (older) runtime, it may be using floating point operations with different behavior. It may emit instructions that end up using 80 bit precision internally before rounding back down to 32 bits, while RyuJIT on the serverside is running SIMD operations at 32...