Growing up, I always had a bit of a knack pulling things apart and seeing how they work. From toys to stereos, to game consoles, I always had to have a look inside. And this translated to the digital world as well, computer games are no exception. One series of PC games I played and remember quite fondly were the old Matchbox cars games. Personally I have (and still do have in my possession to this day) the Caterpillar Construction Zone 2 and Matchbox Emergency Patrol games respectively, of which I have spent extensive hours playing both. Later on I moved up to the “big boy games”, which was the NFS series of games, the then new Battlefield 1942 and Quake III, which then evolved over time.
The two Matchbox games I had were quite unique, as they were released in 2000 and 2001 respectively, so no modern day bullshit like microtransations, predatory in-app ads or always online connectivity. About the only “online” games in that list were BF1942 and Quake, however those could be played just fine offline in a LAN.
Despite growing up and having a great arsenal of games over the years, and advancements of technology, I occasionally booted up the Matchbox games for old times sake. There’s just something… cool about aimlessly wandering around a low poly world causing havok. While the scope of doing this was pretty limited in Construction Zone 2 (you could still fuck up the gold processing plant easily, which led to many hours of laughter after I first worked this out), Emergency Patrol was way different. You could be a Paramedic, Firie or Cop saving the town.
While you could play it properly and complete the missions, you could just cruise around the town, and basically let your imagination run wild. This imaginitive play has opportunity however, and that comes into modding the game.
But why mod a 20 year old children’s game? Because I was bored during the COVID lockdowns. And in the end, this turned out to be quite easy while also learning at how this game ticked.
I’ll show you how you can turn an innocent game into something worthy of achievement.
1. Understanding the file structure
This can be the tricky part for many games, as quite often games used to pack things into their own bespoke file format. Emergency Patrol was no different. It thankfully uses a fairly simple structure, thus easy to understand. The file structure is as follows:
hightex [DIR]
icons [DIR]
objects [DIR]
textures [DIR]
videos [DIR]
|–config.cfg
|–Cpuinf32.dll
|–errorfile.txt
|–F1.bor
|–IntroAnimation.bor
|–LevelFile.mef
|–libmmd.dll
|–mep.exe
|–Msvcp60.dll
|–PreloadCamera.bor
|–ReadMe.txt
|–renderd3dR.dll
|–rendersoftR.dll
|–rendersoftrf.dll
|–savegame.dat
|–sbox10r.dll
|–smackw32.dll
|–texture_attributes.dat
|–textures_all2.tex
|–textures_all2s.tex
|–textures_all4s.tex
|–title.bmp
|–Voices.dat
|–wave.dat
|–xgame.exe
|–xgamesetup.exe
Lets start in the first folder, the root level.
At this point in time, we can safely ignore everything with a DLL, EXE, MEF or TEX extension. The TEX files contain the textures for the game, which I haven’t yet figured out how to crack open. The MEF file must contain internal pathing for the actual world itself, which on inspection doesn’t look like anything we can modify without having the game source. However, the four DAT files are of interest.
The two big files, Voices.dat and wave.dat are where the audio magic happens. These are simply renamed ZIP archives, as 7Zip will open them in their current state. If you change the extension to ZIP, Windows Explorer will even open them. Handy, huh?
Extracting them reveals an even better surprise. The files here are all standard 11025 or 22050khz .wav files. No restrictions apply to the bitrate or length, as they aren’t read in sequentially. The game simply loads the files by name.
To replace them, its as easy as copying files with the same name over the top.
Once you are done, simply compress the directory again using Windows Explorer and rename the newly created archive to the same .DAT extension. Be sure to not include the directory inside, as the game will crash! The best way is to select all files inside the Wave or Voices folder, then right-click and select Send to > Compressed ZIP.
The two other DAT files are less interesting. Unlike Voices and Wave.dat, they are not ZIP files.
savegame.dat is only used to keep your progress in the game. This one seems to be raw data.
texture_attributes.dat is used to assign shading types to textures. This is just a text file.
The three BOR files serve pretty much what they say on the tin, with the exception of F1.bor. Again, this is one of the magical files that cause the most significant changes to the game. It contains all vehicle info, including handling, engine info and model assignments. It also controls model shading assignments as well as other low level graphics information.
The Hightex folder contains only two BMP files, of which neither are used in the game when it is running in hardware rendering mode. These may only work if the game is set to run in software rendering.
The same applies to nearly all of the BMP files in the icons folder, with the exception of a few files. All of the BMP files in credits.dat appear to be used in hardware mode, as I have had success modding these.
Objects contain the game’s entire physical models as well as the model for the world. These files are in MS2 and BPK format, of which the former lives inside another DAT file. The MS2 and BPK files I don’t know what they are, thus ignore them for now.
Textures appear to contain 7 BMP files, of which again may only be used if the game is running in software rendering.
Videos is a very interesting folder. To the unitiated, this folder contains 31 .SMK files in an unknown format. However, the game’s own ReadMe file names exactly what these are, given away in the legal notice section.
Uses Smacker Video Technology. Copyright (C) 1994-2000 by RAD Game Tools, Inc.
You may be asking, Smacker Video Technology, what is that? Well, Smacker Video is a very old compression technology for playing videos! Those SMK files? They are known as Smacker video files. These files can be played back by installing the RAD Video Tools suite from the RAD Tools site at http://www.radgametools.com/bnkdown.htm.
2. Creating game mods
You now know the file structure for the game, and its current limitations. Sounds and videos are currently fully hackable, however textures are not currently.
Modding game sounds
As previously mentioned, this can be done by extracting and replacing files inside the Voices and Wave.dat files respectively. These files are standard WAV audio format files, and as such can be easily tweaked.
Compiling compatible Smacker video files
Unfortunately, compiling fully supported videos for this game isn’t as easy as grabbing the latest RAD Tools and going to town. Far from it in fact. Because Emergency Patrol is so old, it uses a very outdated Smacker codec. The workarounds to getting this to work are very tedious at best, but the way I have done it was the most successful and produces the most consistent results.
To make life more difficult, the newest tools available from RAD Tools barely have a working Smacker video compressor at all. Very often it spits out corrupted video files that just spew up pixels all over the screen, like a bad Digital TV signal. It also cannot produce rips of the original game videos with working sound. At most you get very loud clicking sounds, at worst nothing at all. So in my eyes, this one is pretty much junk and useless.
Here’s what you’ll need to be able to get both working rips and replacement videos:
RAD Video Tools 1.8
Quicktime 7.4 (the latest version)
Smacker Tools 4.2c
Handbrake
XMedia Recode
One you have all of these installed, lets make a start.
1. Get any video in MP4 format. We will need to rip the audio into WAV format, so that we can mix it in later.
You will need to re-encode using Handbrake to shrink it down for the Smacker compressors as to not make a huge file.
Settings for the video encode in Handbrake are based off the Discord 240p preset. Changes are as follows:
SUMMARY:
– Format: MP4
– Web optimised, align A/V start and passthru all unchecked.
Ensure that the output file has an MP4 extension, NOT M4V.VIDEO:
– Encoder: MPEG4
– FPS: 25 (or the source of the file)
– Avg Bitrate: 200
– 2 pass encoding checkedSettings for the audio in XMedia Recode are WAV, codec PCM unsigned 8 bit, sample and channels of your choice. Use XMedia Recode to save a 1:1 copy of the audio data from your video.
The reason for the low bitrate of the video is to match the originals from the game. With a low bitrate, this allows them to be playable on Windows 95 and 98 era hardware without any problems.
If you are playing on much newer hardware, you may be able to increase the resolution up to 640×480. However, I would not go beyond this, as the game has to try and rescale the output to fit the game’s render window.
2. Using RAD Tools 1.8, “smack” the resulting MP4 file that Handbrake put out. You can leave the settings as default. This will create the first .SMK file. If you do not want any sound in the video, you can leave it as is and skip to the last stage.
At this moment, I strongly recommend you test that the video plays properly with no artifacts using the Smacker Player. If you installed the tools to your machine, simply double-click the file in Windows Explorer.
3. Using the old Smacker 4.2c tools (run smackerw), smack the SMK file you just created with default settings. This is required so the Smacker Mixer can place audio in the file. For some reason, the older Smacker Mixer complains of an invalid Smacker file if you skip this step.
4. Mix in the WAV file using the Mixer tab on the file created in the last step.
5. Play the created Mixed file using the Smacker player. It should have full sound support.
6. Copy the newly created file to the game’s Videos folder. It must replace an existing file. For testing I usually replace the Mattel Interactive video, which is named “MIIntro.smk”.
Vehicle handling mods
Inside the F1.BOR file lives the vehicle handling data. Below is an example of the file in question.
*CAR FireTruckDesc ThisIsDescriptionOnly=1
CarWeight = 2.0
MaxPower = 12.0
MaxBrakes = 0.0005
Friction = 0.15
# TireDX = 325 TireDYFront = 500 TireDYBack = 580 TireDZ = 100 TireDYMid = -370
TireDX = 235 TireDYFront = 450 TireDYBack = 650 TireDZ = 100 TireDYMid = -350
FrameDX = 375 FrameDY1 = 770 FrameDY2 = 800 FrameDZ = 180
TopZ = 550
NumberOfTires = 6
TireShapeName = “FireTruckTire”
CameraHeight = 500 CameraDist = 2500# —– Parameters for physical car
M = 4 GravityK=5 # main values
MaxSpringDX = 6
Ks = 0.09 # spring k
Fx = 0.9 Fy = 0.025 Fz = 0.03 # friction matrix mains
DrivingForceDZ = 50 PowerK =0.5 # displacement and K to handicap Power
BrakesK = 1000
BounceMeRest = 1.5 SmallLightRest = 0 SmallHeavyRest = 0.5 BigLightRest = 0.1 BigHeavyRest = 0.8
ObjectsBounceForce = 5
BounceZ = -0.6 BounceX = 0.8 BounceY = 1
LocalGravityK =1
AddGroundCollisionK = -0.1
MaxBrakesK = 0.5
TireRadius = 70
SpringO = -20 # spring origin in car (when spring length is 0)
SpringMax = 70
BodyO = 0# —- car engine dynamics ——-
DriveStartPower =4 DriveAddPower =1.0 DriveDelPower = 0.8
ReverseStartPower=4 ReverseAddPower =1.5 ReverseDelPower= 0.5
TurboMult = 2.5 TurboAddPowerMult = 3.0
SlideMult = 8 SlideTilt = 0.7 SlideMaxTiltAngle = 15
FirstGearEnd=60 SecondGearEnd=120 ThirdGearEnd=180
Here’s what I think each parameter does. Note that setting any of these values to be too low or high will crash the game, or cause the vehicle to handle like total shit 🙂
CarWeight is self explanatory. Not sure what units it is in.
MaxPower is self explanatory. Values of 12 to 16 are safe values to have.
MaxBrakes is self explanatory. I think this may be used as part of mathematical formulas in conjunction with BrakesK.
Friction has to do with the speed that the car accelerates / decelerates.
TireDX, DY and DZ are used for tire placements on the car. This is centered around the vehicle origin.
FrameDX, DY and DZ I think are used for Center of Gravity calculations, and ground height?
TopZ I’m not sure what this does?
NumberOfTires is self explanatory.
TireShapeName controls what model appears for the wheels on the car. It appears at least from my testing this has no impact on actual handling, and can be anything.
CameraHeight and Dist controls how far away the camera is from the vehicle origin point.
M and GravityK are used for vehicle local gravity applications.
MaxSpring is self explanatory.
Ks is used for spring calculations.
Fx, Fy and Fz are used as part of friction calculations.
DrivingForceDZ and PowerK are also used for acceleration calculations.
BrakesK is used for brake force calculations.
The Bounce values are all used to determine how much the vehicle reacts to bumps and scrapes from reacting with the world.
LocalGravity is another gravity force calculation.
AddGroundCollisionK I’m not sure what it does.
MaxBrakesK is the limit for brake force.
TireRadius is used to determine how big the wheels on the vehicle are.
SpringO is self explanatory.
SpringMax is self explanatory.
BodyO is used for determining the origin of the actual vehicle. Best to leave this one alone.
DriveStartPower, DriveAddPower and DriveDelPower are all the normal vehicle handling stats, and are used when the sirens are not turned on.
ReverseStartPower, ReverseAddPower and ReverseDelPower are used for when the vehicle is in reverse. These are not affected by the sirens.
TurboMult and TurboAddPowerMult are used to determine how much of a difference turning on the sirens make to the vehicle power, in terms of multiplying the base power value.
SlideMult, SlideTilt and SlideMaxTiltAngle calculate the maximum angle the vehicle can drive up.
FirstGearEnd, SecondGearEnd and ThirdGearEnd are the maximum speeds in km/h that the vehicle will travel.
Other noteworthy values inside the file
UpgradeCop = 0 UpgradeFire = 0 UpgradeAmbul = 0
Setting any of these values to 1 will cause the vehicle upgrades to be available from the start of the game, when starting a new game. This does not apply retroactively, hence the requirement for starting a new game.
AmbientVolumeScale = 0.5 EngineVolumeScale = 0.45 MusicVolumeScale = 1.0
PlainVolumeScale = 0.3
These control how loud the game is internally. MusicVolume is only used for the intro and credits song, named “Song1” inside Wave.DAT.
3. Have fun!
At this stage, you’ve pretty much done everything that can currently be done to the game.
If anyone knows what the TEX file format is, or knows how to crack it open, please let me know.