Realistic car sway/bounce?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Posts: 61
Joined: Thu Mar 05, 2015 11:27 am

Realistic car sway/bounce?

#1 Post by Rainvillain » Sun Oct 27, 2019 2:22 pm

Hi there,

I have a few shots in my game that take place behind the driver's seat and I'm trying to get a realistic ATL of the car's swaying. So far they feel a little stuttery and stiff. This is the transform code I'm working with:

Code: Select all

transform car_sway:
        ypos 0
        linear 0.3 ypos -2
        linear 0.2 ypos 0
        linear 0.2 ypos 2
        linear 0.1 ypos 0
        linear 0.2 ypos -2
        linear 0.3 ypos 0
and the effect is "okay"... does anyone have any suggestions? I'm thinking I might just have the transform code longer with slight variations and that might help it.

I also want to design a more "intense" version, for during a police chase, but figure I should nail the calmer speed first.
Currently working on Cross the Moon

User avatar
Eileen-Class Veteran
Posts: 1853
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil

Re: Realistic car sway/bounce?

#2 Post by Donmai » Tue Oct 29, 2019 10:32 am

In one of my old and unreleased projects, I've used a similar transform trying to suggest the sensation of being inside a moving car.

Code: Select all

transform car_moving:
        ease 0.1 xoffset -1 yoffset 2 
        ease 0.1 xoffset 0 yoffset 0 
        ease 0.1 xoffset 1 yoffset -2
        ease 0.1 xoffset 0 yoffset 0
Maybe the main difference is that in this case the "car" moves a bit to the left and right while it gently "bounces" in the road.
It worked for me. It can be easily adjusted by changing the warper and offset values.
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: IaMe