PDA

View Full Version : Mapping Recreating Map's Editor Files


Outlawz7
2010-07-13, 12:37
In this tutorial I'll show you how to (re)create the editor files for a map, in cases where there's no way to gain access to the original ones or if you had them, but lost them.
If you don't know what "editor files" are; these are the files located inside your map's Editor folder, putting it simply. From here they can be edited via BFEditor and saved in an uncompressed format, from where later on you'll compile the compressed files when you save.
In case your files get corrupted, you can resave from here where you'll always have working files.
Not all files edited with BFEditor (and indirectly, by you) are located here, like Staticobjects.con, Sky.con... those are in the main folder, can be read and do not need to be recreated in anyway, and some files are saved from bfeditor's rawdata folder, like lowdetail textures and undergrowth.

You'll need:



Notepad
BFEditor
Photoshop CS3 (or higher)
XVI32 Hex editor (http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm#download) or a hex editor of your choice, but you'll have to figure some stuff out yourself then
Photoshop Action - SalvageColorDetail (https://www.dropbox.com/s/59sb9z6sjpnxf3n/SalvageColorDetail.atn?dl=0)
DDS plugin for Photoshop (http://developer.nvidia.com/object/photoshop_dds_plugins.html) - unless you already have it
a map without its editor files



Preparations
I'm going to pick Gulf of Oman from Battlefield 2 for this tutorial. You can pick any map or mod, process is the same.

To be on the safe side I'm going to create a temporary mod for this tutorial and copy the map to there, so I can still play BF2. If you're already using a copy of your mod intended for editing, then you can skip this and do it there.

Now before we begin, install the PS action SalvageColorDetail to Adobe\Adobe Photoshop CS3\Presets\Actions.

Extract your map's client and server .zips.
Before you continue, go into the above directory, right-click on your maps' folder and untick 'Read only', in case the map's files have this enabled, in my case they do since DiCE made everything read only in their maps.
Go back to your map folder and create a new folder called Editor (Caps doesn't matter).
http://i57.photobucket.com/albums/g214/privateLoL/pic1.jpg

We're all set to begin.

Salvaging the ground textures

We'll start with probably the most important aspect of editor files, the ground textures. Color, detail and lowdetail maps are already here, but they aren't in proper format and/or size to be edited.

Copy your colormaps, detailmaps and lowdetailmaps folders in your map directory to your Editor folder.
http://i57.photobucket.com/albums/g214/privateLoL/pic2.jpg

Open up Photoshop CS3. We'll begin with the colormaps. These do not need to be resized, only resaved. Select all the files inside the folder and drag&drop them into Photoshop.
http://i57.photobucket.com/albums/g214/privateLoL/pic3.jpg

Give it a few moments for all the files to be loaded. On the bottom right of your PS interface there should be an Actions tab, where you might already see your SalvageColorDetail action set. If you do not see this tab, press F9.
http://i57.photobucket.com/albums/g214/privateLoL/pic4.jpg

Now go to File>Automate>Batch,
http://i57.photobucket.com/albums/g214/privateLoL/pic5a.jpg

and select the SalvageColorDetail action set and under actions, saveColor, leave the source at Opened Files.
http://i57.photobucket.com/albums/g214/privateLoL/pic5b.jpg

and let it rip. If you observe the Actions tab, you'll see Photoshop working on your opened files, which will get duplicated only inside Photoshop, don't worry it doesn't double the actual files.

In case you're wondering what just happened; what this action did was resave the colormaps to 32-bit A8R8G8B8 format with one mipmap. This is the format that editor can use.
http://i57.photobucket.com/albums/g214/privateLoL/pic6.jpg


Now, go File>Close All, so you get rid of the opened files.
We continue with detail and lowdetailmaps. Both of these need to be resized and resaved to same size and format and as you guessed by now, the action set does the dirty work here.

Again, drag&drop files from both lowdetail and detailmaps folders into Photoshop, go to File>Automate>Batch.
Using the same SalvageColorDetail set, this time change the action from saveColor to ResizeSave_DetailLowdetail
http://i57.photobucket.com/albums/g214/privateLoL/pic7.jpg

and let it rip, then once done, close Photoshop. You now have ground textures you can work with.

Setting up Ground Properties

Load up your mod and map in BFEditor. You now have nicely looking textures on your map, but you're missing the lowdetail texture and detail textures. Actually, you're only missing the latter, the lowdetail texture is already here, just needs to be regenerated. ;)

If you want to use the lowdetail texture elsewhere or want it backed up, you can copy the lowdetailtexture.dds in your map's main folder to \Battlefield 2\bf2editor\RawData\Common\Terrain\Textures\LowDet ail, and give it a suffix or rename it, so you know from which map it is.

Minimize the editor window, open up the hex editor and your map's main folder and drag&drop the terraindata.raw file into the hex editor.
http://i57.photobucket.com/albums/g214/privateLoL/pic8.jpg

If you fear a program crash, close the editor first, then do this. It might be too hard to read the text lines bunched up in between symbols, go to Tools>Options>Appearance tab and play with the settings
http://i57.photobucket.com/albums/g214/privateLoL/pic9.jpg


First four lines are the load lines for ground textures and ground lightmaps, the lower six are the detail textures. Follow the line til you get to the texture name and then switch to BFEditor, go to terrainEditor>Texture. Under the first layer's detail texture select the respective texture.

If the first texture name in terraindata is ie. grass01, then the first layer detail texture should be grass01.

In my case the texture is detail_rock04_dark.
Select a material, in my case the appropriate one would be 'rock'. Look around your map to find where the texture is used, though first layers are always sloped areas.
http://i57.photobucket.com/albums/g214/privateLoL/pic10-1.jpg

Now generate lowdetailmaps. Since the texture is already here, as said, simply select a type (1 or 2) and click on generate LowDetailMaps.

http://i57.photobucket.com/albums/g214/privateLoL/pic11.jpg

For rock textures which are usually on the first layer, use the number 2 type and set PlaneMap to 1. Use type 1 for other layers.

Repeat this for the remaining layers. You can now close the hex editor. If you did everything correctly, your map should look something like this in the Detail mode now.

http://i57.photobucket.com/albums/g214/privateLoL/pic12.jpg

Save your map.
You now have working ground textures with detail and lowdetail textures. From here you can freely edit the terrain and paint new areas. :)

Setting up Lightmap settings

In case you want to relightmap the map, you'll need to start off with some lightmap settings. You can tweak these later, but first lets get them set up.

Terrain lightmaps are already loaded and can be read by the editor, but the object lightmaps need to be in separate files in order for the editor to read them, which they aren't, because they need to be packed in atlases in order for the game to read them and to reduce file size and load times. So far no one figured out if there's a way to get them out of an atlas :P

In BFeditor go to Light>Preset and pick a lightmap preset. Note that this also changes the sky settings on your map, which we'll fix right away, but first lets save the lightmap settings.
In the Tweak bar, right-click on LightmapsSettings(Objectmode) and click Save Object mode then click the Switch to Terrain mode and save the terrain mode.

http://i57.photobucket.com/albums/g214/privateLoL/pic13.jpg

Now to fix the sky settings. Go again to Light>Preset, but scroll down below the lightmap settings and select your map's name, this will reset back to your map's sky settings.

To use your or other map's sky settings, the sky.con needs to be extracted (nothing else required, you don't need to extract everything, just the sky.con)

You now have lightmaps settings you can tweak and use to lightmap the map.

Setting up your GamePlayObjects

Still in the editor, switch to levelEditor (if you aren't already there) and under Layers in the rightside tab, start creating new layers for gamemodes and sizes.

http://i57.photobucket.com/albums/g214/privateLoL/pic14.jpg

You can create a new layer for each gamemode and size, or combine if the GPO is the same ie. the 16 player size is usually always the same in gpm_cq 16, gpm_coop 16 and SP1 16, so instead of creating three layers, create one with three gamemodes.

After you're done, untick the layers to make them invisible and lock them before saving, that will later on prevent you from seeing all of the GPOs overlapping each other when you open the map and selecting objects in different layers
http://i57.photobucket.com/albums/g214/privateLoL/pic15.jpg


Save and close the editor.

Go to your map's Editor folder and open the GPO.con.
http://i57.photobucket.com/albums/g214/privateLoL/pic16.jpg
Its currently empty with some default lines, which you'll delete.
Keep the file open and go to the main folder>Gamemodes, then to each separate gamemode and size; let's start with gpm_cq and 64.
Open that GPO and scroll down to the bottom, where you should see what layer the combat zone and everything else is on.
http://i57.photobucket.com/albums/g214/privateLoL/pic17.jpg

My intended layer for gpm_cq is layer 2, so in this case no need to change this, however you will most likely need to change the layer, so here's how to do it. Press Ctrl+H to open Find&Replace function and under Find write the layer that's currently used in the file ie. 'layer 4', note the spacing.
Under Replace with write the layer you want it to be on ie. 'layer 2' then Replace All and give it a few moments to replace all the strings. Now press Ctrl+A to select everything and paste it into your empty Editor GPO. No need to save the file you just edited.

Repeat the above for all other GPOs, once done close and save the Editor GPO. You now have all the existing GPOs in one place to edit.

Usually, everything inside the Editor GPO is sorted by groups of ObjectSpawners, SpawnPoints, ControlPoints and Combat Areas regardless of layers, however when you were putting together your GPO from others, the groups ended up like this: ObjectSpawners-SpawnPoints-ControlPoints-Combat Areas, ObjectSpawners-SpawnPoints-ControlPoints-Combat Areas , ObjectSpawners-SpawnPoints-ControlPoints-Combat Areas... for every GPO you pasted in. Don't worry, once you open it in BFEditor, the program will sort it out ;)

Setting up StrategicAreas

This is optional, if you plan to renavmesh the map or mess with control point placement or naming or you combined the SP/Coop GPOs etc. I'd advise not to do this and set up new Strategic Areas, otherwise your editor will crash while loading your map due an illegal CP error. If you still want to do it, it's very simple.

Go to a SP gamemode directory (SP1, SP2, SP3 or gpm_coop) and game size, next to the GPO should be an AI folder. Copy that and paste it into the Editor folder, then open it and inside it open the Strategic Areas file and change the layer with Find&Replace to match your SP GPO layer. If you have several SAs, copy paste them into the Editor one, same as with the GPO basically.

Note about Roads

You can't recreate roads, since you need the spline.con data which you can't get from anywhere in the map's files, the roads are saved as compiled meshes. However, the roads are baked onto the colormap which should give you an excellent guideline to lay down new ones from scratch.

http://i57.photobucket.com/albums/g214/privateLoL/pic18.jpg

This is pretty much it, post any questions you might have below.
As trivia, the Photoshop action sets are very easy to create, I actually pondered including how to do those into this tutorial, but rather kept it game related and avoid extra confusion. Here's the link to the PS tutorial on action sets.

Photoshop CS3 batch automate function, resizing images using automate function in photoshop cs3 (http://www.coremediadesign.co.uk/learn_web_design/free_web_design_tutorials/tutorial/photoshop_batch_automate_function.html)

Smegburt_funkledink
2010-07-13, 13:02
You're not just a pretty face are you?

Very well written tut mate. :)

Amok@ndy
2010-07-13, 15:30
but there is still the problem of the colourtiling or have you a solution for this ?

Outlawz7
2010-07-13, 16:37
What problem?

Amok@ndy
2010-07-13, 16:40
you cant read out the tiling of the terraindata.raw can you ?

Outlawz7
2010-07-13, 17:17
No I don't think so, layers are completely reset, except the lowdetail texture tiling which is ok.
Why would you colortiling, its crap IMO...

Amok@ndy
2010-07-13, 18:39
well im using the detail tiling and the lowdetailtiling on nearly every map

Terminal-Access
2010-11-24, 21:50
Would any one be able to provide a link to the SalvageColorDetail.atn as it is no longer avaliable on file front.

thanx

TA

Outlawz7
2010-12-06, 16:08
File reuploaded.

0utlaw
2011-04-10, 22:57
Would any one be able to provide a link to the SalvageColorDetail.atn as it is no longer avaliable on file front. thanks.

Outlawz7
2011-04-11, 12:47
Link fixed, should be a stable download source now.

Sgt. Mahi
2011-04-11, 13:15
Sweet! Thanks :-)

Shovel
2011-04-19, 00:56
Tutorial seems good, but i cant get it to work with CS5. I tried installing it on both the 32 and 54 bit versions, but SalvageColorDetail won't show up in the Actions tab.

?????????????

EDIT: Nevermind. I figured it out. All I had to do was drag the preset into photoshop.

DHope129
2011-07-05, 21:18
Hi,
I was regenerating kashan for personal use and I got up the the part where you put the detail textures in and i put editor in detail texture mode and got black stripes spanning the map. I'm not entirely sure what im supposed to do in this case. Should i paint these areas, or did i do something wrong? Ill post a screenshot, Thanks.

http://i54.tinypic.com/1zcim83.jpg

Shovel
2012-01-22, 23:41
Is there a way to figure out what types of overgrowth a map uses?

pr|Zer0
2012-01-25, 08:21
Hi,
I was regenerating kashan for personal use and I got up the the part where you put the detail textures in and i put editor in detail texture mode and got black stripes spanning the map. I'm not entirely sure what im supposed to do in this case. Should i paint these areas, or did i do something wrong? Ill post a screenshot, Thanks.

http://i54.tinypic.com/1zcim83.jpg

Same here...could be something related to color tiling or size...not sure

Outlawz7
2012-01-29, 09:49
Did you use the "ResizeSave_DetailLowdetail" action with detailmaps? Those need to be resized first.

pr|Zer0
2012-02-17, 10:13
nope...by tut, its "drop low detail and detail"in Photoshop at the same time
Oulawz7"]Again, drag&drop files from both lowdetail and detailmaps folders into Photoshop, go to File>Automate>Batch.
Using the same SalvageColorDetail set, this time change the action from saveColor to ResizeSave_DetailLowdetail
Did just that and ended with missing texture/color strips

Spyker2041
2012-04-27, 23:38
Hi,
I was regenerating kashan for personal use and I got up the the part where you put the detail textures in and i put editor in detail texture mode and got black stripes spanning the map. I'm not entirely sure what im supposed to do in this case. Should i paint these areas, or did i do something wrong? Ill post a screenshot, Thanks.

http://i54.tinypic.com/1zcim83.jpg

I get the same issue too, anyone know how to fix it?

Amok@ndy
2012-04-28, 07:12
check all texture.dds files maybe 1 or 2 are in the wrong format or size

Spyker2041
2012-04-28, 08:51
Outlawz7;1388904']In case you're wondering what just happened; what this action did was resave the colormaps to 32-bit A8R8G8B8 format with one mipmap. This is the format that editor can use.
http://i57.photobucket.com/albums/g214/privateLoL/pic6.jpg


Manually resaved one of the files with settings shown in the above pic but all "squares" still have black lines going through them.

Amok@ndy
2012-04-28, 09:07
did you have a look at all your files ? i guess that a detailtexture or a lowdetail.dds has this black lines in it

Spyker2041
2012-04-28, 13:01
Amok@ndy;1765395']did you have a look at all your files ? i guess that a detailtexture or a lowdetail.dds has this black lines in it

I resaved tx00x00.dds for color, detail and lowdetail but black lines still there. :(

Amok@ndy
2012-04-28, 20:29
so you had a look at all .dds files and made sure that there are no black lines in the texture ?

Spyker2041
2012-04-28, 20:57
Amok@ndy;1765597']so you had a look at all .dds files and made sure that there are no black lines in the texture ?

Correct, none of the colormap textures have black lines

Amok@ndy
2012-04-28, 21:00
detail and lowdetail ? as far as i remember i had this issue with a detail or lowdetail not beeing 512x512 but beeing 1024x1024

Spyker2041
2012-04-29, 11:33
Nope everything is 512x512

Amok@ndy
2012-04-29, 12:03
so you have all your textures in /yourmap/ and in /yourmap/editor/ ?

Spyker2041
2012-04-29, 12:33
Correct.

Amok@ndy
2012-04-29, 12:38
thats really strange, have you tried regenerating lowdetailmaps in the editor ?

Rudd
2012-04-29, 16:21
I has an idea...could you rename the original map's folder, and try loading the map again in the editor - perhaps a file is still pointing to the old files (maybe the .mat?) and that is resulting in this strangeness; just a thought.

AFsoccer
2012-05-20, 03:31
Hi,
I was regenerating kashan for personal use and I got up the the part where you put the detail textures in and i put editor in detail texture mode and got black stripes spanning the map. I'm not entirely sure what im supposed to do in this case. Should i paint these areas, or did i do something wrong? Ill post a screenshot, Thanks.

http://i54.tinypic.com/1zcim83.jpg

I just experienced the same problem. So after some investigation it looks like the action script isn't working correctly. When I checked my files they were all saved as DXT5. I started over and tried again to see if it would reproduce the same error and it did. So then I created a new script that saved the files correctly and the map looks correct now (i.e. no black lines).

Btw, I used Photoshop CS5 and Outlawz used CS3 so maybe that caused the issue, or maybe since the first link went down Outlawz uploaded an old/incorrect script the second time. In any case, a new script is needed. I would upload mine but I don't know how to make it save files to the right spot. I had to manually copy mine over after it was done.

HangMan_
2012-05-20, 04:45
can u upload your updated/new script? Please:)

Clos3r
2012-05-30, 16:26
Nice tutorial!
Can you upload to us? :D

Outlawz7
2012-05-31, 09:52
Redid it, check if it works, file attached.

Gracler
2013-01-23, 12:41
Did the black line issue get resolved? I tryed this "new" action script and Im still having black lines :( how is the manual way again?

edit:
AFsoccer;1773108']I just experienced the same problem. So after some investigation it looks like the action script isn't working correctly. When I checked my files they were all saved as DXT5. I started over and tried again to see if it would reproduce the same error and it did. So then I created a new script that saved the files correctly and the map looks correct now (i.e. no black lines).


Am I right that it should save it as DXT1 -> alpha 1 -> no mips?

Edit2:
using woody's Texture Viewer it tells me that the dds files from "detailmaps" are "format 16bit- R5G6B5 size 256x256 mipmap1/1"

after i run the action script in photoshop (im using CS5) it changes to the same except its now size 256x512 size..... shoudnt it be 512x512 ? Im not sure that the settings in the dds save dialogue is correct, and i wonder what they should be or if somone has a profile I can use that is correct.

Furthermore the action script dosent seem to have any effect on the dds save dialogue so it will save-as with the previous used dds settings, which means i guess i have to set them properly to get this to work.

Problem Solved ! see below (https://www.realitymod.com/forum/f189-modding-tutorials/83949-tutorial-recreating-maps-editor-files-4.html#post1857579)

AFsoccer
2013-01-23, 19:35
It's probably best to create your own script. It's fairly easy to do so, and then you can have it save the files in the correct format and in whatever location you prefer. As for format, it should be 32-bit A8R8G8B8 512x512 and 1 mipmap.

Gracler
2013-01-24, 00:26
There is apparently nothing wrong with the script what I did to resolve my problem was!


test save a dds to bring up the Nvidia dds format save dialogue. Here I set it to 8.8.8.8 ARGB 32 bpp and under MIP Map Generation i set it to "Generate MIP maps" "1"
Then I ran the script like this guide describes and it worked fine


The main problem was that I had checked "Use Existing MIP maps" which gave me a 256x512 format

Ivancic1941
2016-05-06, 15:44
Plz
I downloaded salvagecolordetail and I have PS2.So I opened rar file and in it was something that I just extracted(in tut it says install?) to Ps2/Presets/Actions (note I needed to create this actions folder). After I started proces I came to
" and select the SalvageColorDetail action set and under actions" in batch. But there wasnt this to select. I dont know how to activate/install this salvagecolordetail as there is not exe in downloaded