Idea for a visual mod if anyone wants to try it.

Avatar
CassataGames
98 Posts
Posted Nov 04, 2007
Not sure exactly how doable something like this would be, but I thought it might be an interesting task for someone bored, to try to take on.

As we all know, objects go through portals seamlessly. On levels with awkward lighting though, this could lead to some strange looking cut lines, especially when moving an object from a light room to a dark room.

Well I'm sure regardless of some mild performance slumps, and interesting mod could consist of copying lights from 1 side of a portal to another side so that light seems to travel through the portal.

Take this picture example using a spotlight.

Now of course, to keep with performance, there might be something such as a limited amount of lights that are copied and perhaps a distance.

A mod like this would lead to some nicer looking object transitions between portals and actually might even go as far as to add an entire new aspect to puzzles.
For example, using portals to light up dark rooms!

Advertisement
Registered users don't see ads! Register now!
Avatar
youme
937 Posts
Posted Nov 04, 2007
Replied 33 minutes later
Its a great idea, and I'm sure most of us thought about it whilst playing, I know I did, but it would probably lag like mad.
Avatar
DaB00m
14 Posts
Posted Nov 04, 2007
Replied 1 minutes later
I was thinking of this the over day I thought of a map were you would have to use your portals to see where to go
Avatar
Rivid31
152 Posts
Posted Nov 04, 2007
Replied 7 minutes later
I'm not even attempting to think this through entirely but it might be possible to simulate something to this effect with a func_portal_detector switching on/off lights. Have no clue how you'd actually go about doing it though.
Avatar
CassataGames
98 Posts
Posted Nov 04, 2007
Replied 57 minutes later
Well in Portal, when you place say for example, a Box into a portal. Theres actually 2 boxes now. The half on your side and the one on the other half. Theres a split down the middle to make them both align correctly.

Essentially thats how the lights would work. A copy of all near by lights would be created on the other side.

To keep the lag down, the game might limit to lights only within say a 64 point distance and limit it to maybe 2 or 3 lights at a time.

Avatar
Rivid31
152 Posts
Posted Nov 04, 2007
Replied 43 minutes later
Well, yeah. Thats if you want to do some actual coding, which might get difficult. Figuring out some genius scheme turning lights on/off would also be somewhat difficult, but at least all the tools you need are already in hammer (presumably) to make it good enough.

It would be cool if someone took the time to code it up though.

Avatar
thecake
37 Posts
Posted Nov 04, 2007
Replied 12 minutes later
Only problem is that the lighting is precomputed when you compile the map so I don't think its possible.
Avatar
msleeper
4,095 Posts
Member
Posted Nov 04, 2007
Replied 2 minutes later
Normal lights can be turned off and on, very easily infact.
Avatar
nickworks
34 Posts
Posted Nov 04, 2007
Replied 1 hour later
I hadn't thought about this before...

BUT it would make new puzzles. Because in Portal, you obviously have no flashlight. But you could bring light into really dark rooms using portals.

Hmmm.... Very nice!

EDIT: Just saw original poster pointed this out already. I'm apparently just expressing my agreement.

Avatar
Artesia
238 Posts
Posted Nov 04, 2007
Replied 32 minutes later
lights can be turned on and off its true, but in order for this to look good its going to need to be a spotlight, so you would have to place hundreds along all the walls and at every angle (since the angle of the light going into portal A would change how it would come out of Portal B)

Right now a portal is basically putting a camera behind its connected portal to allow you to look through, it doesn't pass any information back through. Anything's possible, but my bet is you have to wait for Portal 2

Avatar
Thunder79
8 Posts
Posted Nov 04, 2007
Replied 8 minutes later

msleeper wrote:
Normal lights can be turned off and on, very easily infact.

Every single light that is turned off and on is pre-computed...when compiling it goes through every combination of lighting in the level. When you start working on lighting for a map you'll run into the fact fairly quickly.

Would this mod be possible? I don't know....what I'm fairly sure about is that it is impossible without the sdk. Don't think this is something you can accomplish with hammer alone.

Avatar
CassataGames
98 Posts
Posted Nov 04, 2007
Replied 2 hours later
I love the feedback I got on this idea, even if the mod might not be made anytime soon or even at all, the reality of it seems to have sparked a lot of interest.

I'll keep this in mind for future idea's. Thanks guys!

Avatar
Artesia
238 Posts
Posted Nov 04, 2007
Replied 34 minutes later
I think the best bet would be to "fake it"

make it part of certain puzzles but not work in all cases...

An example...

in order to escape a certain room, you must direct an energy field onto a hidden exit. Said energy field looks like a light, you put a portal in the center of the spotlight. in the other room there are only a couple places you can put the other portal. each possible point has a light that will be activated if you put a portal there. if you put it in the right place, the light shines on the exit, which once looked like a normal part of the floor, the portal detector turned off a portion of the floor making it passable.

you would have to severly limit where portals can be placed to limit the lights needed. but still make there enough variety that you have to try several times.

Avatar
Rivid31
152 Posts
Posted Nov 05, 2007
Replied 27 minutes later
That is along the same lines as I had initially thought of faking it as well. If you're going to fake it, you can't make it universal.

Unless there is a way to move a light as part of a trigger, and get the location of a portal_detector... then you could possibly just have 1 extra copy of each light color/brightness you have in your map, and move the copy around based on where the portal detectors were. If this is even possible, I could see it getting pretty complicated.

Avatar
thecake
37 Posts
Posted Nov 05, 2007
Replied 5 hours later
You can't move lights with triggers only turn them on and off.
Avatar
Rivid31
152 Posts
Posted Nov 05, 2007
Replied 2 hours later
That isn't entirely correct. light_dynamic can be parented to things, and moves around with them. The trouble I had was figuring out how to teleport anything besides yourself.
Avatar
CassataGames
98 Posts
Posted Nov 05, 2007
Replied 39 minutes later

Rivid31 wrote:
That isn't entirely correct. light_dynamic can be parented to things, and moves around with them. The trouble I had was figuring out how to teleport anything besides yourself.

If you can do this, then maybe you could set it up so that any dynamic lights near 1 portal, are copied over to the other portal so they appear to shine through the portal.

Avatar
thecake
37 Posts
Posted Nov 05, 2007
Replied 24 minutes later

Rivid31 wrote:
That isn't entirely correct. light_dynamic can be parented to things, and moves around with them. The trouble I had was figuring out how to teleport anything besides yourself.

I stand corrected

Avatar
Rivid31
152 Posts
Posted Nov 05, 2007
Replied 2 hours later
Alright, I played around with this for about an hour and decided that teleporting lights to a portal_detector IS possible, it is just extremely buggy and wouldn't work for a general case.

In order for it to work, though, you need to create an invisible model in front of each portal_detector. Using the portal model as a prop_dynamic instead of a prop_portal, you can accomplish this. Then you have to set up your portal_detectors to parent your light to this model, and then SetParentAttachment of the light to 'particles' which is an attach point for the portal model... also, the portal model has to be perpendicular to the wall...

Setting up two of these I managed to make a light move between them, but it does get slightly glitchy...
Example:
blue portal on detector_1
orange portal not on a detector:
Light shines through to the opposite wall of blue
Move blue portal to detector_2:
Light moves with the blue portal
Put orange portal on detector_1:
No light from either
Move orange portal back off detector:
Still no light
Re-fire blue back right where it was:
Light goes across from blue

As you can see.... this is not optimal, and still is not universal, as you would need to set up MANY portal detectors, and MANY portal-props to attach to, and even then... still doesn't really work if you put both portals on portal detectors (which would happen quite frequently).

All this said, I did only work on it for a short amount of time... there could be another way. Also, I've only been working in hammer for ~2 weeks, so what the hell do I know.

Best bet: set up spot lights in distinct locations and only have this effect work there by switching on/off the lights.

Advertisement
Registered users don't see ads! Register now!
Avatar
CassataGames
98 Posts
Posted Nov 05, 2007
Replied 17 minutes later
Well having mild game programming experience myself, I think it's safe to assume that if you were able to do it period, regardless of the glitches, then eventually the glitches could be ironed out.

Like I said, I think this could be a rather successful project if anyone has the spare time to fix up all the issues and clean it up.

Perhaps the mod could be set up so that only dynamic lights that are parented to an invisible dynamic/physic (which ever would work) object, will go through portals. That way you could copy the actual object (similar to what the game already does when your mid-way through sliding an object through the portal), and then copy the dynamic light. Then parent the copy of the light to the copy of the object.

PS: The idea is not so that lights themselves can travel through portals, the idea is to have the illusion that light is being cast through the portal and showing up on the opposite portal.