• Blurring the line between real and virtual motorsports
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tracks Track Cameras - A tutorial

Discussion in 'Assetto Corsa Modding Discussions' started by norbs, Jun 12, 2016.

  1. norbs

    Premium Member

    Ripped from AC forums.

    A lot of people have asked me to create track cams for their tracks. Because I am a lazy bastard, I thought I would use the old adage of "teach a man to fish", and hopefully lighten the load.

    I have made a video that shows how I do it, this is certainly not the only way, or even the correct way, but it works for me.

    If you have any questions, ask away. I will do my best to answer them.

    Please don't ask me how to get the FBX files. Get them from the track makers.

    Video available here for download to save you streaming all the time.

    Below all from @NightEye87

    Some remarks on FOV:
    Lower FOV values can work fine, even Kunos uses values of 0.5 sometimes. But it can mess with LODs and shadows. So shadow bias is definately a thing to change, then.
    Zooming cameras with a low FOV as minimum and a high maximum tend to work quite bad because the FOV gamma (=0) value is crooked. So whenever you use MIN=2, don't set the maximum anywhere above, say, MAX=5.

    Concerning start/finish cams:
    It is possible to have only one camera at the S/F line. For example: you can set your cam_0 to IN=0.98 and OUT=0.02 and the camera will remain active when a car passes the finish line. It has one drawback, though: if a replay (or to be more precise: if the grid spot) starts at 0.981 (so slightly after the IN point), the game does not recognize the correct camera for it, and picks one (top one? second one? Not sure, would need to test further). This has probably to do with the fact there is no camera that has IN=0. This might have changed, as it's been a good few months since I tried.

    I might do a more detailed tutorial on moving cameras one day. I don't have that sexy Aussie accent, though, so that would be a bit of a let down :D But a written one would work just fine, perhaps even better for moving cams.

    Here is a tutorial on how to deal with moving cameras.

    There are several possibilities for them:
    - Boom operated camera;
    - Dolly camera (sideways, upwards, curved, anything);
    - Pitlane fly-over camera;
    - A moving camera along a corner;
    - Basically any movement you can think of.
    In this tutorial I will be covering a start/finish fly-over camera, as it covers basically everything you need to know.

    For those of you familiar with editing cameras, inside the cameras.ini is a line POSITION=X,Y,Z. These are offset positions from the world origin (0,0,0). That is important to realise.

    In your 3D application, place a camera where you want the camera to start. I want a camera that flies across the track,

    from the grand stand over the track towards the pit exit. So I place a camera at the grand stand at frame 0.
    Also place a Null (Empty/Dummy) at that spot and parent the camera to it. For ease of use, I have rotated the Null towards the pit exit, so my camera only moves in Y and Z axis, not in X, with respect to the Null.
    The blue arrow is LightWave's +Z direction (-Z in AC's coordinate system):

    I want it to move towards the pit exit, so I move it there at frame 29. If you want it to move in a straight line, you really only need two frames. I want it to sack in the middle, so I need a little bit more to keep the movement smooth. Positions between all frames are linearly interpolated, so 30 frames might still be a bit jagged.
    I now move to frame 14 (1/2th on the path) and move the camera down a bit (I have auto key on, but if it isn't: create an animation key). Interpolation inside my 3D application is non linear so this creates a nice smooth curve. I tweak it a little by moving the camera at frame 7 and 22 (roughly at 1/4th and 3/4th of the path). I then bake the motion on each frame. This is different in each application. If you cannot automatically bake animations, simply go to every frame and create a key.
    Now, inside the Graph Editor (I believe any 3D application has this), I select my Position.X, Position.Y and Position.Z and export them. I export them seperately for better overview.

    Now, create a new document and save it as \yourtrack\data\flycam.csv or similar. This document will contain all positions relative to that Null we created. In this case, all those positions from the exported graphs. X was zero at all times, so that's a worry less. Format is "X, Y, Z" in meters, one frame per line. As far as digits: use at least 3 or 4 to make it nice and smooth.
    Note: my 3D application uses -Z for +Z in Assetto Corsa, so I reversed them.

    Now, inside one of your camera files (in my case cameras_3.ini), add a new camera or edit an existing one.
    Because we made the camera a child of the Null, all positions in the csv file are offsets from that position. Therefore, make a camera at the position of your Null. In this case: X,Y,Z(100.7351, 11.640, -442.9832).
    At SPLINE=flycam.csv, write down the name of the csv file.
    I rotated the Null so I didn't have to deal with the X coordinate. So fill in the SPLINE_ROTATION as below.
    Rotation works counter-clockwise with movement in the +X direction being 0 degrees and moving east. This is the same system used as with trigonometry. As my camera moves in -Z, 0 degrees means it will move north. 270 degrees means it will move east. I need 302.3 degrees for this camera.
    Play with the SPLINE_ANIMATION_LENGTH. The lower the number, the faster the camera moves. It doesn't move along with any car. You will have to find a nice balance between (most used) cars. Also keep in mind that the animation length is dependant of the number of entries in the .csv file.
    Please be aware that cars entering the pitlane will have the same camera viewing them, but will move at a much slower pace. So the start/finish straight might not be your best pick for cameras like this. Boom operated cameras at chicanes work quite nicely with most cars.
    POSITION=100.7351 ,11.640 ,-442.9832
    FORWARD=-0.143628 ,-0.237703 ,0.960663
    UP=-0.0351484 ,0.971338 ,0.235091

    Preview and comparison between slow and faster cars:

    Obviously you can create whatever path you wish. One thing you cannot do, is use static cameras. This would be really useful for creating videos, but sadly I haven't found a way to do this.

    I did a boom operated camera a while ago. While the effect is very subtle with this narrow lens, I think it does give a nice feel the first few seconds.
    Last edited: Jun 16, 2016
    • Like Like x 8
    • Love Love x 2
  2. Very helpful, thanks for the tutorial!
  3. Interesting.

    Is there any reason why he used cameras_4.ini as the name at the end?

    This looks like there is no way to have different cameras per pass? Ie, every lap will use the same cameras again?

    I'm wondering if you have many camera ini files that different ones will be used each lap?!

    Also is there any videos just talking about one camera, and going through ALL the settings. There looks like there are lots but very little is mentioned.

    Also the near/far fov, are they just interpolated between with cam > spline distance vs in/out points?


    • Agree Agree x 1
  4. Most of it is mentioned on the AC forum. And sadly every lap will use the same cameras. The numbers are just for sets, so you can switch between sets of cams.
    @norbs better copy the rest, too :)
    • Like Like x 1
  5. Yea @norbs get back to work! :coffee:
  6. Yeah the cameras look very similar to the Free Racer spline cameras actually.

    So great for tracks with one route, but probably not so useful for rally-cross tracks and stuff like that?

    That's a shame on the cameras being limited each time around. It'd be nice to have a way to have each new lap pick a new camera chunk randomly.

    I know I know, replays are probably low down the priority list... but it's the details that make the difference at this stage.
    When games like NFS4 could do this kinda stuff, then it makes not doing it during the first development pass on a game almost 20 years later seem like a mistake.
  7. norbs

    Premium Member

    I didnt want to look like I was taking credit for your work. ;)
  8. I'm not sure if this has been mentioned, but the camera files MUST follow an incremental naming system: So:
    I spent about an hour trying to work out why the new camera set on my track wasn't even showing up in-game, and I finally worked out that it was because they were called cameras_track.ini :O_o:
    • Like Like x 1
  9. Hang on, so why would you have multiple cameras.ini files?
  10. So you can have multiple set of cameras. Trackside ones, static ones, low ones, drone ones in the air (as I have on Bilster Berg), and then you just switch from one set to the other in the replay bar.
  11. Yea, like Fat-Alfie said. When your watching a replay and you switch camera sets in the replay bar, it's loading a different camera.ini file.
  12. Ah ok... so there is the ability to have different cameras per pass of the car, just not automatically random in the replay.

    Is that mentioned in the video? Just my luck I wasn't paying attention at the very moment that was mentioned :D

    • Like Like x 1
  13. I'd rather have all info in one post :) I might have figured out a lot of stuff, but I didn't invent it :p
  14. norbs

    Premium Member

    I think I got most of it.
    • Like Like x 1
  15. norbs

    Premium Member

    F3 switches between the camera views.
  16. F2 to activate random cameras. It uses all cameras including cockpit view.
    F3 to switch between track cameras.
    F1 to switch between 'drivable' cameras.
    F5 manual external camera.
    F6 onboard cameras.

    To have sonething cooler in replays, you can use a broadcast app such as BCast (check AC forum) which will automatically focus on those cars having battles and lets you choose which cameras to cycle.
    • Like Like x 1