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

Report article 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 Ark_ on Apr 21st, 2011
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

Post comment Comments
]BlackPhoenix[
]BlackPhoenix[ Apr 21 2011, 6:03am says:

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

+14 votes     reply to comment
zonbie
zonbie Apr 21 2011, 6:43am says:

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

+12 votes     reply to comment
AmaroqDricaldari
AmaroqDricaldari Apr 21 2011, 8:22am says:

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

+2 votes     reply to comment
Ark_
Ark_ Apr 21 2011, 8:48am replied:

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.

+7 votes     reply to comment
Pyroguy
Pyroguy Apr 24 2011, 10:45pm replied:

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

+2 votes     reply to comment
cW#Ravenblood
cW#Ravenblood Apr 21 2011, 9:37am says:

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

+4 votes     reply to comment
Ark_
Ark_ Apr 21 2011, 9:50am replied:

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.

+3 votes     reply to comment
Kizzycocoa
Kizzycocoa Apr 21 2011, 1:42pm says:

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!

+8 votes     reply to comment
ammd
ammd Apr 21 2011, 2:07pm replied:

^This.

+5 votes     reply to comment
why_me
why_me Apr 21 2011, 4:57pm says:

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

+2 votes     reply to comment
Dragondx11
Dragondx11 Apr 22 2011, 4:21am replied:

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.

+5 votes     reply to comment
Jeek
Jeek Apr 22 2011, 4:29am buried:

(buried)

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

-6 votes     reply to comment
BlabVoid
BlabVoid Apr 24 2011, 6:32pm replied:

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

+3 votes     reply to comment
*Don*
*Don* Apr 22 2011, 3:23am says:

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

+5 votes     reply to comment
Anddos
Anddos Apr 22 2011, 5:14am says:

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

+2 votes     reply to comment
ManWhoWasFromFinland
ManWhoWasFromFinland May 2 2011, 1:29am replied:

yes it do

+2 votes     reply to comment
jackar
jackar Apr 22 2011, 8:12am says:

id rather wait for official SDK to come out

+3 votes     reply to comment
spuuunit
spuuunit Apr 22 2011, 8:48am says:

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

+2 votes     reply to comment
macacos2
macacos2 Apr 22 2011, 10:09am says:

Too glitchy. Waiting for the official release.

+3 votes     reply to comment
ochtendjas
ochtendjas Apr 22 2011, 11:12am says:

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?

+2 votes     reply to comment
Ark_
Ark_ Apr 23 2011, 6:16am replied:

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.

+2 votes     reply to comment
Dragondx11
Dragondx11 Apr 23 2011, 5:34am says:

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!

+2 votes     reply to comment
Ark_
Ark_ Apr 23 2011, 6:11am replied:

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.

+2 votes     reply to comment
user1220
user1220 Apr 23 2011, 11:31am says:

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!

+2 votes     reply to comment
Ark_
Ark_ Apr 23 2011, 11:38am replied:

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.

+3 votes     reply to comment
David-B-737
David-B-737 Apr 26 2011, 9:28am replied:

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

+2 votes     reply to comment
user1220
user1220 Apr 23 2011, 1:01pm says:

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?

+2 votes     reply to comment
user1220
user1220 Apr 23 2011, 1:09pm says:

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.

+2 votes     reply to comment
Kamikazi[Uk]
Kamikazi[Uk] Apr 24 2011, 4:22pm says:

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.

+2 votes     reply to comment
Ark_
Ark_ Apr 24 2011, 4:31pm replied:

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

+2 votes     reply to comment
Kamikazi[Uk]
Kamikazi[Uk] Apr 24 2011, 5:04pm replied:

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

+2 votes     reply to comment
Ark_
Ark_ Apr 24 2011, 7:22pm replied:

Odd, maybe try updateing your java?

+2 votes     reply to comment
EmuGator
EmuGator Apr 26 2011, 3:58pm says:

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!

+2 votes     reply to comment
Ark_
Ark_ Apr 26 2011, 4:53pm replied:

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.

+2 votes     reply to comment
EmuGator
EmuGator Apr 26 2011, 5:41pm replied:

Thanks a lot this really helped!:D

+2 votes     reply to comment
DiederikV
DiederikV Apr 30 2011, 10:35am says:

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

+2 votes     reply to comment
Ark_
Ark_ Apr 30 2011, 2:08pm replied:

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

+2 votes     reply to comment
DiederikV
DiederikV May 1 2011, 10:23am replied:

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

+2 votes     reply to comment
Ark_
Ark_ May 3 2011, 9:28pm replied:

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?

+2 votes     reply to comment
djreidak
djreidak Apr 30 2011, 5:39pm says:

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

+2 votes     reply to comment
Ark_
Ark_ May 1 2011, 7:11am replied:

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

+2 votes     reply to comment
Brinstar
Brinstar May 3 2011, 6:44pm says:

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)

+2 votes     reply to comment
Ark_
Ark_ May 3 2011, 9:29pm replied:

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

+2 votes     reply to comment
Brinstar
Brinstar May 4 2011, 5:35pm replied:

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

+2 votes     reply to comment
Brinstar
Brinstar May 5 2011, 3:50pm replied:

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.

+2 votes     reply to comment
HerreH
HerreH May 8 2011, 11:05am says:

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.

+2 votes     reply to comment
Ark_
Ark_ May 10 2011, 8:14pm says:

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

+2 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Portal 2
Platforms
Windows, Mac, PS3, X360
Developer & Publisher
Valve
Engine
Source
Contact
Send Message
Official Page
Thinkwithportals.com
Release Date
Released Apr 18, 2011
Game Watch
Track this game
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Games
Portal 2
Portal 2 Single & Multiplayer Puzzle Compilation
Related Engines
Source
Source Commercial Released Oct 31, 2004
Related Groups
Level Design Group
Level Design Group Hobbies & Interests group with 588 members
Valve
Valve Developer & Publisher