UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Tutorial] How to port Source Engine maps to Call of Duty

HOT
broken avatar :(
Created 11 years ago
by johndoe
0 Members and 1 Guest are viewing this topic.
40,855 views
broken avatar :(
×
broken avatar :(
Location: tr
Date Registered: 1 March 2013
Last active: 3 days ago
Posts
816
Respect
Forum Rank
The Decider
Primary Group
2015 Contest Winner
My Groups
More
My Contact & Social Links
More
Personal Quote
Caw caw caw
×
johndoe's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
2015 Contest Winner
johndoe's Contact & Social Links-johndoemyc153
I have released the tool for public use and you can get it from the project's Github page. Watch the tutorial below to learn how to use it.



My new tool, Corvid, is going to be released for everyone in a short time. You can follow the progress from the Github page of the project or even download and test it for yourself if you know your way around Python. I will be releasing a tutorial along with the binaries once everything is ready. Here are some screenshots of the tests I and the testers did.

Assault from Counter-Strike Global Offensive. Courtesy of Numan.




Overpass from Counter-Strike Global Offensive. Courtesy of Geekidos.




Mirage from Counter-Strike Global Offensive. I was too lazy to bake lighting in Radiant since my computer is not good enough for such intense tasks.




Mirage again, but in Cod 4.



However, I'm not deleting the original tutorial because I think it has historical value.

Hidden Text
Hey guys. I've been working on this for a very long time and I think it's high time I share it. Unlike porting GoldSRC Engine (Half-Life, CS 1.6, etc) maps, porting maps from Source Engine maps is a lot harder and requires more skills. I tried to make the hard part as easy as I can so hopefully it'll be an easy job for you guys to port maps from Source Engine maps.

Note: Before starting, I would like to thank the guys at killtube.org for the VMF parser. It saved lots of time for me
http://killtube.org/showthread.php?1003-VMF2Map
Another note: Unfortunately, I still haven't found a way to convert the terrain patches, so they'll be flat brushes when they are converted. Any help will be appreciated about that :P

Requirements
  • A game built on Source Engine
  • The tools listed below
  • Maya with Call of Duty export plugins and the knowledge of how to use them
  • A functional brain
Before you start, you'll need to download the following tools.

BSPSource: http://ata4.info/downloads/apps/bspsource/bspsrc_1.3.14.zip (to decompile bsp files)
Crafty: http://nemesis.thewavelength.net/files/files/crafty102.zip (to decompile models)
VTFEdit: http://nemesis.thewavelength.net/files/files/vtfedit125-11.zip (to convert the textures)
GCFSpace: http://nemesis.thewavelength.net/files/files/gcfscape185.zip (to extract the models and textures)
NVidia DDS Converter: http://originaldll.com/file/nvdxt.exe/39376.html (to convert dds files)
Johndoe's Tools: https://www.dropbox.com/s/4gb27krd63az2oe/tools.rar


 - Extracting the materials and models with GCFSpace

In Source Engine, files like textures and models are stored in VPK files pretty much like Call of Duty's IWD files. There are usually two directories in which the VPK files are stored on most of the games (l4d2 is not one of them for example). One of them is always hl2 and the other one is usually the game's name's abbreviation (hl2mp in my case).



You'll need to open VPK files like gamename_pak_dir.vpk, gamename_misc_dir.vpk, gamename_textures_dir.vpk, and extract the folders "materials" and "models" in the same folder.



After you're done extracting the models and materials, you can copy or move the extracted folders in the game's directory (in my case steamdir/steamapps/common/Half-Life 2 Deathmatch/hl2mp/).


 - Decompiling the bsp file with BSPSource

Run BSPSrc, click "Add", find the bsp file of the map you want to port and click "Decompile". I'm decompiling dm_steamlab from Half-Life 2 Deathmatch as an example.




 - Converting the decompiled VMF file to a MAP file readable by Radiant

Run Johndoe's Tools, go to Source2Cod -> Map Converter, chose the VMF file you want to convert and hit "Convert".



After the app converts a VMF file, it creates three files. The file mapname.map is obviously the converted map file, mapname_textures.json and mapname_models.json have information about models and textures which can be used by Johndoe's Tools to copy the assets later.


 - Copying the textures and models

Go to Settings, set your game's directory. Go to Source2Cod -> Texture/Model copier, select mapname_textures/mapname_models.json and hit "Copy".




 - Decompiling the models with crafty

Go to the directory "copiedassets/mapname" and copy the directory "models" in gamedir/models/ with a different name (gamedir/models/copiedmodels/ for example).

Run Crafty, go to Setup -> Options -> Exporting and set texture extension to VTF and save it.



Go to Setup -> Options -> Directories and set your Steam directory and username.



Go to Setup -> Profiles and select the game.



Go to View -> Model Browser



If you set your Steam directory and game profile correct, then you'll see the copied models in root/models/[copiedmodels]. Find your copied models folder and expand it, right click every MDL file one by one and click "Export" or just navigate among the models with arrow keys and press Ctrl + E to export the highlighted model.



Make sure you export the models with their respective names in the same folder.


- Exporting the models with Maya

Create a file called resize.mel on your desktop, paste the following code in it and save it.

Code Snippet
Plaintext
scale -r 2.54 2.54 2.54; makeIdentity -apply true -t 1 -r 1 -s 1 -n 0; polyColorPerVertex -r 1 -g 1 -b 1 -a 1 -cdo;
Run maya, open a model, select the whole model, drag and drop the MEL file on it. When exported, models from Source Engine are 2.54 times smaller than they are supposed to be so what we're doing here right here is a quick fix for it. You can safely export the models with their respective names.


 - Fixing material names of the models
When you export a model with Crafty, it exports the textures like modelname_material_x. Even if there are models that shares some textures, there will be multiple copies of the same file over and over again which makes the map's size bigger and makes you closer to engine limits. To prevent this, copy the xmodel_export files in "tobefixed/xmodel_export/" and the exported VTF files in "tobefixed/vtf/". Go to Source2Cod -> Material Fixer, hit "Start Fixing". It will copy the fixed xmodel_export and VTF files in "fixedmodels/xmodel_export/" and "fixedmodels/vtf/". When it's done, move the fixed xmodel_export files into "Johndoe's Tools/xmodel_export/".

 - Converting the textures with VTFEdit and NVidia DDS Converter
Go to "copiedassets/mapname/textures" and move the vtf files in a new folder, go to "fixedmodel/vtf" and move the vtf files in the same folder. Run VTFEdit, go to Tools -> Convert Folder, set the the folder you just created as the input folder, create another folder and set it as the output folder. Set output type as TGA, convert the textures. Set the output type as PNG and convert them in a different output folder.


Copy nvdxt.exe in the folder where you exported the tga files, create a .bat file and copy following code and paste it into it.
Code Snippet
Plaintext
nvdxt.exe -file *.tga -dxt5 -alpha
Copy the recently created DDS files in the folder "dds" in Johndoe's tools. Copy the PNG files in "dds/thumbnails".
  - Go to GDT Generator -> For Textures/For Models
You can safely save the gdt file for xmodels. However, you'll need to set the properties of every single texture by looking at their preview images. This part is self-explanatory, so I don't think you'll need screenshots for it.
  - Converting the assets for Call of Duty
Copy the GDT files from the folder "gdt" and paste them in "codroot/source_data/", the DDS files in "codroot/raw/images/custom/", xmodel_export files in "codroot/model_export/custom/". If you want to do a quick conversion, you can copy the .bat files in "Johndoe's Tools/gdt/" and paste them into "codroot/bin/". It always works on my computer when I run the .bat files as administrator, but for some reason, it doesn't work on computers of the people who tested it. So you'll need to run cmd.exe as administrator (Press start, type cmd, run as administrator), type the following and press enter.
For Call of Duty World at war Steam version:
Code Snippet
Plaintext
cd "/Program Files (x86)/Steam/SteamApps/Common/Call of Duty - World at War/bin/"
For disc version:
Code Snippet
Plaintext
cd "/Program Files (x86)/Activision/Call of duty - World at War/bin/"
For Call of Duty Modern Warfare:
Code Snippet
Plaintext
cd "/Program Files (x86)/Steam/SteamApps/Common/Call of Duty 4 - Modern Warfare/bin/"
For disc version:
Code Snippet
Plaintext
cd "/Program Files (x86)/Activision/Call of Duty 4 - Modern Warfare/bin/"
If you have it installed in another directory, you'll need to change it to your game's folder. After that, just type the name of the bat file (you should convert the textures before the models) and it should convert all of the materials one by one. If it doesn't work and gives errors, try converting them manually on asset manager and see the error yourself.

After you've done all of these, you can open the map (exported/mapname.map) on Radiant to see if it worked and start working on it after fixing the texture alignments. Here's a screenshot of the map after the conversion. Note that the textures of the brushes need to be realigned since the way the texture alignment info is stored in both VMF and MAP format are different and I couldn't find a way to convert that yet. Also, the pink boxes are actually infodecals converted to script_structs as I couldn't find a way to make a port them directly. For now you can delete all of them. Hopefully I will find a way to work some day.

Another screenshot of a room from the same map with fixed textures.

Screenshots of other ported maps.
cs_assault from Counter-Strike: Source (modified for the zombie mode)

contact from Insurgency (modified for the zombie mode)

I hope I made everything clear. If you have any troubles with anything with this, feel free to ask.
Last Edit: April 06, 2021, 08:49:07 pm by johndoe
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 1 year ago
Posts
5,551
Respect
6,693Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Sweet
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Did you ever find a fix for L4D2 textures?
broken avatar :(
×
broken avatar :(
Location: tr
Date Registered: 1 March 2013
Last active: 3 days ago
Posts
816
Respect
Forum Rank
The Decider
Primary Group
2015 Contest Winner
My Groups
More
My Contact & Social Links
More
Personal Quote
Caw caw caw
×
johndoe's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
2015 Contest Winner
johndoe's Contact & Social Links-johndoemyc153
Did you ever find a fix for L4D2 textures?
I wasn't using the method i use now back then. I'm pretty sure it should work fine with l4d2.
Last Edit: May 31, 2014, 11:02:24 am by johndoe
broken avatar :(
×
broken avatar :(
[UGX] Maintainer (Admin & Programmer)
Location: deFriedrichshafen, Baden-Württemberg, Germany
Date Registered: 29 August 2012
Last active: 6 hours ago
Posts
441
Respect
Forum Rank
Perk Hacker
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Personal Quote
Dolphin!
Signature
changed one line of code, bug is fixed


Coming to work on monday morning.
When a bug mysteriously disappears.


:ugxmods: Developer ;)
×
Delta's Groups
UGX Administrator
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
UGX Chat Moderator Has the ability to mute, kick, or ban chat members for being abusive or breaking the rules of the forum.
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Delta's Contact & Social LinksItsDeltaugx_deltathe-deltaugxDeltaigdeltaigDelta UGX_DeltaigdeltaPersonal Site
Thats awesome. But I think we need some rules (at least here) about releasing such maps ( if someone would work on thise, which I'm pretty sure someone will do )

Because I don't want to have 10 different de_dust2 version on the forum...

>> Will talk to the team about this

Legal side is another thing - many already walk on thin ice


Are there any downsides so far? - Does it export everything or does it have any limitations ???
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Just sayin, I'm already making a de_dust2 port.
broken avatar :(
×
broken avatar :(
Location: tr
Date Registered: 1 March 2013
Last active: 3 days ago
Posts
816
Respect
Forum Rank
The Decider
Primary Group
2015 Contest Winner
My Groups
More
My Contact & Social Links
More
Personal Quote
Caw caw caw
×
johndoe's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
2015 Contest Winner
johndoe's Contact & Social Links-johndoemyc153
Because I don't want to have 10 different de_dust2 version on the forum...
I don't think a mapper skilled enough to port a map is dumb enough to try and port a map that popular. Even if they do think of doing such a thing, i'm pretty sure they'll check the wip sections first. Also, this:
Just sayin, I'm already making a de_dust2 port.

Legal side is another thing - many already walk on thin ice
Well it's an official map, i don't believe there should be any problems since i found some of the tools to decompile some Source Engine related assets on Valve's own wiki. But if someone wants to port a custom map, he should probably find the original mapper and ask for permission.
Are there any downsides so far? - Does it export everything or does it have any limitations ???
So far there are only two things i haven't been able to port two things: decals and patches. I'm pretty sure if i try harder i may be able to port that as well but decals seem impossible because they are simply laid on the map as normal entities without any geometrical info. But even without them, it works pretty fine.
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Legal side is another thing - many already walk on thin ice

I was actually wondering if it was legal myself. So i went searching for the legal docs in L4D2 but couldn't find any legal agreement. I did however manage to find it in the 2013 SDK SP tools. From what i remember as long as you give credit to valve, third-parties, and compile the lengthy document with the mod, it is legal. I'd have to redownload the SDK again to make sure.

I wasn't using the method i use now back then. I'm pretty sure it should work fine with l4d2.

So i should be able to get these textures?

Spoiler: click to open...
Last Edit: May 31, 2014, 03:44:10 pm by daedra descent
broken avatar :(
×
broken avatar :(
[UGX] Maintainer (Admin & Programmer)
Location: deFriedrichshafen, Baden-Württemberg, Germany
Date Registered: 29 August 2012
Last active: 6 hours ago
Posts
441
Respect
Forum Rank
Perk Hacker
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Personal Quote
Dolphin!
×
Delta's Groups
UGX Administrator
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
UGX Chat Moderator Has the ability to mute, kick, or ban chat members for being abusive or breaking the rules of the forum.
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Delta's Contact & Social LinksItsDeltaugx_deltathe-deltaugxDeltaigdeltaigDelta UGX_DeltaigdeltaPersonal Site
OK well any valid source to the legel thing would be appreciated, that would mean I don't have to find it.

There are enough people out there who will mess around with this. Especially newcomers could find this interesting and thats why we will most likely add some rules to protect at least our site / forum and of course the mapper himself.

Definitely, the original mapper has to agree, must know all the changes and where the map will be destributed.
Idk about valve content in non-valve games / source engine - This is activision / treyarch / infinity ward so we need to check this.

Quote
I don't think a mapper skilled enough to port a map is dumb enough to try and port a map that popular. Even if they do think of doing such a thing, i'm pretty sure they'll check the wip sections first. Also, this:

There is no rule against multiple maps or whatsoever - First comes first serves seems also unfair - so idk about this topic yet.
broken avatar :(
×
broken avatar :(
UM Member, Mapper and 3d Modeler
Location: ca
Date Registered: 8 February 2014
Last active: 4 years ago
Posts
835
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Port Arthur
Signature
×
pashan's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
i hope that people just don't port the map and add spawners and publish it
broken avatar :(
×
broken avatar :(
Swag Commander ( ͡
Location: us
Date Registered: 12 January 2014
Last active: 7 years ago
Posts
855
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Dat feel when anims "fall from sky" ;)
×
CyberMan1011's Groups
CyberMan1011's Contact & Social Linkscyberman1011
Definitely, the original mapper has to agree, must know all the changes and where the map will be destributed.

Darn it...really?

http://www.gamemaps.com/details/2145

This is a Terminal remake I found for L4D2 which almost looks EXACTLY like the original one from MW2. I was hoping to port it into WaW, but I think the original creator of the map has been inactive for a long time... :l

Can't I just list him in the credits for creating the original remake in L4D2?
Last Edit: May 31, 2014, 05:11:52 pm by CyberMan1011
broken avatar :(
×
broken avatar :(
Location: caCranbrook
Date Registered: 1 June 2013
Last active: 2 years ago
Posts
334
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Zombies?
Signature
http://www.speedtest.net/result/3950067582.png

WaW - Nazi_zombie_candyland/Nazi_zombie_ascension2.0  90%-95% (Not completed)
WaW - Nazi_zombie_meth/Nazi_zombie_lamanai  100% (complete)
WaW - Nazi_zombie_killswitch 100% (complete)
WaW - Nazi_zombie_pax 100%  (complete + UGX 1.1 edition)
BO3 - zm_epping_woods 80%
×
iBarnett's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
iBarnett's Contact & Social LinksiBarnettiBarnettiBarnettCorey Barnett
i hope that people just don't port the map and add spawners and publish it
I agree with this. Sure people can port over maps from source... That's cool. A new take on some good old classic maps with zombies. Couldn't want more. I just don't want people to start pumping out the same map with little changes. Ex. Adding a few creates or barrels around and calling it there own. Even though I dl every map that's released for waw it's different then most molding communitys. People seem to make there own ideas into reality. I just think Trem's right and it needs to be regulated so we don't see 15 of the same map with a crappy face lift. But props to you for figuring this out!! Excited to give it a try... If I can
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 8 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
OK well any valid source to the legel thing would be appreciated, that would mean I don't have to find it.

There are enough people out there who will mess around with this. Especially newcomers could find this interesting and thats why we will most likely add some rules to protect at least our site / forum and of course the mapper himself.

Definitely, the original mapper has to agree, must know all the changes and where the map will be destributed.
Idk about valve content in non-valve games / source engine - This is activision / treyarch / infinity ward so we need to check this.

All i can find so far is a third-party notice that comes with the 2013 SDK but i know there is another somewhere. I don't know how legal it is to post legal agreements, so i'll just let you download the SDK and look for yourself. You can download it from the "tools" tab in Steam.

So far for L4D2 i'm not seeing anything. Maybe all Source engine's use the same agreement?
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 1 year ago
Posts
5,551
Respect
6,693Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
I don't know how legal it is to post legal agreements
It's a free download, nobody cares.
broken avatar :(
×
broken avatar :(
Location: usFlorida
Date Registered: 4 August 2012
Last active: 8 years ago
Posts
326
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Its only the beginning.. of the end.. 1.1.13
Signature


People love me on youtube :)
×
geh233's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
geh233's Contact & Social LinksGarrett The Parrot!geh233
PLEASE FOR THE LOVE OF GOD SOMEONE MAKE A CS_OFFICE ZOMBIE MAP

 
Loading ...