• Welcome to Freedom Reborn Archive.
 

Making Maps with Nifskope

Started by joemama, February 11, 2007, 06:13:30 AM

Previous topic - Next topic

joemama

Terraforming with Nifskope - Creating Custom Terrains

Got an idea for a great map but think it's too complicated to pull off?  Maybe you're getting sick of fighting in the city and would like a more exotic locale?  Mapmaking is not as hard as it appears and nifskope makes it much easier. 

This tutorial will show you how to use nifskope to modify an existing terrain of create a new one altogether.  The instructions are long because I'm assuming you've never gotten into modding, but it's actually very simple.  After 2 or 3 tries,  the whole process will take you about 20 minutes. 

What you'll need:

Nifskope -- Available at sourceforge.net (direct link: http://sourceforge.net/project/showfiles.php?group_id=149157&package_id=170735)
FFedit
At least 200MB to burn.  300MB if you want to go big.
It helps to have a decent video card and at least 512MB of RAM.

I – Extract  your source files and set up a working folder

Before getting started, we need to set up our working folder and unzip some files that came with the game.  I always use a working folder when making maps, to keep my regular .dats and files safe (in case I screw something up!).  You do not have to.  To set up a working folder, just create a folder named "mapmaker" (or similar) in your main Freedom Force Directory (C:\Program Files\Irrational Games\Freedom Force vs The 3rd Reich\).  Basically, you're creating a mapmaking "mod" folder. 

Copy the art.ff, missions.ff, and layout.ff files from your Data directory and paste them into your working folder.  These are large files, but we'll be downsizing shortly.  You'll also need to copy all your .dat files (attributes, campdef,  characters, objects, etc.).  You won't be adjusting all of them, but it helps to have everything you'd normally have in the real game. 

To unzip, right click art.ff and rename it to art.zip.  Repeat for the other two files and then unzip them into your working folder.  Be sure to keep existing file structure intact and, if prompted, click "OK" to replace any existing files.  When finished you should have two folders: "art" and "missions"(the "layout" files have been extracted into the "art" folder).  Open "art", and then "library".  The only folders you really need are "area_specific" and "terrain".  You can delete the rest.  You can also open up "area_specific" and delete everything but "_textures" if you like.  The other folders are the objects and characters used in the game.  I keep them in case I need to create a new object using one of the standard objects.  The difference is about 80MB memory, if that means anything.  You can also delete the art.zip, missions.zip, and layout.zip if you haven't already. 

When finished, your working folder should be located at: C:\Program Files\Irrational Games\Freedom Force vs The 3rd Reich\workingfolder.
 
II – Create a base terrain
The easiest way to create a new terrain is to modify an existing terrain, so the first thing to do is decide which map you want to modify.  Try to pick something with the general contours and landmarks you need.  For this example, we're going to create a grassy plain that can be used as a base for creating other maps.  I chose this example for brevity.  You can use the same process for any map. 

Open FFedit and select the "options" tab.  Point your "Primary Data Path" to your working folder.  Next, click on the "missions" tab and then press the "Load" button towards the bottom of the page.  The window that opens should contain all the campaign and multiplayer missions.  Load a mission and the click the "Edit In-game" button to see how it looks.  Repeat through the various levels until you find one that suits your needs.  I've chosen level "3A_Red".  Once you've found your level, use the "Save as" button on FFEdit.  When the box opens, find your working folder and expand it.  Next, scroll down to the "Missions" folder and highlight it.  Click the "make new folder" button and name it whatever you want to name your map.  For this example, I'm using "jm_grassy_knoll_base". 

Now you're ready to create your base terrain! 

In FFedit, just below the "Mission Objects" window, are two boxes: one says "Layout" and the other says "Objects".  Deselect the "Objects" box and select instead the "Layout" box.  The "Mission Objects" window should fill with the various items as defined in the level layout file.  Find the object named "_impobj_0" and note the location of its .NIF file in the "Object Details" section to the right of "Mission Objects".  In this case, the .NIF location is: library\area_specific\Cuba\terrain\3a_terrain.nif

Remember, you're in your working folder, so the .NIF's actual location would be workingfolder\data\art\library\area_specific\Cuba\terrain\3a_terrain.nif.  This is your new terrain base.  You'll need to copy (always good to keep a backup) and rename it.  I put all my custom objects into a custom directory (to make them easier to find), but you can put it wherever you like.  Just make note of the location for later.  As for the name, I'm using jm2_terrain.nif .  My new base is therefore located at: C:\Program Files\Irrational Games\Freedom Force vs The 3rd Reich\workingfolder\art\library\area_specific\jm_objects\terrain\jm2_terrain.nif.

Now comes the fun part...
 
Navigate to your new NIF file.  Right click and select "Properties".  Deselect "Read Only" and click "OK".  Now open it in nifskope.  If you really want to go big, you can change every texture file to whatever you like.  I'm kinda lazy, so I'm only going to change the ones I really need to.  Since I'm creating a grassy knoll, I'm going to replace all the "non grassy" textures with "grassy" ones. 

The same process applies for any type of terrain you want to create.  I prefer using the in-game textures whenever possible to conserve memory and save time, but you can use pretty much any texture you like, just make sure it's in standard dimensions (i.e. 256x256 or 512x512).  Any custom textures that you want to use should go into the default directory (i.e. art\library\area_specific\_textures).  You can create a separate texture folder for your map, but then you have to copy every texture your map uses, including lightmaps and debris.  It's much faster to add your own textures to the default directory.  Just be sure to name your textures something unique, like "jm_texture1" (using your initials) so they do not conflict with anything else.  If I'm bringing in textures and/or objects fro m FF1, I usually keep the same file names, as they could affect many different objects/characters. 

The "Block List" window of nifskope lists every textured item within the NIF file.  Yes, there are quite a few.  Fortunately, nifskope changes multiple textures at once, making our job MUCH easier. 

First, I want to select my basic "grass" texture.  I'm going to use one of the map's existing textures for simplicity.  (If you want to use a different texture from the game, you can find them at: "workingfolder\data\art\library\area_specific\_textures".)  Scrolling down through the block list I find several nodes listed as "grass".  Expand a "grass" node until you find an entry called "NiSourceTexture"; the specific file is in the "value" box.  In this case: "cub_terrain_grass2.tga".  Click the flower icon next to the texture name and you will open a window asking you to select a texture file.  Highlight the name of texture (again, "cub_terrain_grass2.tga" in our example) then right-click..."Copy" it.  Hit cancel to close the window.  Now scroll back up to the top of the "Block List" window.  Every node that doesn't say "grass" somewhere in the title must be changed (cliffs, and other rock-based features excepted).  I'm also changing the footpaths, but you may wish to keep them in your own map.  To change the textures, just double click just to the right of the texture name (within the same line) and you will open up a manual entry box (like my technical jargon?).  Highlight the existing texture (using click and drag), and then type "CRTL +'V'" (control button and letter "v" simultaneously) to paste the new texture name into place.  You can also click the "flower" icon and navigate to the texture you want, but this places a direct link onto the .NIF file.  If you distribute it and somebody does not have the texture in that exact location it will not show up.  By placing only the name of the file, the program will look in whatever "texture" directory you define later in FFedit.  Don't worry about the .tga extensions, FFVTTR will run a .dds file if no .tga file is present. 

Repeat.  Many times.
 
If you are doing this example, you will notice that, by node 60 ("60 NiNode"), the new texture is already in place.  You'll find the same with other nodes as well.  Thank you nifskope!  I usually expand every couple of nodes to double check, but this little feature still saves you quite a bit of time.  Once you're finished, just save and that's it!  You have a new terrain. 

NOTE: Want roads without the markings (crosswalks, arrows, etc.)?  You can replace the existing texture with the same texture as the road (as long as it is seamless) or you can "hide" the markings themselves.  Expand the NiNode in question and click on NiTriShape.  You'll see the object highlight in the rendered view to your right.  Right click the node and select "flags".  Check the "hidden" box and click "accept".  Unfortunately, you can't do multiple nodes at once, but there usually are more than a few lines to modify.  Double check the rendered view to ensure you didn't hide an integral part of the terrain.  You'll know by the hole in the map! 

You might be thinking: "Why don't I just change the actual textures themselves?  Wouldn't it be easier?"  The answer is "yes"....and "no".  Changing the textures themselves requires a separate texture directory (otherwise you'll change the texture for the entire game).  Which means, in addition to the textures you want to change, you also have to copy every texture you're going to use – including debris and shadowboxes.  This takes up time and memory and makes for a lengthy download..  Changing the .NIF file directly allows you to use the default texture directory and saves you time (and memory) in the long run.

III. Testing and using your new terrain
So you have a terrain, now how do you use it in FFedit?  There are two ways to do this: 1) create a new level layout file or 2) hex edit your mission.dat file to point to your new terrain.  I prefer to create a blank level layout file.  That way, if you ever use the same terrain again, you can just import the layout and place everything else as objects.  By all means, hex edit if you prefer, but this section will cover the layout file.
 
Who the heck is Perforce and where the heck is that folder???  That has always annoyed me, even more now that I'm making maps.  Now I just create my own layout files, as it's very simple.  Go to "workingfolder\art\level layout\", copy the folder for the mission you modified (in this case, "3a_red") and rename it to the name of your mission.  For this example: "jm_grassy_knoll_base".  Open up the folder and right click the layout file.  Select "Properties" and then de-select "Read Only".  Save and close. 

To edit your new layout file, just open it in notepad.  The first line should be the terrain's location followed by its coordinates: (0,0,0).  Edit the line to point to your new terrain.  There's nothing else on this terrain that I really need, so I just delete everything else on the file.  That's right.  Just highlight and delete.  If you want to keep certain items but not others, you can delete them individually in FFedit.  Save and close. 

Now go back into FFedit.  Select the "options" tab and make sure your "Primary Data Path" points to your working folder.  Go to the "missions" tab and "Load" your mission.  Now select "Import" and navigate to "workingfolder\art\level layout\yourlevellayout\" and click "OK".  This will import your new layout file.  You should see "_impobj_0" in your "Mission Objects" window and it should point to your new terrain.  Use "Edit In-game" to check your work.  The most common mistakes are forgetting to change a certain texture or typing in the wrong file name   You'll know pretty quickly if something's amiss.  You can make changes in nifskope and then click save.  When you click "Edit In-game" again the new version will come up. 

You're all set to add whatever objects, characters and markers you like.  When you're done, just copy your mission & layout folders, and any custom textures/objects you created into their respective places in your default "Data" directory (or elsewhere).  Be sure to give custom objects and textures unique names or directories before you move them into your "Data" folder.  (Use file menu "View>Arrange Icons By>Modified" to quickly locate new textures.) Finally, merge your objects.dat and characters.dat files to incorporate custom objects and characters into your game.  I always follow Renegade's suggestion that you merge from your "Data" characters and objects into your working folder BEFORE merging from your working folder into your "Data" folder.  That way, your objects and characters stay current and the new ones are added. 

You're all done.  Once you get the hang of it, this will take about 20 minutes or so.  Have fun!

This tutorial is also available at: http://engineering.freedomu.info/terraforming.htm and will be added to the wiki


Level 3A_Red: before:


Level 3A_Red: after:


Hope it helps

JM



EDIT-- More fun with Nifskope
nifskope tutorials on the wiki - http://frworld.wikispaces.com/NifSkope

Following Symon's simple tutorials (say that five times fast) you can clone objects from one map to the other.  I wasn't able to attach an FF1 object to an FF2 Map, but I did put it onto an FF1 map and used FF2 textures (does that make sense?).  At any rate, here's what I came up with:

FF1 Central Park Map with End of Time (level 24b?) castle skoped:

The castle is 2.25x it's normal size, making it look quite impenetrable:

FF1 Central Park Map original:

Still a WIP, but you can imagine the possibilities

EDIT--
Castle Final Version:

Volsung

That souds good! :)

Do you got an exemple?

joemama

Man!

You're fast!

I have two completed (terra-formed maps) here:

http://geography.freedomu.info/

I'll have the base maps and some objects up tonight (?)

Edit--added thumbnails to initial post


JM

stumpy

Cool stuff, JM! Thanks.  :thumbup:

BentonGrey

Yeah, thanks!  I may actually give this a shot one of these days.

joemama

Edit

added shots of skoped ff1 maps

Lunarman

sweet. I'm going to have to try this!

jeremy355


Epimethee

Just saw your released maps. Very cool stuff!

Thanks, Joe.

cmdrkoenig67

Thanks for the Tut, Joemama...I'm totally going to try this, whenever I get the time to play around with NIFSkope.  Your example-pics/maps rock!

Dana

joemama

Nifskope must be a sin, cuz Joemama went to hell (WIP):


FF1 End of Time (level 24c) terra-skoped:



This is an original remake of Gengoro's hell2 map at fxforce.com.
It started as a cloud city (which I'll eventually get to), but ended up as a place to kick some demon butt.  I haven't tested it yet, but I hope to jump/fly between disks (I'm sure there'll be an ffx teleport switch here and there as well)
JM

PS--I'll probably release a "combat arena" version of it too (for those of you with fewer issues :wacko:)

Carravaggio

aw, man, i love nifskope. total, deep-down warm and fuzzy love it. Between this and EZScript (thanks M25!) we can make almost anything we set our minds to.
Thanks for this tute, man, it will be invaluable!