About Store Forum Documentation Contact
Donations:
207$/mo



Post Reply 
[2.0] Making Character Controllers Framerate independent
Author Message
Kevin Offline
Member

Post: #1
[2.0] Making Character Controllers Framerate independent
Hi there,
I just purchased 2.0 and Esenthel, you did a really great job on it, I like it! smile

But I don't know if this issue only occurs in 2.0 or also in Esenthel 1.0. I am trying to make my (first person) character controller framerate independent. So I enabled screen synchronization, but this doesn't seem to work like I expected...
Now the character controller moves way to fast, so I thought it might be a problem with dt, which isn't used by the controller.update method. So I multiplied the Tim.dt, but this results in very strange behavior (laggy movement).

This issue can be easily reproduced if you change the Physics/05 - Controllers sample:
Add D.synch(false) in the InitPre method and change Flt s = 3 to Flt s=300 * Time.d().

Am I doing something wrong or is this a bug?

Thanks in advance smile
03-04-2013 12:28 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: [2.0] Making Character Controllers Framerate independent
I was able to reproduce it, and it does seem to be a bug or a conflict of some kind.
03-06-2013 02:42 PM
Find all posts by this user Quote this message in a reply
Kevin Offline
Member

Post: #3
RE: [2.0] Making Character Controllers Framerate independent
Thanks for reproducing this!

Esenthel, could you look into it please, I really need a working character controller which doesn't depend on a constant 60 fps framerate, and I think I am not the only one wink
03-07-2013 11:44 AM
Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #4
RE: [2.0] Making Character Controllers Framerate independent
Not sure if my problem is related but when the screen locks (because I have no idea what I'm doing!) ESC or ALT-F4 doesn't work until a minute later.

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
03-07-2013 12:30 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: [2.0] Making Character Controllers Framerate independent
(03-04-2013 12:28 PM)Kevin Wrote:  I just purchased 2.0 and Esenthel, you did a really great job on it, I like it! smile
Thanks for the comment, I appreciate it smile

I've reproduced the bug with 05 - Controller with D.sync(false);
I'm now investigating this.

Please note that Flt s=3; is ok it should not be multiplied by Time.d();
There's something wrong with controller velocities in EE physx 3 version (I'm checking).
03-10-2013 04:20 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: [2.0] Making Character Controllers Framerate independent
Temporary fix is to set Physics.timestep(PHYS_TIMESTEP_VARIABLE);
I'm checking PHYS_TIMESTEP_ROUND
03-10-2013 05:14 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: [2.0] Making Character Controllers Framerate independent
Okay I managed to make this work correctly in PHYS_TIMESTEP_ROUND as well.
It should be ok in next release.
03-10-2013 05:41 PM
Find all posts by this user Quote this message in a reply
Kevin Offline
Member

Post: #8
RE: [2.0] Making Character Controllers Framerate independent
great, thanks! wink
03-10-2013 06:10 PM
Find all posts by this user Quote this message in a reply
Post Reply