jilderthoekstra / granturismo

Simple example how to automate tasks using remote play and playstation.
6 stars 4 forks source link

Car crashing into opponents at beginning #7

Closed BrunGomes19 closed 2 years ago

BrunGomes19 commented 2 years ago

In the beginning of the race, it seems that is at least in the current state to avoid crashing against the first and second to last car on the race. You think that would be any way to avoid it and to get the extra 50% cash every race? I'm currently using the perfect stats for the race, and the steering is just good, but it seems impossible to avoid the bump, unless the car waits some seconds to start racing, for example.

nicholaicascio commented 2 years ago

Try making your steering more aggressive and you can get the clean race bonus almost every time.

nicholaicascio commented 2 years ago

You could also easily add a delay before going full throttle in the race screen using time.sleep(float) if you think that will help.

BrunGomes19 commented 2 years ago

I tried to code a little bit (I'm a Python mega newbie), but I wasn't able to correctly delay the throttle. It was delaying all the process including the steering, and for that reason when I started throttle with the delay it was too far from the wall and the car fully crashed :/ I'll try the steer solution

jilderthoekstra commented 2 years ago

The crash should not have any impact on the clean race bonus for this race at this time. That's why I haven't changed that yet. Here it also crashed in to the first 2 opponents. But still getting clean race bonus. But I'll see if I can update it to be more friendly :-)

nicholaicascio commented 2 years ago

@aimerror yeah I was gonna say I believe you can still get the clean race bonus even when you YEET the Corvette.

BrunGomes19 commented 2 years ago

I'm not winning the clean bonus at least, and I don't think I'm doing anything wrong :/

Btw, on offtopic @aimerror , you should add a donation somewhere, it's the minimum we can give you :)

jilderthoekstra commented 2 years ago

Okay, I decided not to add a throttle delay because we want to go faster not slower ^^ But I've added a race macro function which in my opinion is a lot better :P, you can configure some manual steering inputs in there. This can be switch on and off in the config.py.

Are you driving with the Tomahawk S VGT car? I've set up the simple macro function to overtake the first 3 cars on the left. Then it will steer to the wall. Obviously this will depend a bit on the tune of your car. I've got racing softs on mine and racing transmission set to topspeed 390kmh. And I've slammed it to the ground and lvl 10 anti rollbar. I've tested the macro with controller sensitivity -2 and +3. Both worked fine here.

Anyway at the top of the gran_turismo.py file there is a function called execute_race_start_steering_macro. There you can play around with it. After the macro function has ended the auto drive logic will take over again.

Code should be pretty self explanatory. time.sleep(0.6) <= this will just sleep the program for 0.6 seconds window.key_press(config.LEFT_STICK_RIGHT, 0.21) <= this wil press the LEFT_STICK_RIGHT for 0.21 before moving on to the next line.

Let me know if it works correctly for you

BrunGomes19 commented 2 years ago

Hi mate! Just saw you update and it seems perfect! My tomahawk is on default so I need to do some tuning to the function! However tonight I just left home for a week and my ps5 is sitting at home so I'll be giving you feedback in a week probably :/ but thank you so much for this macro, it should make every race a 52.5k race when right tuned and a lot more efficient! Perfect ❤️

jilderthoekstra commented 2 years ago

Solved with use of race steering macro.