The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/printthread.php 179 postParser->parse_message
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
Wrong calculation for brake lock/unlock? - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Help (https://www.vdrift.net/Forum/forumdisplay.php?fid=5)
+--- Thread: Wrong calculation for brake lock/unlock? (/showthread.php?tid=1228)



Wrong calculation for brake lock/unlock? - sebiastisch - 02-02-2010

Hallo there,
first of all: thank you all for the great game !

I am not sure whether I got the following wrong or this is a bug.

I recognized, that unlocking the brakes seems to be harder than it should. The following brake lock calculation could explain that:

Quote:T GetTorque ( T rotational_speed )
{
T brake = brake_factor > handbrake_factor ? brake_factor : handbrake_factor;
//brake = pow(brake,2.0f);

T pressure = brake * bias * max_pressure;
T normal = pressure * area;
T torque = friction * normal * radius;
T velocity = radius * rotational_speed;
if ( velocity < 0.0 )
torque = -torque;

T absvel = std::abs(velocity);

// See if the brake is locked.
if ( absvel < threshold * normal )
//if ( absvel < ( threshold * brake ) )
{
torque = 0.0;
locked = true;
}
else
locked = false;

lasttorque = torque;

return torque;
}

In cardynamics the wheel speed is set to zero, when brakes are locked.
Hence,
Quote:if ( absvel < threshold * normal )
is always true, as absvel is proportional to the rotational wheel velocity.
Shouldn't the engine, tire-friction and all that influence the lock-state of the brakes? If these torques are higher than the static friction of the brake discs, the brakes should unlock.

Perhaps someone can help me understanding the physics calculations here.

Regards
Sebastian


- NaN - 02-02-2010

Looks like ApplyWheelForces() and CARBRAKE need some care. I'll look into it asap. Please feel free to help.Smile


- portets - 02-02-2010

another thing about the brakes is that the handbrake locks up all wheels. it seems that it just uses the the normal brake, just harder.

because on a car with a break bias 60/40 front/back, the front brakes are more likely to lock up using the handbrake.
even though in the .car file the handbrake option is only on the rear wheels.


- joevenzon - 02-04-2010

portets Wrote:another thing about the brakes is that the handbrake locks up all wheels

Doh, you are correct. In carbrake.h we should always multiple handbrake_factor by handbrake. I fixed this in R2583.


- portets - 02-04-2010

oh my! yes!

i think i mentioned this almost a year ago in the forum here and it went unnoticed.

this game feels so much more realistic now! haha.

but now that it only works on the rear wheels, it's a lot weaker. someone will need to go in and change the handbrake multiplier on the cars. i tested three cars now and the handbrake is very weak on them.

edit: changing them all to "2.0" feels about right. but maybe instead you can just code the handbrake to be twice as strong? it would make things easier if that's not too much of a burden. and an even "1.0" in the .car files looks nicer, :wink:


- joevenzon - 02-05-2010

Ah, I like the idea of just changing the .car files to handbrake=2.0 or whatever where needed instead of changing the code to automatically pump up the handbrake values. If you want to do that along with your other .car changes I'd be happy to commit them for you.


- portets - 02-05-2010

okay, will do. but just in case you don't like my .car changes (you probably will, they mostly involve very minor things like moving wheels slightly forward) i'll do a set of unmodified cars with just the handbrakes changed.