Categories
Development High Stakes Tutorials

Importing a NFS5 PU track into Unreal Engine 5

Prequisites

Step 1 – Exporting the track

First you should open up your blender track project, in this case the “Industrial”-track from NFS5 (you can follow my guide and download the blender project here)

Then just go to file > export > fbx

Adjust the settings to your needs and export the track.

Step 2 – Importing into UE5

I already have setup up a basic vehicle game template I am using, if you don’t have any you can use the one shipped with the unreal engine or google up some tutorials, there are plenty.

First a new level should be created, I suggest to select “Open World” or “Basic” – I used “basic” for the following steps.

First of the floor static mesh (SM) can be removed as it is not needed.

Second a new folder, according to your track, should be created – I chose “industrial”

Navigate inside that newly created folder and click on “Import” right above the content browser

Navigate to the folder where you exported the .fbx-file to and select the correct .fbx-file, then hit “open”

In the following dialog window make sure you have selected “Create New Materials” within the “Material Import Method” so that the engine is creating the materials for you. Then simply hit “import” and sit back and wait.

This may take a while depending on how many objects your imported track has. Once its done you will find the imported geometry (static meshes), textures and materials in your content browser

First, now you should hit the “Save all” button to save the level and all imported assets, that will make alot of perfomance difference.

Once the saving process is done you surely want to have the track in your level, right? Okay, gotcha.

The easiest way is to apply a filter to your working folder, filtering for “static meshes” because within the whole texture-material-static-mesh-mess you simply don’t want to search for the SMs right?

Step 2 – Getting the track to play

As mentioned before, set a filter by clicking the filter-icon and selecting “static mesh”.

then apply the filter by simply clicking it on the left hand side (depending on your layout) of the content browser:

And all off a sudden you will see all the beautiful meshes you freshly imported, all textured and ready to use (the view might differ from mine as I sorted, grouped and united the track’s objects before to fit my needs)

Then all you need to do is press CTRL+A (to select all static meshes) and drag&drop it into the viewport above

And you have successfully imported the track to the unreal engine 5.

Step 3 – adjusting the collision

per default you would not be able to “race” the track right now as the collision settings would block you to do so. So the easiest way to adjust this is – as I do know you simply want to RACE THE TRACK – open the static mesh’s properties (one by one, by simply double-clicking it) and go to the collision settings:

In there you will find the setting “Collision Complexity” – just set this to “use Complex Collision as simple”

This will force the engine to use the mesh of the static mesh as a collision instead of creating a basic box around it – to make the difference clear on a smaller mesh you will see both, simple and complex collision on the following mesh:

green being the simple collision, turquise being the complex collision. In this case using simple collision would lead to not being able to drive through the crane.

Make sure to hit the save button as changing the collision preset is not saved automatically!

Repeat this step for all needed objects (depending on how many you have)

Step 4 – adjusting the size

This step can be very frustrating, but is mandatory. You need to get any reference point from the old game and transfer it to the new one to adjust the sizes – more or less, depending on how accurate you want it to be.

As I do not have yet a Porsche model ingame I am using the existing McLaren F1 as reference as well as some ingame shots from the original game.

First we take a screenshot of the starting lane and find the same spot in the unreal engine project

Once we found the spot we add our car as reference object

Now, for my good, it seems to be pretty well scaled. If you are not the lucky one to find the scaling right, just select all track objects in the level outliner (top right in the default layout) and adjust the scaling accordingly – attention, some math can be required (e.g. the original game screenshot car (911 GT-1 ) is 1990mm width, McLaren F1 is 1820mm width), so you could measure the actual ingame road lane width and transfer it to unreal engine using simple math.

Step 4 – adjusting materials

Gladly we have all needed materials ready, sadly they are all missing the alpha channel and, as the NFS5-Engine is dealing a lot of objects as two-sided, this setting is also missing and needs to be adjusted.

This is how to do it

First, detect the materials/textures that have an alpha channel and/or are two sided, e.g. signs, trees etc.

those for example are pretty sure having an alpha channel

Once you find the texture/material, double click the material (NOT the texture). The editor will open a new window, looking like this

In here, left hand side, change the “Blend mode” to “Masked” and check “Two Sided”

Then in the notes view you can now drag the A (for alpha) channel note to the opacity mask note

You will notice (depending on the texture) that there now will be transparent parts and the shadow will be calculated accordingly

Afterwards always hit APPLY first, then SAVE

repeat this step for all needed textures/materials. Knowing the original track/textures does help as well as flying through the track in the engine.

Step 5 – adjusting lightning

Of couse you could race now, but as you are tend to get the atmosphere right we should adjust the lightning and atmosphere – using – again – old ingame references.

Step 6 – race!

Categories
Development High Stakes Tutorials

Converting a NFS5 PU track to blender

In this tutorial I show you the (for me, yet) best way to convert a track from NFS5 aka Porsche / Porsche Unleashed to a blender-compatible format.

First of all you obviously need a original copy from nfs5 pu for your pc. I will target the PSX version in another tutorial.

Futhermore you need the NFSPU CRP Track Converter (Credits to Denis Auroux, Bonne, Krom, Nikko, The Born, Addict) which you can download right here – and of course blender.

First of all you need to locate the desired track for conversion – in my case I chose “Zone Indutrielle”.

The trackdata can be found under \GameData\Track

To keep a better eye on the converted tracks and data I always copy the files to another location where I can better sort and store the track data, but that is totally up to you.

Step 1 – DRP2DRP

Shipped with the NFSPU CRP Track Converter Tool you find the crp2drp.exe in the main directory.

Once started you might want to select “decompress” and then select the corresponding .crp-file of your track.

This will create a new .drp-file within the folder of which you started:

Step 2: DRP2LWO

Once we got the .drp-file of the selected track from the step above we now can convert it to .lwo file format. Again, shipped with the toolset you find the drp2lwo.exe in the main folder.

As easy as it could be you now just have to select the just created .drp-file

And need to wait a bit until it states “complete”

Then you will find a new folder, named after the .drp-file in the root folder where your track files are located. Inside you will find a bunch of .lwo-files:

Step 3: Converting the textures

Before heading into blender – according to the guide shipped with the toolset – we need to convert our textures.

For this we find the tool “FSH2PTX” in the “FSH2TGA” subfolder of the toolset. This needs to be run via CLI/command line.

Also I recommend to copy the track’s .fsh-file (e.g. industrial.fsh) to the same folder of the fsh2ptx.exe

So the prompt would be

fsh2ptx industrial.fsh

After pressing “Enter” the final conversion starts. This might take a while as there will be a bunch of textures converted.

Once completed (and duplicated the folder at a 100% state), you can remove all .ptx-files as they are not needed, and that results in a folder full of .tga-files:

Again, following the guide, now you need to copy the “Unknown.tga” from the root folder of the toolset to the other track’s tga-files.

Step 4: Merging the folders

This step can differ as it depends on your working structure. As I, as stated before, work with separate folders for the converted track .lwo-files and the .tga-files I now need to join them in one single folder. I tend to call those folders TRACKNAME_united_blender for better identification.

Step 5: Installing the Plugin for blender

Now you need to install the “io_scene_lwo” Plugin into blender.

Step 6: Importing the files

After launching blender, at first I recommend to remove the default objects from the scene at first so we have a clean start.

If you have successfully and correctly installed the “io_scene_lwo” plugin you can now find the lwo-import option from the menu under file > import > LightWave Object

Then navigate to the tracks’s folder you just created

I personally recommend to check these settings

Breakdown of settings:

  • Use Existing Materials – as in the NFS universe a Block/LWO-File will have multiple textures assigned blender otherwise tends to create materials for each texture for each object imported, leading to easily over 5.000 materials for the scene. I tried cleaning them up, it was a pure mess.
  • Import all files in current directory – simply a pure time saver if you want to import the whole track at once. If you just want specific blocks this setting should be off.
  • forest:
    1045_CNK1624R (1 WATERFALLBACK01).lwo,
    1046_CNK1624R (1 WATERFALLFRONT01).lwo
  • industrial:
    327_OBJECT01 MID1.lwo,
    328_OBJECT02 MID1.lwo,
    329_OBJECT03 MID1.lwo,
    330_OBJECT04 MID1.lwo,
    331_OBJECT05 MID1.lwo,
    332_DOCKWATERCLOSE05 MID1.lwo,
    333_OBJECT07 MID1.lwo,
    1214_CNK0000L (7 LINE01).lwo,
    1219_CNK0016L (7 LINE01).lwo,
    1224_CNK0032L (7 LINE01).lwo,
    1545_CNK1056L (1 CONVEYOR).lwo,
    1547_CNK1056L (1 CONVEYOR01).lwo,
    1612_CNK1072L (1 CONVEYOR).lwo,
    1614_CNK1072L (1 CONVEYOR01).lwo

Then hit “Import LWO” and wait!

If you encounter a force close this will be caused by a single or multiple faulty blocks - I then start to import 100 files at once, save, and keep doing this until I reach the 100-block-set causing a force close and strip it down until I find the block(s) that cause the trouble. Mostly those blocks are only one or two, but finding them is kind of hard. Maybe you can reach out to the reNFS5 Project via Discord:

Once the import has successfully completed you will find the track inside blender – even if you switch to textured view there wont be any textures:

Step 7: Run the texture script

Inside the toolbox you will find a readme containing a script. Don’t bother, here is the script for you:

import bpy

import bpy

for obj in bpy.context.scene.objects:
    if obj.type == "MESH":
        for mat_slot in obj.material_slots:
            mat = mat_slot.material
            if mat:
                has_unused_texture = False
                for node in mat.node_tree.nodes:
                    if node.type == "TEX_IMAGE" and not node.outputs[0].is_linked:
                        has_unused_texture = True
                        for input in mat.node_tree.nodes["Principled BSDF"].inputs:
                            if input.name == "Base Color":
                                mat.node_tree.links.new(node.outputs[0], input)
                                break
                        break
                if not has_unused_texture:
                    print("Material", mat.name, "has no unused image texture.")

Copy this script and run it in the script window of blender. Please make sure that during the import AND before running the script the corresponding .tga-files have been in the same folder (not any subfolder) of your imported .lwo-files!

Insert the script and click “play” – wait a bit and your viewport will turn back to default shading, if you switch now back to textured view, you will see the track beautifully textured:

click this for textured view

Step 8 – optional – cleaning the object mess

As the track is now successfully imported you will find a pretty mess of easily over 1.000 single objects. For my further use that is totally useless, so I tend to sort the objects to

  • road
  • landscape
  • signs and other objects
  • foliage
  • movables
  • blockers

For this I simply create new collections and name them correspondingly

Once all sorting is done I can toggle all specific groups to check all objects are – more or less – properly sorted (I need this for the future rework of the track(s)).

After having them successfully sorted the objects are being united (except the movables). To do so just select all objects and press CTRL+J in object mode in the viewport.

Step 9 – further processing

As the track is now imported and saved you can do whatever your next steps are.

You can download the blender project here

Here you can discover how I continued to import them into the unreal engine 5 for the High Stakes project.

Categories
Development High Stakes

Main Menu for High Stakes – Artwork and WIP

When it comes to game development sooner or later you will have to think about the thing most people see when they launch a game – the main menu.

When it comes to “High Stakes” I do wanted to achieve three things

  • obtain the oldschool menu look and feel from NFS1, NFS2, NFS3 and NFS4
  • transfer the oldschool look and feel to a new experience
  • add visually nice effects that give an immersive experience

So, in first place, I took a deeper look to all menus of these four games and compared them.

As you will see some don’t have anything in common and some differences couldn’t be bigger, I took a note on every single element I really liked about the menu from each game, alsways keeping the usability in mind, e.g. that I do not want to force users to need to use mouse input to browse through the menus.

The following screenshots are work-in-progress state of the current main menu of High Stakes – resembling a mix of all nfs1-nfs4 elements and my very own taste.

Categories
Development General High Stakes Tutorials

Importing NFS3 PSX Tracks to Blender

If you want to import some or all Need For Speed III – Hot Pursuit PSX tracks to blender this short guide might help you.

I digged into it to get to the data of the Playstation-only Tracks Autocross, Caverns, Scorpio-7, Space Race and The Room, but also to finally see the legend TR02B myself.

Personal trivia: I knew that there needed to be some sort of hidden tracks and cars beside the ones that I could ever find as I can clearly remember as if it was yesterday when I read an article about the upcoming NFS3 game showing a screenshot of both track and car that I could never find in the (PC-)release version. Due to the fact that I never had a PSX myself but playing it on PC, I honestly never looked after it. Today I found out that the screenshot was representing the Autocross-Track with the PSX El Nino which has (for some reason) differences in it’s rear end textures.

Prequisites

  • Blender (download here)
  • The PC-Version of Need For Speed III*
  • The PSX-Release of Need For Speed III**
  • The Tool/Game OpenNFS (download here, mirror, mirror)
  • The Tool trk2blend (download here)
  • Adobe Photoshop (or any other tool with the ability to batch-convert BMP-files to PNG-files)

Setting up OpenNFS

This step might be optional as there could be other ways to get your hands on the texture of those tracks, but I found it the most easy way once you set up OpenNFS.

Once you have downloaded OpenNFS you may just want to extract the zipped folder to a location of your choice.

Following the original installation instruction (mirror) you then need to copy the whole NFSIII-PC files obtained from your original NFSIII-PC CD to resources/NFS_3 and the extracted files from your NFSIII-PSX CD to resouces/NFS_3_PS1, so that both folders look like the following screenhots show:

The following step with OpenNFS might be obsolete as there are other tools to convert the textures to BMP, PNG or whatever, but I personally found it the most easy way just to click through the dropdown in OpenNFS waiting for the tracks to load and have the textures all ready in each folder instead of working on a cli.

Starting OpenNFS

Once you started OpenNFS select TR02B (or any other track you like) from the track dropdown

In the cli window in the background you will notice some stuff going on, just be patient and wait for the track to load.

TR02B from NFS3 Hot Pursuit loaded in OpenNFS

Once the track is fully loaded you now may exit OpenNFS or take a lap around the track – your choice.

Afterwards you navigate to the installation directory of OpenNFS and jump to

/bin/assets/tracks/NFS_3_PS1/

In there you will find all track-folders you already opened in OpenNFS containing each track’s textures as BMP files.

e.g. ZZZTR02B

Converting the BMP files to PNGs

As there are many ways to achieve that I will leave that up to you, I used a simple photoshop action and batch-runned it to get them into PNGs.

I suggest to store the png files in new folder. Personally, I always create new folders like

ROOT/exports/nfs3/tracks/tr02b/png

Converting the TRK files to Blender with TRK2Blender

Open the tool “TRK2Blender”, navigate to the PSX-files-folder within your OpenNFS installation directory and select the corresponding trk file, e.g. ZZZTRK02B.

Afterwars you will see the conversion process running

Prompting “Conversion complete, please exit.” when the process is completed. Within the NFS3-PSX file folder in OpenNFS’s resources you then will find a new folder named after the track file you opened containing all .lwo files.

Note: At this step I suggest to copy all .lwo-files to the export-folder above just to keep an eye on the exported files for later use maybe.

ROOT/exports/nfs3/tracks/tr02b/

Make sure you copied the bmps converted to png in the subfolder (here “PNG”; but the name is up to you, e.g. “textures” or whatever).

Start Blender

Once you started blender I prefer to empty the scene to remove unused content.

Open scripting tab, click “new” and paste the following script.

import os
import bpy

# put the location to the folder where the objs are located here in this fashion
# this line will only work on windows ie C:\objects
path_to_obj_dir = os.path.join('C:\\', 'Users', 'USERNAME', 'PATH', 'TO', 'YOUR', 'FILES')

# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))

# get a list of files ending in 'obj'
obj_list = [item for item in file_list if item.endswith('.lwo')]

# loop through the strings in obj_list and add the files to the scene
for item in obj_list:
    path_to_file = os.path.join(path_to_obj_dir, item)
    bpy.ops.import_scene.lwo(filepath = path_to_file)

Make sure to edit the “path_to_obj_dir” var to match your folder structure, e.g.

 path_to_obj_dir = os.path.join('D:\\', '_HighStakes', 'OpenNFS', 'OpenNFS.Pre-Alpha.v_03', 'resources', 'NFS_3_PS1', 'ZZZTR02B')

And hit the “play”-button in the scripting Tab. An error will occur.

Select the texture folder created, hit “Select Image Search…” and see imported track TR02B in blender.

TR02B – The hidden track from Need For Speed III – Hot Pursuit – imported to blender.

*, ** – Due to copyrights I cannot give you access to any of these original game data files, of course!

Categories
Development High Stakes Tutorials

How to convert a NFS3/NFS4 Track for use in Blender, 3D Studio and/or Unreal Engine (4)

THIS IS AN OUTDATED AND TOO COMPLICATED WAY - READ THE FOLLOWING TUTORIAL INSTEAD! LINK

As there has been a HUGE update on the process – you should continue reading here.

Requirements:

Additional Tools

  • NFS3/NFS4 FRD Track Editor (to view tracks originally) [download here]
  • Photoshop, Affinity or similar gfx tool

Step 1 – Convert the track file from .frd to .lwo

The first tool you need to use is “frd2lwo” – this is a light weight gui-based tool to convert frd-files (nfs3/nfs4 native track file format) to lwo (lightwave object).

The tool right after first start

As easy as it can be, click “open” and locate your .frd-file.

Select the Tr.FRD of the track you want to convert

Select the file and once again click “open”

Once the conversion process is completed, you will kindly be asked to exit the tool.

Now, if you browse to the source folder of your .frd-file you will now find a new folder “LWO” containing all the .lwo-converted files of the original track.

Just like in the original frd file each block has been converted to a single .lwo file.

Meaning: the longer the track (the more blocks it has) the more files you will get, yay.

Step 2 – preparing track textures

If you would like to skip this step – be warned, the LWO is always prompting an error for each missing texture piece.

Although we won’t be able to create all textures in the following process, we will reduce the amount of missing textures alot.

Reading this tutorial you might be into NFS-modding and maybe aware of where to get the textures from. If not, I will gladly tell you.

The textures of NFS3/NFS4 tracks are stored within the .qfs-file. QFS is a sort of container format containing all textures, really weird.

Step 2.1 – QFS2FSH

The first step is to convert the .qfs-file into a fsh-file. Therefor we need the tool qfs2fsh – this is a command line tool.

The basic syntax is

qfs2fsh source.qfs target.fsh
e.g. qfs2fsh tr0.qfs provinggrounds.fsh

You may want to copy the .qfs into the place of the binary, I think

Step 2.2 – FSH2BMP

The second step is to convert the .fsh-file into tga-files. Therefor we need the tool fsh2bmp – a part of the QFSSuite – this is a command line tool.

The basic syntax is

fsh2bmp source.fsh TARGETFOLDER 
e.g. fsh2bmp provinggrounds.fsh BMP

You may want to copy the .fsh into the place of the binary, I think.

If you are using Windows in 64 bit version you might need to run qfssuite, at least for fsh2bmp in a dosbox or similar.

And you finally have all single textures as BMP

Step 3 – Getting the LWO-Files in blender

Once you have converted the track to LWO you want to start blender and activate the lwo-import plugin.

Now you could import one block after the other for the whole track..

Or you may use the lwo mass import script for blender

import os
import bpy

# put the location to the folder where the objs are located here in this fashion
# this line will only work on windows ie C:\objects
path_to_obj_dir = os.path.join('F:\\', 'test')

# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))

# get a list of files ending in 'obj'
obj_list = [item for item in file_list if item.endswith('.lwo')]

# loop through the strings in obj_list and add the files to the scene
for item in obj_list:
    path_to_file = os.path.join(path_to_obj_dir, item)
    bpy.ops.import_scene.lwo(filepath = path_to_file)

Of course you need to adjust the path_to_obj_dir with your drive letter and folder structure, and bare in mind that you need to escape the “\”-character like \\this\\is\\a\\folder

And then, click “play” – this may take long and sometimes blender will crash, which can be related to a specific block. I could not find any reason, but I just try and error with removing files from the batch import folder until it is working.

You also may want to check if all blocks are imported correctly as there might be any gaps.

TIP: If you keep on encountering errors while importing or opening even one single .lwo file, try to get another version of the track you want to import as there may be faulty blocks.

Finally, you have all the track data into blender – one step further of having the good old track information in somewhat up-to-date file format. I suggest to save the .blend project right now, just in case.

Looks familiar, huh?

Anyway – within the import process – I would suggest to save the blender project each time possible, as using all this tools is very fragile.

But, where is my textures?

Well, at first, they are there! At second, you have to enable the viewport texture mode

Third, they will look odd, or I totally cannot remember the rusty springs scenery decorated in tons of advertising papers

Imported NFS1 Track "Rusty Springs" - Detail view.

I think that is due to an offset between the numbers in the original QFS file and the export process, but till now I was not able to figure that out.

Anyway, for my personal futher process, the original texture are not really mattering.

So, for me, the next step is uniting the single blocks to one single mesh, in blender you can just press the A-key, and then CTRL+J, and you got one single mesh.

By the way, you can downlod the Rusty Springs blend-files (blocks and united) right here, together with the exported LWO and BMP textures as a zip-package.

Step 4 – Export the Mesh

Right now it is time to export the mesh – for me, I choose the .fbx file for further usage, but your choice might be different depending on what you want to do next.

Step 5 – Further processing

This step is totally individual – I will process the file I created within the unreal engine, you keep reading here.