Tutorial Layout editor tool: Setup and basic editing

Lengthier learning guides you can learn more in-depth processes to improve or setup NR2003 or related tool/programs
Layout Editor Background


The layout editor tool (also known as n2003lyt.exe) is (or was) a lesser known editing tool for NR2003. Its first inception was really only used for a simple UI modification that allowed the F settings when racing to be in any corner the player chose. After this the tool fell into obscurity to never be used again until I found it and used the tool to create UIE 2013 UI mod which is still used to this day by many NR2003 players.

n2003lyt.exe is an old tool. So old when it was created the tool was only made to work on 32 bit OS. The tool itself is a 16 bit program which means it will not run on 64 bit modern machines. Back in the day I would run the tool on an older 32 bit machine then transfer change by change via a usb stick back to my main PC when making UIE. It was an extremely tedious process not only learning how to move around the UI in the lyt files but making a change and booting up NR2003 and seeing if things were moved where I wanted them to be moved. Later in development (as UIE was in development for a good 2 years) I found an 'easier' process by using a 32 bit virtual windows XP machine on a 64 bit machine where I could run and edit layout files using the same pc. This greatly sped up the process and also meant the tool will still be usable with modern machines.

Then in 2020 I once again wanted to use the tool to make my own UI for my ICR series, its not publicly released UI tickers but you can see it in my ICR racing series footage for example this:
1704704004978.png

When making this new UI I did additional research in trying to find a way to run the old program natively on 64 bit machines without requiring virtual machine setup and today now that I have time can share this setup for those interested in making their own layouts for NR2003.


Setup Process


To start you will need to download a few programs to have the layout editor up and running: The tool itself, vDosPlus, then WinMip2, and a text editor. vDosPlus is a tool that acts as a container to run older bit programs and allows them to work on modern machines. This lightweight tool is the key to being able to run n2003lyt.exe on any pc. You can choose to download either the installation or portable zip (I went with portable zip).

vDosPlus

n2003lyt.exe tool

WinMip2

Text Editor (highly recommend Notepad++)

To get started make a folder anywhere on your pc where you want to use as your layout editing area. You can name the folder anything but I will simply call mine 'vDosPlus'. In this folder unzip/install vDosPlus. Next make a folder within vDosPlus folder (where the vDosPlus exe is located) called 'lyt'. Again you can name this anything you prefer but I will keep mine short as lyt for the name 'layout' (short name is recommend). You should have a folder structure like this:

1704704476179.png

Now that vDosPlus is ready we need to add n2003lyt.exe program into it so we can run it within vDosPlus. From the provided link above go into the lyt folder and unzip n2003lyt.zip it will look something like this:

1704704719329.png
N2003LYT.EXE is the original 16 bit program. If you try and click on it you will see it cannot be run on a 64 bit machine natively:
1704704770828.png

Likewise you don't actually run the exe by clicking it, it is similar to make3do.exe where it is run via command prompt. But again trying to run the program in CMD on a 64 bit machine will not work. To do so we run it through the vDosPlus CMD.


Lastly you need a lyt file from NR2003 to edit to begin. I mainly edited files in NR2003 from the replay, main menu, or driving layouts. To get these go to your root NR2003 directory. Then with winmip2 unpack the layout.dat file which can be found in the layouts folder. Unpacked you will see all the layout files that NR2003 uses to tell the game where stp files and text should be on the screen:
1704705591931.png


Note: This directory also includes the .win files which allows you to increase the UI resolution of the game via a hex editor. I will not being going over this myself but you can find the process in the README files of the download I provided.

For the demonstration purpose of this tutorial grab the layout file called mainmenu.lyt and copy and paste it into the lyt folder we made, the same one where n2003lyt.exe is located:
1704705733628.png

Now that the tool is ready we need to run it to edit a layout file. layout files known a .lyt files in NR2003 are what dictates where the UI is placed and looks like in the game, While you will still be limited in some factors such as resolution width and other elements you can manipulate the layout files enough if you think outside of the box. For example how I made UIE 2013 UI Mod to make the appearance of tickers and brand new menus and the ever popular horizontal looking reply UI.

In the n2003lyt download I provided a few of my own txt files that I made way back when I developed UIE 2013:

n2003lyt_partially_translated.txt
Mysticals quick LYT GUIDE.txt

The first text file 'n2003lyt_partially_translated' is where I quick translated the original authors README file into English. The instructions and program itself is in German. So I had to first translate partially and learn in the CMD how to run the tool from German words. You can read my partially translated txt file to understand the raw process how the tool is run.

Secondly the text file 'Mysticals quick LYT GUIDE' I provide the basic run commands I did to edit a layout file. Some of these steps can be skipped nowadays as I found a faster process but I still provided it in-case. We don't need to actually edit the layout files using a CMD anymore and can edit them via a text editor then simply run n2003lyt through vDosPlus to generate the end result layout file we want.


You can read over these on your own time for additional context on the detailed process but next we will run a simple command to edit a layout file to get you started

Running n2003lyt.exe to edit layout files


First thing we need to do is generate a working layout file we can edit, we want to edit that mainmenu.lyt into as workable format we can change values with. To do this go into your vDosPlus folder and double click the vDosPlus exe:

1704706024828.png

When you do, a command prompt like window will appear, this is VDosPlus container shell to run other programs that are not compatible on 64 bit machines:
1704706079267.png

You will notice at the bottom the root directory is defaulting to a 'C drive' interestingly depending where you installed vDosPLus the program isn't actually in a C drive (like mine). vDosPlus is acting like its own root directory as the 'C' drive essentially. We need to point vDosPlus now to the n2003lyt.exe folder. This is very easy to do and the first step always when wanting to edit a layout file.

Type in CD/lyt

1704706273423.png

You will now see vDosPlus is pointing to our lyt folder. Now when we run layout editing commands vDosPlus can properly run the layout editor executable. For the first command we need to take the mainmenu.lyt and make it a text file we can not only read but edit. For this type in the CMD (or copy/paste):

Code:
N2003LYT.exe mainmenu.lyt /gener >mainmenu.gener

Next hit enter. Now go to your lyt folder and you should see a newly generated file called mainmenu.gener:
1704706516401.png

Congrats you just de-compiled a layout file successfully into an editable text format. You can open this format in a text editor. Before doing so what did the command do?

Essentially I told n2003lyt.exe to take the mainmenu.lyt file and generate a gener (or text) file of the layout file. This gener file can be changed to a txt file but it reads the same regardless in notepad++ so I recommended do not change it to a .txt as it will create more work for you.

Now open up the mainmenu.gener file you can see this gives you the ability to start changing the elements. In this case the mainmenu.lyt contains EVERY visible element you see in NR2003 on the main menu. For this demonstration we are going to move the 'single race' button to the right of the screen a bit. Go down to line 183 and you will see all the items for the single race button text:
1704706801256.png

Each UI element is compromised of these 11 parts.

xpos= horizontal coordinates for element
ypos= vertical coordinates for element
xlen= the horizontal length of the element (essentially the render window it can appear in)
ylen= the horizontal length of the element (essentially the render window it can appear in)
fntc= font color (uses HEX color code)
bgrr= background red RGB color
bgrg= background green RGB color
bgrb= background blue RGB color
bgrt= background transparency color
fntn= font style (fonts used by NR2003 in the fonts folder only)
stpn= STP file used (would point to the folder directory in NR2003 where STP resides)

*Objekende = this is not an element, this just means end of the current object statement in German, do not edit it


Note: not all UI elements use all 11 (or even can use them but you will have to play around with them to see what can and cannot work.)
Note: When making edits highly recommended making a backup of your last known GOOD state. If you accidentally change a UI element too much (for example move the EXIT button off the screen) you'd have to force close NR2003 as no button would be the to press and revert your change. Some changes could crash NR2003 if the game doesn't understand the text/numbers you put in too


For this example we are going to move the SINGLE RACE button on the main menu over to the Right side of the screen a bit. Find line 184 where is says xpos=51 and change 51 to 151 then save your file. We moved it over to the right 100 pixels essentially.

Now that we have made an edit we can recompile our gener file into a working layout file to put into NR2003 and see our changes. To do so go back to vDosPlus and enter this command:
Code:
n2003lyt.exe mainmenu.lyt /edit <mainmenu.gener > nul

Now you have successfully overwritten the mainmenu.lyt file that was in the lyt folder:
1704707471336.png

This command I told the exe to take our gener file and edit the current mainmenu.lyt file that is in the folder with our new changes.

Note: to verify the file was updated seeing the time/date change is the best way to see it was modified on the lyt file


Now take your mainmenu.lyt and copy/paste it into your NR2003/layout folder and boot up NR2003:

1704707829118.png


And there it is, the very basic creation process of customizing your UI in NR2003 any way you like.


Considerations when editing layout files


There are some things you should take into consideration when playing around with and editing layout files as you delve deeper into them and the experience I have with more complex edits:

  • The 2 commands I did above can be reused to de-compile and compile any layout file, just replace where it said mainmenu.lyt or mainmenu.gener to whatever layout file name you are editing
  • notepad++ is really great for being able to find and replace multiple changes as well, for example if you make a bunch of custom STP's and want to rename then much faster than manual typing and finding them on each line
  • Adding or removing ANY line in a layout file will break it, the game will not understand additional lines so you can only edit what is currently present but no add additional elements
  • Some UI elements are children to other elements, so if you move one others will follow it. This is most evident on the racing F settings for example. So you you move a main F2 Setting elements ALL of the other F2 elements under it will follow, So this makes it more complicated when changing the coordinates between parent vs child elements
  • Some layout files such as the player menu (where you the player chooses your single player/multiplayer car) may not be editable, certain layout files have other elements such as sound files and this will crash the game when you recompile and inject these into NR2003
  • Its recommended when making custom UI layouts to start slow and save your files little by little as you make changes so if you make a bad change you can quickly revert to a good state
  • You may open up and edit my UIE 2013 layout files for example for educational purposes locally on your wn pc of course to see the more complex processes I did but do not re-upload or modify my files to any site or claim credit from those changes I did (such as removing my credits sections or injecting new changes and claiming UIE 2013 for yourself). It would be no different from someone taking a track or mod another made and modifying it without permission.
  • You can read the partially translated README to know how to increase your UI by resolution editing the .win files in a Hex editor. 2 numbers need to be adjusted to gain a higher resolution like I did with UIE 2013 layouts and my ICR custom layouts
  • While you can define your own folder directories for STP files in the layouts folder, the lyt files themselves will still need to be in the root NR2003 layout folder for your changes to take effect in NR2003
  • STP files can be designed however you want, saving them as type 6 or 7 (highest quality) is recommended depending if they have transparency or not (6 for opaque and 7 for transparent elements in a STP)
 
Last edited:
Who read this thread (Total readers: 0)
    Top