Dungeon Transitions
- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Dungeon Transitions
Can this technique be used to simulate static portals?
(placed anywhere in the level, not necessarily at the map edges)
(placed anywhere in the level, not necessarily at the map edges)
Re: Dungeon Transitions
Not sure i know what you mean...Zo Kath Ra wrote:Can this technique be used to simulate static portals?
(placed anywhere in the level, not necessarily at the map edges)
- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Dungeon Transitions
sajon wrote:Not sure i know what you mean...Zo Kath Ra wrote:Can this technique be used to simulate static portals?
(placed anywhere in the level, not necessarily at the map edges)
SpoilerShow
The "true" ending of LoG2 has this portal:
https://www.youtube.com/watch?v=jeE0YEhOC6w#t=158
When the party walks into it, the game ends.
https://www.youtube.com/watch?v=jeE0YEhOC6w#t=158
When the party walks into it, the game ends.
But I also want the player to see this other area when he looks through the portal (instead of what's behind the portal on the same level).
It would be even better if the portal had two sides:
Looking at it from one side shows one area, looking at it from the other side shows a different area.
It would work just like the portals in Valve's Portal games.
But the portals I'm thinking about would be static, i.e. they are always be in the same location (no portal gun).
Re: Dungeon Transitions
That sounds complicated.Zo Kath Ra wrote:I'd like to make it so that walking into the portal teleports the party to another area (no problem with scripting).
But I also want the player to see this other area when he looks through the portal (instead of what's behind the portal on the same level).
It would be even better if the portal had two sides:
Looking at it from one side shows one area, looking at it from the other side shows a different area.
It would work just like the portals in Valve's Portal games.
But the portals I'm thinking about would be static, i.e. they are always be in the same location (no portal gun).

It's possible (with restrictions) for a one sided portal, but for a two sided portal, it would (for the effect I'm thinking of) have to be possible to make a material out of a camera's view; or otherwise render two camera angles at once. I've no idea if that can be done in the current engine; but I would assume that it is not possible.
I can think of two ways to make a one-sided portal. The obvious way is to not make it one; just have the portal effect be in a hallway to another room, and let them walk into it; (with some sound effect and a screen flash).
Alternatively [a real portal]: place your custom portal effect at the exit from the edge of the map, leading to the adjacent map. Behind the effect, place some offset lights and an offset a 3D mockup of the room (which you would have to build in a 3D modeler). I have done this in my Eye of the Beholder map for LoG1. It lets the player seemingly walk right off the map, and into a different part of the same map. In this example, there is no portal effect. The intent was that the player not even notice it, but they can stand facing the edge of the map, and mouselook all the like at the room off the edge of the map. When they step towards it, they are teleported to the room at the other side of the map. This could just as easily be to a different level.

There is a third way that comes to mind... and that is to use a partially transparent image (a static screen shot) of the destination room, and place it as a decoration in the center of the portal effect; perhaps have it shimmer or wiggle a bit; but that would not allow animation of the depicted room's interior (flames flickering or monsters moving around in it); those would only work with the first two options, and would be rather involved to achieve in option 2. However this would be a shockingly easy way two have a two sided portal; with two views of the room.
Last edited by Isaac on Sun Mar 01, 2015 8:57 am, edited 1 time in total.
Re: Dungeon Transitions
You can copy objects from the other side of the portal to the space behind the portal, but this is problematic in many ways (consider monsters, heightmaps, etc) and you'll need intervening models/obstacles such that you can't see those objects from around the portal. You can of course do a two-sided portal this way but you would have to switch between the two sides when the camera angle crosses the plane, which would surely result in a hiccup since you'd be removing and adding bunch of models/light sources/etc.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Dungeon Transitions
That sounds like a more complex (minmay wrote:You can copy objects from the other side of the portal to the space behind the portal, but this is problematic in many ways (consider monsters, heightmaps, etc) and you'll need intervening models/obstacles such that you can't see those objects from around the portal. You can of course do a two-sided portal this way but you would have to switch between the two sides when the camera angle crosses the plane, which would surely result in a hiccup since you'd be removing and adding bunch of models/light sources/etc.

One could of course have the portal [my option 1] teleport the party to a different level into the destination room; (where the view from the portal is of a partial copy of the room done on the current map, one that the player can never actually enter).
Re: Dungeon Transitions
If you make a static model (animations, light sources, etc.) instead of copying objects from the real other side, you run into the problem that if the state of things on the real other side changes (player drops items there, for example) the changes won't be reflected in the portal view. For LoG1 this wasn't even possible for items, but in LoG2 you can properly do it with items, and with careful use of GameObject:setPosition() and :setWorldPosition(), I'm pretty sure you could properly do it for projectiles without world space particle emitters too. Probably not possible to seamlessly do it for monsters though, and synchronizing animated objects sounds difficult as well.
I should clarify that I don't recommend actually doing this.
I should clarify that I don't recommend actually doing this.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Dungeon Transitions
It's to be expected when you are faking it... The portal effect should [deliberately] obscure things a bit.minmay wrote:If you make a static model (animations, light sources, etc.) instead of copying objects from the real other side, you run into the problem that if the state of things on the real other side changes (player drops items there, for example) the changes won't be reflected in the portal view.
*Not worth it IMO, but the real room could be examined for items, and a script probably written to spawn offset items, as well as destroy them if they are later absent from the real room. [That would have meant custom duplicates of every item they could drop; in an LoG1 map.

And I'm not suggesting it be done.
In my ORRR2 room, I actually had set it up so that the torch_holders in the main hall (with the catwalk) would spawn particle flames in the torch_holders on the visible mock-ups of the other rooms. If you placed a torch in the downstairs holder, and went upstairs, you would see the light and smoke in the faked room below. Alas, it's scripted in the map, but it was unexpectedly mangled by the dungeon-wide room-respawning script that deletes or re-spawns all the room objects when the player leaves or returns to an area. Originally the wardens were to have at least static mock-ups visible downstairs if they were loose; but time constraints caused so many cuts, including two custom monster types from the Foundry; the dwarven blacksmiths, and the foundry ghost.For LoG1 this wasn't even possible for items, but in LoG2 you can properly do it with items, and with careful use of GameObject:setPosition() and :setWorldPosition(), I'm pretty sure you could properly do it for projectiles without world space particle emitters too. Probably not possible to seamlessly do it for monsters though, and synchronizing animated objects sounds difficult as well.
Re: Dungeon Transitions
Yeah my fist thought was to do a screen shot of the area and just texture a fake model with it, but i had to many transitions to do that. It might work for a portal. sort of like what Isaac said.
I think Portals by design, are to be mysterious; but for a permanent portal. I think, take a screen shot of the area save it as a .dds and texture you portal with it throw some effects on it an you have a working static portal. Do that for both side and you have a 2-way portal. but that is a lot of work if you have 10-20 transitions per level.
I think Portals by design, are to be mysterious; but for a permanent portal. I think, take a screen shot of the area save it as a .dds and texture you portal with it throw some effects on it an you have a working static portal. Do that for both side and you have a 2-way portal. but that is a lot of work if you have 10-20 transitions per level.
Re: Dungeon Transitions
You might be able to make one custom portal model, and change (screenshot) materials via script.sajon wrote:Yeah my fist thought was to do a screen shot of the area and just texture a fake model with it, but i had to many transitions to do that. It might work for a portal. sort of like what Isaac said.
I think Portals by design, are to be mysterious; but for a permanent portal. I think, take a screen shot of the area save it as a .dds and texture you portal with it throw some effects on it an you have a working static portal. Do that for both side and you have a 2-way portal. but that is a lot of work if you have 10-20 transitions per level.