Wednesday, April 27, 2011

Getting ready for Portal 2 mapping.

With the release of Portal 2, I was wicked hyped to play it. After I played the campaign, I then went right into co-op. And after that, I played the campaign three or four more times. And every time I played it, I could not wait till the SDK. It was not long till people figured out that you can config the Alien Swarm SDK to map for Portal 2, since the engine versions are close enough such like Source 2006 and Source 2007. However their method involves copying over the files into a mod folder. Meanwhile like a pro, I just set up the SDK to read the Portal 2 VPKs. A thread on myApertureLabs about setting it up is here.

So what did I do the instant I loaded up the tools? Well, to be honest, I was lost. It felt like I was mapping in unknown territory, much like I was mapping for Team Fortress 2, or Left 4 Dead. So, I started to make buttons and switches like I would for Portal 1. It was not long till I got a hold of a decompiler and realized that doors, switches, buttons, you name it, are all entities. Wow, Looks like Valve got tired of triggers and doors too! After decompiling, looking at the new way to map for Portal, I started to make prefabs. They were mostly easy till I got into the box dropper. Man that was so complex. It involves 3 logic cases,, a branch listener and other stuff so the box can fizzle and be respawned much like how it is in the game. I've included it in my prefab pack, in case you wanna look at it.

Next I was ready to map. I was working on a map to test my prefabs untill a friend said that a working Diversity Vent would be awesome to see in Portal 2. So In a rush because I was going out that night, I quickly remade the  E3 Vent chamber:

Like its Portal 1 counterpart I made in the Portal 2 Demomap, its kinda buggy, and since I rushed, this is even more buggy. I wanted to test the portal detectors new outputs (OnEndTouchPortal) which will make Portaling  things in the future A LOT easier. In the end I screwed up the I/O communications and theres some points where it did not work. But again in a rush, made a video, uploaded it and went out.

The thing I got out of that map was not the I/O part, but the lighting. People said it was almost a close match. Finally! I think I got the hang of lighting after 4 years! So I went back to that map I was working on and remade some ideas I had that I did in Portal 1. Later, I posted this picture:

I got people off their feet with this one since most people are currently playing with things like panels and such, not really caring how the map looks while I just want to express the engine and the puzzle ideas. No one is right on what they want to work on first, but being that I remade half the stuff in Portal 1, I got to work as soon as possible. At this point, the tools now feel just like the Portal 1 tools I've been using ever since; I feel right at home again. 

I will be releasing a map very shortly, I just want to fix up a few things and then I'll upload it to the myApertureLabs database. I'm thinking about releasing a lot of small test maps from now till the real tools come out. After that, it will be time to get to business. 

Friday, April 15, 2011

Conversion Cube'd

First off, this map and the vmf is out. You can download them both here. (The vmf is in the SDK.) As you may notice in the SDK I have 2 vmfs. The plan was to extend the map a bit, but it did not go well at all. No idea why, I got andry and gave yup

A little history: The paint system started way back in the summer when everyone was remaking Portal 2 elements in Portal 1. One thing that people tried and tried was the gels. Well to be honest, while on a role with the Thermal Discouragement Beam, Faith Plates and Vents (What happened to those?) I got cocky and decided to tackle the paint deal.

To make a long story short, I did it in the most complicated way possible. The main issue was not the jumping effect, but the stains. To fix this, the floors worked like a grid. The paint would hit a sector, making the stain and spawning the effect at the center of that box. You can see it here.

But for the common human mind (and its normal for everyone else to see this as madness), no one understood it. Also, on some machines, it would crash. (No, not fixing it, Wait 5 days for Portal 2.) How are we going to pull the same effect, but easier?

When the paint will breaks, it will tell its maker to spawn 1.25 secs after the call. The ground will just have a trigger that tells the !activator to break. And if theres a Portal under the dropping, you just disable it if so using HMWs Portal detector. There, paint falls, hits floor, respawns! Now on to the cube. When the paint hits the cube, it will break but call a relay, and a logic_branch that controls the cubes properties.

The break/splat effect is called by a relay, then the trigger also calls the branch. The trigger will also tell the paint to break, thus the paint will tell its maker to respawn. The paint also has a info_target parented and spawned with it, make sure the info_particle_system spawns to that target before its killed!

Confusing? Take a look at the vmfs. maybe you will understand it better with the file and this post. . 

Monday, April 11, 2011


First post, lets see how this goes. . .

Ever since I played Left 4 Dead on my favorite campaign No Mercy, I always wondered how Valve got the lightning effect to work. It was not until May 2009 when I got to see the vmf. In Valves case, the lightning effect is done by logic_cases, sounds, logic_timers and flashing sprites in the 3D skybox. However, this is in the first part of No Mercy when your outside and inside almost equal amounts of time. Without going into detail on how they did theirs, I decided to take a whack on this effect for a map were your indoors.

Better remember, lightning never strikes twice!

This was for a small map I was playing with, mostly playing with an idea me and another developer were doing. For that screen, I had to go into demo mode, and slow down the playback. Yeah, it flashes that fast, like real lightning. A neat effect to have in your map, totally when you use env_projectedtextures. Best off all, its actually very easy to do. 

I don't want these posts to be tutorials, but at the same time, I want to tell you how I did it. I'm sure if I told you what entity does what and how by text, I'll lose people. Lets see how I can show this.

I think if you can follow this diagram, this should tell you on how all the entities communicate with each other. The gray thin line is your window wall. The logic_timer is enabled at start. On its high random time, it triggers the relay that makes the effect. After its done, it calls the logic_case which decides what sound file to use, and when. A really simple and easy effect!

Now, unless you fixed the env_projectedtexture in your mod by code, you want to use your env_projectedtexture in the best spot possible since you are only allowed to use one. If you only have one to use, I would recommend to spot this on something important, a pathway direction, or the case of "Whats going to leave a better shadow?". But only use this if you got memory to spare, it only lasts a second, and most people will not noticed the dynamic shadow much if they are running by it,

Again, something simple and easy to do. I do think the pictures help as they save text, and keep people in understanding. Ha, I can't wait to talk about the Conversion Cubed stuff, and what I had to fight with.

Sunday, April 10, 2011

New Blog, Welcome!

As you might already know, there is a play list on my YouTube called "Hammer Notepad", which features a lot of crazy stuff I do in Valve's Hammer Editor on the Source engine. Over the months, people been asking me how I did them, what entities I used, etc. To clear this up, I wish to start a blog about the development part of the Source engine. Hopefully, this will limit questions and educate more mappers. . 

Another way I want to use this blog is to talk about what I'm doing with the SDK tools. And now with Portal 2, I have a lot of plans and thought of what I wish to do. From just brainstorming to problems I wish to discuss, hopefully I will not forget about this blog as I did with so many others. . .

Going back to Portal 2, Source 2011 is sure going to be exciting! I'm nervous on how complex its gonna be compared with the Source 2009 tools, but I'm still hyped . Rumors tell me that a complete over-hall of Hammer will be in the Portal 2 tools along with a three view Tilegen. I can't wait, just one more week to go. On that same note, I'm unsure about how much the vpk system will limit me. Since I've been mapping, I always known the gcf file system. Its really easy once you get the hang of it. Drag and place, your done. However, the vpk system is a tad different as you can not do sourcemods anymore using the same bin file as the game, no more texture replacements, (unless they are in a separate vpk) and you have to script your sounds in. But yet again, Valve has improved the vpk since when I used it (Left 4 Dead) in Left 4 Dead 2 and Alien Swarm. Who knows, maybe it will be easier for the developer and the user altogether. . 

Anyway, I'll be writing up and linking my Notepad videos from now on, plus more.