Jump to content

A Guide to File Editing, Definitions & Modding


Recommended Posts

Since the arrival of Red Dead Redemption 2 for PC in late 2019 the modding community have been hard at work researching and developing new mods to bring new exciting and fun experiences to everyone. As an experienced mod developer I would like to share my knowledge to help anyone who is looking into pursuing modding since there isn't too much information about so I hope this topic brings some light into how modding works with this newest version of RAGE and provides the necessary information needed. If you're familiar with other RAGE titles such as Grand Theft Auto V/IV, Max Payne 3, etc, I would recommend reading on due to Rockstar making some sufficient changes to the current iteration of the RAGE engine. This topic will aim to cover the basics of file definitions and their main purposes, ways to stream modified files directly to the game during runtime, tools needed to mod the game and the current constraints on modding as it stands right now. Moreover, to give a brief on who I am and my background in the Red Dead Redemption modding scene, I have been heavily active in the modding community since the release. I've developed a couple of mods including the Armadillo Restoration Community Project and a couple of other map mods. 


Before I dig any further I would like to give my biggest thank you to the OpenIV Team, LMS, Alexander Blade, @rollschuh2282, the Cfx.re (RedM/FiveM Team) and everyone else involved helping the community with the amazing research and the tools to make modding possible for Red Dead Redemption 2. I couldn't thank you enough for the amazing collaborations you folks have made.




The release of the game for PC brought in several challenges to modders in 2019, the reasoning things are progressing much slower than Grand Theft Auto V is due to the newly updated file formats and the introduction of hashed file names in all of the RPF directory archives. This has led to a very slow start but 2021 has brought much less weight to that and more developers are getting involved to help shape the future of modding. This year the developers behind the LSPDFR mod officially released Lenny's Mod Loader for RDR2, enabling the modding community to stream modified game assets into the game for the first time. This tool allows for any sort of file to be streamed ranging from basic XML files, select RAGE files (i.e. Ymap, Ytyp, Ymt, Ytd, Ydr) and all sorts of other game files. To modify a file OpenIV is needed to extract any files you wish to modify, please note the OpenIV Team has announced it is bringing editing support later in the future but a release date is currently unknown.


JrBPaH1.pngHow would you go about editing files? This is super straightforward. Lenny's Mod Loader is capable of streaming files from its raw file state so there won't be any need to find a tool to encode a file into a box standard compressed PSO/RAGE file. This means exporting a PSO/RAGE file into an XML file will make the game recognize that it is a valid file, thus can be streamed into the game with the power of Lenny's Mod Loader. 


But how will you be able to edit these files? This is where the good ol' Notepad comes in but not the super basic Windows application. I would recommend installing Notepad+ or any alternatives that can handle large files with a range of tools to help you edit the files. Some files you will be editing may be large in file size so avoid the basic Notepad if you can. 


If you wish to export a file which is compressed/or has encryption, OpenIV will provide an option (in some exceptions depending on the file format) to export the file into an XML file by right-clicking on a specified file. Note that some files can be large, in cases can be up to 50-100MB depending on the file. This is why Rockstar compresses these files so the game isn't so large unlike titles such as Modern Warfare (lol)




Let's dive into another important topic to be aware of. The release of the game brought in a new measure to the game files which I will try to explain in the most detailed way possible. Rockstar Games introduced hashed file names across every RAGE package file when opened in OpenIV. It seems Rockstar isn't too much of a fan of people digging into the files but the OpenIV Team, @rollschuh2282@_CP_ & @WildBrick142 have been hard at work adding the file names to a GitHub repository. You can compile the newly updated file names at OpenIV's GitHub but the updated names are expected to be featured in the upcoming update. But for the sake of this topic, I will explain the process of compiling the file names and have them added to OpenIV without having to wait for an update.


Follow these instructions carefully: 

1. Head over to OpenIV's String Database and press the option 'Code' then download   

2. Extract the ZIP file

3. Open the RDR2 folder

4. Open the following CMD files 'Build-ArchiveItems-RDR2-OpenIV', 'Build-AudioTracks-RDR2-OpenIV', 'Build-TextKeys-RDR2-OpenIV'

5. After the tools finish compiling the file names, head Documents\OpenIV\Red Dead Redemption 2\Strings and move the compiled .txt files into Strings directory 


 Open the image links for the full picture sizes  

WaYXhY6.png  qInILgO.pngcyEQ2FA.pngm02ZGpZ.png


Next up, we will dive into Lenny's Mod Loader. This brilliant tool was developed by LMS, this tool allows us to stream modified files during runtime. If you're familiar with GTA: San Andreas modding, the process should be fairly easy to understand since it involves a Mod Manager. Lenny's Mod Loader does not edit the RAGE archives but instead replaces a file during runtime. When LML (Lenny's Mod Loader) has been installed into your game directory, you'll notice the tool will bring a new folder forward named 'LML', this will be your main hub where your modified files are stored at. 


You have three option which I will explain very carefully in order to stream files.


  • You can create a new folder named 'stream', you'll be able to stream any modified file but this is not recommended for mod releases and should really be used for testing or mod debugging purposes
  • Secondly, you can create another folder named 'replace', but you will need to specify a folder directory with the file path of what asset you're trying to replace. For example, if you're replacing a simple ymap file for '0xdee91a1c.ymap', then you'll need to make a folder structure such as this 'levels/rdr3/terrain/NOPQ_07_10/NOPQ_7_10_lod_COMBINE_METADATA' but do not follow the OpenIV file structure. You can grab the proper structure by enabling the vfs debug log in lml.ini (can be found in your game directory) by setting the LogLevel value to 0 and heading directly into the game in order for LML to record the file path which therefore can be seen vfs.log in Notepad.
  • Lastly, you can create a folder where your modified assets can be stored at with an install.xml file to let LML know where it can replace your modified files with their respective file paths. This is recommended for developers who are planning to publish a mod. This is a way more public-friendly way of shipping out mods as the user would only have to copy over a folder directly into the LML folder without having to mess around too much. There is some install.xml examples within the LML download so be sure to have a look at them.




fIBofeq.png     pAvYS0U.png    ZRTuPUO.png







evmH71T.png  This is file keeps compressed map placement data for all types of game archetypes (also known as game models and fragments). This file is also responsible for keeping data for LOD lights (Level of Detail) and vegetation.


EI6bXQc.png  Ytyp file is a compressed file responsible for defining game archetypes (also known as models and fragments) and storing data for interior object placements and other types of data for MLO interiors.


QfpOijT.png  Ymt is a compressed and encrypted XML file that has several key responsibilities, this may vary from item data, game character definitions, attributes for many key parts of the game, etc.


wH2dDyZ.png This file is an encrypted and compressed file for game models. Every YDR object needs to be defined in the Ymf (manifest) and Ytyp files in order for the game to load it.


eTjIxUs.png This contains compressed texture files reserved for game models and other key areas of the game (UI, in-game item previews etc). This file can be edited with the RedM conversion tool as of now.


AUgshce.png This file defines files such as Ymap, Ytyp, Ydr, Ybn, Ytd and interior files


OdkDl1X.png This file is responsible for containing collision mesh. For example it keeps the surfaces and objects solid with certain flags attached to several parts of the game so it has different reactions/behaviours 


B8O4SvS.png AWC is an encrypted and compressed file containing audio data, this file is currently not editable at this time.


juvchz2.png This file is a dynamic 3D model which can be broken into parts (i.e. fence), this file is compressed and encrypted.  


s2qnqBy.png This file is an encrypted and compressed file containing the game code for Red Dead Redemption 2


m6Omm72.png This file is a compressed file containing text entities, there are several of these files for different languages 


CskTzOd.png This file contains navmesh, this file gives NPCs instructions (or flags in a better manner) for appropriate places to be on (i.e. a street) 


Fa1ZhuC.png This file contains more than more one standard Ydr model. This is usually reserved for game map LODs


Hpv0uUS.png Ycd contains encrypted and compressed animation data 




PbJES7z.pngThis part of the topic will cover the basics of map editing. After some extensive work on many of my map projects for Red Dead Redemption 2, I would like to share some of my techniques in order to make changes to the map using the proper Ymap files. We'll not be using Map Editor to make changes but it'll be needed later on during this tutorial to record the entity positions if we would like to remove certain objects within the game world. For the purpose of this section, we're going to make a few changes to a small building platform in Armadillo, as you can see with an image on the left there is debris, damaged objects and vomit scattered across the platform. The aim of this tutorial to remove rubbish and cleaning things up to make this platform look like the original title. So, what do we need? Well, several tools will be required so please install them if you haven't already:

RedM (for texture conversions) 

- Map Editor 

- A handy Notepad+

- OpenIV




To start right off, we're going to need to use the Map Editor to record the entity positions for a save file. This amazing mod will allow us to remove any objects within the game world which then save the entity positions into the project file, therefore enabling us to find the object positions in a Ymap file directly from the XML file the Map Editor generates in the game directory. By pressing F5 on your keyboard it'll bring up a menu with a freecam view, by moving around with the camera you may notice the dot in the middle will turn white if an object is selected, for example, we're currently selecting a plate on the platform. We're going to hold the space key while the object is selected in the camera view then simply press the 'Delete' key. Apply this same method to every object you would like removed - after finishing save the project, this will create a new file in the Map Editor folder in the game directory. 


Your file can be found in Red Dead Redemption 2/Map Editor/Maps


O8Yz8Jt.pngLet's start by opening the file in Notepad+. Bingo! It has recorded the entity positions in each of the deleted object entities which we will now locate in the Ymap file for removals. Next up, we're going to be locating the Ymap file responsible for keeping the prop positions on the platform. It is a little tricky finding the file manually but Lenny's Mod Loader keeps a log of RPF achieves being read during runtime in its vfs.log. By opening the log, locate the file along with the words "lod_combine_metadata", if you search for it should be on the bottom result if you closed the game. It should look like this:



We're now going to search for the responsible RPF file keeping for all the Ymap files for New Austin in OpenIV, this is the following file we'll be finding rstu_96_99_area_lod_combine_metadata.rpf. Please select all the Ymap files, right click and press 'Export to XML' (create new folder somewhere to store these files). Now, head to the file location where the exported Ymap files can be found and have them all opened in Notepad+. This may take a little while to open to the sizes of the files. Once this has been done, we're move onto the next task to locate the debris entities within these Ymap files.


When searching for any type of file in OpenIV, please always check if the there is a new version of the file stored in the patchpack files. A file path to the updated file will be needed


EjfbHw3.png     xnNJpgJ.png     



We now have all the files open, please open the save from the Map Editor to have the entity positions handy. Use the search tool with Notepad+ and copy the first object position value into the search function (also use other values if no search results come up, can be a little tricky sometimes), then press 'Find in All Opened Files'. Depending your PC speed, this may take a few seconds to search through the files considering there are tens of thousands of entities across these files. Once this has been done, Notepad will provide a search in a box on the bottom. And there it is! The first result will provide the name of the responsible Ymap file and its entity properties. Make sure to double click on the first result to open the Ymap file, this will also direct you to the first entity. 




Remember that bowl we selected in Map Editor earlier? Here is the entity. Select the whole of the entity properties and remove it. Please apply this same process to the other objects to remove them. When you have completed this process save the Ymap file into a different location and make sure the file is named .ymap with its file extension so LML can load into the game later on.


Let's test the changes out! You can test the changes out by creating a new folder in the LML folder "stream" and adding the modifed ymap file into the folder. Lenny's Mod Loader will override the game's file with your modified file during runtime.


Success! We have successfully removed the objects!



You can apply this same process again if you want to remove any sort of model such bushes and all other type of models in the game world! But it's not quite finished yet. We still need to remove the vomit across the surfaces with the platform. This is where RedM comes in super handy. The folks at RedM have developed a new tool to enable us to edit RAGE texture container files (also known as .ytd files) with the RedM conversion tool. The process is a little confusing but I will walk everyone through for the sake of this topic. 


Make sure you have RedM and OpenIV installed and are on the latest update and follow carefully! 


1. Make sure to have a copy of Grand Theft Auto V installed on your PC and launch OpenIV (with GTAV)

2. Create a new folder anywhere in your game directory then right click inside and create a new RPF archive (any name you want)


3. Inside your new RPF file, right click again and create new YTD file (any name you want for now)


4. Now with that created, let's move onto another section. This texture container will needed shortly which will explained in a bit.



We're now going to find the textures responsible for containing the vomit textures but if you're going to edit a texture you'll need to locate the location vfs.log file to help you locate it. For example, the voimit for the platform are located in platform:/levels/rdr3/area/RSTU_96_99/arm_03.rpf. 



Edited by VideoTech
Link to comment
Share on other sites

  • 6 months later...

Thanks very much! Cld you pls post a turorial for .ydr file in red dead redemption 2?

The OpenIV version is 4.1

Why do i have no View or Export to openFormats(.odr) item?

Link to comment
Share on other sites

  • 7 months later...

Glad to have this. But man, when and why the hell did all modding discussions move to Discord? There’s so much more we’ve found out concerning modding RDR2, but most documentation is hidden in Discord channels that you have to be invited to. And obviously searching on Google won’t bring you to any of those tutorials or documentation posts.

  • Like 2
Link to comment
Share on other sites

  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.