W.I.P. Vancouver City circuit 98

Discussion in 'Tracks' started by JrC, Feb 2, 2021.

  1. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    I got one of the skytrain meshes animated on a track but the positioning is all off. Ill have to keep fiddling with it but eventually there will be animated skytrains preferably with emissive windows at night and a proper sound so you can see it moving on the tracks above as you run the track.
     
  2. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    How did you do it? Path constraint?
     
  3. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    https://github.com/ac-custom-shaders-patch/acc-extension-config/wiki/Tracks-–-Animated-objects

    CSP animated objects. I have them moving in a line but the offset is weird.

    Just a simple plane for the track. They move back and forth really nicely on the plane but again... offset into the distance. I need to fiddle with the start position and position offset I think.

    Code:
    [ANIMATION_...]
    NODE = train_node
    MOVE_ALONG = train_loop             ; name of a mesh along which train is going to move¹
    NODES_FOLLOWING = train_1, train_2  ; names of carriages attached to the train
    
    CLUSTER_THRESHOLD = 3      ; might have to adjust to help trajectory detection
    STARTING_POINT = X, Y, Z   ; for unlooped paths, start here and move to another end
    INVERT_DIRECTION = 0       ; for looped paths
    TICK_TOCK_MODE = 0         ; set to 1 to go forwards and backwards
    CUBIC_INTERPOLATION = 0    ; set to 1 for smoother movement (recommended)
    SPEED_KMH = 40             ; basic train speed*
    ; PROGRESS =               ; travel progress²*
    PIECE_LENGTH = 5           ; length of attached carriages
    LAG_UP = 0.9               ; acceleration lag
    LAG_DOWN = 0.9             ; deceleration lag
    DELAY_BETWEEN_RUNS = 0, 0  ; min and max boundaries for a random delay between runs, in seconds
    DEBUG_PATH = 0             ; set to 1 to highlight resulting path
    
    ; Path can also contain local speed adjustment areas:
    SPEED_ADJUSTMENT_0 = 50             ; target speed for a train within that area*
    SPEED_ADJUSTMENT_0_POINT = X, Y, Z  ; coordinates
    SPEED_ADJUSTMENT_0_RADIUS = 20, 60  ; radius of full effect and of adjustment start, in meters
    
    ; Train can also create new inputs for other conditions, great for attaching audio or lights:
    SPEED_CONDITION_INPUT = MyNewInput_TrainSpeed
    PROGRESS_CONDITION_INPUT = MyNewCondition_TrainProgress
     
  4. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    Ah yeah, the CSP move along path option...

    I found it really messy and unreliable, so I do it through keyframe animation
     
  5. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    Ill have a look at that. Really would like to have some activity around the driver.
     
  6. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    Thinking back on your CSP code, is your node pivot point set correctly? In the middle of the train mesh?
     
  7. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada

    Thanks for the tip. Probably not. Ill have to relook at it.

    Another issue is the Jumbotrons are showing a very low LOD for the cars with no wheels.
    Gunnars looked really good so Ill have to go back and figure that out too...
     
  8. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    It essentially works like a track side camera, so the distance to the “target” car and FOV parameters need to be set correctly.
     
    JrC likes this.
  9. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    Things will slow down for a bit as I travel a bit for work. I still have blender so I should be able to get some lighting done and some trees redone...

    and possibly an export of some Lidar data
     
    Tom 00 likes this.
  10. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    Red lights didnt make a ton of sense... so they are green now

    [​IMG]

    And yellow lights are tied to yellow flags via dynamic flags

    [​IMG]
     
    luchian, maruto and Tom 00 like this.
  11. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    You can actually make all 3 of them work correctly with LUT tables
     
    JrC likes this.
  12. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    I figured and have the conditions set up because I want it to have green on, yellow only and then blue up top.

    Couldn't really figure out the LUTs though... is there a good description of how this works somewhere?
     
  13. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    551
    Likes Received:
    201
    see "extension\config\tracks\common\flag_colors.lut"
    Code:
    [CONDITION_...]
    NAME=RACING_FLAG_GREEN_ONLY
    INPUT=FLAG_TYPE
    LUT=(|1=0,1,0|2=0|3=0|4=0|5=0|6=0|7=0|8=0|9=0|10=0|11=0|12=0|13=0|14=0|)
    
    [CONDITION_...]
    NAME=RACING_FLAG_NONGREEN
    INPUT=FLAG_TYPE
    LUT=(|1=0,0,0|2=1,1,0|3=1,0.5,0|4=1,0.3,0|5=1,0,0|6=0.7,0.7,0.7|7=1,0.5,0.5|8=0.1,0.1,0.1|9=0,0,0.1|10=0.5,0.5,0.5|11=0.5,0.5,0.5|12=0,0,1.5|13=0,0,0|14=1,1,1|)
     
    JrC likes this.
  14. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
  15. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    That got it... and I looked up the proper RGB for the traffic lights. Set up the blue flag but havent seen it yet.

    [​IMG]
     
  16. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    Ah... thought you were going to make it work as a proper traffic light
     
  17. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada

    When you say proper traffic light do you mean it cycling through green amber and red as if it was operating normally?

    I hadnt really thought of that but it might be interesting to try. Right now its tied into the track flags so the lights go amber in the correct area if there is a yellow flag.

    Not sure if anyone wants that or not as Im pretty sure its not historically accurate but it does provide some extra interactivity to the environment around the driver.
     
  18. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada
    Im having a lot of trouble getting this to move properly along the test mesh using the wrap mesh code.

    Ive got a test mesh set up and the skytrain moves along a similar path but floating way out in space but Im using this position in red for pivot point and yet the train is animated along the yellow line out in space.

    [​IMG]

    [​IMG]

    Code:
    [WRAP_MESHES_...]
    NAME = _train_node_0
    MESHES = SKYTRAIN_01
    PIVOT_POS = -3.001, -4.57, 0.2533
    PIVOT_DIR = -0.256, 0,0
    
    [WRAP_MESHES_...]
    NAME = _train_node_1
    MESHES = SKYTRAIN_02
    PIVOT_POS = -2.705, -4.574, 0.2541
    PIVOT_DIR = -0.256, 0,0
    
    [WRAP_MESHES_...]
    NAME = _train_node_2
    MESHES = SKYTRAIN_03
    PIVOT_POS = -2.404, -4.573, 0.2539
    PIVOT_DIR = -0.256, 0,0
    
    ; Animate train
    [ANIMATED_...]
    NODE = _train_node_0 ; node to move
     MOVE_ALONG = train_path ; move along this mesh (this line sets the movement mode)
    ;MOVE_ALONG = train_loop ; alternative looped path
    
    ; all following parameters are the ones for MOVE_ALONG mode:
    CLUSTER_THRESHOLD = 3 ; required for finding trajectory from train_path properly
    CUBIC_INTERPOLATION = 1 ; smooth out path
    NODES_FOLLOWING = _train_node_1, _train_node_2 ; move those things as well
    INVERT_DIRECTION = 0 ; for looped paths
    TICK_TOCK_MODE = 1 ; set to 1 to go forwards and backwards
    STARTING_POINT = -3.19, -4.573, 0.2375 ; for unlooped paths, start here and move to another end
    SPEED_KMH = 30 ; basic train speed
    LAG_UP = 0.99
    LAG_DOWN = 0.9
    DEBUG_PATH = 0
     
  19. Johnr777

    Johnr777 Moderator

    Joined:
    Jul 26, 2017
    Messages:
    687
    Likes Received:
    456
    Not sure if you can use the blender axis values “as is”. Try switching the second and third values?

    or use the CSP object inspector to get the right position
     
    JrC likes this.
  20. JrC

    JrC Active Member

    Joined:
    Feb 2, 2021
    Messages:
    175
    Likes Received:
    106
    Location:
    Canada

    @Johnr777 to the rescue again.

    Using OI was it. Had to use world coordinates and not Blender. Skytrain now moving on track.

    I need to now get a mesh following the proper skytrain track, figure out the emissive windows, and we have moving skytrains ... I think its going to look pretty cool moving at night. Oh, and need a sound too.

    [​IMG]
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice