It’s been a long time. How have you been? I’ve been really busy being dead. You know... after you murdered me?

Post tutorial Report content RSS feed Getting setup for Portal 2 mapping

Get A head start before the offical sdk comes out. Shows you how to set up hammer to get cracking on those Portal 2 maps.

Posted by on - Basic Mapping/Technical


Note: This tutioral is no longer needed, a Beta of the Portal 2 sdk is now on steam.

If you are like me then you will want a bit of an edge over the competion, its time we showed the guys at Black Mesa a thing or two about banging rocks. Can't wait for the offical mod sdk? Well we have you covered.


What you need:

  • Portal 2, well sorta obvious but you never know.
  • Alien swarm, its free so....

Step 1 (Setting up the Alien Swarm sdk for Portal 2):

We will use the Alien Swarm sdk because it is the most recent version of the source engine (bar Portal 2) and it can load Portal 2 models and textures.

Note: Click the images for a larger version.

Go to the tools tab in steam and launch the Alien Swarm Authoring tools.


Open the the edit game configurations option.


Then go to add and then enter "Portal 2" as the name and the browse to your Portal 2 folder.
See the image below for an example for what the path should look like.



Ok so thats the Authoring tools set up, next we have to edit the portal 2 gameinfo.txt file to tell it to look in the platform folder for the editior resources. If you didnt add this Hammer would moan about missing files, the 3d veiw wouldnt work and the 2d veiws would be trippy. (try it if you must :P)

Go to your portal 2 folder inside the portal2 folder and open the gameinfo.txt text file.
e.g. "C:\Program Files\Steam\steamapps\common\portal 2\portal2"

Scroll down to the bottom and look for "SearchPaths" and change it to look like this

text code:
SearchPaths
{
Game        |gameinfo_path|.
"Game"  "platform"
}

Almost done, now we just have to set up the compile options and you can proced with the testing.


Compiling:

Ok, so launch the Alien Swarm Authoring tools again and select Portal 2 in the current game drop down box and now just launch Hammer.

When hammer loads you should see this in the messages box.

If you dont see the second line mentioning platform double check you gameinfo.txt file.

Thankfully the final hurdel is an easy one.
To get your map to compile you will need to use the expert compile option (f9, then Expert).
We need remove some of the options for the compile tools to avoid errors.


Change $bsp_exe to "-game $gamedir $path\$file".
If you left the -alldetail option you would get alot of compiler warnings.


Well Thats about all to it.

Notes: I found some textures will cause the map to have no lighing ingame (compilers report no errors), I have a feeling that Vavle added a new material property that the compilers are freaking out over.

You can use this map decompiler to get the entity names: Nuclearvelocity.com I used the stable version as the beta with portal 2 support didnt seem to work but the older one works just fine.


Happy moding :)

Ok things are now starting to take off.
There is an .fdg in the works that you can grab from this thread: Facepunch.com

Comments
Cyberpresident_CORE
Cyberpresident_CORE

Lets get started.
Were going to do maps ... even if you dont like it !

Reply Good karma Bad karma+14 votes
zonbie
zonbie

Let's have fun...with mapping!!

Reply Good karma Bad karma+12 votes
AmaroqDricaldari
AmaroqDricaldari

But why is it part of the Alien Swarm SDK? Why not normal Source SDK?

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

The Alien Swarm SDK is the most recent version of the sdk that we have acess to, so it gives the cloest set of tools next to the one vavle used internaly for Portal 2.

The Hammer version in the normal Source SDK doesnt suport loading files from the .vpk structre that Vavle now use, nor does it suport the new model format.
You can still compile maps with the Source SDK and have them run in portal 2 but you will missout on being able to see the textures and models, you could extract the textures and put them in a folder within the normal SDK but thats uneeded hassle and you wont get the benifate of the improve compile tools.

Reply Good karma+7 votes
Pyroguy
Pyroguy

Valve has stated they will release a proper SDK at a later date, this is just a temporary solution someone discovered.

Reply Good karma Bad karma+2 votes
cW#Ravenblood

Well, soon a real P2 sdk is comming!
Get ready!

Reply Good karma Bad karma+4 votes
Ark_ Author
Ark_

Yea, but Vavle unfortanly tend to have, em, timing issues. Developer.valvesoftware.com
They said they are to be made available after launch, but we dont know how long that could be.
No harm in having a leg up anyway :)

At least the offical one should have helpers in hammer for lining up the areial plates.

Reply Good karma+3 votes
Kizzycocoa
Kizzycocoa

I hope the real SDK allows full blown mods.

if not, that's just sad. lose out on things like Blue Portals etc. porting to Portal 2 and taking advantage of the new engine, while adding their own definitive stamp onto the game.

still, looking forward to map again. it's going to be fun!

Reply Good karma Bad karma+8 votes
ammd
ammd

^This.

Reply Good karma Bad karma+5 votes
why_me
why_me

I think it would be cool to recreate portal 1 in portal 2 but add the new stuff in some how

Reply Good karma Bad karma+2 votes
Dragondx11
Dragondx11

I was thinking the same thing. It would be fun to try out Portal 1 using Portal 2 mechanics. Even maybe making some of the P1 maps co-op using different tactics.

Reply Good karma Bad karma+5 votes
Jeek
Jeek

(buried)

There would be no point doing that, really. And even if there was, it's too much work.

Reply Good karma Bad karma-6 votes
BlabVoid
BlabVoid

@Jeek I believe when you made your account you put an e instead of an r - Jerk. Respect other people's ideas.

Reply Good karma Bad karma+3 votes
*Don*
*Don*

Have the BMS team do that and it will be out in 2037

Reply Good karma Bad karma+5 votes
Anddos
Anddos

will custom maps work for coop mode?, if so that will be awsome

Reply Good karma Bad karma+2 votes
ManWhoWasFromFinland
ManWhoWasFromFinland

yes it do

Reply Good karma Bad karma+2 votes
jackar
jackar

id rather wait for official SDK to come out

Reply Good karma Bad karma+3 votes
spuuunit
spuuunit

When people make mods to Portal 2, are they gonna use this then?

Reply Good karma Bad karma+2 votes
macacos2
macacos2

Too glitchy. Waiting for the official release.

Reply Good karma Bad karma+3 votes
ochtendjas
ochtendjas

can you make maps for co op and even put them on a mod so people can play it online within your mod?
and are there prefabs for portal 2?

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Yep you can make coop maps with this, you just need to use the coop spawn entitys.

To play a custom coop map with a freind you will have to send them the map and then invite them to play coop with you. When you are both in the hub, open the console and type changelevel yourmap and that should be it.

Reply Good karma+2 votes
Dragondx11
Dragondx11

People were talking about this on the steam forum: Forums.steampowered.com
The FDG is located here: Facepunch.com

If this was stated before sorry =\... If not, enjoy mapping!

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Some one else showed me a similair guide on the facepunch fourms, only real differnace between my metiod and theirs is that with mine you dont need to extract anything with gcfscape, Alien Swarms tools can read right out of the .vpks so there is no need. Handy if you cant spare space on your hard drive :)

Also added a link to the fdg in the guide, thanks.

Reply Good karma+2 votes
user1220
user1220

Thanks for the guide, it was very helpful for me! :-)

I'm new to creating custom maps, and played around with Hammer a little, but when I tried to run the map, the following error occured: "Can't find background image 'materials/console/background_menu_widescreen.vtf'. However, when I start Portal 2 and run the map from the console, it works just fine.

What could I do to solve this system? Thanks in advance!

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Are you useing the run game after compile option (the last option in the compile menu)?

I just have it disabled, have Portal2 running in bordeless windowed mode.
Then when I compile all I have to do is load the map in the console.
It's alot faster than startng the game each time I recompile.

Reply Good karma+3 votes
David-B-737
David-B-737

I am already working on a Portal 2 mod, by making concept maps in Portal 1.

Reply Good karma Bad karma+2 votes
user1220
user1220

Thanks for your reply. I think I'm going to do it this way now. :-)

However, I have another problem with the editor. I configured the SDK as described in the tutorial, but the "weapon_portalgun" class does not show up in my entity list.

Maybe the name is different from Portal 1?

Reply Good karma Bad karma+2 votes
user1220
user1220

Okay, I solved the problem. I found out that if you type weapon_portalgun into the dropdown menu for the entity names, it will actually appear in the game, though it won't in the map editor.

Reply Good karma Bad karma+2 votes
Kamikazi[Uk]
Kamikazi[Uk]

Is anyone able to decompile a few portal 2 maps so i can look i can't seem to get the tool to work.

Thanks.

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

The beta version with suposted suport for Portal 2 maps doesnt work but the version just before it does. Dont fix whats not broken?
Anyway I uploaded the version that I have as I know it works Arkage.co.cc

Reply Good karma+2 votes
Kamikazi[Uk]
Kamikazi[Uk]

That version don't work just flashs open then closes.

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Odd, maybe try updateing your java?

Reply Good karma+2 votes
EmuGator
EmuGator

The guide was great!
but I had 1 problem.
when I load the map using the map command in portal 2 it disconnects me from the server in single player and it doesn't load the map please help!

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

If you already have an offical map loaded and then try to load your map it will dissconnect you, just reenter the command and it will load it then.

Reply Good karma+2 votes
EmuGator
EmuGator

Thanks a lot this really helped!:D

Reply Good karma Bad karma+2 votes
DiederikV
DiederikV

Afther editting the game configurations and the search path, when I try to switch "alien swarm" to "portal 2" it doesn't switch.

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Close the Alien Swarm authoring tools and then reopen, now you should be able to see the portal 2 option.

Reply Good karma+2 votes
DiederikV
DiederikV

I can see the option but when I click on it it doesn't switch to portal it stays on alien swarm.

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

That sounds really strange, have you tryied making a Alien Swarm mod jsut to see if it will appear in the list and be selectable?

Reply Good karma+2 votes
djreidak
djreidak

I followed all the steps, but when I try to compile the map the compiler always crashes. What do I do?

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Does it display anything in the output window or does it just close? If its out puts anything what does it say?

Reply Good karma+2 votes
Brinstar
Brinstar

There aren't any entities in my Hammer. When I click to add an entity the drop boxes are empty. Also I don't have Orangebox or SourceSDK, just Alien Swarm and Portal 2. (if that makes a difference)

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

Can you check your gameconfiguration from inside hammer nad see if there are any .fdgs listed?

Reply Good karma+2 votes
Brinstar
Brinstar

It says Portal2_omni.fdg is listed under game data files.

I noticed when I edit the portal2_omni.fdg that it says "@include "halflife2.fgd"" would I need to have HL2 for this to work? To my knowledge I don't have halflife2.fgd

Reply Good karma Bad karma+2 votes
Brinstar
Brinstar

I fixed it. I didn't have halflife2.fgd or the other FGD's, just the custom portal 2 one. After getting a zip with all the FGDs it is now showing me Entities and working as expected. Thanks for the help.

Reply Good karma Bad karma+2 votes
HerreH
HerreH

When I run my map it does alot of things in a command window but in the end it says "Empty map"
What can I do to fix this?
So far I only have a hollow cube with (I think) a spawnpoint in the middle (I don't really know how to spawn custom entities yet) and a block you can jump on. So it's defenitely not empty.

Reply Good karma Bad karma+2 votes
Ark_ Author
Ark_

The Portal 2 SDK has just gone live on steam.
Not much seems to have changed :(

Reply Good karma+2 votes
JR0DGamerz
JR0DGamerz

Wireframe is missing and textures only display debug textures.

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Icon
Portal 2
Platforms
Windows, Mac, X360, PS3
Developer & Publisher
Valve
Engine
Source
Contact
Send Message
Release date
Game watch
Start tracking
Tutorial
Browse
Tutorials
Share
Related Games
Portal 2
Portal 2 Puzzle
Related Engines
Source
Source Commercial
Related Groups
Level Design Group
Level Design Group Hobbies & Interests
Valve
Valve Developer & Publisher