Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can HPL2 do this? (Texture swapping based on camera)
Arkham Offline
Junior Member

Posts: 3
Threads: 1
Joined: Aug 2012
Reputation: 0
#1
Question  Can HPL2 do this? (Texture swapping based on camera)

Hey all --

I finished playing TDD and Justine as of a few days ago, and I enjoyed my "bout of Amnesia" a great deal. I'm excited at the idea of creating a short custom story, just to see what I can do in an engine centered around creating a horror experience.
While I've done modding/environment art in other contexts (mostly UT3/UDK) I'm asking this question as a complete newbie to HPL2, so I really have no idea if what I'm asking about is a reasonable expectation, or completely out of the question, so please bear with me.

This is an idea of mine that has been kicking around in my head in rudimentary fashion for a while now, but the painting of Alexander in the Transept section of the game really got me wondering if this game's engine could do something like this. I'm not much of a scripter, but if this kind of thing can be done then I might just have to learn how.

Consider the following setup:

Say we have a scene with a bunch of stained glass windows. Though it could be other things like paintings or whatever. For the purposes of fleshing out this example let's call it stained glass.
So, say you're walking down a cathedral nave or whatever, and there are several panes of stained glass on the walls around you.
Each window has two different versions of its particular texture -- one depicting a normal, innocuous-looking scene, and a second version with subtly warped/wicked/horrific details added.
Most of the windows will display their "normal" texture; but a few of them, randomly selected, will display the warped version by default.

Here's where I think it gets tricky --
The randomly-selected warped versions should only display the warped texture while they are located in the player's peripheral vision. Once the player looks at them (i.e. the camera views the window in question within a certain radius of the targeting reticle) they jump back to displaying the normal texture.

After this switcheroo-dealie, the warped version doesn't come back... for now. In other words, even if the player tries to move the suspiciously-behaving window back into their peripheral vision to see the warped version of the window, the window stubbornly continues to look normal. ("Was it all in my head??")

Once the window passes out of the camera's view entirely (the player is looking away or has walked passed it), a timer starts counting down for somewhere between 10 and 20 seconds. Once the timer finishes counting down, the whole script resets itself, and we go from the beginning -- either the window gets weird again in peripheral vision, or perhaps that window stays normal and another window gets selected for wierd-ification.

So, to actually distill all that into a question: is this possible/feasible? Huh
Thanks in advance.
(This post was last modified: 08-22-2012, 10:21 AM by Arkham.)
08-22-2012, 10:18 AM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: Can HPL2 do this? (Texture swapping based on camera)

(08-22-2012, 10:18 AM)Arkham Wrote: Hey all --

I finished playing TDD and Justine as of a few days ago, and I enjoyed my "bout of Amnesia" a great deal. I'm excited at the idea of creating a short custom story, just to see what I can do in an engine centered around creating a horror experience.
While I've done modding/environment art in other contexts (mostly UT3/UDK) I'm asking this question as a complete newbie to HPL2, so I really have no idea if what I'm asking about is a reasonable expectation, or completely out of the question, so please bear with me.

This is an idea of mine that has been kicking around in my head in rudimentary fashion for a while now, but the painting of Alexander in the Transept section of the game really got me wondering if this game's engine could do something like this. I'm not much of a scripter, but if this kind of thing can be done then I might just have to learn how.

Consider the following setup:

Say we have a scene with a bunch of stained glass windows. Though it could be other things like paintings or whatever. For the purposes of fleshing out this example let's call it stained glass.
So, say you're walking down a cathedral nave or whatever, and there are several panes of stained glass on the walls around you.
Each window has two different versions of its particular texture -- one depicting a normal, innocuous-looking scene, and a second version with subtly warped/wicked/horrific details added.
Most of the windows will display their "normal" texture; but a few of them, randomly selected, will display the warped version by default.

Here's where I think it gets tricky --
The randomly-selected warped versions should only display the warped texture while they are located in the player's peripheral vision. Once the player looks at them (i.e. the camera views the window in question within a certain radius of the targeting reticle) they jump back to displaying the normal texture.

After this switcheroo-dealie, the warped version doesn't come back... for now. In other words, even if the player tries to move the suspiciously-behaving window back into their peripheral vision to see the warped version of the window, the window stubbornly continues to look normal. ("Was it all in my head??")

Once the window passes out of the camera's view entirely (the player is looking away or has walked passed it), a timer starts counting down for somewhere between 10 and 20 seconds. Once the timer finishes counting down, the whole script resets itself, and we go from the beginning -- either the window gets weird again in peripheral vision, or perhaps that window stays normal and another window gets selected for wierd-ification.

So, to actually distill all that into a question: is this possible/feasible? Huh
Thanks in advance.
Seems interesting. I don't know about this one, and I know you can do some "sanity" visions, but they don't work the way you explained. I don't know if your idea may be possible, but maybe it is.

The "sanity" vision trick: Let's say we have that painting of Alexander. He is normal. Your sanity is about 56. There is the distorted version of the picture that appears when your sanity is 50 or below. Since your sanity is 56, the distorted pic isn't there. But once your sanity drops below 50, the picture will become distorted (if you look at the picture while your sanity drops, you won't see the effect until you look away for approx. 1 second. Same when the pic should return to normal). When your sanity goes above 50, the pic should return to normal (assuming you looked away for a second).

This does not reflect your idea, but this (^) is possible. And you don't even need to script it. Your idea needs some scripting, but it does not mean it is not possible. It is just complicated.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-22-2012, 11:29 AM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Can HPL2 do this? (Texture swapping based on camera)

The engine has callbacks that can be set when a player is looking at an object. This, however, is limited to the white dot on the center of the screen. Peripheral vision, therefore, would have to be achieved using script areas that are larger than the object it is associated with or placed somewhere on the sides of the object. This means taking into consideration the user's window resolution.

Tutorials: From Noob to Pro
08-22-2012, 12:07 PM
Website Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#4
RE: Can HPL2 do this? (Texture swapping based on camera)

(08-22-2012, 12:07 PM)Your Computer Wrote: This means taking into consideration the user's window resolution.
And that would be problematic.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 08-22-2012, 12:09 PM by Robby.)
08-22-2012, 12:08 PM
Website Find
Arkham Offline
Junior Member

Posts: 3
Threads: 1
Joined: Aug 2012
Reputation: 0
#5
RE: Can HPL2 do this? (Texture swapping based on camera)

(08-22-2012, 12:07 PM)Your Computer Wrote: Peripheral vision, therefore, would have to be achieved using script areas that are larger than the object it is associated with or placed somewhere on the sides of the object. This means taking into consideration the user's window resolution.
Do you mean there would have to be differently-sized script areas for every possible monitor resolution (daunting, and maybe impossible if Amnesia supports custom resolutions)?
Or do you mean there would have to be different ones based on possible monitor ratios, i.e. 5:4, 16:9, 16:10 (which seems a lot more doable)?
(This post was last modified: 08-22-2012, 06:58 PM by Arkham.)
08-22-2012, 06:56 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#6
RE: Can HPL2 do this? (Texture swapping based on camera)

(08-22-2012, 06:56 PM)Arkham Wrote:
(08-22-2012, 12:07 PM)Your Computer Wrote: Peripheral vision, therefore, would have to be achieved using script areas that are larger than the object it is associated with or placed somewhere on the sides of the object. This means taking into consideration the user's window resolution.
Do you mean there would have to be differently-sized script areas for every possible monitor resolution (daunting, and maybe impossible if Amnesia supports custom resolutions)?
Or do you mean there would have to be different ones based on possible monitor ratios, i.e. 5:4, 16:9, 16:10 (which seems a lot more doable)?
To me it seems kinda like it. But I may be wrong here, though.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-22-2012, 07:05 PM
Website Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#7
RE: Can HPL2 do this? (Texture swapping based on camera)

This actually sounds rather easy, if I'm not unaware about some core problem revolving this.
Why would it not be possible?

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
08-22-2012, 07:15 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Can HPL2 do this? (Texture swapping based on camera)

(08-22-2012, 06:56 PM)Arkham Wrote: Do you mean there would have to be differently-sized script areas for every possible monitor resolution (daunting, and maybe impossible if Amnesia supports custom resolutions)?
Or do you mean there would have to be different ones based on possible monitor ratios, i.e. 5:4, 16:9, 16:10 (which seems a lot more doable)?

I wouldn't say it is as daunting as it sounds. You should be able to find a sweet spot for most resolutions. Just take into consideration one resolution, like 1024x[height], and work around that, forgetting about smaller sizes. Full conversions can suggest what resolution the game should start at, but the player can change that resolution at any given time. There's no way to detect what resolution the player is using through scripts, but if you keep to one standard, that shouldn't be an issue. If some players miss out because they choose to play on dated hardware, i would argue that's their problem.

Tutorials: From Noob to Pro
08-22-2012, 09:31 PM
Website Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#9
RE: Can HPL2 do this? (Texture swapping based on camera)

I have a few, um, hacks which may be able to help with detecting orientation of the player (which you can then use to work out what is in the peripheral vision). I'm going to have a play about tomorrow to see how feasible they are before I get your hopes up with anything though.
(This post was last modified: 08-23-2012, 03:41 AM by Apjjm.)
08-23-2012, 03:40 AM
Find
Arkham Offline
Junior Member

Posts: 3
Threads: 1
Joined: Aug 2012
Reputation: 0
#10
RE: Can HPL2 do this? (Texture swapping based on camera)

Thanks for the ideas/feedback, everyone. Sounds encouraging. I'll have to start learning the level editor and getting Maya set up to export opencollada files...
08-23-2012, 10:39 PM
Find




Users browsing this thread: 2 Guest(s)