Slow down steering at higher speeds

This commit is contained in:
Miloslav Ciz 2025-03-30 20:29:35 +02:00
parent 9a4d49d7e6
commit fb5d9d118e
3 changed files with 15 additions and 83 deletions

View file

@ -60,6 +60,7 @@
=========== BUGS =================
- MAP4: one triangle in top section is missing!
- very rarely the near plane overflow bug still happens, maybe shift near plane
a bit further still?
- sometimes during long loading the screen goes black, seems to have appeared

79
data
View file

@ -31,79 +31,6 @@ bottom section
:;41ZJ :fR21 long wall top
:;91WL :fJ21 long wall top bottom
:xr1V :fa37
:n31W :f121 :=31X :f123 :=01W :f321 corner top left
diagonal corner top left
:=30U :f413 :=70V :=50T
:A50S :f131 :A60T :f131
:A70U :f131 :A80V :f131
:A41SI :f121 :A51TI :f121
:A61UI :f121 :A71VI :f121
:\81WJ| :f121
top section
:\w1ZL :f131 :\x1YI| :f131L
:nw4Y1L :f121
:;w1&J :f421 :f151
:=w3Z2 :^w3@2I- :^w4@2 :=w4&2
:=w0Y :f514
:AA0&L :f131 :AB0@L :f131 :AA1@J :f121 :\B1ZJ :f121
:=w0Y :f141 :m664
small house top
:-J3Y :f411 :<J3ZI :f411 :,K1Z2J :f211 :^J0ZI :f311
:=M1Z2 :f121 :=J0Y1 :m443 :=I0X2 :=J0Y3
:x514 :f426
:=D06 :fk21 :nD06I :f121 :=D01 :fp21 :nD11I walls bottom
:=W06 :f12b :=&01 :f12g
top right corners
:AV0ZL :f131 :AW0YL :f131 :AX0XL :f131
:AY0WL :f131 :AZ0VL :f131 :A@0UL :f131
:A&0TL :f131 :AV1YJ :f121 :AW1XJ :f121
:AX1WJ :f121 :AY1VJ :f121 :AZ1UJ :f121
:A@1TJ :f121 :AS0VJ :f131 :AT0UJ :f131
:AU0TJ :f131 :AV0SJ :f131 :AW0RJ :f131
:AT1VL :f121 :AU1UL :f121 :AV1TL :f121
:AW1SL :f121 :AX1RL :f121
:=U1Z :f121 :\S1WL :f121
:=X0C2 :f13f :f21f :=&0C2 :f13h :=@0C2 :f11f right walls
left section
:=01P :f127 :=41P :f123 :\01O|L :f121 :\41OJ :f121
:\22L|I :m111 :\42G|I :m111 :\22C|I :m111
:~31I2 :~11G2
:=50y :f212 :A00yJ :A50AL :A60zL :A70yL
bowl
:'60rJ :f117 :^70rL- :f117 :^71rJ :f117 :|72rJ- :f117
:|82rL :f117 :|81rL- :f117 :'50rL :f117 :m437
details
:;y031J :f311 :;y021L :f311 hole
:^3212L :^3112L- :-2212 :-2112- arrow
:=410 :f222
:]X1uL :f118
:]&1uJ :f118
:>F01 :f316
:>00D :f513
:=b0W3 :fa14
:'W02L :f114
:=60I2 :f236 :^62IJ :f116 :^73IJ :f116 spectator seats
:|01z2L :f11e border left
#RLC1;00LC1;8bd6e314 0000519:0121:00a3:0041:0069:0041:00d9:0081:0049:0081:0059:0021:00d9:0041:0245:0031:0019:01e1:0023:00e1:0029:00b1:0089:0051:0039:0031:0123:0021:0395:0041:01b3:0031:0073:0041:0033:0051:0033:0121:0043:0031:0073:0031:0053:0031:0103:0031:00d9:0011:0339:0021:0109:0011:00b9:0031
#BLC1;
#RLC1;00LC1;8bd6e314 0000519:0011:0149:0051:0159:0071:00a9:0041:00f9:0021:0123:0021:00b9:0088:0040:00b8:001c:0054:0030:0079:0051:0143:0081:0029:0101:00e9:0041:0099:0051:00a9:0041:0335:0031:0189:0041:00a3:00c1:0033:0031:0013:0071:0043:00b1:00a3:0051:0169:0021:0429:0021:00b3:0031

View file

@ -76,7 +76,8 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
#define LCR_CAR_STEER_FRICTION ((3 * TPE_F) / 4)
#define LCR_CAR_ELASTICITY (TPE_F / 64)
#define LCR_CAR_ACCELERATION (LCR_PHYSICS_UNIT / 9)
#define LCR_CAR_STEER_SPEED 13 ///< 0 to 16, lower is faster
#define LCR_CAR_STEER_SPEED 52 ///< 0 to 64, lower is faster
#define LCR_CAR_STEER_SLOWDOWN 128 ///< slows down steering at higher speeds
#define LCR_CAR_STEER_MAX (LCR_GAME_UNIT / 2)
#define LCR_CAR_ACCELERATOR_FACTOR 2
@ -1290,17 +1291,20 @@ uint32_t LCR_racingStep(unsigned int input)
{
steering = 2;
LCR_racing.wheelSteer =
LCR_CAR_STEER_MAX -
(LCR_CAR_STEER_SPEED * (LCR_CAR_STEER_MAX - LCR_racing.wheelSteer)) / 16;
// We slow down steering by 1 for each LCR_CAR_STEER_SLOWDOWN speed.
LCR_racing.wheelSteer = LCR_CAR_STEER_MAX -
(TPE_min(LCR_CAR_STEER_SPEED + LCR_racingGetCarSpeedUnsigned() /
LCR_CAR_STEER_SLOWDOWN,64) * (LCR_CAR_STEER_MAX -
LCR_racing.wheelSteer)) / 64;
}
else if (input & LCR_RACING_INPUT_LEFT)
{
steering = 1;
LCR_racing.wheelSteer =
-1 * LCR_CAR_STEER_MAX +
(LCR_CAR_STEER_SPEED * (LCR_racing.wheelSteer + LCR_CAR_STEER_MAX)) / 16;
LCR_racing.wheelSteer = -1 * LCR_CAR_STEER_MAX +
(TPE_min(LCR_CAR_STEER_SPEED + LCR_racingGetCarSpeedUnsigned() /
LCR_CAR_STEER_SLOWDOWN,64) * (LCR_racing.wheelSteer +
LCR_CAR_STEER_MAX)) / 64;
}
if ((LCR_racing.wheelCollisions & 0xcc)) // back wheel on ground?