Russian version (link)IntroductionIn this article we will try to understand how the interior of the player's first safehouse was added, i.e. Roman's apartment and the adjacent entranceway. This will help you add your own interior to the game.
Which files will be edited- Interior collision (wbd)
- Models for interiors (wdr/wft)
- The ide file to define the interior
- The wpl file to place the interior
What you'll need- Text editor
- OpenIV
- 3ds Max with GIMS IV max script supported
- GIMS IV for 3ds Max
The interior of the safe houseLet's start with the
ide text file, where the interior itself is initialized and configured.
This file is located here: pc\data\maps\interiors\generic\brownstones.ide
Open it and find the following line:
shitholesave, 0, 3, 2, 56, 100, -1, -1
This is where the definition of the interior itself is located. If we scroll down below, we realize that the interior definition is divided into three sections:
1. shitholesave, 0, 3, 2, 56, 100, -1, -1
2. mloroomstart
3. mloportalstart
Below
mloportalstart is the line
mloend, which tells us that this is the end of the interior definition.
After examining the sections of the game interiors, I have compiled the approximate parameters of each section. I will say right off the bat that "unk" is an unknown parameter to me.
The first sectioncollisionName, unk, numRooms, numPortals, numModels, unk, unk, unk
shitholesave, 0, 3, 2, 56, 100, -1, -1
collisionName (shitholesave) - name of the collision whose model is located here: pc\data\maps\interiors\generic\brownstones.img\shitholesave.wbd\shitholesave
numRooms (3) - number of "rooms" defined in the mloroomstart section
numPortals (2) - number of "portals" defined in the mloportalstart section
numModels (56) - number of models defined in the contents of the first section (Actually, there are 57 models, because the report starts from zero, not one)
Now let's look at the contents of the first section. It sets the location of all models relative to the collision center
shitholesave.
modelName, posX, posY, posZ, rotX, rotY, rotZ, rotW, unk, unk,
modelName - model name (wdr/wft)
posX, posY, posZ - position relative to the collision center
rotX, rotY, rotZ, rotW - rotation in quaternions relative to the collision center
Section mloroomstartIn this section the interior rooms are set up. There are three of them:
limbo, shitholerm, shitstairoms.
Each game interior has a room called
limbo. You can say that it is a common room for the whole interior.
I have depicted the boundaries of these rooms in the screenshots in the form of a blue cube:



Now let's look at the room parameters using the
shitholerm example:
interiorName, numModels, numPortals, startX, startY, startZ, endX, endY, endZ, unk, flags, unk
shitholerm, 41, 1, 4.48729, 6.88999, 4.42927, -10.1903, -5.46523, -0.0108841, 1, 2821791308, 111
interiorName - interiorName. It can be used in the function (native) SET_ROOM_FOR_CHAR_BY_NAME and similar functions
numModels - number of used models in this room from the first section
numPortals - number of used portals in this room from the mloportalstart section
startX, startY, startZ, endX, endY, endZ - start and end position of the imaginary cube that will mark the boundaries of the room
Section mloportalstartIn this section, interior portals are configured. When we cross such a portal, we move to the interior room or to the outside.
There are two of them here:
The first portal moves us between the
shitholerm and
shitstairoms rooms
The second portal moves us between the street and the
shitstairoms room
The screenshot shows these portals as planes:

Now let's look at the portal parameters using the second portal as an example:
fromRoomID, toRoomID, posX1, posY1, posZ1, posX2, posY2, posZ2, posX3, posY3, posZ3, posX4, posY4, posZ4, modifierID, unk, unk, unk, unk, flags, unk
2, 0, 2.92575, -7.98447, -4.37221, 2.92575, -7.98447, -1.67221, 2.92575, -9.68447, -1.67221, 2.92575, -9.68447, -4.37221, 55, -1, -1, -1, 64, 16777215, 1
fromRoomID, toRoomID - between which rooms we will move by crossing the portal. In this case ID 0 - street, ID 1 - shitholerm, ID 2 - shitstairoms
posX1-posZ4 - four positions of the imaginary plane, which will mark the boundaries of the portal
modifierID - ID of the timecycle modifier. These modifiers are located here: pc\data\timecyclemodifiers.dat. In this case it is the Diner (55) modifier
We are done with
ide. Now let's look at the line responsible for placing the interior on the map. This line is located in this file: pc\data\maps\east\brook_s.img\brook_s_strbig0.wpl
This line looks like this:
893.109, -496.1509, 18.40247, 0, -1.867381E-008, 0, -1, shitholesave, 385, -1, 15, 500
Note! The collision model of the interior from
shitholesave.wbd is specified here. The same model is specified in the first
mlo section.
At the moment, this is all I know about the interiors of GTA IV.