How to Use demos/recs in Vanilla MBG:
Written by:
Mazik
Special Thanks to:
Dom, NF, Doomblah, Xelna, Hyran
Mazik
Special Thanks to:
Dom, NF, Doomblah, Xelna, Hyran
To all the people wanting to get into speedrunning in vanilla MBG who have lost recs to the rec system and/or poor explanations of it, or do not know what a rec is and want to know (please keep your innocence) - this guide is for you. This post will try to cover every detail you need to know about recs and how they work so that you hopefully do not lose a good run, or, god forbid, a world record to the mess that the rec system is. All of this will seem pretty complicated at first, but don’t worry. Once you play around with recs a good number of times it is actually not as daunting or confusing as it may seem.
Some things to keep in mind: Red text indicates what is either a common mistake and/or things you shouldn’t do, and blue text indicates alternatives to something I mentioned earlier.
What are demos/recs?
This section can be skipped for those already familiar. For the uninitiated; demos, or recs, are files that MBG uses for its replay system. The rec works by tracking all inputs for each frame of the run, which are recreated in real time when the rec is replayed. This usually works well, but there are certain factors that could easily cause recs to not work as intended. These factors will be discussed later.
Before using recs (on Windows)…
Before starting to record a rec, it's important to note that how you open MBG (with or without administrator) and where the shortcut is on your computer can affect whether a file is created or not when recording. A rec not saving due to this has happened to a select few people in the past and has caused some confusion. For starters, avoid multiple installs of MBG on your computer to prevent confusion on where a rec got saved (this applies to both Mac and Windows).
If you're opening the game from within the MBG folder (located at C:\Program Files (x86)\Marble Blast Gold by default) and you save a rec, then it will save the rec properly. This works with marbleblast-patched.exe as well. Otherwise, if you have an MBG shortcut outside the root folder and you're using that to open MBG, run it as administrator, so that recs save properly.
What I personally do:
What I found to be most convenient for me was to drag the MBG folder out of Program Files (x86) after a fresh install, put it on my desktop, and run MBG from there. I wanted to have MBG in an accessible location for me along with everything else relevant to it (like recs). Another option is to create a shortcut for the Marble Blast Gold folder to your desktop. By working directly with the Marble Blast Gold folder, you will never have an issue where a rec doesn’t save even though you followed all the steps for recording a rec file. This is merely a suggestion, though, so do what works for you.
Recording and Viewing demo/rec Files:
The reason why you are here. In this section, I’ll go over all the important details you have to follow when dealing with recs, along with some extra details that may be beneficial in some scenarios. Here is a video showing all the important steps below in action. This video works best when viewed in tandem with the written steps below.
In addition, Dom has also created some great resources that makes dealing with recs a lot more convenient. If you are playing on a Mac however, the relevant tools will not work for you. You can find them here. The ‘Read Me’ document contains all the details about every tool provided so don’t skip over it. Here are all the relevant stuff that pertains to recs and which steps they apply to:
- recverify: Step 7
- main.CS: Steps 2 and 6a
- playgui.cs (both of them): Step 6a
- Open the game and go to level select.
- While in level select, open the console using the tilde (~) key on an english language keyboard, the console will appear on the top left corner. Type $doRecordDemo=1; into the console box, then close the console with the same key. This command, along with any others shown after, are not case sensitive.
a. It is recommended to copy and paste the command. Syntax errors may give an error on the console, but accidentally omitting or adding a letter to the command will usually not give an error and may lead to a false positive of thinking you have started a rec recording.
b. For non-english language keyboards, the console key should still be just below the escape key.
c. For Macs: Fn + F10 is how you open the console. If that doesn’t work, try ctrl + Fn + F10, or just F10.
d. Console Tip: You will often be using certain commands multiple times when using the console. To make your life easier, you can sift through previously used commands in the console by pressing the up/down arrows on your keyboard. - Pick a level you want to record a rec for and play that level normally. The rec starts recording while the level is loading.
- If you fail a run/go out of bounds (OOB), press escape, exit the level, and re-enter the level for another attempt. The rec for that run ends once you’re in level select.
a. You do not need to retype the recording command before entering the level again, the command will continue to run until you close the game.
b. Do not press “Restart” on the pause menu while recording a rec. This results in the inputs you use in the following run(s) to be transferred over to your first attempt on playback of the rec.
c. For some levels ( like Space Slide on 30 FPS ) it can be beneficial to go OOB while holding the left mouse button for faster attempts due to long loads. Keep in mind, sitting through multiple attempts in one rec is not fun for any viewer, so keep this to a minimum.- Trap Door Madness and Battlements (WR log traplaunch) are unique in that because trapdoors don’t reset after you go OOB, the first attempt in the rec is just a setup for the 2nd attempt. Treat both attempts as one and do step 4 accordingly.
- If you finish a run and want to keep doing attempts you must first exit the level by hitting “continue”. The rec is currently in some sort of finalizing state, and it is not safe to do the next attempt. To finalize the rec, enter any level and exit. Then, return to your level of choice and enter. You should now be safe to do the next attempt.
a. If you don’t follow step 5 (or 5c), the rec will show a previous run you did and use the inputs you used in the following attempt(s) on the finish pad.
b. Note that existing particles (jumping, super speed, super jump, mines, and fireworks) can cause the game to crash when you re-enter too quickly. It is best to wait for the fireworks to complete before step 5.
c. A simpler and less convoluted method than step 5 is to press “Replay” on the finish screen, then exit and re-enter the level. Do not finish a run immediately after pressing “Replay”, as that will have the same result as step 5a.
d. If you wish to view a run you just finished and you don’t care about saving the rec, simply exit the level, go to the main menu, and back to level select. Then open the console and type: playDemo(“marble/client/demos/demo.rec”);. Not going to the main menu before viewing the rec causes the game to crash, but you will not lose your rec from that.- If you choose to use step 5c instead of step 5, you can view the rec straight from level select without the game crashing.
- If you finish a run and want to save your time on rec, or if you want to save a fail/blooper you just got, exit the game and go to your demos folder, located at C:\Program Files (x86)\Marble Blast Gold\marble\client\demos by default (If you moved your MBG folder, go to wherever you put it). The rec you want to save will always be named “demo.rec”. Rename the rec file with whatever name you want to give it to prevent the demo from being overwritten while doing additional attempts.
a. To see the 3rd decimal of any run, at any point in time before you leave a level, type echo(playgui.elapsedtime); or messageboxok(playgui.elapsedtime); in the console to see it. The first one will display the full time in the console and the second one will display the full time in a message box in the middle of the screen. Use whichever command you like best.- After viewing a rec (Steps 4d, 5d, and 7) you can use the above commands to check the 3rd decimal too.
- Alternatively, if you get a local top 3 time, you can check your prefs.cs file located at Marble Blast Gold\common\client and scroll down to see your top 3 in any level you want. Keep in mind some levels may be spelled slightly differently.
c. For Macs: users/[user]/Library/MarbleBlast/marble/client/demos is the file path by default. “Library” is a hidden folder, so click on "Go" in the menu bar and hold down option, it should reveal the library folder for you to access.- Other methods to access Library: (1) Shift + Command + G and type Library, (2) Shift + Command + . to show or hide hidden folders (macOS Sierra or later)
- Sometimes the file path can change because of a variety of reasons, maybe you just recently installed another marble blast mod (including the unlocked framerate version of MBG), or you recently upgraded your OS. Whatever the case is, if the file path changes at any point, simply go to MBG, right click and Show Package Contents, marble/client/demos.
- If you want to view the recently renamed rec, open up MBG, and go to level select. From here, open the console and type in the command playDemo(“marble/client/demos/[demo].rec”); to view your run, just replace [demo] with whatever name you gave that rec.
a. Do not view your recs from the main menu. If your rec goes on for longer than ~15 (Mac) or ~30 seconds (Windows), the game will try to play another rec while the one you’re watching is playing, causing the game to crash.
b. playNextDemo(); is another command you can use in place of the one in step 7. This one plays all the recs in your demos folder in reverse alphabetical order by default. It will play the last rec in the folder, and when you put in the command again it will go to the next one. Mostly useful when you only keep a select few rec files in your demos folder.
c. playDemo(FindFirstFile(“*[demo].rec”)); is another command that functions the same as the one in step 7, with the key difference being that you don’t have to type in the file path. This is especially useful if you have folders within your demos folder for organization purposes.
d. Playing Windows recs on Mac and Vice Versa: Windows and Macs physics are calculated slightly differently between the operating systems. The inputs recorded on a Windows rec might play back differently on a Mac, or vice versa, which would result in a desync.
Desyncs
Even if you follow all of the steps above to a tea, there are a few scenarios where the rec will display an incorrect time at the finish, or not even finish at all. This is called a desync, and on a select few levels can be incredibly annoying. Here is what they look like, along with the solutions to them (more info below).
Step 7d in the section above is the only example where a desync can happen for any level, but thankfully this is a minor issue. What are not so minor are trapdoors and fans. These two hazards are major issues to deal with when getting recs to play back properly.
Trapdoors and fans will desync whenever the frame rate at the time of recording does not match the frame rate during playback. Fortunately, trapdoors will cause a desync only when stood on for too long. To avoid this, either continuously jump or be rolling fast enough on the trapdoor to prevent being on the trapdoor while it is descending.
For fans, the solution is to use a third party frame rate locker like RTSS to lock to a frame rate where every frame is the same duration (250 fps, 200 fps, 125 fps, 100 fps, 50 fps). You will want to use whatever the highest value is that you can maintain with 100% consistency. When playing back the rec, you will also need to lock to this value. Unfortunately this is a Windows only solution, as there are no framerate lockers like RTSS for Mac. The closest thing Macs have is playing MBG with Vsync and playing the rec back with it (more info in the next section), but this is very unreliable and is not recommended.
Rivatuner Statistics Server (RTSS) and Vsync
Mentioned in the previous section, RTSS is a framerate locker for Windows that allows you to lock your framerate at any value from 30 (minimum fps allowed for marble blast runs) to 480 (maximum for RTSS). You will rarely use this when doing runs, but it helps immensely on Airwalk and Fan Lift for more consistent rec playbacks, and for Freeway Crossing and Space Slide for more powerful mine hits. If you’re interested in using it for these levels (and possibly others), here is the download link, download the latest version at the bottom of the page.
Once you download RTSS and launch it, it won’t open right away. It’ll appear on the far right of your taskbar as a tiny icon. Click that icon for RTSS to open.
You should be met with this screen. If you want only a specific game to be affected by RTSS, click on the green “Add” button, navigate to wherever “marbleblast-patched.exe” is (unlocked fps version) and select that. Copy all of the settings from the right hand side of the screenshot onto your copy of RTSS, you can adjust a few of these settings to your liking.
Now with RTSS configured, open up MBG and you should see your framerate in whatever corner you put the fps counter in. Now you can play any level you want and record recs as normal. Note that when viewing a rec that was originally played in lower fps, it will look more choppy than other recs when viewing it at a higher framerate.
While Macs may lose out on locking to any fps value they want, they can lock to whatever their monitor’s refresh rate is (or whatever they have their refresh rate set to). To do this, open MBG and type in the console setVerticalSync(true); to set your fps to your refresh rate, then play as normal. If you want to turn it off, replace true with false. This command works on both Mac and Windows, but the downside of this method is that your fps won’t be as stable compared to when you are using a framerate locker.