Skip to content

How to make CS2 edit

Rikki edited this page Dec 29, 2024 · 35 revisions
Video tutorials

Showcase: https://www.youtube.com/watch?v=6zw0TgrEIAs
1st part (basics, campath, misc): ??? (waiting for valve to fix the laggy 3rd person animations)
2nd part (reshade, streams, scripts): ??? (waiting for a good looking depth)


HLAE (editing tool)
>>> Installation
  1. Download the latest .zip version: https://github.com/advancedfx/advancedfx/releases/latest
  2. Create an empty HLAE folder and extract archive content to it

>>> Usage
  1. Open HLAE.exe
  2. Go to: Tools -> Developer -> Custom Loader
    image
  3. Adjust custom loader parameters
    image

Program Path: ..\Counter-Strike Global Offensive\game\bin\win64\cs2.exe
Launch options: -insecure -console -language english -afxDisableSteamStorage -sw -w 1920 -h 1080

-insecure disables VAC
-console enables console
-language english sets game language to english
-afxDisableSteamStorage disables steam cloud sync
-sw windowed mode
-w 1920 -h 1080 resolution (resolution sides must have even numbers or you will have problems with recording)

DLLs to inject: ..\HLAE\x64\AfxHookSource2.dll

Environment variables: USRLOCALCSGO=<PATH_TO_MVM_FOLDER>

If you set the variable, HLAE will generate game configs inside the specified folder and start using them instead of the main game settings
All the changes (graphic settings, new binds) will be applied to those generated configs
It means HLAE won't affect the game settings that you have when launching the game without HLAE

  1. Disable all anticheats (ex: faceit anticheat) and all antiviruses (you can keep windows defender turned on)
  2. Launch the game via HLAE by pressing OK

If you get errors

Join HLAE support server: https://discord.com/invite/NGp8qhN


>>> How to update HLAE
  1. Launch HLAE
  2. Go to: Help -> Check for updates -> Check now
  3. Press Update available! button, it will redirect you to the https://github.com/advancedfx/advancedfx/releases/latest
    image
  4. Download the latest .zip version
  5. Close HLAE
  6. Extract archive content to the 'HLAE' folder you created earlier with replacement
    image


FFMPEG (video recording)

Installation

  1. Download FFMPEG (direct link): https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z
    Extract archive content to ..\HLAE\ffmpeg like this:
    image

  2. Install K-Lite Codec Pack (standart): https://codecguide.com/download_kl.htm
    It's a good video player that can play almost every video/audio without any issues

  3. Install these codecs to be able to import them into video editing software:
    Ut Video Codec (.avi): https://www.videohelp.com/software/Ut-Video-Codec-Suite
    Quicktime Codec (.mov): https://support.apple.com/en-us/106375


My configs

Installation

  1. Download the configs: https://github.com/eirisocherry/cs2-editing/releases
  2. Extract them to ..\Counter-Strike Global Offensive\game\csgo\cfg
  3. Adjust _reset.cfg to your needs, so you can reset the game settings at any time
  4. Adjust _core.cfg, set output recording folder, bind types etc. (you can do it later)
    image

Usage

  1. Join the game
  2. Type exec _core and reset in the console
  3. Play a demo playdemo <demo_name>
    Demos folder: ..\Counter-Strike Global Offensive\game\csgo
  4. Activate editing config by typing fe
  5. Read the pop-up menu to learn more about the config

Optional

Notepad++ (handy notepad): https://notepad-plus-plus.org/downloads/


Sounds (SFX)

How to extract CS2 sounds

  1. Download Source2Viewer: https://valveresourceformat.github.io/
  2. Open Source2Viewer, go to File -> Open and specify the ..\Counter-Strike Global Offensive\game\csgo\pak01_dir.vpk file
  3. Right click the sounds folder and press Decompile & export
  4. Output=sound, press continue and specify the output folder you want to extract sounds to
  5. Wait till exporting is finished
cs2_sounds_export.mp4

How to make SFX in Vegas Pro

Tutorial: https://www.youtube.com/watch?v=sZ1bdfBcKwM


Reshade

Installation

https://github.com/advancedfx/ReShade_advancedfx/wiki

All you need to do in custom loader is to [Browse ...] <reshade_folder>\dxgi.dll and place it below x64\AfxHookSource2.dll
image


Streams
>>> How to record depth
  1. Install reshade
  2. Download junior.fx: https://drive.google.com/file/d/1Q1N6ctyhJJeUcbMZSNeeXieprOcjH8jj/view?usp=sharing
    Place junior.fx to <reshade_folder>\reshade-shaders\Shaders

Junior.fx creator: https://github.com/jooonior

  1. Enable this reshade effect and adjust its parameters:

Far Plane: 50
Present type: Grayscale
Dithered (checked)

image

  1. Open _core.cfg and switch recording preset to utTrueSplit (don't forget to save changes)
  2. Type fe in the console to apply changes
  3. Do the recording
  4. Enjoy your depth

>>> High precision depth

How to record high precision depth

  1. Install reshade
  2. Download junior.fx: https://drive.google.com/file/d/1Q1N6ctyhJJeUcbMZSNeeXieprOcjH8jj/view?usp=sharing
    Place junior.fx to <reshade_folder>\reshade-shaders\Shaders

Junior.fx creator: https://github.com/jooonior

  1. Enable this reshade effect and adjust its parameters:

Far Plane: 50
Present type: Full RGB

image

  1. Open _core.cfg and switch recording preset to utTrueSplit (don't forget to save changes)
  2. Type fe in the console to apply changes you made in _core.cfg
  3. Do the recording

How to convert RGB depth to Grayscale depth

  1. Install AE_tl_math (after effects plugin): https://github.com/crazylafo/AE_tl_math
  2. Set AE project to 32bit and import rgb depth
  3. Apply tl_maths effect and press SETUP
  4. Paste the following glsl code and hit APPLY:
vec3 outputRgb;

// Get depth from RGB data.
float val = inputRgb.x * 256 * 256 + inputRgb.y * 256 + inputRgb.z;
val /= 65535;  // 2^16 - 1

return vec3(val);

image

  1. Add the video to render queue (ctrl + m)
  2. Export as EXR sequence
    image
  3. Import back to AE and set the framerate of your original rgb depth
    image

>>> 4k resolution without 4k monitor

What's the point of setting 4k resolution?

Junior.fx splits the screen/resolution into 4 pieces:
1920x1080 recording outputs two small 960x540 videos (960x540 resolution is way too small)
3840x2160 recording outputs two 1920x1080 videos (1920x1080 is good, that's why you need to set your resolution to 4k)

NVIDIA

  1. Go to NVIDIA Control Panel > Manage 3D Settings
    Set DSR - Factors to 4X, DSR - Smoothness to 0% and hit [Apply]
    image

  2. Go to NVIDIA Control Panel > Change resolution
    Find Dynamic Super Resolution category and set resolution to 4k (3840x2160)
    image

  3. When you done recording the game, go to NVIDIA Control Panel > Change resolution
    Find PC category and choose your native resolution (1920x1080 in my case)
    image

AMD

I don't have AMD, but i know it has similar feature, try searching something like How to enable AMD Super Resolution on youtube

Once you set 4k resolution in windows

  1. Open HLAE.exe
  2. Go to: Tools -> Developer -> Custom Loader
    Multiply your current resolution by 2 (i had -w 1920 -h 1080, 1920x2=3840 1080x2=2160, so i set -w 3840 -h 2160)
    image

>>> Perfect 3D tracking (cam_main.cam)
  1. Open _core.cfg and add camera stream to your streams preset
    image
    Join the demo, type fe to activate editing config and do the recording
    image
  2. Download HLAE CamIO To AE script: https://github.com/xNWP/HLAE-CamIO-To-AE/releases/latest
    Install the script by moving HLAE-CamIO-To-AE-Cam_2_0.jsx to C:\Program Files\Adobe\Adobe After Effects CC <version>\Support Files\Scripts\ScriptUI Panels
  3. Create a new composition for your recording (composition fps must match recording fps)
    image
  4. Go to Window and open HLAE-CamIO-To-AE-Cam_2_0.jsx
    image
    Press [Import HLAE CamIO], choose your recorded cam_main.cam and click [OK]
    image
    After importing the camera, switch its properties keyframe interpolation from linear to hold (select all keyframes, right click, toggle hold keyframes) otherwise your tracking will be inaccurate
    image
  5. Done! Now you can add 3d layers/objects and they will be perfectly tracked
camio.mp4

>>> Campath auto-save and load (campath.xml)
  1. Open _core.cfg and add campath stream to your streams preset
    image
  2. Create a campath and record a cinematic
  3. Go to the take folder
  4. Copy campath.xml and paste it to the game folder ..\Counter-Strike Global Offensive\game\bin\win64
  5. Load the campath by typing mirv_campath load campath.xml